Lecture # 11 - Software Test Design Techniques - II
Lecture # 11 - Software Test Design Techniques - II
TESTING
LECTURE # 11
Fault Tolerance
Fault Avoidance Fault Detection
Configuration
Verification
Management
Testing Debugging
nd Bruegge & Allen H. Dutoit Object-Oriented Software Engineering: Using UML, Patterns, and Java 3
Quality Assurance encompasses
Testing
Quality Assurance
Usability Testing
Atomic Modular
Configuration Transactions Redundancy
Verification
Management
Fault Detection
Reviews
Debugging
Walkthrough Inspection
Testing
Correctness Performance
Unit Integration System Debugging Debugging
nd Bruegge & Allen H. Dutoit
Testing Testing Testing
Object-Oriented Software Engineering: Using UML, Patterns, and Java 4
Preamble
Is ‘exhaustive’ testing possible?
Can we test everything?
In order to know what the system should do, we need to have
a source of information about the correct behavior of the
system - this is called an 'oracle' or a test oracle.
Test Design Techniques
There are many different types of software testing techniques,
each with its own strengths and weaknesses.
Each testing technique falls into one of a number of different
categories.
Broadly speaking there are two main categories, static and
dynamic.
Static Testing
Control Flow
The sequence in which operations are performed by a business
process, component or system.
Data Flow
A type of static analysis based on the lifecycle of variables e.g.,
creation, usage, modification or destruction.
Dynamic Testing
Dynamic techniques are subdivided into three more
categories:
Specification-based (black-box, also known as behavioral
techniques)
Structure-based (white-box or structural techniques)
Experience-based
Specification-based techniques include both functional and
non-functional techniques (i.e. quality characteristics).
Equivalence Partitioning
Equivalence Partitioning is also known as
Equivalence Class Partitioning.
Equivalence partitioning is a black-box testing
technique that applies to all levels of testing.
Equivalence class is a subset of data that is
representative of a larger class.
Divide input domain into equivalence classes.
One test case per equivalence class, to reduce total
number of test cases needed.
Equivalence Partitioning -
Example
You are filling an online application form
for a gym membership. The
only important criteria for getting a
membership is your age! Most of the gyms
have age criteria of 16-60, where you can
independently get the membership
without any supervision needed. If you
look at below membership form, you will
need to fill age first. After that, depending
on whether you are between 16-60, you
can go further. Otherwise, you will get a
message that you cannot get a
membership.
Equivalence Partitions - Example
Read(ScoreFile, Score); 6
}
/* Compute the mean and print the result */
7 if (NumberOfScores > 0) {
Mean = SumOfScores / NumberOfScores;
printf(“ The mean score is %f\n”, Mean); 8
} else
printf (“No scores found in file\n”); 9
Constructing the Logic Flow
Diagram
Start
F
2
T
3
T F
4 5
7
T F
8 9
Exit
Finding the test cases
Start
1
a (Covered by any data)
2
c b (Data set must contain at least one value)
(Positive score) d 3
e (Negative score)
4 5
(Data set must g h (Reached if either f or
f
be empty 6 e is reached)
Statement testing
A white-box test technique in which test cases are
designed to execute statements.
Statement Testing and Coverage
Number of Statements = 3
Decision Testing and Coverage
Decision
A type of statement in which a choice between two or
more possible outcomes controls which set of actions
will result.
Coverage
Number of Decision= 2
Decision Testing and Coverage
Decision Coverage =
(Number decision
exercised)/(Total Number of
decision) x 100
Only two path required to
execute every decision in
diagram.
100% decision coverage
implies 100% Statement
coverage. (but not vice
versa)