You are on page 1of 33

Fundamentals

SOFTWARE QUALITY ASSURANCE (SQA)


SQA

DAY 04
What you will learn Today

►Test Design Techniques (Dynamic)

2
SQA

Table of Content
►Introduction To Dynamic Test Techniques
Introduction

►Experience Based Techniques


►White Box Techniques
►Black Box Techniques
►Lab Exercise

3
Test Design Technique - DYNAMIC
Informal

Inspection

Reviews
Technical

Walkthroughs

Coed Metric
Static

Control Flow
Static Analysis

Data Flow

Statement

Branch/Decision
Structured Based

Condition

Error Guessing
Based

Exploratory
Experienced

BVA

ECP
Dynamic
Test Design Techniques

State Transition

Use Case
4
Specification Based

Decision Table
SQA

Experienced Based
Techniques

5
SQA

Experienced Based
►In experience-based techniques, people’s knowledge, skills and background
are of prime importance.
Introduction

►The experience of both technical and business people is required.

►Experience-based techniques go together with specification-based and


structure-based techniques, and are also used when there is no specification,
or if the specification is inadequate or out of date.

►This may be the only type of technique used for low-risk systems, but this
approach may be particularly useful under extreme time pressure – in fact this
is one of the factors leading to exploratory testing.
6
When to Use?
Experienced Based

►Requirements and specifications are not available.


►Requirements are inadequate.
►Limited knowledge of the software product.

►Time constraints to follow a structured approach.

7
Experienced Based Types
Experience Based

Experienced Tester applies his experience to


Based Error Guessing guess the areas in the application
that are prone to error

Tester explores the application and


Exploratory uses his experience to navigate
thru different functionalities.
Testing
Tester's experience to create a
Checklist Based checklist of different functionalities
and use cases for testing.

8
Error Guessing
Experienced Based

►A structured approach to the error-guessing technique is to list possible


defects and attempt to produce them.

►These lists can be built based on the tester’s own experience or that of
other people experience.

EXAMPLES:
 Divide by ZERO
 Null inputs
 Negative Numbers
 Check fields on Maximum limits
 Check by inserting special characters

9
Exploratory Testing
Experienced Based

►Exploratory testing is a hands-on approach in which


testers are involved in minimum planning and maximum
test execution.

►The planning involves the creation of a test charter, a


short declaration of the scope of a short (1 to 2 hour)
time-boxed test effort, the objectives and possible
approaches to be used.

►Test logging is undertaken as test execution is performed,


documenting the key aspects of what is tested, any
defects found and any thoughts about possible further
testing.
10
SQA

White Box Techniques

11
White Box Types
White Box Testing

White Box Techniques

Statement Condition Decision


Coverage Coverage Coverage

Minimum no of test Minimum no of test


Minimum no of test
cases required to cases required to
cases required to
cover all cover all decision
cover all conditions
statements or branches

12
White Box Types
White Box Testing

Type TC Test Data

Statement Coverage 01 (P=51, Q=01)

(P=52, Q=01)
Branch Coverage 02 (P=01, Q=01)

Condition Coverage 01 (P=00, Q=00)

13
White Box Testing - Activity
White Box Techniques

1 int Test_Function(int x, int y, int z)


2 {
3 int i = 0;
4 if(x > y)
5 {
6 i = x + z;
7 }
8 else
9 {
10 i = y + z;
11 }
12 return i;
13 }
14
White Box Testing - Activity
White Box Techniques

int Test_Function()
{
int i = 0;
static int x, int y, int z;

if(x > z)
{
i = x + z;
}
else
{
if (x > 200)
{
i = x - z;
}
else
{
i = z;
}
}
return i;
} 15
SQA

Black Box Techniques

16
Black Box Types
Black Box Testing

Black Box Techniques

Boundary State
Equivalence Decision Use Case
Value Transition
Partitioning Tables Testing
Analysis Testing

17
Type of Need: Progr
ammers can
Black Box Techniques

Black Box
or mistake ar m a k e s er r o r s
Technique ounds the bo
when using undaries;
= , <, >, >= ,
the number o
f times a loop
<= or
should be
r un.
All
BVA
Applies in
range of
Test numbers,
li c e n s e a pplication
dates, & driving ld be
Levels time. Example: Athat age of applicant shouense.
having a ca
se
l to 1 8 fo r driving lic
n or equa 18 for a
greater tha s te a d o f > =
e v e lo pe r u sing >18 in
(d
condition).
o s t li k ely errors
m
Extension
e a b o v e e xample, the ie s : ages equal
In th n d a r
of EP
u ld b e a ro und the bou
wo
9.
to 17, 18, 1

18
How to Perform Boundary Value
Analysis (BVA)
Black Box Technoqies

Age:

Age Group allowed: 18-35 years


The first step of Boundary value analysis is to create EP.

17 18 35 36

Invalid Partition (IP) Valid Partition (VP) Invalid Partition (IP)

Equivalence Class Partitioning (EP)

19
SQA

Now Concentrate on the Valid Partition, which ranges from 18-35 Age:

Age Group allowed: 18-35 years


17 18 19 34 35 36

Boundary Boundary Boundary Boundary 30Kg – 150Kg


-1 +1 -1 +1
30, 31, 149, 150
Boundary Boundary
29, 151

If 1 decimal allowed

Valid Boundary: 30, 30.1, 149.9, 150


 Identify Exact Boundary Value of this partition Class? 18 & 35 18, 19, 34, 35
29.9, 150.1
 Get the Boundary value which is one less than the exact Boundary? 17 & 34
 Get the Boundary Value which is one more than the precise Boundary? 19 & 36 Invalid
Boundary:
17, 36

20
Problem: One of the fields on a form contains a text box that accepts numeric values in the range of 18
to 30. What are boundary values and Equivalence class partitions?

Three Classes
• 1 Valid Class
• 2 Invalid Classes Range: 18 - 30
Invalid Valid Invalid

<M N–M >M

< 18 18 - 30 > 30
Invalid Valid Invalid

21
Exercise 1
Order numbers on a stock control system can range between 10000 and
99999 inclusive. Which of the following inputs might be a result of
designing tests for only valid equivalence classes and valid boundaries:

A. 1000, 5000, 99999


B. 9999, 50000, 100000
C. 10000, 50000, 99999
D. 10000, 99999
E. 9999, 10000, 50000, 99999, 10000

22
Exercise 2
In a system designed to work out the tax to be paid:
An employee has £4000 of salary tax free.
The next £1500 is taxed at 10%
The next £28000 is taxed at 22%
Any further amount is taxed at 40%

To the nearest whole pound, which of these is a valid Boundary Value Analysis test
case?
0000 – 4000  0%
a) £1500
b) £32001 4001 – 5500  10%
c) £33501
d) £28000
5501 – 33500  22%
33501 – infi  40 %
23
Exercise 3
A thermometer measures temperature in whole degrees only. If the temperature falls
below 18 degrees, the heating is switched off. It is switched on again when the
temperature reaches 21 degrees. What are the best values in degrees to cover all
equivalence partitions?

A. 15, 19 and 25.


B. 17, 18 and19.
C. 18, 20 and22.
D. 16, 26 and 32.

24
Exercise 4
In a system designed to work out the tax to be paid:
An employee has £4000 of salary tax free.
The next £1500 is taxed at 10%
The next £28000 is taxed at 22%
Any further amount is taxed at 40%

Which of these groups of numbers would fall into the same equivalence class?

a) £4800; £14000; £28000 0000 – 4000  0%


b) £5200; £5500; £28000
c) £28001; £32000; £35000
4001 – 5500  10%
d) £5800; £28000; £32000 5501 – 33500  22%
33501 – infi  40 %
25
Decision Table
Example:
Black Box Testing

A bank account process a loan to a person if he/she is more than 18 years old. Loan processing
policy also include a condition, candidate must be a job holder. But if, a job holder candidate is
less than or equal to 18 years old, in specific case, he/she is eligible for a loan application. Loan
approval or rejection will depend on bank decision

Conditions Test Inputs Test Inputs Test Inputs Test Inputs


Age > 18 FALSE FALSE TRUE TRUE
Job Holder FALSE TRUE FALSE TRUE

Decision Reject Approve Reject Approve

26
Use Case Testing
Black Box Testing

In a use-case, an actor is represented by "A" and


system by "S". We create Use for a login functionality
of a Web Application as shown:

• Consider the first step of an end-to-end


scenario for a login functionality for web Main Scenario Step Description
application where the Actor enters email and
password. A:Actor 1 A: Enter Agent Name & Password
• S:System
In the next step, the system will validate the 2 S: Validate Password
password 3 S: Allow Account Access
• Next, if the password is correct, the access will
be granted Extensions 2a Password not valid
• There can be an extension of this use case. In S: Display Message and ask for re-try 4
case password is not valid system will display a times
message and ask for re-try four times 2b Password not valid 4 times
• If Password, not valid four times system will ban S: Close Application
the IP address.

27
Use Case Testing
Steps Description
Black Box Testing

1 A: Inserts card

2 S: Validates card and ask for PIN


Main Success Scenario
3 A: Enters PIN
A: Actor
S: System 4 S: Validates PIN

5 S: Allows access to account


Card not valid
2a S: Display message and reject card
Pin not valid
4a S: Display message and ask for retry (twice)
Extensions
PIN invalid 3 times
4b S: Eat card and exit

28
State Transition
Black Box Testing

EVENT 1 EVENT 2 EVENT 3 EVENT 4


card enter PIN PIN OK Pin not
Inserted OK
S1: start S2 - - -
S2: wait for PIN - S3 - -
S3: 1st try - - S6 S4
S4: 2nd try - - S6 S5
S5: 3rd try - - S6 S7
S6: access to
account - - - -
S7: eat card - - - -

29
State Transition
Given the following state transition diagram Which of the following series of state transitions contains an
INVALID transition which may indicate a fault in the system design?

A B D F G

Brows Check Pay Logout


Login Basket out
er

C E
A. Login Browse Basket Checkout Basket Checkout Pay Logout.
B. Login Browse Basket Checkout Pay Logout.
C. Login Browse Basket Checkout Basket Logout.
D. Login Browse Basket Browse Basket Checkout Pay Logout.

30
SQA

End of Day 04
 Reading Exercises
 Exercises of Dynamic Testing
 Test Case Writing using Test Design Techniques

31
SQA

Lab Exercise

32
SQA

Q&A
Instructor Notes

33

You might also like