7 1) Boundary Value Analysis: BVA(Cont.)BVA Test cases for function FX1X2Expected Resultsx1nomx2minx2min+x2nomx2max-x2maxx1minx1min+x1max-x1maxThe number of test case is 4n+1,where n is the number of variable

9 1) Boundary Value Analysis: BVA(Cont.)The idea and motivation behind BVA is that errors tend to occur near the extremities of the input variables. The defects found on the boundaries of these input variables can obviously be the result of countless possibilities.For example if the programmer forgot to count from zero or they just miscalculated. Errors in the code concerning loop counters being off by one or the use of a < operator instead of ≤.One of the values taking on their extreme values at any one particular time. The reason for this is that generally Boundary Value Analysis uses that called “Single Fault Assumption”.

14 Example: The Next Date FunctionProblem Statementsinput 3 variables: month, date, yearOutput:as the next date from input the dateSpec. and Conditions:C1: January =< month =< DecemberC2: 1 =< day =< 31C3: 1812 =< year =< 2012**Remark: The year should be verified as leap year

15 Leap YearOne year has the length of 365 days, 5 hours, 48 minutes and 47 seconds.A normal year has been given 365 days and a leap year 366 days.So at leap years February 29th is added, which doesn't exist in a normal year.A leap year is every 4 years, but not every 100 years, then again every 400 years.For example:1992 is Leap Year (1992 mod 4 = 0 but1992 mod 100 and 400 ≠ 0)1900 is NOT a Leap Year (1900 mod 4 and 1900 mod100 = 0 but 1900 mod 400 ≠ 0)2000 is Leap Year (2000 mod 4,100 and 400 = 0)

17 2) Robustness Testing: RTRobustness testing can be seen as and extension of Boundary Value Analysis.The idea behind Robustness testing is to test input variables that fall just outside this input domain.We use two more values for each variable min- and max+ which are designed to fall just outside of the input range.Robustness testing is still “Single Fault Assumption” because one of the values taking on their 7 extreme values at any one particular time.

18 2) Robustness Testing: RTRobustness Test cases for function FX1X2Expected Resultsx1nomx2min-Alert message (out of range)x2minx2min+x2nomx2max-x2maxx2max+x1min-x1minx1min+x1max-x1maxx1max+The number of test case is 6n+1,where n is the number of variable

19 3) Worst-Case Testing: WTWorst-case Testing uses the critical fault assumption for more than one variable at a time assuming its extreme values called “multiple faults assumption”So we are able to test the outcome if more than one variable were to assume its extreme value.To generate test cases we take the original 5 extreme values (min, min+, nom, max-, max) and perform the Cartesian product of these values. The end product is a much larger set of results than we have seen before.

20 3) Worst-Case Testing: WT(Cont.)Worst-Case Test cases for function Fx1x2minmin+nommax-maxminmin+nommax-maxThe number of test case is 5n,where n is the number of variable

22 4) Robust Worst-Case Test: RWTIf the function under test were to be of the greatest importance we could use a method named Robust Worst-Case testing which as the name suggests draws it attributes from Robust Worst-Case testing.Test cases are constructed by taking the Cartesian product of the 7 extreme values (min-, min, min+, nom, max-, max, max+)There are more than one variable at a time assuming its extreme values occurred critical fault called “multiple faults assumption”

23 4) Robust Worst-Case Test: RWTx2x1min-minmin+nommax-maxmax+min-minmin+nommax-maxmax+The number of test case is 7n,where n is the number of variable

25 How to use Boundary Value Testing (BVT)BVT is considered in 2 approaches:1) By the number of variables.We could use a certain set integer, we could allow the program to use the highest or lowest possible integer.2) By the kind of ranges.For example in the Next Date exampleSome languages to declare an enumerated type {Jan, Feb, Mar,......, Dec}. It would normally encode for testing of the month’s variable so that January corresponded to 1 and February corresponded to 2 etc.

26 Summary of Boundary Value Testing (BVT)BVT only focuses on variable as number.BVT works well for consideration the function of several independent variables that represent boundary value such as Triangle Program. But it is not good enough for the next date program that has dependent variable.