Deiva Preetha/SornalakshmiAsst Prof
SRM University, Kattankulathur
School of Computing, Department of IT 1
The contents of the slides are solely for the purpose of teaching students at SRM University. All copyrights and Trademarks of organizations/persons apply even if not specified explicitly.
School of Computing, Department of IT 2
What is it?
Who does it?
Why is it important?
What are the steps?
What is the work product?
School of Computing, Department of IT 3
Intention of testing is finding error
A good test case has a high probability
of finding an as-yet-undiscovered error.
A successful test is one that uncovers
an as-yet-undiscovered error.
School of Computing, Department of IT 4
All tests should be traceable to customer
requirements
Tests should be planned long before testing
begins
The Pareto principle applies to software testing.
Testing should begin “in the small” and
progress toward testing “in the large.”
Exhaustive testing is not possible.
Independent third party testingSchool of Computing, Department of IT 5
Operability
Observability
Controllability
Decomposability
Simplicity
Stability
Understandability
School of Computing, Department of IT 6
Exercise all independent paths
Exercise all logical decisions on their
true and false sides
Execute all loops at their boundaries
and within their operational bounds
Exercise internal data structures to
ensure their validity.
School of Computing, Department of IT 7
Logic errors/incorrect assumptions are
inversely proportional to the probability
that a program path will be executed.
A logical path that is assumed as not
likely to be executed in fact, may be
executed on a regular basis.
Typographical errors are random
School of Computing, Department of IT 8
Basis path testing is a white-box testing
technique first proposed by Tom McCabe
Helps derive a logical complexity measure
of a procedural design.
Use this measure as a guide for defining a
basis set of execution paths.
Test cases derived to exercise all
execution pathsSchool of Computing, Department of IT 9
Graphical representation of Logical Control Flow
School of Computing, Department of IT 10
Value computed for cyclomatic complexity
defines the number of independent paths
and an upper bound for the number of
tests for coverage of all statements.
An independent path is any path that
introduces at least one new set of
processing statements or a new condition.
School of Computing, Department of IT 11
School of Computing, Department of IT 12
A graph matrix is a square matrix whose
size (i.e., number of rows and
columns)is equal to the number of
nodes on the flow graph.
Each row and column corresponds to an
identified node
Matrix entries correspond to
connections (an edge) between nodes.School of Computing, Department of IT 13
School of Computing, Department of IT 14
School of Computing, Department of IT 15
Method that exercises the logical conditions
Types of error
Boolean operator error (incorrect/missing/extra
Boolean operators).
Boolean variable error.
Boolean parenthesis error.
Relational operator error.
Arithmetic expression error.
School of Computing, Department of IT 16
Method selects test paths of a program according to the locations of definitions and uses of variables in the program.
Example DEF(S) = {X | statement S contains a definition
of X} USE(S) = {X | statement S contains a use of X}
Definition-use (DU) chain of variable X is of the form [X, S, S'], where S and S' are statement numbers, X is in DEF(S) and USE(S'), and the definition of X in statement
S is live at statement S'
School of Computing, Department of IT 17
White-box testing technique that
focuses exclusively on the validity of
loop constructs.
Complex loop structures are another
hiding place for bugs.
School of Computing, Department of IT 18
School of Computing, Department of IT 19
Also called behavioral testing, focuses on the functional requirements
Not an alternative to white box testing Attempts to find errors in five categories
Incorrect or missing functions Interface errorsErrors in data structures or external data
base access, Behavior or performance errors Initialization and termination errors.
School of Computing, Department of IT 20
A graph represents the relationships
between data objects and program
objects
Enables us to derive test cases that
search for errors associated with these
relationships.
School of Computing, Department of IT 21
School of Computing, Department of IT 22
Transaction Flow Modeling
Finite State Modeling
Data Flow Modeling
Timing Modeling
School of Computing, Department of IT 23
Black-box testing method that divides
the input domain into classes of data
from which test cases are derived.
Test case design for equivalence
partitioning is based on an evaluation of
equivalence classes for an input
condition
School of Computing, Department of IT 24
Guidelines If an input condition specifies a range, one
valid and two invalid equivalence classes are defined.
If an input condition requires a specific value, one valid and two invalid equivalence classes are defined.
If an input condition specifies a member of a set, one valid and one invalid equivalence class are defined.
If an input condition is Boolean, one valid and one invalid class are defined.
School of Computing, Department of IT 25
Test cases that exercise bounding values If an input condition specifies a range
bounded by values a and b, test cases should be designed with values a and b and just above and just below a and b.
If an input condition specifies a number of values, test cases exercise the minimum and maximum numbers and just above and below minimum and maximum.
Apply previous two steps to outputs Boundaries of internal data structures
School of Computing, Department of IT 26
When multiple implementations of the same specification have been produced, test cases designed using other black-box techniques are provided as input to each version of the software.
If the output from each version is the same, it is assumed that all implementations are correct.
If the output is different, each of the applications is investigated to determine if a defect in one or more versions is responsible for the difference.
School of Computing, Department of IT 27
Orthogonal array testing enables you to design test cases that provide maximum test coverage with a reasonable number of test cases.
School of Computing, Department of IT 28
Verification of smallest unit – module or
component
White box oriented
The relative complexity of tests and
uncovered errors is limited by the
constrained scope established for unit
testing.
School of Computing, Department of IT 29
School of Computing, Department of IT 30
Drivers
Stubs
During situations in which you will not
have the resources to do
comprehensive unit testing. Select
critical modules and those with high
cyclomatic complexity and unit test only
them.School of Computing, Department of IT 31
Systematic technique for constructing the
program structure
While at the same time conducting tests to
uncover errors associated with interfacing.
The objective is to take unit tested
components and build a program structure
that has been dictated by design.
School of Computing, Department of IT 32
School of Computing, Department of IT 33
top module is tested with top module is tested with stubsstubs
stubs are replaced one at stubs are replaced one at a time, "depth first"a time, "depth first"
as new modules are integrated, as new modules are integrated, some subset of tests is re-runsome subset of tests is re-run
AA
BB
CC
DD EE
FF GG
drivers are replaced one at a drivers are replaced one at a time, "depth first"time, "depth first"
worker modules are grouped into worker modules are grouped into builds and integratedbuilds and integrated
AA
BB
CC
DD EE
FF GG
clustercluster
34School of Computing, Department of IT
Regression testing is an important
strategy for reducing “side effects.”
Run regression tests every time a major
change is made to the software
(including the integration of new
module)
School of Computing, Department of IT 35
Software components that have been
translated into code are integrated into a
“build.” functions.
A series of tests is designed to expose
errors that will keep the build from properly
performing its function.
The build is integrated with other builds
and the entire product is smoke tested
dailySchool of Computing, Department of IT 36
Focus is at the requirements level— on
things that will be immediately apparent
to the end-user.
Configuration Review – review all
elements of SC.
School of Computing, Department of IT 37
The alpha test is conducted at the developer's site by a customer. Alpha tests are conducted in a controlled environment.
The beta test is conducted at one or more customer sites by the end-user of the software.
Unlike alpha testing, the developer is generally not present. T
Beta test is a "live" application of the software in an uncontrolled environment.
School of Computing, Department of IT 38
Ultimately, when software is
incorporated with other system elements
(e.g., hardware, people, information), a
series of system integration and
validation tests are conducted.
A series of different tests whose primary
purpose is to fully exercise the
computer-based systemSchool of Computing, Department of IT 39
System test that forces the software to
fail in a variety of ways and verifies that
recovery is properly performed.
Reinitialization,
Check pointing mechanisms,
Data recovery,
Restart
School of Computing, Department of IT 40
Attempts to verify if protection
mechanisms built into a system will
protect it from improper penetration.
System designer should make
penetration cost more than information
cost.
School of Computing, Department of IT 41
Executes a system in a manner that
demands resources in abnormal
quantity, frequency, or volume
Sensitivity testing - attempts to uncover
data combinations within valid input
classes that may cause instability or
improper processing.
School of Computing, Department of IT 42
Performance tests are often coupled with
stress testing and usually require both
hardware and software instrumentation.
Resource utilization (e.g., processor cycles)
Execution intervals
Log events (e.g., interrupts) as they occur,
Sample machine states on a regular basis.
School of Computing, Department of IT 43
Software Engineering, Roger Pressman, Fifth Edition
Software Engineering, Ian Sommerville, Sixth Edition
School of Computing, Department of IT 44
What is Pareto principle? Is graph based testing a black box or
white box testing technique? What is an independent path? What testing concentrates on identifying
only the show stopper defects? Is beta testing done in presence of the
customer?
School of Computing, Department of IT 45