0% found this document useful (0 votes)
49 views23 pages

Verification vs. Validation: Unit 7

Verification ensures that the product is being built correctly according to specifications, while validation ensures the right product is being built by checking user requirements. The V&V process aims to discover defects and assess usefulness through static and dynamic verification methods. V&V planning is important and involves defining standards, requirements traceability, and test procedures. The V-model depicts the relationship between testing and corresponding development phases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views23 pages

Verification vs. Validation: Unit 7

Verification ensures that the product is being built correctly according to specifications, while validation ensures the right product is being built by checking user requirements. The V&V process aims to discover defects and assess usefulness through static and dynamic verification methods. V&V planning is important and involves defining standards, requirements traceability, and test procedures. The V-model depicts the relationship between testing and corresponding development phases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Smartworld.asia 1 Smartzworld.

com

Software Engineering 10IS51

UNIT 7
VERIFICATION AND VALIDATION

Verification vs. validation


Verification: "Are we building the product right”, The software should
conform to its specification.

Validation: "Are we building the right product”., The software should do what
the user really requires.

The V & V process


• Is a whole life-cycle process - V & V must be applied at each stage
in the software process.
• Has two principal objectives
• The discovery of defects in a system;
• The assessment of whether or not the system is useful and useable
in an operational situation

V& V goals
Verification and validation should establish confidence that the software is fit
for purpose. This does NOT mean completely free of defects. Rather, it must
be good enough for its intended use and the type of use will determine the
degree of confidence that is needed.

V & V confidence
Depends on system‟s purpose, user expectations and marketing environment
Software function
•The level of confidence depends on how critical the software is to
an organisation.
User expectations
•Users may have low expectations of certain kinds of software.
Marketing environment
•Getting a product to market early may be more important than
finding defects in the program.

Static and dynamic verification


• Software inspections. Concerned with analysis of
the static system representation to discover problems (static
verification)
• May be supplement by tool-based document and code analysis
• Software testing. Concerned with exercising and
observing product behaviour (dynamic verification)
• The system is executed with test data and its operational behaviour is
observed

Department of CSE, SJBIT Page 71


Smartworld.asia 2 Smartzworld.com

Software Engineering 10IS51

Static and dynamic V&V

Program testing
Can reveal the presence of errors NOT their absence. The only validation
technique for non-functional requirements as the software has to be executed
to see how it behaves. Should be used in conjunction with static verification to
provide full V&V coverage.

Types of testing
• Defect testing: Tests designed to discover system defects. A
successful defect test is one which reveals the presence of defects in
a system. Covered in Chapter 23
• Validation testing: Intended to show that the software meets its
requ irements. A successful test is one that shows that a requirement
has been properly implemented.

Testing and debugging


Defect testing and debugging are distinct processes. Verification
and validation is concerned with establishing the existence of
defects in a program. Debugging is concerned with locating and
repairing these errors. Debugging involves formulating a hypothesis
about program behaviour then testing these hypotheses to find the
system error.
The debugging process

Department of CSE, SJBIT Page 72


Smartworld.asia 3 Smartzworld.com

Software Engineering 10IS51

V & V planning
Careful planning is required to get the most out of testing and inspection
processes. Planning should start early in the development process. The plan
should identify the balance between static verification and testing. Test
planning is about defining standards for the testing process rather than
describing product tests.

The V-model of development

The structure of a software test plan


• The testing process.
• Requirements traceability.
• Tested items.
• Testing schedule.
• Test recording procedures.
• Hardware and software requirements.
• Constraints.

Department of CSE, SJBIT Page 73


Smartworld.asia 4 Smartzworld.com

Software Engineering 10IS51

The software test plan

T he tes tin g proc ess


A descriptio n of the m ajor pha ses o f the tes tin g proc es s. These m ig ht
be a s de sc ribed e arlie r in this chap ter.

Requ irem en ts trac eab ility


Use rs ar e mos t in te rested in the system m e eting its requirem ents an d
testin g s hou ld be p la nn ed s o that all requ irem ents a re in dividually tested.

T es ted item s
T he p rodu cts o f the s of tw are p rocess th at a re to be tes ted s hou ld be
spe cifie d.

T es ting sch edu le


A n overall te sting s ch edule an d re s ou rc e alloc atio n for this sc he du le
. T his, ob vio us ly , is link ed to the m ore general p ro je ct de velopm
ent sc hed ul e.

T es t reco rd in g p ro ced ures


It is no t en ou gh s im ply to ru n tes ts. T he re su lts o f the tes ts m ust b e
syste m a tic ally re cord ed . It m us t be pos sible to audit th e testin g proc
ess to c he ck tha t it bee n ca rried out co rrectly.

Hardw are and s oftw are req uir em en


ts
T his s ec tio n sh ould set out s oftw are tools requ ired a nd es tim a te d
h ardw are ut ilis ation.

C ons tr a ints
Constra in ts affecting th e tes tin g proc es s suc h as sta ff sho rtag es sho uld
b e an ticip ated in th is se ction .

Software inspections
These involve people examining the source representation with the aim of
discovering anomalies and defects.
Inspections not require execution of a system so may be used before
implementation.
They may be applied to any representation of the system (requirements,
design, configuration data, test data, etc.).
They have been shown to be an effective technique for discovering program
errors.
Inspection success
Many different defects may be discovered in a single inspection. In
testing, one defect, may mask another so several executions are
required. The reuse domain and programming knowledge so
reviewers are likely to have seen the types of error that commonly
arise.
Inspections and testing
Inspections and testing are complementary and not opposing
verification techniques. Both should be used during the V & V
process. Inspections can check conformance with a specification but
not conformance with the customer‟s real requirements. Inspections

Department of CSE, SJBIT Page 74


Smartworld.asia 5 Smartzworld.com

Software Engineering 10IS51

cannot check non-functional characteristics such as performance,


usability, etc.

Program inspections
Formalised approach to document reviews. Intended explicitly for
defect detection (not correction). Defects may be logical errors,
anomalies in the code that might indicate an erroneous condition
(e.g. an uninitialised variable) or non-compliance with standards.

Inspection pre-conditions
• A precise specification must be available.
• Team members must be familiar with the organisation standards.
• Syntactically correct code or other system representations must be
available.
• An error checklist should be prepared.
• Management must accept that inspection will increase costs early
in the software process.
• Management should not use inspections for staff appraisal i.e.
finding out who makes mistakes.

The inspection process

Inspection procedure
• System overview presented to inspection team.
• Code and associated documents are distributed to inspection
team in advance.
• Inspection takes place and discovered errors are noted.
• Modifications are made to repair discovered errors.
• Re-inspection may or may not be required.

Department of CSE, SJBIT Page 75


Smartworld.asia 6 Smartzworld.com

Software Engineering 10IS51

Inspection roles

Author or owner The programmer or designe r responsible for


producing the program or document. Responsible
for fixing defects discovered during the inspection
process.
Inspector Finds errors, omissions and inconsistencies in
programs and documents. May also identify
broader issues that are outside the scope of the
inspection team.
Reader Presents the code or document at an inspection
meeting.
Scribe Records the results of the inspection meeting.
Chairman or moderator Manages the process and facilitates the inspection.
Reports process results to the Chief moderator.
Chief moderator Responsible for inspection process improvements,
checklist updating, standards development etc.

Inspection checklists
• Checklist of common errors should be used to drive the inspection.
• Error checklists are programming language dependent and reflect the
characteristic errors that are likely to arise in the language.
• In general, the 'weaker' the type checking, the larger the checklist.
• Examples: Initialisation, Constant naming, loop termination, array
bounds, etc.
Inspection check

Data faults are all program variables initialized before


their values are used?
Have all constants been named?
Should the lower bound of arrays be 0, 1,
or
something else?
Should the upper bound of arrays be equal
to the size of the array or Size -1?
If character strings are used, is a delimiter
explicitly assigned?

Control faults for each conditional statement, is the


condition
correct?
Is each loop certain to terminate?

Department of CSE, SJBIT Page 76


Smartworld.asia 7 Smartzworld.com

Software Engineering 10IS51

Are compound statements correctly


bracketed?
In case statements, are all possible cases
accounted for?
Input/output faults are all input variables
used?
Are all output variables assigned a value
before they are output?

Interface faults do all function and procedure calls have


the correct number of parameters?

Do formal and actual parameter types


match?
Are the parameters in the right order?
If components access shared memory, do
they have the same model of the shared
memory structure?

Segment faults If a linked structure is modified, have all


links been correctly reassigned?
If dynamic storage is used, has space been
allocated correctly?
Is space explicitly de-allocated after it is
no longer Inspection checks required?

Exception Management Have all possible error conditions been


taken
into account?

Inspection rate
500 statements/hour during overview. 125 source statement/hour during
individual
preparation. 90-125 statements/hour can be inspected. Inspection is therefore
an expensive process. Inspecting 500 lines costs about 40 man/hours effort -
about £2800 at UK rates.

Automated static analysis


• Static analysers are software tools for source text processing.
• They parse the program text and try to discover potentially erroneous
conditions and bring these to the attention of the V & V team.
• They are very effective as an aid to inspections - they are a supplement
to but not a replacement for inspections.

Stages of static analysis


• Control flow analysis. Checks for loops with multiple exit or entry
points, finds unreachable code, etc.

Department of CSE, SJBIT Page 77


Smartworld.asia 8 Smartzworld.com

Software Engineering 10IS51

• Data use analysis. Detects uninitialised variables, variables written


twice without an intervening assignment, variables which are declared
but never used, etc.
• Interface analysis. Checks the consistency of routine and procedure
declarations and their use.
• Information flow analysis. Identifies the dependencies of output
variables. Does not detect anomalies itself but highlights information
for code inspection or review
• Path analysis. Identifies paths through the program and sets out the
statements executed in that path. Again, potentially useful in the
review process
• Both these stages generate vast amounts of information. They must be
used with care.

LINT static analysis


138% more lint_ex.c
#include <stdio.h>
printarray (Anarray)
int Anarray;
{
printf(“%d”,Anarray);
}
main ()
{
int Anarray[5]; int i; char c;
printarray (Anarray, i, c);
printarray (Anarray) ;
}
139% cc lint_ex.c
140% lint lint_ex.c
lint_ex.c(10): warning: c may be used before set
lint_ex.c(10): warning: i may be used before set
printarray: variable # of args. lint_ex.c(4) :: lint_ex.c(10)
printarray, arg. 1 used inconsistently lint_ex.c(4) ::
lint_ex.c(10)
printarray, arg. 1 used inconsistently lint_ex.c(4) ::
LINT static analysis
lint_ex.c(11)
printf returns value which is always ignored.

Use of static analysis


Particularly valuable when a language such as C is used which has weak
typing and hence many errors are undetected by the compiler, Less cost-
effective for languages like Java that have strong type checking and can
therefore detect many errors during compilation.

Department of CSE, SJBIT Page 78


Smartworld.asia 9 Smartzworld.com

Software Engineering 10IS51

Verification and formal methods


• Formal methods can be used when a mathematical specification
of the system is produced.
• They are the ultimate static verification technique.
• They involve detailed mathematical analysis of the
specification and may develop formal arguments that a program
conforms to its mathematical specification.

Arguments for formal methods


Producing a mathematical specification requires a detailed analysis
of the requirements and this is likely to uncover errors. They can
detect implementation errors before testing when the program is
analyzed alongside the specification.

Arguments against formal methods


• Require specialized notations that cannot be understood by
domain experts.
• Very expensive to develop a specification and even more
expensive to show that a program meets that specification.
• It may be possible to reach the same level of confidence in a
program more cheaply using other V & V techniques.
Cleanroom software development
The name is derived from the „Cleanroom‟ process in
semiconductor fabrication. The
philosophy is defect avoidance rather than defect removal.
This software development process is based on:
• Incremental development;
• Formal specification;
• Static verification using correctness arguments;
• Statistical testing to determine program reliability.

The Cleanroom process

Cleanroom process characteristics


• Formal specification using a state transition model.

Department of CSE, SJBIT Page 79


Smartworld.asia 10 Smartzworld.com

Software Engineering 10IS51

• Incremental development where the customer prioritises


increments.
• Structured programming - limited control and abstraction
constructs are used in the program.
• Static verification using rigorous inspections.
• Statistical testing of the system

Formal specification and inspections


• The state based model is a system specification and the
inspection process checks the program against this mode. l
• The programming approach is defined so that the
correspondence between the model and the system is clear.
• Mathematical arguments (not proofs) are used to increase
confidence in the inspection process.
Cleanroom process teams
Specification team: Responsible for developing and maintaining the
system specification.
Development team: Responsible for developing and verifying the
software. The software is NOT executed or even compiled during
this process.
Certification team: Responsible for developing a set of statistical
tests to exercise the software after development. Reliability growth
models used to determine when reliability is acceptable.

Cleanroom process evaluation


• The results of using the Cleanroom process have been very
impressive with few discovered faults in delivered systems.
• Independent assessment shows that the process is no more
expensive than other approaches.
• There were fewer errors than in a 'traditional' development
process.
• However, the process is not widely used. It is not clear how this
approach can be transferred to an environment with less skilled or
less motivated software engineers.
The testing process
Component testing
• Testing of individual program components;
• Usually the responsibility of the component developer (except
sometimes for critical systems);
• Tests are derived from the developer‟s experience.
System testing
• Testing of groups of components integrated to create a system
or sub-system;
• The responsibility of an independent testing team;
• Tests are based on a system specification.

Department of CSE, SJBIT Page 80


Smartworld.asia 11 Smartzworld.com

Software Engineering 10IS51

ITesting phases

Defect testing
• The goal of defect testing is to discover defects in programs
• A successful defect test is a test which causes a program to
behave in an anomalous way
• Tests show the presence not the absence of defects

Testing process goals


Validation testing: To demonstrate to the developer and the system
customer that the software meets its requirements; a successful test shows that
the system operates as intended.
Defect testing: To discover faults or defects in the software where its
behavior is incorrect or not in conformance with its specification; a successful
test is a test that makes the system perform incorrectly and so exposes a defect
in the system.

The software testing process

Testing policies
Only exhaustive testing can show a program is free from defects.
However, exhaustive testing is impossible,
Testing policies define the approach to be used in selecting system
tests:
•All functions accessed through menus should be tested;
•Combinations of functions accessed through the same menu should
be tested;

Department of CSE, SJBIT Page 81


Smartworld.asia 12 Smartzworld.com

Software Engineering 10IS51

•Where user input is required, all functions must be tested with


correct and incorrect input.
System testing
• Involves integrating components to create a system or sub-
system.
• May involve testing an increment to be delivered to the
customer.
• Two phases:
Integration testing - the test team have access to the system source
code. The system is tested as components are integrated.
Release testing - the test team test the complete system to be
delivered as a black-box.
Integration testing
• Involves building a system from its components and testing it
for problems that arise from component interactions.
Top-down integration: Develop the skeleton of the system and
populate it with components.
Bottom-up integration: Integrate infrastructure components then add
functional components.
• To simplify error localisation, systems should be incrementally
integrated .

Incremental integration testing


I

Testing approaches
• Architectural validation: Top-down integration testing is better
at discovering errors in the system architecture.
• System demonstration: Top-down integration testing allows a
limited demonstration at an early stage in the development.
• Test implementation: Often easier with bottom-up integration
testing.
• Test observation: Problems with both approaches. Extra code
may be required to observe tests.

Department of CSE, SJBIT Page 82


Smartworld.asia 13 Smartzworld.com

Software Engineering 10IS51

Release testing
• The process of testing a release of a system that will be
distributed to customers.
• Primary goal is to increase the supplier‟s confidence that the
system meets its requirements.
• Release testing is usually black-box or functional testing
• Based on the system specification only;
• Testers do not have knowledge of the system implementation.

Black-box testing
I

Testing guidelines
Testing guidelines are hints for the testing team to help them choose
tests that will reveal defects in the system
• Choose inputs that force the system to generate all error
messages;
• Design inputs that cause buffers to overflow;
• Repeat the same input or input series several times;
• Force invalid outputs to be generated;
• Force computation results to be too large or too small.

System tests
1. T e s t t h e l o g in m e c h a n i s m u s i n g c o r r e c t a n d i n c o r re c t l o g in s t o c h e c k
t h a t v a l i d u s e rs a r e a c c e p te d a n d i n v a l i d u s e rs a re r e je c t e d .
2. T e s t t h e s e a r c h f a c i li t y u s i n g d if f e r e n t q u e r ie s a g a in s t k n o w n s o u r c e s to
c h e c k t h a t th e s e a r c h m e c h a n i s m is a c t u a l ly f i n d i n g d o c u m e n t s .
3. T e s t t h e s y s te m p re s e n t a t i o n f a c i l i t y t o c h e c k t h a t i n f o r m a t i o n ab ou t
d o c u m e n t s is d i s p la y e d p r o p e r ly .
4. T e s t t h e m e c h a n is m t o r e q u e s t p e r m is s i o n f o r d o w n l o a d i n g .
5. T e s t th e e - m a i l r e s p o n s e in d i c a t i n g th a t th e d o w n l o a d e d d o c u m e n t is
a v ailab le.

Department of CSE, SJBIT Page 83


Smartworld.asia 14 Smartzworld.com

Software Engineering 10IS51

Use cases
Use cases can be a basis for deriving the tests for a system. They
help identify operations to be tested and help design the required
test cases. From an associated sequence diagram, the inputs and
outputs to be created for the tests can be identified.

Collect weather data sequence chart

Performance testing
Part of release testing may involve testing the emergent properties
of a system, such as performance and reliability. Performance tests
usually involve planning a series of tests where the load is steadily
increased until the system performance becomes unacceptable.

Stress testing
• Exercises the system beyond its maximum design load.
Stressing the system often causes defects to
come to light.
• Stressing the system test failure behaviour.. Systems should not
fail catastrophically. Stress testing checks for unacceptable loss of
service or data.
• Stress testing is particularly relevant to distributed systems that
can exhibit severe degradation as a
network becomes overloaded .

Component testing
• Component or unit testing is the process of testing individual
components in isolation.

Department of CSE, SJBIT Page 84


Smartworld.asia 15 Smartzworld.com

Software Engineering 10IS51

• It is a defect testing process.


• Components may be:
• Individual functions or methods within an object;
• Object classes with several attributes and methods;
• Composite components with defined interfaces used to access
their functionality.

Object class testing


Complete test coverage of a class involves
• Testing all operations associated with an object;
• Setting and interrogating all object attributes;
• Exercising the object in all possible states.
Inheritance makes it more difficult to design object class tests as the
information to be tested is not localised.
Weather station object interface
I

Weather station testing


•Need to define test cases for reportWeather, calibrate, test, startup
and shutdown.
•Using a state model, identify sequences of state transitions to be
tested and the event sequences to cause these transitions
For example:
•Waiting -> Calibrating -> Testing -> Transmitting -> Waiting.

Interface testing
• Objectives are to detect faults due to interface errors or invalid
assumptions about interfaces.

Department of CSE, SJBIT Page 85


Smartworld.asia 16 Smartzworld.com

Software Engineering 10IS51

• Particularly important for object-oriented development as


objects are defined by their interfaces.
Interface testing

Interface types
• Parameter interfaces: Data passed from one procedure to
another.
• Shared memory interfaces: Block of memory is shared between
procedures or functions.
• Procedural interfaces: Sub-system encapsulates a set of
procedures to be called by other sub-systems.
• Message passing interfaces: Sub-systems request services from
other sub-systems

Interface errors
• Interface misuse: A calling component calls another component
and makes an error in its use of its interface e.g. parameters in the
wrong order.
• Interface misunderstanding: A calling component embeds
assumptions about the behaviour of the called component which are
incorrect.

Department of CSE, SJBIT Page 86


Smartworld.asia 17 Smartzworld.com

Software Engineering 10IS51

• Timing errors: The called and the calling component operate at


different speeds and out-of-date information is accessed.

Interface testing guidelines


• Design tests so that parameters to a called procedure are at the
extreme ends of their ranges.
• Always test pointer parameters with null pointers.
• Design tests which cause the component to fail.
• Use stress testing in message passing systems.
• In shared memory systems, vary the order in which components
are activated.

Test case design


• Involves designing the test cases (inputs and outputs) used to
test the system.
• The goal of test case design is to create a set of tests that are
effective in validation and defect testing.
• Design approaches:
• Requirements-based testing;
• Partition testing;
• Structural testing.

Requirements based testing


A general principle of requirements engineering is that requirements
should be testable. Requirements-based testing is a validation
testing technique where you consider each requirement and derive a
set of tests for that requirement.

LIBSYS requirementsLIBSYS tests

The user shall be able to search either all of the initial set of databases or select a
subset from it.
The system shall provide appropriate viewers for the user to read documents in the
document store.
Every order shall be allocated a unique identifier (ORDER_ID) that the user shall
be able to copy to the ac countÕs permanent storage area.

Department of CSE, SJBIT Page 87


Smartworld.asia 18 Smartzworld.com

Software Engineering 10IS51

Partition testing
• Input data and output results often fall into different classes
where all members of a class are related.
• Each of these classes is an equivalence partition or domain
where the program behaves in an equivalent way for each class
member.
• Initiate user search for searches fo r items that are known to
be present and known not to be present, where the set of
databases includes 1 database.
• Initiate user searches fo r items that are known to be present
and known not to be present, where the set of databases
includes 2 da tabases
• Initiate user searches fo r items that are known to be present
and known not to be present where the set of databases
includes more than 2 databases.
• Select one database from the set of databases and initiate
user searches for items that are known to be present and
known not to be present.
• Select more than on e database from the set of databases
and initiate searches for items that are known to be present
and known not to be present.
• Test cases should be chosen from each partition.

Equivalence partitioning

Department of CSE, SJBIT Page 88


Smartworld.asia 19 Smartzworld.com

Software Engineering 10IS51

Equivalence partitions

Search routine specification


procedure Search (Key : ELEM ; T: SEQ of ELEM;
Found : in out BOOLEAN; L: in out ELEM_INDEX) ;

Pre-condition
-- the sequence has at least one element
T‟FIRST <= T‟LAST
Post-condition
-- the element is found and is referenced by L
( Found and T (L) = Key)
or
-- the element is not in the array
( not Found and
not (exists i, T‟FIRST >= i <= T‟LAST, T (i) = Key ))

Search routine - input partitions


• Inputs which conform to the pre-conditions.
• Inputs where a pre-condition does not hold.
• Inputs where the key element is a member of the array.
• Inputs where the key element is not a member of the array.

Testing guidelines (sequences)


• Test software with sequences which have only a single value.
• Use sequences of different sizes in different tests.
• Derive tests so that the first, middle and last elements of the
sequence are accessed.
• Test with sequences of zero length.

Department of CSE, SJBIT Page 89


Smartworld.asia 20 Smartzworld.com

Software Engineering 10IS51

Search routine - input partitions


S eq u e n ce Elem e nt
S in g l e v al u e I n s e q u en c e
S in g l e v al u e N o t in se q u e n ce
M o re t h a n 1 v a l u e F ir s t e le m e n t i n s eq u en c e
M o re t h a n 1 v a l u e L a s t el e m en t in s e q u e n ce
M o re t h a n 1 v a l u e M id d le ele m e n t in seq u e n ce
M o re t h a n 1 v a l u e N o t in se q u e n ce

I n p u t s e q u e n ce ( T ) K ey ( K ey ) O u tp ut ( F o u n d , L )
17 17 tr u e, 1
17 0 f al s e , ? ?
17, 29 , 21, 23 17 tr u e, 1
41, 18 , 9, 3 1, 30, 1 6, 45 45 tr u e, 7
1 7, 18 , 2 1 , 23 , 2 9 , 41 , 3 8 23 tr u e, 4
21, 23 , 2 9, 33 , 38 25 f al s e , ? ?

Structural testing
Sometime called white-box testing. Derivation of test cases
according to program structure. Knowledge of the program is used
to identify additional test cases. Objective is to exercise all program
statements (not all path combinations)

Binary search - equiv. partitions


• Pre-conditions satisfied, key element in array.
• Pre-conditions satisfied, key element not in
array.
• Pre-conditions unsatisfied, key element in array.
• Pre-conditions unsatisfied, key element not in array.
• Input array has a single value.
• Input array has an even number of values.

Department of CSE, SJBIT Page 90


Smartworld.asia 21 Smartzworld.com

Software Engineering 10IS51

• Input array has an odd number of values

Binary search - test cases

Input array (T ) Key (Key) Output (Found, L)


17 17 true, 1
17 0 false, ??
17, 21, 23, 29 17 true, 1
9, 16, 18, 30, 31, 41, 45 45 true, 7
17, 18, 21, 23, 29, 38, 41 23 true, 4
17, 18, 21, 23, 29, 33, 38 21 true, 3
12, 18, 21, 23, 32 23 true, 4
21, 23, 29, 33, 38 25 false, ??

Path testing
• The objective of path testing is to ensure that the set of test
cases is such that each path through the program is executed at least
once.
• The starting point for path testing is a program flow graph that
shows nodes representing program decisions and arcs representing
the flow of control.
• Statements with conditions are therefore nodes in the flow
graph.

Department of CSE, SJBIT Page 91


Smartworld.asia 22 Smartzworld.com

Software Engineering 10IS51

Binary search flow graph


I

Independent paths
•1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14
•1, 2, 3, 4, 5, 14
•1, 2, 3, 4, 5, 6, 7, 11, 12, 5, …
•1, 2, 3, 4, 6, 7, 2, 11, 13, 5, …

•Testcases should be derived so that all of these paths are executed


•Adynamic program analyser may be used to check that paths have
been executed

Test automation
• Testing is an expensive process phase. Testing workbenches
provide a range of tools to reduce the time required and total testing
costs.
• Systems such as Junit support the automatic execution of tests.
• Most testing workbenches are open systems because testing
needs are organisation-specific.
• They are sometimes difficult to integrate with closed design
and analysis workbenches.

Department of CSE, SJBIT Page 92


Smartworld.asia 23 Smartzworld.com

Software Engineering 10IS51

A testing workbench
I

Testing workbench adaptation


• Scripts may be developed for user interface simulators and
patterns for test data generators.
• Test outputs may have to be prepared manually for comparison.
• Special-purpose file comparators may be developed.

Department of CSE, SJBIT Page 93

You might also like