Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques.

Similar presentations


Presentation on theme: "1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques."— Presentation transcript:

1 1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques

2 2 Lecture Outline Black-box & White-box Testing Input Domains Random Testing Equivalence Classes

3 3 Black-Box Testing requirements events input output

4 4 Black-box Testing Test cases are derived from formal specification of the system. Test case selection can be done without any reference to the program design or code. Only tests the functionality and features of the program. Not the internal operation.

5 5 Black-box Testing Advantages Test case selection is done before the implementation of a program. Help in getting the design and coding correct with respect to the specification.

6 6 White-Box Testing

7 7 Test cases are derived from the internal design specification or actual code for the program. Advantages Tests the internal details of the code; Checks all paths that a program can execute. Limitations Wait until after designing and coding the program under test in order to select test cases.

8 8 Input Domains Software requirements and design specification; and External variables of the program you are testing. Test input selection all about selecting the values in this domain that has the highest likelihood of producing failures.

9 9 Input Partitioning Input Classifier Function1 (with input domain D1) Function 2 (with input domain D2) Function n (with input domain Dn) Output

10 10 Input Partitioning Programs are considered as the composition of an input classifier; that Classifies input domain into one of a number of different classes; where Each input class computes one function of the overall program. Each of the functions computed by a program occurs along a program path, a path in the program that executes a sequence of statements for computing function.

11 11 Input Partitioning - Example Int min (int x, int y) { int minimum = x; if (x > y) { minimum = y; } return minimum; } Path 1

12 12 Input Partitioning - Example Int min (int x, int y) { int minimum = x; if (x > y) { minimum = y; } return minimum; } Path 2

13 13 Input Partitioning - Example Computation faults - The correct path is chosen but an incorrect computation occurs along that path. Domain faults - The computation is correct for each path but an incorrect path is chosen. The incorrect path is executed for the input domain. The decisions that make up the path selection may contain a fault. The correct path (or a part) may be missing.

14 14 Random Testing Distribution of inputs comes form an operational profile for the program. Probability that an element in the input domain will be chosen if the program is actually being used.

15 15 Random Testing ACB Inputs Probability of Occurrence Using some form of equivalence class Inputs randomly chosen from the equivalence class

16 16 Random Testing - Issues Large number of inputs need to be confident that input domain has been adequately covered. Distribution of random input simply misses the faults. Difficult to estimate coverage of the input domain.

17 17 Equivalence Classes Set of values from the input domain that are likely to produce failures for a program. A single test input taken from an equivalence class is representative of all of the inputs in that class.

18 18 Equivalence Classes Int min (int x, int y) { int minimum = x; if (x > y) { minimum = y; } return minimum; } Equivalence Class A - All inputs that satisfy x > y will execute one path. Equivalence Class B - All inputs that satisfy x ≤ y will execute one path.

19 19 A Good Equivalence Class? Use underlying structure of the program To determine which inputs execute the same program statements White-box testing Specified functionality of the program Black-box testing Domain Testing Equivalence Partitioning

20 20 Domain Testing Partition input of a program using the program structure itself. Input space is first partitioned into a set of mutually exclusive classes. Each corresponds to a program path. Test cases are selected from The domain boundaries Points close to the domain boundaries.

21 21 Equivalence Partitioning Partitions the input of a program using the functional requirements of the program. Aim is to minimise the number of test cases required to cover all of the equivalence classes.

22 22 Key Points Black-box and white-box testing are complementary approaches. Each program has a input domain. Test input selection is all about selecting the values in this domain that has the highest likelihood of producing failures.


Download ppt "1 Software Testing and Quality Assurance Lecture 5 - Software Testing Techniques."

Similar presentations


Ads by Google