Professional Documents
Culture Documents
• The more formal, the more repeatable the tests, but it does depend
on the context of the testing being carried out.
Test Test
Procedure Execution
Sourced Documentation
Specification Schedule
Manual Test
Test Script
Test Test Test Procedure
Cases
Condition Cases or Specifications
Automated
Priority Test Script
Categories of Test Design Techniques
1. Specification-based Techniques (Black Box
Testing)
– derive test cases from the specification or a
model of the system
– testing of what a system should do
3. Experience-based Techniques
– derive test cases from the tester’s experience of
similar systems and general experience of
testing
Specification-based Techniques
(Black Box Testing)
Specification-based Techniques – Black Box Testing
• Testing without knowing the internal workings of the code.
• Idea: Dividing the test input data into a range of values and
selecting one input value from each range.
Equivalence Partitioning: Example-1
• There is a college that gives admissions to students based upon
their percentage only between 50 to 90 %. More and even less than
this range will not be accepted, and application will redirect user to
an error page.
Equivalence Partitioning
Invalid Valid Invalid
< 50 50 – 90 > 90
Equivalence Partitioning: Example-2
• Consider a system for postal services’ payment. Letters up to 100g
are called as ‘light’. Postal rates for sending the light letters up to
10g are $25. The next 40g will be charged by $35. Each next 25g up
to 100g should be charged by an extra $10.
– Maximum
Boundary Value Analysis: Example-1
• Consider a system that accepts ages from 18 to 56.
y2
d
a b y1
Boundary Value Analysis: Single Fault Assumption
• In this respect, boundary value analysis test cases can be obtained
by holding the values of all but one variable at their nominal values,
and letting that variable assume its extreme values.
T = { <y1nom , y2min>,
<y1nom , y2min+1>,
<y1nom , y2nom>, For n variable to be checked:
<y1nom , y2max-1>, Maximum of 4n+1 test cases
<y1nom , y2max>,
<y1min , y2nom>,
<y1min+1 , y2nom>,
<y1max-1 , y2nom>,
<y1max , y2nom> }
Boundary Value Analysis: Example-2
• Consider a Program for determining the Previous Date.
• Input: Day, Month, Year with valid ranges as-
1 ≤ Month≤12
1 ≤ Day ≤31
1900 ≤ Year ≤ 2000
Design Boundary Value Test Cases.
Expected Expected
Month Day Year Month Day Year
Output Output
6 15 1990 14/6/1990 6 30 1950 29/6/1950
6 15 1991 14/6/1991 6 31 1950 Invalid
6 15 1950 14/6/1950 1 15 1950 14/6/1950
6 15 1999 14/6/1999 2 15 1950 14/2/1950
6 15 2000 14/6/2000 11 15 1950 14/11/1950
6 1 1950 31/5/1950 12 15 1950 14/12/1950
6 2 1950 1/6/1950
Decision Table Testing
• A Decision Table is the method used to build a complete set of test
cases without using the internal structure of the program in
question.
• Conditions = Input.
• Actions = Output.
Decision Table Testing: Log In Facebook Example
Password
Error:
Error:
Error:
Error: Error: Facebook
Please
Please
Expected Results Incorrect
Incorrect Incorrect Page is
Confirm
Confirm
Email
Email Email Processed
Password
Password
Components of a Decision Table
• A decision table has 4 parts:
1. Condition stub
2. Condition entry
3. Action stubs
4. Action entry
Types of Condition Entries
1. Limited Entry : In the limited entry decision tables, the
condition entries are restricted to binary values.
Action Stubs
Action Entry
Password Blank Invalid Valid Blank Invalid Valid Blank Invalid Valid
• Actions:
– Not a Triangle
– Scalene
– Isosceles
– Equilateral
– Impossible
Decision Table Testing: Triangle Problem
Conditions Rule 1 Rule 2 Rule 3 Rule 4 Rule 5 Rule 6 Rule 7 Rule 8 Rule 9
c1: a, b, c form a ∆? F T T T T T T T T
c2: a = b? - T T T T F F F F
c3: a = c? - T T F F T T F F
c4: b = c? - T F T F T F T F
a1: Not a triangle X
a2: Scalene X
a3: Isosceles X X X
a4: Equilateral X
a5: Impossible X X X
State Transition Testing
• It is a test design techniques based on the theory of finite state
machine.
OFF ON
• State transition testing tests the valid transitions from one state to
another and also the invalid transitions.
State Transition Testing: Car Example
• States are Stopped, Accelerating, Constant speed and Braking
Accelerating
Constant
Stopped
Speed
Braking
State Transition Testing: Car - State Table
States Inputs Next State
Stopped Press brake pedal more Accelerating
Accelerating Keep gas pedal constant Constant speed
Accelerating Switch to brake pedal Braking
Constant Speed Press gas pedal more Accelerating
Constant Speed Switch to brake pedal Braking
Braking Switch to gas pedal; Press Accelerating
gas pedal more
Braking Switch to gas pedal Constant Speed
Braking Keep braking Stopped
Stopped ? Constant speed
Stopped ? Braking
Accelerating ? Stopped
Constant Speed ? Stopped
State Transition Testing: Car – Test Case
• Test case 1 – Stopped > Accelerating > Constant speed > Braking > Stopped
• Test case 2 – Stopped > Accelerating > Braking > Accelerating > Braking >
Stopped
• Test case 3 – Stopped > Accelerating > Constant Speed > Accelerating >
Braking > Accelerating > Constant speed > Braking > Constant speed >
Braking > Stopped
Accelerating
Constant
Stopped
Speed
Braking
Use Case Testing
• This technique helps identify test cases that cover the entire
system, on a transaction by transaction basis, from start to finish.
• These steps define the interactions between the actor and the
system.
• Test cases can be designed to reach every branch in the code and to
exercise each condition.
Input Output
Types of White Box Testing
1. Statement Coverage
2. Decision/Branch Coverage
3. Condition Coverage
4. Path Coverage
Statement Coverage
• Statement coverage methodology:
– design test cases so that every statement in a program is executed at
least once.
Case 1: If A = 7, B= 3 Case 2: If A = 4, B= 8
No of statements Executed = 5 No of statements Executed = 6
Total statements = 7 Total statements = 7
Statement coverage = 5 / 7 * 100 Statement coverage = 6 / 7 * 100
= 71.42 % = 85.20 %
∴ Minimum number of test cases required for 100% statement coverage = 2
Statement Coverage: Example-2
Wait for card to be inserted
IF card is valid THEN
display “Enter PIN number”
IF PIN is valid THEN
select transaction
ELSE
display “Invalid PIN”
ELSE
reject card
Number of test cases required for 100% statement coverage = 1 + count of ELSE
Statement Coverage: Example-3
Read A
IF A > 0 THEN
IF A == 21 THEN
Print “Key”
ENDIF
ENDIF
• Defined in terms of
– control flow graph (CFG) of a program.
• There are few scenarios where these are the only option to apply:
– Specifications are poorly defined.
– Time pressure.
– Testing team is not formally trained on testing fundamentals.
Types of Experience-based Techniques
• Error guessing is a technique that should always be used as a
complement to other more formal techniques. The success of error
guessing is very much dependent on the skill of the tester, as good
testers know where the defects are most likely to lurk.