Software Validation and Verification Guide
Software Validation and Verification Guide
1
Validation & Verification (V & V)
Validation Verification
Verification
Actual
Customer
Performance of
expectations
software
Validation
4
Validation & Verification
• Early validation of the system requirements is
very important. It is easy to make errors &
omissions in the system’s requirements and in
such cases the final software will not meet it’s
customers expectations.
• But, requirements validation is unlikely to
discover all requirements problems. Some faults
in requirements can sometimes only be
discovered when the system implementation is
complete.
5
Static and dynamic V & V
• Within the V & V process, two techniques of system
checking & analysis may be used.
• Software inspection
– Analyze & check, system representations such as the
requirements document, design diagrams and the program
source code.
– This is to be applied at all stages of the process. Inspections
may be supplemented by associated documents.
– Software inspection is a static V & V technique as it does not
require the system to be executed.
• Software testing
– Involves executing an implementation of the software with test
data and examining the outputs of the software and it’s
operational behavior to check that it is performing as required.
– Testing is a dynamic V & V technique , because it works with
an executable representation of the system.
6
Software inspection & testing
Requirements
Requirements High-level
High-level Formal
Formal Detailed
Detailed Program
Program
specification
specification design
design specification
specification design
design
Program
Program
Prototype testing
testing
8
Software inspection
• Software inspections do not require the program to be
executed, so may be used as a verification technique
before programs are implemented.
• During an inspection, a representation of the system is
examined. Eg: System model, language source code, a
requirement document etc. Errors can be considered in
isolation, without being concerned about how it will affect
the behavior of the system.
• Inspections have proved to be an effective technique of
error detection. Errors can be found more cheaply
through inspection than by program testing.
• In other words, reviews & inspections are usually more
effective and less expensive than dynamic testing for
discovering defects.
9
Why inspection is more effective
than dynamic testing?
1. Many different defects may be detected in a
single inspection. In testing, it can often detect
only one error per test, because defects can
cause the program to crash or interfere with
other program defects.
2. Inspections use domain & programming
knowledge. The reviewers are likely to have
seen the types of errors that commonly occur
in particular type of applications. They can
therefore focus on these error types.
10
Inspection & testing
• But inspections cannot replace software testing.
Inspections of the software can check conformance
(match up) with a specification but they cannot validate
dynamic behavior.
• It is often impractical to inspect a complete system that is
integrated from a number of different sub-systems.
Testing is the only possible V & V technique at the
system level. Testing is also necessary for reliability
assessment, performance analysis, user interface
validation and to check that the software requirements
are what the user really wants.
• Inspection & testing are not competing (rival) V & V
techniques. Inspection plays one part and testing plays
another part in V & V. They have their own pluses &
minuses.
11
Program inspections
• Software inspections may be applied to
requirements specification, high-level design,
detailed design definitions, programs etc.
• When the program source code is inspected for
defects it is called as program inspections.
• Two main techniques in program inspections.
– Reviews
• The author distributes the code lists to team members. At a
review meeting improvements are suggested.
– Walkthroughs
• The author explains the code to other team members. They
examine the code and suggest improvements.
12
Program inspection
• Software inspection includes program
inspections, but static techniques can only check
the correspondence between a program & it’s
specification (a static verification); they cannot
demonstrate that the software is operationally
useful.
• Nor can they check non-functional
characteristics of the software such as
performance. (to check performance, it is
needed to run the program; which indicates it is
not static).
• Therefore some testing, is always required to
validate a software system. 13
Software testing
Module
testing
Component testing
Sub-system
testing
System
testing
Module
Module&&unit
unit
System
System Sub-system
Sub-system Code
Acceptance
Acceptance Code
Integration
Integration Integration
Integration &&
Test
Testplan
plan Test
Testplan
plan Test
Testplan
plan test
test
Acceptance
Acceptance System
System Sub-system
Sub-system
Service test Integration
Service test Integrationtest
test Integration
Integrationtest
test
27
Software testing - Details
• Software testing process started with the testing
of individual program units such as functions or
objects.
• These were then integrated into sub-systems &
systems and the interactions of these units were
tested.
• Finally after completion of the system, the
customer may carry out a series of acceptance
tests to check that the system performs as
specified.
Component Integration
testing testing
Software developer Independent testing team 28
Component & integration testing
• The component testing phase is concerned with
testing the functioning of clearly identifiable
components. These may be functions or groups
of methods collected together into a module or
object.
• During integration testing, these components are
integrated to form sub-systems or the complete
system. At this phase, testing should focus on
interactions between the components and on the
functionality & performance of the system as a
whole.
• Defects in components, that have been missed
during earlier testing are discovered during
integration testing.
29
Component & integration testing
• Integration testing must be based on a
written system specification. This can be a
detailed system requirements specification
or a user-oriented specification of the
features that should be implemented in the
system.
• A separate team, who use the user &
system requirements documents to
develop detailed integration test plans is
responsible for integration testing.
30
Defect testing
• The objective of defect testing is to expose
hidden defects in a software system
before the system is delivered.
• A successful defect test is a test, which
causes a system to perform incorrectly
and hence exposes a defect.
• Defect testing demonstrates the
presence, not the absence of program
faults.
31
Defect testing process
Test
Test Test
Test Test Test
cases data Test Test
cases data results
results report
report
Design
Designtest
test Prepare
Preparetest
test Run
Runprogram
program Compare
Compareresults
results
cases
cases data
data with
with testdata
test data To test cases
To test cases
• Test cases
Specification of the inputs to the test & the expected output from the system
and a statement of what is being tested.
• Test data
Inputs which have been devised to test the system.
32
Defect testing
• Full testing, where every possible program
execution sequence is tested is impractical.
Therefore it is to be based on a subset of
possible test cases.
• That subset should be selected based on the
organizational policies. Alternatively, policies
may be based on features of the operational
system. Eg:
– All system functions that are accessed through menus
should be tested.
– Where user input is provided, all functions must be
tested with both correct & incorrect input.
33
Black-box testing
• This is an approach to testing where the test
cases are derived from system specifications.
• The system is a ‘Black-box’, whose behavior can
only be determined by studying it’s inputs and
related outputs.
• This test concerns only about the functionality
and not the implementation of the software.
• The key problem is to select inputs, which are
likely to reveal defects.( In the subset I e of the
diagram) Test engineers use their previous
experience & domain knowledge to identify such
test cases.
34
Black-box testing
Inputs causing
Input
Inputtest
testdata
data Ie abnormal
behavior
System is a black
box
System
System
Outputs which
reveal the
presence of
Output test
results Oe defects
35
Equivalence Partitioning
• The input data to a program usually fall into a
number of different groups. Eg: positive
numbers, negative numbers.
• Programs normally behave in a comparable way
for all members within a group. Because of this
equivalent behavior, these groups are
sometimes called equivalence partitions.
• One systematic approach to defect testing is
based on identifying all equivalence partitions
which must be handled by a program. Test
cases are designed so that the inputs or outputs
lie within these partitions. 36
Equivalence Partitioning
• Eg: If input is a 5 digit integer between 10,000 and 99,999
equivalence partitions are
<10000, 10000-99999 , >99999
• Once the set of partitions are identified, test cases should be
chosen from each of these partitions. A good guideline is,
3 4 7 10 11
Less
Lessthan
than44 Between
Between44and
and10
10 More
Morethan
than10
10
Less
Lessthan
than10,000
10,000 Between
Between10,000
10,000and
and99,999
99,999 More
Morethan
than99,999
99,999
Input values
38
Glass-box testing
• This is sometimes called as ‘structural testing’ or
‘white-box’ testing or ‘clear-box’ testing.
• This is an approach to testing, where the tests
are derived from the knowledge of the software’s
structure and implementation.
• This is usually applied to relatively small
program units or the operations associated with
an object.
• The tester can analyze the code and use
knowledge about the structure of a component
to derive test data. The analysis of the code can
be used to find out how many test cases are
needed to guarantee that all of the statements
in the program are executed at least once
during the testing process. 39
Glass-box testing
Test
Testdata
data
Tests
Derives
Component
code Test
Testoutputs
outputs
40
Path testing
• Path testing is a glass-box testing strategy/
technique whose objective is to exercise every
independent execution path through a program.
If every independent path is executed then all
statements must have been executed at least
once.
• All conditional statements are tested for both
true & false cases.
• In an object oriented development process, path
testing may be used when testing methods
associated with objects.
41
Path testing
• The number of paths through a program is
proportional to it’s size. As modules are
integrated into systems, it becomes difficult to
use path testing techniques.
• Path testing techniques are mostly used at the
unit testing and module testing phases of the
testing process.
• The starting point for path testing is a program
flow graph. This is a skeletal model of all paths
through the program. A flow graph consists of
nodes representing decisions and edges
showing flow of control.
• The flow graph is constructed by replacing
program control statements by equivalent
diagrams.
42
Path testing
Flow chart Flow graph
1 1
2
2
3 4
3 4
5
6
43
Path testing
• Sequential statements can be ignored in the flow-graph
construction. (assignments, I/O statements).
• Each branch in a conditional statement (if-then-else OR
case) is shown as a separate path and loops are
indicated by an arrow looping back to the loop condition
node.
• The objective of structural testing is to exercise all
program statements by executing each independent
program path at least once. Therefore all path
combinations are not needed to consider.
• An independent program path is one which traverses at
least one new edge in the flow graph. This means
exercising one or more new conditions.
• Both the true & false branches of all conditions must be
executed.
44
Path testing
Sequence If=then-else While loop Until loop Case selection
1 1 1 1 1
R1 R2 R1 R1 R1 R2 R3
2 R1 3 2 3 4 5
2 2
2 R2
4 R2 R4
6
45
Path testing
• If all of these paths are executed,
– Every statement has been executed at least once
– Every branch has been exercised for true & false conditions
T2 T2 T2
B B
B T3
T3 T3
C C
T4
T4
D
T5
49
Regression testing
• Carried out after any changes are made to
a software application.
• The purpose of regression test is to prove
that the change has been made correctly
and that the change has not introduced
any new errors.
• Regression test plans are usually a sub-
set of the integration or system test plans.
It is designed to cover enough functionality
to give confidence that the change has not
affected any other part of the system. 50
Top-down integration testing
• In top-down integration, the high level components of a
system are integrated and tested, before design &
implementation of some of the low level components.