ISTQB Chapter4
ISTQB Chapter4
Objectives
LO-4.1.1 Differentiate between a test design specification, test case
specification and test procedure specification. (K2)
LO-4.1.2 Compare the terms test condition, test case and test
procedure. (K2)
LO-4.1.3 Evaluate the quality of test cases. Do they:
Show clear traceability to the requirements;
Contain an expected result. (K2)
LO-4.1.4 Translate test cases into a well-structured test procedure
specification at a level of detail relevant to the knowledge of the
testers. (K3)
Test analysis: identifying test conditions
4
A testing technique helps us select a good set of tests from the total
number of all possible tests for a given system.
Test design: specifying test cases
5
Test design: The test cases and test data are created and specified.
A test case consists of a set of input values, execution preconditions,
expected results and execution post-conditions, developed to cover
certain test condition(s).
Expected results should be produced as part of the specification of a test
case and include outputs, changes to data and states, and any other
consequences of the test.
Expected results should ideally be defined prior to test execution.
Test implementation: specifying test
procedures or scripts
6
Objectives
LO-4.2.1 Recall reasons that both specification-based (black-box)
and structure-based (white box) approaches to test case design are
useful, and list the common techniques for each. (K1)
LO-4.2.2 Explain the characteristics and differences between
specification-based testing, structure-based testing and experience-
based testing. (K2)
Introduction of Test Technique
8
Dynamic Techniques
Specification-Based
White-box
Equivalence
Partitioning
Statement
Experience-based
Boundary
Analysis
Decision
Decision
Error Exploratory Table
Guessing Testing
Condition
State Transition
Multiple Condition
Use Case
4.3 Specification-based or black-box
techniques
12
Objectives
LO-4.3.1 Write test cases from given software models using the
following test design techniques: (K3)
equivalence partitioning;
boundary value analysis;
decision table testing;
state transition testing.
LO-4.3.2 Understand the main purpose of each of the four
techniques, what level and type of testing could use the technique,
and how coverage may be measured. (K2)
LO-4.3.3 Understand the concept of use case testing and its
benefits. (K2)
Specification-based or black-box techniques
13
Black-box Techniques
Equivalence Partitioning
Boundary Value Analysis
Decision Table
State Transition
Equivalence Partitioning
15
Outputs
Time-related values P1 P2 P3 P4
Equivalence Partitioning
17
Example:
A saving account in a bank earns a different rate of interest
depending on the balance in the account. Below are the ranges of
balance values that earn the different rates of interest.
Interest Rate 3% 5% 7%
Equivalence Partitioning
18
50$ 260$
-1$ 1350$
P1 P2 P3 P4
0$ - 101$ - >=1000$
< 0$ 100$ 999$
Boundary Value Analysis
19
In-Bound
On-Bound
P1 P2 P3 P4
Out-Of-Bound
Boundary Value Analysis
21
Example:
A printer has an input option of the number of
copies to be made, from 1 to 99.
Condition #1 T T F F
Condition #2 T F T F
Actions/Outcomes
Outcome #1 Y Y
Example:
If you are a new customer opening a credit card account, you will get a
15% discount on all your purchases today.
If you are an existing customer and you hold a loyalty card, you get a
10% discount.
If you have a coupon, you can get 20% off today (but it can’t be used
with the ‘new customer’ discount).
Discount amounts are added, if applicable.
Decision Table
26
-> We will have 6 test cases to cover all possible rules in the
decision table.
Conditions R1 R2 R3 R4 R5 R6 R7 R8
New customer T T T T F F F F
(15%)
Loyalty card T T F F T T F F
(10%)
Coupon (20%) T F T F T F T F
Actions
Use case testing is a technique that helps us identify test cases that
exercise the whole system on a transaction by transaction basis from
start to finish.
Use cases describe the process flows through a system based on its
most likely use.
Use Case Testing
30
Objectives:
LO-4.4.1 Describe the concept and importance of code coverage.
(K2)
LO-4.4.2 Explain the concepts of statement and decision coverage,
and understand that these concepts can also be used at other test
levels than component testing (e.g. on business procedures at
system level). (K2)
LO-4.4.3 Write test cases from given control flows using the
following test design techniques:
statement testing;
decision testing. (K3)
LO-4.4.4 Assess statement and decision coverage for
completeness. (K3)
Statement Coverage
32
Example:
Let’s look at a code sample below:
1. READ A
2. READ B
3. C = A + 2*B
4. IF C > 50 THEN
5. PRINT “Large C”
6. END
We’ll have 3 tests:
Test 1: A=2, B=3
Test 2: A=0, B=25
Test 3: A=47, B=1
Statement Coverage
35
Statement Coverage:
Pseudo-code:
Test 1: A=2, B=3
Test 2: A=0, B=25 1. READ A
Test 3: A=47, B=1 2. READ B
3. C = A + 2*B
⇒ 85% (5/6 statements)
4. IF C > 50 THEN
5. PRINT “Large C”
Increase coverage to 100% ? 6. END
⇒ Test 4: A=20, B=25
Decision Coverage
36
Example:
Let’s look at a code sample below:
1. READ A
2. READ B
3. C = A - 2*B
4. IF C < 0 THEN
5. PRINT “C negative”
6. END
We’ll have 1 test:
A=20, B=15
Decision Coverage
39 Read
FALSE
⇒ 50% (1/2 decisions)
END
Pseudo-code:
Increase coverage to 100% ? READ A
READ B
⇒ Test 2: A=10, B=2 C = A - 2*B
IF C < 0 THEN
PRINT “C negative”
END
Other White-box Techniques
40
Objectives:
LO-4.5.1 Recall reasons for writing test cases based on intuition,
experience and knowledge about common defects. (K1)
LO-4.5.2 Compare experience-based techniques with specification-
based testing techniques.(K2)
4.5 Experience-based techniques (K2)
42
Error management
Restart/Recovery
Objectives:
LO-4.6.1 List the factors that influence the selection of the
appropriate test design technique for a particular kind of problem,
such as the type of system, risk, customer requirements, models for
use case modeling, requirements models or tester knowledge. (K2)
4.6 Choosing test techniques (K2)
47
Q&A
Glossary
51