Unit 2 Boundary Value Testing, Equivalence Class Testing, Decision Table-Based Testing ST 8 th Sem, A Div 2017-18 Prof. Mouna M. Naravani
19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 2
Boundary Value Testing Boundary Value Analysis (BVA) Robustness Testing Worst case Testing Special Value Testing Random Testing Examples 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 3
Boundary Value Analysis (BVA) Boundary Value Analysis focuses on the boundary of the input space to identify test cases. The rationale behind value testing is that errors tend to occur near the extreme values of an input variable. Ex: Loop conditions may test for < when they should test for. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 4
BVA uses input variable values at their: Minimum (min) Just above the minimum (min+) A nominal value (nom) Just below their maximum (max-) Maximum (max) 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 5
Single Fault Assumption 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 6
a x1 b c x1 d 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 7
19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 8
19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 9
Generalizing Boundary Value Analysis BVA can be generalized in 2 ways: By the number of variables (easy) By the kind of ranges (quite difficult) 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 10
Generalizing by the number of variables: If there are functions with n variables, hold all but one at the nominal value and let the remaining variables assume min, min+, nom, max-, max values, repeating this for each variable. Thus, for a function of n variables, BVA yields 4n + 1 unique test cases. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 11
Generalizing by the kinds of range: Depends on the nature/ type of variables themselves. When no explicit bounds are specified, as in Triangle problems, we usually have to create artificial bounds. The lower bound of side of lengths is 1, but what might be the upper bound? One possibility is, largest representable integer (MAXINT) Or impose an arbitrary upper limit such as 200 or 2000. BVA does not make much sense for Boolean variables: because the extreme values are TRUE or FALSE, and there is no clear choice for the remaining values. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 12
Limitations of Boundary Value Analysis Boundary Value Analysis works well when the program to be tested is a function of several independent variables that represent bounded physical quantities. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 13
Triangle Problem Boundary Value Analysis Test Cases 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 14
Commission Problem Boundary Value Analysis Test Cases 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 15
Robustness Testing Extension of Boundary value analysis. In addition to 5 BVA values of a variable, Robustness testing checks what happens when the extrema are exceeded with a value slightly greater than the maximum (max+) and a value slightly less than the minimum (min-). Generalizations and limitations of BVA applies directly to robustness testing. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 16
19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 17
The most interesting part of robustness testing is not with the inputs, but with the expected outputs. What happens when a physical quantity exceeds its maximum? Ex: if a variable is defined to be within a certain range, values outside that range result in run time errors that abort normal execution. Exception handling choice mandates robustness testing. Robustness testing generates 6n + 1 test cases. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 18
Worst-Case Testing Here, single value fault of Boundary value analysis is rejected. Worst case testing is interested in What happens when more than one variable has an extreme value. Start with the five-elements set that contains min, min+, nom, max-, max. Then take the cartesian product of these sets to generate test cases. Boundary value analysis test cases are a proper subset of worst-case test cases. Worst-case testing is more thorough form of testing. Also requires more effort. Worst-case testing for a function on n variables generates 5 n test cases. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 19
19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 20
Robust Worst-case testing This involves the cartesian product of the seven-element sets used in robustness testing. Robust Worst-case testing for a function on n variables generates 7 n test cases. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 21
Triangle Problem Worst-case test cases 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 22
Triangle Problem Worst-case test cases contd 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 23
NextDate Worst-case test cases 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 24
Special Value Testing Special Value testing occurs when a tester uses domain knowledge, experience with similar programs and information about soft spots to device test cases. No guidelines are used other than to use best engineering judgement. Special value testing is very dependent on the abilities of the tester. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 25
Random Testing Rather than always choosing min, min+, nom, max-, max values of a bounded variable, use a random number generator to pick test case values. Ex: derived from Visual Basic application, where a x b x = Int((b a + 1) * Rnd + a) Where, function Int returns integer part of floating point number, the function Rnd generates random numbers in the interval [0, 1]. Question: How many random test cases are sufficient? 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 26
In each of the following table, the program went through seven cycles that ended with the hard-to-generate test case. avg./percentage: last line shows what percentage of the random test cases was generated for each column. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 27
19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 28
19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 29
References Paul C. Jorgensen: Software Testing, A Craftsman s Approach, 3 rd Edition, Auerbach Publications, 2008. 19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 30
19-02-2018 Dept. of CSE, BLDEACET, Vijarapur 31