Test Design Techniques ISTQB (International Software Testing Qualifications Board) Minsoo Ryu Hanyang University
Testing Process Planning and Control Analysis and Design Implementation and Execution Evaluating Exit Criteria and Reporting Test Closure Activities 2 2
Planning and Control Test planning for the most part occurs at the initiation of the test effort and involves the identification and implementation of all of the activities and resources required to meet the mission and objectives identified in the test strategy Test control is an ongoing activity It involves comparing actual progress against the plan and reporting the status, including deviations from the plan 3 3
Analysis and Design Identification of Test Conditions Test conditions are identified by analysis of the test basis and objectives to determine what to test, using test techniques identified within the Test Strategy and/or the Test Plan Test basis: The documentation on which test cases are based, which may include all documents from which the requirements of a component or system can be inferred Creation of Test Cases Test cases are designed by the stepwise elaboration and refinement of the identified test conditions using test techniques identified in the test strategy They should be repeatable, verifiable and traceable back to requirements 4 4
Implementation and Execution Test implementation includes organizing the test cases into test procedures (test scripts), finalizing test data and test environments, and forming a test execution schedule to enable test case execution to begin Test execution includes executing the test procedures and the comparison of actual results with expected results 5 5
Test Procedure Example 6 6
Test Design Techniques Specification-based (behavior-based or black box) Structure-based (white box) Experience-based 7 7
Specification-Based Techniques Specification based techniques are a way to derive and select test conditions or test cases based on an analysis of the test basis documentation for a component or system without reference to its internal structure Five techniques Equivalence partitioning Boundary value analysis Decision table testing State transition testing Use case testing 8 8
Equivalence Partitioning Classes of input conditions that cause the same output value are called equivalence classes (partitions) Only one test case of each partition is needed to evaluate the behavior of the program for the related partition Thus the number of test cases can be reduced considerably 9 9
Boundary Value Analysis Tests are designed to include representatives of boundary values Values on the minimum and maximum edges of an equivalence partition are tested -N 0, 1 6, 7 12, 13 +N 10 10
Decision Table Testing A decision table lists causes and effects in a matrix Each column represents a unique combination Purpose is to structure logic Combinations Causes Values 1 2 3 4 5 6 7 8 Cause 1 Y, N Y Y Y Y N N N N Cause 2 Y, N Y Y N N Y Y N N Cause 3 Y, N Y N Y N Y N Y N Effects Effect 1 X X X Effect 2 X X X 11 11
Example 12 12
State Transition Testing A system may exhibit a different response depending on current conditions or previous history (its state) The system can be shown with a state transition diagram It allows the tester to view the software in terms of its states, transitions between states, the inputs or events that trigger state changes (transitions) and the actions which may result from those transitions 13 13
Chow s Operation Errors and Transfer Errors Operation error A is said to have operation errors if A is not equivalent to A and A can be modified to be equivalent to A by changing only the output function of A (1 0) A is the standard or the correct version Transfer error A is said to have transfer errors if A is not equivalent to A and A can be modified to be equivalent to A by changing only the next-state function of A 14 14
Switch Coverage (N-1 Switch Cover) 0-Switch Cover or Branch Coverage Every branch (state transition edge) is traversed 1-Switch Cover or Switch Coverage Every branch-to-branch is traversed 15 15
0-Switch Cover or Branch Coverage <State Diagram> <0-switch or Branch Coverage> 16 16
Test Cases 0-switch Cover 17 17
1-Switch Cover or Switch Coverage 18 18
Test Cases 19 19
Use Case Testing Tests can be derived from use cases A use case describes interactions between actors, including users and the system, which produce a result of value to a system user or the customer Use cases are very useful for designing acceptance tests with customer/user participation They also help uncover integration defects caused by the interaction and interference of different components, which individual component testing would not see 20 20