SlideShare a Scribd company logo
1 of 68
Software Testing and
Analysis
Ultimate goal for software testing
Quality
Assurance
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
• Verification: The software should
conform to its specification (Are we
building the product right?)
• Validation: The software should do what
the user really requires (Are we building
the right product?)
Verification vs. validation
“Classical” lifecycle model
• Requirements Phase
• Specification Phase (Analysis)
• Planning Phase
• Design Phase
• Implementation Phase
• Integration and Testing
• Maintenance
• Retirement
Cost to fix faults
Cost
Definition Development Post Release
1*
1.5* to 6*
60* to 100*
• 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 usable in an operational situation.
The V & V process
Sequential model
Requireme
nts
Testing/Ver
ify
Integration
Testing/Ver
ify
Operations
Mode
Specificatio
n
Testing/Ver
ify
Planning
Testing/Ver
ifyDesign
Testing/Ver
ifyImplementa
tion
Testing/Veri
fy
Maintenance
• Software inspections and walkthroughs
- Concerned with analysis of the static
system representation to discover
problems (static verification)
• Software testing - Concerned with
exercising and observing product
behaviour (dynamic verification)
– The system is executed with test data
and its operational behaviour is observed
Static and dynamic verification
Static and dynamic V&V
Formal
specification
High-level
design
Requirements
specification
Detailed
design
Program
Prototype
Dynamic
validation
Static
verification
• 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
V & V planning
The V-model of development
Requirements
specification
System
specification
System
design
Detailed
design
Moduleand
unitcode
and tess
Sub-system
integration
test plan
System
integration
test plan
Acceptance
test plan
Service
Acceptance
test
System
integrationtest
Sub-system
integrationtest
The structure of a software test plan
• The testing process
• Requirements traceability
• Tested items
• Testing schedule
• Test recording procedures
• Hardware and software requirements
• Constraints
Walkthroughs
• Informal examination of a product (document)
• Made up of:
– developers
– client
– next phase developers
– Software Quality Assurance group leader
• Produces:
– list of items not understood
– list of items thought to be incorrect
Software inspections
• Involve people examining the source
representation with the aim of discovering
anomalies and defects
• Do not require execution of a system so may be
used before implementation
• May be applied to any representation of the
system (requirements, design, test data, etc.)
• Very effective technique for discovering 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 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 un-initialised
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 must be available
• An error checklist should be prepared
• Management must accept that inspection will
increase costs early in the software process
• Management must not use inspections for
staff
appraisal
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
Inspection teams
• Made up of at least 4 members
• Author of the code being inspected
• Inspector who finds errors, omissions and
inconsistencies
• Reader who reads the code to the team
• Moderator who chairs the meeting and notes
discovered errors
• Other roles are Scribe and Chief moderator
Inspection checklists
• Checklist of common errors should be used to
drive the inspection
• Error checklist is programming language
dependent
• The 'weaker' the type checking, the larger the
checklist
• Examples: Initialization, Constant naming, loop
termination, array bounds, etc.
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 (@ $50/hr = $2000!!!)
• Can reveal the presence of errors NOT their
absence
• A successful test is a test which discovers one
or more errors
• The only validation technique for non-functional
requirements
• Should be used in conjunction with static
verification to provide full V&V coverage
Program testing
Execution based testing
• “Program testing can be a very effective way
to show the presents of bugs but is
hopelessly inadequate for showing their
absence” [Dijkstra]
• Fault: “bug” incorrect piece of code
• Failure: result of a fault
• Error: mistake made by the
programmer/developer
• 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
Testing and debugging
The debugging process
Locate
error
Design
errorrepair
Repair
error
Re-test
program
Test
results Specification Test
cases
Testing phases
Component
testing
Integration
testing
Software developer Independent testingteam
Testing phases
• 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
• Integration 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
• Only exhaustive testing can show a program
is free from defects. However, exhaustive
testing is impossible
• Tests should exercise a system's capabilities
rather than its components
• Testing old capabilities is more important
than testing new capabilities
• Testing typical situations is more important
than boundary value cases
Testing priorities
• Test data Inputs which have been
devised to test the system
• Test cases Inputs to test the system and
the predicted outputs from these inputs if
the system operates according to its
specification
Test data and test cases
Development of test cases
• Test cases and test scenarios comprise much
of a software systems testware.
• Black box test cases are developed by
domain analysis and examination of the
system requirements and specification.
• Glass box test cases are developed by
examining the behavior of the source code.
The defect testing process
Design test
cases
Prepare test
data
Run program
with test data
Compare results
to test cases
Test
cases
Test
data
Test
results
Test
reports
Methods of testing
• Test to specification:
– Black box,
– Data driven
– Functional testing
– Code is ignored: only use specification document
to develop test cases
• Test to code:
– Glass box/White box
– Logic driven testing
– Ignore specification and only examine the code.
Can you guarantee a program is
correct?
• This is called the Halting Problem
• Write a program to test if any given program
is correct. The output is correct or incorrect.
• Test this program on itself.
• If output is incorrect, then how do you know
the output is correct?
• Conundrum, Dilemma, or Contradiction?
Black-box testing
• An approach to testing where the
program is considered as a ‘black-box’
• The program test cases are based on the
system specification
• Test planning can begin early in the
software process
Black-box testing
I
e
Inputtestdata
OeOutputtestresults
System
Inputscausing
anomalous
behaviour
Outputswhichreveal
thepresenceof
defects
Pairing down test cases
• Use methods that take advantage of
symmetries, data equivalencies, and
independencies to reduce the number of
necessary test cases.
– Equivalence Testing
– Boundary Value Analysis
• Determine the ranges of working system
• Develop equivalence classes of test cases
• Examine the boundaries of these classes
carefully
Equivalence partitioning
• 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 where the program behaves in
an equivalent way for each class member
• Test cases should be chosen from each
partition
Equivalence partitioning
System
Outputs
Invalidinputs Validinputs
• Partition system inputs and outputs into
‘equivalence sets’
– If input is a 5-digit integer between 10,000 and
99,999, equivalence partitions are < 10,000,
10,000 - 99, 999 and > 10, 000
• Choose test cases at the boundary of these
sets
– 00000, 09999, 10000, 99999, 10001
Boundary value testing
Equivalence partitions
Between10000and99999Lessthan10000 Morethan99999
9999
10000 50000
100000
99999
Inputvalues
Between4and10Lessthan4 Morethan10
3
4 7
11
10
Numberofinputvalues
Search routine specification
procedure Search (Key : ELEM ; T: ELEM_ARRAY;
Found : in out BOOLEAN; L: in out ELEM_INDEX) ;
Pre-condition
-- the array 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 ))
• 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
Search routine - input partitions
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
Search routine - input partitions
Array Element
Single value In sequence
Single value Not in sequence
More than 1 value First element in sequence
More than 1 value Last element in sequence
More than 1 value Middle element in sequence
More than 1 value Not in sequence
Input sequence (T) Key (Key) Output (Found, L)
17 17 true, 1
17 0 false, ??
17, 29, 21, 23 17 true, 1
41, 18, 9, 31, 30, 16, 45 45 true, 7
17, 18, 21, 23, 29, 41, 38 23 true, 4
21, 23, 29, 33, 38 25 false, ??
Sorting example
• Example: sort (lst, n)
– Sort a list of numbers
– The list is between 2 and 1000 elements
• Domains:
– The list has some item type (of little concern)
– n is an integer value (sub-range)
• Equivalence classes;
– n < 2
– n > 1000
– 2 <= n <= 1000
Sorting example
• What do you test?
• Not all cases of integers
• Not all cases of positive integers
• Not all cases between 1 and 1001
• Highest payoff for detecting faults is to test around
the boundaries of equivalence classes.
• Test n=1, n=2, n=1000, n=1001, and say n= 10
• Five tests versus 1000.
• Sometime called structural testing or glass-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)
White-box testing
Types of structural testing
• Statement coverage -
– Test cases which will execute every statement at least once.
– Tools exist for help
– No guarantee that all branches are properly tested. Loop
exit?
• Branch coverage
– All branches are tested once
• Path coverage - Restriction of type of paths:
– Linear code sequences
– Definition/Use checking (all definition/use paths)
– Can locate dead code
White-box testing
Component
code
Test
outputs
Test data
DerivesTests
White box testing - binary search example
int search ( int key, int [] elemArray)
{
int bottom = 0;
int top = elemArray.length - 1;
int mid;
int result = -1;
while ( bottom <= top )
{
mid = (top + bottom) / 2;
if (elemArray [mid] == key)
{
result = mid;
return result;
} // if part
else
{
if (elemArray [mid] < key)
bottom = mid + 1;
else
top = mid - 1;
}
} //while loop
return result;
} // search
• 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
• Input array has an odd number of values
Binary search equivalence partitions
Binary search equivalence partitions
Mid-point
Elements<Mid Elements>Mid
Equivalenceclassboundaries
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
• Describes the program control flow. Each
branch is shown as a separate path and loops
are shown by arrows looping back to the loop
condition node
• Used as a basis for computing the cyclomatic
complexity
• Cyclomatic complexity = Number of edges -
Number of nodes +2
Program flow graphs
• The number of tests to test all control
statements equals the cyclomatic complexity
• Cyclomatic complexity equals number of
conditions in a program
• Useful if used with care. Does not imply
adequacy of testing
• Although all paths are executed, all
combinations of paths are not executed
Cyclomatic complexity
1
2
3
4
65
7
while bottom <= top
if (elemArray [mid] == key
(if (elemArray [mid]< key8
9
bottom > top
Binary search flow
graph
• 1, 2, 3, 8, 9
• 1, 2, 3, 4, 6, 7, 2
• 1, 2, 3, 4, 5, 7, 2
• 1, 2, 3, 4, 6, 7, 2, 8, 9
• Test cases should be derived so that
all of these paths are executed
• A dynamic program analyser may be
used to check that paths have been
executed
Independent paths
Feasibility
• Pure black box testing (specification) is
realistically impossible because there are (in
general) too many test cases to consider.
• Pure testing to code requires a test of every
possible path in a flow chart. This is also (in
general) infeasible. Also every path does not
guarantee correctness.
• Normally, a combination of Black box and
Glass box testing is done.
Integration testing
• Tests complete systems or subsystems
composed of integrated components
• Integration testing should be black-box testing
with tests derived from the specification
• Main difficulty is localising errors
• Incremental integration testing reduces this
problem
Incremental integration testing
T3
T2
T1
T4
T5
A
B
C
D
T2
T1
T3
T4
A
B
C
T1
T2
T3
A
B
Test sequence
1
Test sequence
2
Test sequence
3
Approaches to integration testing
• Top-down testing
– Start with high-level system and integrate from the
top-down replacing individual components by stubs
where appropriate
• Bottom-up testing
– Integrate individual components in levels until the
complete system is created
• In practice, most integration involves a
combination of these strategies
Top-down testing
Level 2Level 2Level 2Level 2
Level 1 Level 1
Testing
sequence
Level 2
stubs
Level 3
stubs
. . .
Bottom-up testing
Level NLevel NLevel NLevel NLevel N
Level N–1 Level N–1Level N–1
Testing
sequence
Test
drivers
Test
drivers
Software testing metrics
• Defects rates
• Errors rates
• Number of errors
• Number of errors found per person hours
expended
• Measured by:
– individual
– module
– during development
• Errors should be categorized by origin, type,
cost
More metrics
• Direct measures - cost, effort, LOC, etc.
• Indirect Measures - functionality, quality,
complexity, reliability, maintainability
• Size Oriented:
– Lines of code - LOC
– Effort - person months
– errors/KLOC
– defects/KLOC
– cost/KLOC

More Related Content

What's hot

Eleven step of software testing process
Eleven step of software testing processEleven step of software testing process
Eleven step of software testing processHimanshu
 
Fundamentals of Software Quality Assurance & Testing
Fundamentals of Software Quality Assurance & TestingFundamentals of Software Quality Assurance & Testing
Fundamentals of Software Quality Assurance & Testingrongbaz
 
Testing Concepts and Manual Testing
Testing Concepts and Manual TestingTesting Concepts and Manual Testing
Testing Concepts and Manual TestingSachin-QA
 
Testing types functional and nonfunctional - Kati Holasz
Testing types   functional and nonfunctional - Kati HolaszTesting types   functional and nonfunctional - Kati Holasz
Testing types functional and nonfunctional - Kati HolaszHolasz Kati
 
Role of Testing
Role of Testing Role of Testing
Role of Testing Rishu Seth
 
Manual Testing Questions
Manual Testing QuestionsManual Testing Questions
Manual Testing QuestionsUser1test
 
STLC– software testing life cycle
STLC– software testing life cycleSTLC– software testing life cycle
STLC– software testing life cyclesubash kumar
 
STLC (Software Testing Life Cycle)
STLC (Software Testing Life Cycle)STLC (Software Testing Life Cycle)
STLC (Software Testing Life Cycle)Ch Fahadi
 
Unit 7 verification &amp; validation
Unit 7 verification &amp; validationUnit 7 verification &amp; validation
Unit 7 verification &amp; validationraksharao
 
Verifcation and Validation
Verifcation and ValidationVerifcation and Validation
Verifcation and ValidationSaggitariusArrow
 
verification and validation
verification and validationverification and validation
verification and validationDinesh Pasi
 
Software Testing Principles
Software Testing PrinciplesSoftware Testing Principles
Software Testing PrinciplesKanoah
 
Role of a Software Tester
Role of a Software TesterRole of a Software Tester
Role of a Software TesterQAI Global
 

What's hot (20)

Testing tools
Testing toolsTesting tools
Testing tools
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Eleven step of software testing process
Eleven step of software testing processEleven step of software testing process
Eleven step of software testing process
 
Fundamentals of Software Quality Assurance & Testing
Fundamentals of Software Quality Assurance & TestingFundamentals of Software Quality Assurance & Testing
Fundamentals of Software Quality Assurance & Testing
 
Testing Concepts and Manual Testing
Testing Concepts and Manual TestingTesting Concepts and Manual Testing
Testing Concepts and Manual Testing
 
Testing types functional and nonfunctional - Kati Holasz
Testing types   functional and nonfunctional - Kati HolaszTesting types   functional and nonfunctional - Kati Holasz
Testing types functional and nonfunctional - Kati Holasz
 
Role of Testing
Role of Testing Role of Testing
Role of Testing
 
Software Verification & Validation
Software Verification & ValidationSoftware Verification & Validation
Software Verification & Validation
 
Manual Testing Questions
Manual Testing QuestionsManual Testing Questions
Manual Testing Questions
 
STLC– software testing life cycle
STLC– software testing life cycleSTLC– software testing life cycle
STLC– software testing life cycle
 
Functional testing patterns
Functional testing patternsFunctional testing patterns
Functional testing patterns
 
Lec25
Lec25Lec25
Lec25
 
Data validation
Data validationData validation
Data validation
 
STLC (Software Testing Life Cycle)
STLC (Software Testing Life Cycle)STLC (Software Testing Life Cycle)
STLC (Software Testing Life Cycle)
 
Unit 7 verification &amp; validation
Unit 7 verification &amp; validationUnit 7 verification &amp; validation
Unit 7 verification &amp; validation
 
Software Testing
Software Testing Software Testing
Software Testing
 
Verifcation and Validation
Verifcation and ValidationVerifcation and Validation
Verifcation and Validation
 
verification and validation
verification and validationverification and validation
verification and validation
 
Software Testing Principles
Software Testing PrinciplesSoftware Testing Principles
Software Testing Principles
 
Role of a Software Tester
Role of a Software TesterRole of a Software Tester
Role of a Software Tester
 

Viewers also liked

Chapter 10 software certification
Chapter 10 software certificationChapter 10 software certification
Chapter 10 software certificationPiyush Gogia
 
Requirement Analysis & Specification sharbani bhattacharya
Requirement Analysis & Specification sharbani bhattacharyaRequirement Analysis & Specification sharbani bhattacharya
Requirement Analysis & Specification sharbani bhattacharyaSharbani Bhattacharya
 
Requirement Analysis
Requirement AnalysisRequirement Analysis
Requirement AnalysisWebx
 
Chapter 5 software design
Chapter 5 software designChapter 5 software design
Chapter 5 software designPiyush Gogia
 
Osi model
Osi modelOsi model
Osi modelOnline
 
Chapter 4 software project planning
Chapter 4 software project planningChapter 4 software project planning
Chapter 4 software project planningPiyush Gogia
 
Network Architecture of 5G Mobile Tecnology
Network Architecture of 5G Mobile TecnologyNetwork Architecture of 5G Mobile Tecnology
Network Architecture of 5G Mobile Tecnologyvineetkathan
 
Requirements analysis
Requirements analysisRequirements analysis
Requirements analysisasimnawaz54
 

Viewers also liked (10)

Chapter 10 software certification
Chapter 10 software certificationChapter 10 software certification
Chapter 10 software certification
 
Requirement analysis with use case
Requirement analysis with use caseRequirement analysis with use case
Requirement analysis with use case
 
Requirement Analysis & Specification sharbani bhattacharya
Requirement Analysis & Specification sharbani bhattacharyaRequirement Analysis & Specification sharbani bhattacharya
Requirement Analysis & Specification sharbani bhattacharya
 
Requirement Analysis
Requirement AnalysisRequirement Analysis
Requirement Analysis
 
Chapter 5 software design
Chapter 5 software designChapter 5 software design
Chapter 5 software design
 
Osi model
Osi modelOsi model
Osi model
 
Osi model
Osi modelOsi model
Osi model
 
Chapter 4 software project planning
Chapter 4 software project planningChapter 4 software project planning
Chapter 4 software project planning
 
Network Architecture of 5G Mobile Tecnology
Network Architecture of 5G Mobile TecnologyNetwork Architecture of 5G Mobile Tecnology
Network Architecture of 5G Mobile Tecnology
 
Requirements analysis
Requirements analysisRequirements analysis
Requirements analysis
 

Similar to Software Testing Analysis Guide

SENG202-v-and-v-modeling_121810.pptx
SENG202-v-and-v-modeling_121810.pptxSENG202-v-and-v-modeling_121810.pptx
SENG202-v-and-v-modeling_121810.pptxMinsasWorld
 
testing strategies and tactics
 testing strategies and tactics testing strategies and tactics
testing strategies and tacticsPreeti Mishra
 
Software Quality Assurance
Software Quality AssuranceSoftware Quality Assurance
Software Quality AssuranceSaqib Raza
 
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...ShudipPal
 
Software Engineering (Testing Overview)
Software Engineering (Testing Overview)Software Engineering (Testing Overview)
Software Engineering (Testing Overview)ShudipPal
 
Quality Analyst Training - Gain America
Quality Analyst Training - Gain AmericaQuality Analyst Training - Gain America
Quality Analyst Training - Gain AmericaGainAmerica
 
Test planning and software's engineering
Test planning and software's engineeringTest planning and software's engineering
Test planning and software's engineeringMansiganeshJawale
 
Software Testing PPT | Software All Testing
Software Testing PPT | Software All TestingSoftware Testing PPT | Software All Testing
Software Testing PPT | Software All Testingsankalpkumarsahoo174
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategiesSHREEHARI WADAWADAGI
 
unit-2_20-july-2018 (1).pptx
unit-2_20-july-2018 (1).pptxunit-2_20-july-2018 (1).pptx
unit-2_20-july-2018 (1).pptxPriyaFulpagare1
 
Unit iv-testing-pune-university-sres-coe
Unit iv-testing-pune-university-sres-coeUnit iv-testing-pune-university-sres-coe
Unit iv-testing-pune-university-sres-coeHitesh Mohapatra
 
Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Taymoor Nazmy
 
Fundamentals of software part 1
Fundamentals of software part 1Fundamentals of software part 1
Fundamentals of software part 1Siddharth Sharma
 

Similar to Software Testing Analysis Guide (20)

SENG202-v-and-v-modeling_121810.pptx
SENG202-v-and-v-modeling_121810.pptxSENG202-v-and-v-modeling_121810.pptx
SENG202-v-and-v-modeling_121810.pptx
 
testing strategies and tactics
 testing strategies and tactics testing strategies and tactics
testing strategies and tactics
 
Software Quality Assurance
Software Quality AssuranceSoftware Quality Assurance
Software Quality Assurance
 
Software testing
Software testingSoftware testing
Software testing
 
Testing fundamentals
Testing fundamentalsTesting fundamentals
Testing fundamentals
 
UNIT 1.pptx
UNIT 1.pptxUNIT 1.pptx
UNIT 1.pptx
 
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
Software Engineering (Software Quality Assurance & Testing: Supplementary Mat...
 
Software Engineering (Testing Overview)
Software Engineering (Testing Overview)Software Engineering (Testing Overview)
Software Engineering (Testing Overview)
 
Software testing introduction
Software testing  introductionSoftware testing  introduction
Software testing introduction
 
Quality Analyst Training - Gain America
Quality Analyst Training - Gain AmericaQuality Analyst Training - Gain America
Quality Analyst Training - Gain America
 
Test planning and software's engineering
Test planning and software's engineeringTest planning and software's engineering
Test planning and software's engineering
 
6. oose testing
6. oose testing6. oose testing
6. oose testing
 
Manual testing - Introduction to Manual Software testing
Manual testing - Introduction to Manual Software testingManual testing - Introduction to Manual Software testing
Manual testing - Introduction to Manual Software testing
 
Software Testing PPT | Software All Testing
Software Testing PPT | Software All TestingSoftware Testing PPT | Software All Testing
Software Testing PPT | Software All Testing
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
 
unit-2_20-july-2018 (1).pptx
unit-2_20-july-2018 (1).pptxunit-2_20-july-2018 (1).pptx
unit-2_20-july-2018 (1).pptx
 
Software testing
Software testingSoftware testing
Software testing
 
Unit iv-testing-pune-university-sres-coe
Unit iv-testing-pune-university-sres-coeUnit iv-testing-pune-university-sres-coe
Unit iv-testing-pune-university-sres-coe
 
Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--
 
Fundamentals of software part 1
Fundamentals of software part 1Fundamentals of software part 1
Fundamentals of software part 1
 

More from WBUTTUTORIALS

Fuzzy logic-introduction
Fuzzy logic-introductionFuzzy logic-introduction
Fuzzy logic-introductionWBUTTUTORIALS
 
Failure mode-and-effects-analysis
Failure mode-and-effects-analysisFailure mode-and-effects-analysis
Failure mode-and-effects-analysisWBUTTUTORIALS
 
Direct memory access
Direct memory accessDirect memory access
Direct memory accessWBUTTUTORIALS
 
Cost volume-profit-relationships
Cost volume-profit-relationshipsCost volume-profit-relationships
Cost volume-profit-relationshipsWBUTTUTORIALS
 
Control unit-implementation
Control unit-implementationControl unit-implementation
Control unit-implementationWBUTTUTORIALS
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimizationWBUTTUTORIALS
 
Data communications-concepts
Data communications-conceptsData communications-concepts
Data communications-conceptsWBUTTUTORIALS
 
Ajax toolkit-framework
Ajax toolkit-frameworkAjax toolkit-framework
Ajax toolkit-frameworkWBUTTUTORIALS
 

More from WBUTTUTORIALS (12)

Query optimisation
Query optimisationQuery optimisation
Query optimisation
 
Fuzzy logic-introduction
Fuzzy logic-introductionFuzzy logic-introduction
Fuzzy logic-introduction
 
Failure mode-and-effects-analysis
Failure mode-and-effects-analysisFailure mode-and-effects-analysis
Failure mode-and-effects-analysis
 
Direct memory access
Direct memory accessDirect memory access
Direct memory access
 
Cost volume-profit-relationships
Cost volume-profit-relationshipsCost volume-profit-relationships
Cost volume-profit-relationships
 
Control unit-implementation
Control unit-implementationControl unit-implementation
Control unit-implementation
 
Relational model
Relational modelRelational model
Relational model
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimization
 
Data communications-concepts
Data communications-conceptsData communications-concepts
Data communications-concepts
 
Ajax workshop
Ajax workshopAjax workshop
Ajax workshop
 
Ajax toolkit-framework
Ajax toolkit-frameworkAjax toolkit-framework
Ajax toolkit-framework
 
Ajax
AjaxAjax
Ajax
 

Recently uploaded

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 

Recently uploaded (20)

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 

Software Testing Analysis Guide

  • 2. Ultimate goal for software testing Quality Assurance
  • 3. 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
  • 4. • Verification: The software should conform to its specification (Are we building the product right?) • Validation: The software should do what the user really requires (Are we building the right product?) Verification vs. validation
  • 5. “Classical” lifecycle model • Requirements Phase • Specification Phase (Analysis) • Planning Phase • Design Phase • Implementation Phase • Integration and Testing • Maintenance • Retirement
  • 6. Cost to fix faults Cost Definition Development Post Release 1* 1.5* to 6* 60* to 100*
  • 7. • 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 usable in an operational situation. The V & V process
  • 9. • Software inspections and walkthroughs - Concerned with analysis of the static system representation to discover problems (static verification) • Software testing - Concerned with exercising and observing product behaviour (dynamic verification) – The system is executed with test data and its operational behaviour is observed Static and dynamic verification
  • 10. Static and dynamic V&V Formal specification High-level design Requirements specification Detailed design Program Prototype Dynamic validation Static verification
  • 11. • 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 V & V planning
  • 12. The V-model of development Requirements specification System specification System design Detailed design Moduleand unitcode and tess Sub-system integration test plan System integration test plan Acceptance test plan Service Acceptance test System integrationtest Sub-system integrationtest
  • 13. The structure of a software test plan • The testing process • Requirements traceability • Tested items • Testing schedule • Test recording procedures • Hardware and software requirements • Constraints
  • 14. Walkthroughs • Informal examination of a product (document) • Made up of: – developers – client – next phase developers – Software Quality Assurance group leader • Produces: – list of items not understood – list of items thought to be incorrect
  • 15. Software inspections • Involve people examining the source representation with the aim of discovering anomalies and defects • Do not require execution of a system so may be used before implementation • May be applied to any representation of the system (requirements, design, test data, etc.) • Very effective technique for discovering errors
  • 16. 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
  • 17. 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 cannot check non-functional characteristics such as performance, usability, etc.
  • 18. 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 un-initialised variable) or non-compliance with standards
  • 19. Inspection pre-conditions • A precise specification must be available • Team members must be familiar with the organisation standards • Syntactically correct code must be available • An error checklist should be prepared • Management must accept that inspection will increase costs early in the software process • Management must not use inspections for staff appraisal
  • 20. 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
  • 21. Inspection teams • Made up of at least 4 members • Author of the code being inspected • Inspector who finds errors, omissions and inconsistencies • Reader who reads the code to the team • Moderator who chairs the meeting and notes discovered errors • Other roles are Scribe and Chief moderator
  • 22. Inspection checklists • Checklist of common errors should be used to drive the inspection • Error checklist is programming language dependent • The 'weaker' the type checking, the larger the checklist • Examples: Initialization, Constant naming, loop termination, array bounds, etc.
  • 23. 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 (@ $50/hr = $2000!!!)
  • 24. • Can reveal the presence of errors NOT their absence • A successful test is a test which discovers one or more errors • The only validation technique for non-functional requirements • Should be used in conjunction with static verification to provide full V&V coverage Program testing
  • 25. Execution based testing • “Program testing can be a very effective way to show the presents of bugs but is hopelessly inadequate for showing their absence” [Dijkstra] • Fault: “bug” incorrect piece of code • Failure: result of a fault • Error: mistake made by the programmer/developer
  • 26. • 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 Testing and debugging
  • 29. Testing phases • 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 • Integration 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
  • 30. • Only exhaustive testing can show a program is free from defects. However, exhaustive testing is impossible • Tests should exercise a system's capabilities rather than its components • Testing old capabilities is more important than testing new capabilities • Testing typical situations is more important than boundary value cases Testing priorities
  • 31. • Test data Inputs which have been devised to test the system • Test cases Inputs to test the system and the predicted outputs from these inputs if the system operates according to its specification Test data and test cases
  • 32. Development of test cases • Test cases and test scenarios comprise much of a software systems testware. • Black box test cases are developed by domain analysis and examination of the system requirements and specification. • Glass box test cases are developed by examining the behavior of the source code.
  • 33. The defect testing process Design test cases Prepare test data Run program with test data Compare results to test cases Test cases Test data Test results Test reports
  • 34. Methods of testing • Test to specification: – Black box, – Data driven – Functional testing – Code is ignored: only use specification document to develop test cases • Test to code: – Glass box/White box – Logic driven testing – Ignore specification and only examine the code.
  • 35. Can you guarantee a program is correct? • This is called the Halting Problem • Write a program to test if any given program is correct. The output is correct or incorrect. • Test this program on itself. • If output is incorrect, then how do you know the output is correct? • Conundrum, Dilemma, or Contradiction?
  • 36. Black-box testing • An approach to testing where the program is considered as a ‘black-box’ • The program test cases are based on the system specification • Test planning can begin early in the software process
  • 38. Pairing down test cases • Use methods that take advantage of symmetries, data equivalencies, and independencies to reduce the number of necessary test cases. – Equivalence Testing – Boundary Value Analysis • Determine the ranges of working system • Develop equivalence classes of test cases • Examine the boundaries of these classes carefully
  • 39. Equivalence partitioning • 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 where the program behaves in an equivalent way for each class member • Test cases should be chosen from each partition
  • 41. • Partition system inputs and outputs into ‘equivalence sets’ – If input is a 5-digit integer between 10,000 and 99,999, equivalence partitions are < 10,000, 10,000 - 99, 999 and > 10, 000 • Choose test cases at the boundary of these sets – 00000, 09999, 10000, 99999, 10001 Boundary value testing
  • 42. Equivalence partitions Between10000and99999Lessthan10000 Morethan99999 9999 10000 50000 100000 99999 Inputvalues Between4and10Lessthan4 Morethan10 3 4 7 11 10 Numberofinputvalues
  • 43. Search routine specification procedure Search (Key : ELEM ; T: ELEM_ARRAY; Found : in out BOOLEAN; L: in out ELEM_INDEX) ; Pre-condition -- the array 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 ))
  • 44. • 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 Search routine - input partitions
  • 45. 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
  • 46. Search routine - input partitions Array Element Single value In sequence Single value Not in sequence More than 1 value First element in sequence More than 1 value Last element in sequence More than 1 value Middle element in sequence More than 1 value Not in sequence Input sequence (T) Key (Key) Output (Found, L) 17 17 true, 1 17 0 false, ?? 17, 29, 21, 23 17 true, 1 41, 18, 9, 31, 30, 16, 45 45 true, 7 17, 18, 21, 23, 29, 41, 38 23 true, 4 21, 23, 29, 33, 38 25 false, ??
  • 47. Sorting example • Example: sort (lst, n) – Sort a list of numbers – The list is between 2 and 1000 elements • Domains: – The list has some item type (of little concern) – n is an integer value (sub-range) • Equivalence classes; – n < 2 – n > 1000 – 2 <= n <= 1000
  • 48. Sorting example • What do you test? • Not all cases of integers • Not all cases of positive integers • Not all cases between 1 and 1001 • Highest payoff for detecting faults is to test around the boundaries of equivalence classes. • Test n=1, n=2, n=1000, n=1001, and say n= 10 • Five tests versus 1000.
  • 49. • Sometime called structural testing or glass-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) White-box testing
  • 50. Types of structural testing • Statement coverage - – Test cases which will execute every statement at least once. – Tools exist for help – No guarantee that all branches are properly tested. Loop exit? • Branch coverage – All branches are tested once • Path coverage - Restriction of type of paths: – Linear code sequences – Definition/Use checking (all definition/use paths) – Can locate dead code
  • 52. White box testing - binary search example int search ( int key, int [] elemArray) { int bottom = 0; int top = elemArray.length - 1; int mid; int result = -1; while ( bottom <= top ) { mid = (top + bottom) / 2; if (elemArray [mid] == key) { result = mid; return result; } // if part else { if (elemArray [mid] < key) bottom = mid + 1; else top = mid - 1; } } //while loop return result; } // search
  • 53. • 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 • Input array has an odd number of values Binary search equivalence partitions
  • 54. Binary search equivalence partitions Mid-point Elements<Mid Elements>Mid Equivalenceclassboundaries
  • 55. 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, ??
  • 56. 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
  • 57. • Describes the program control flow. Each branch is shown as a separate path and loops are shown by arrows looping back to the loop condition node • Used as a basis for computing the cyclomatic complexity • Cyclomatic complexity = Number of edges - Number of nodes +2 Program flow graphs
  • 58. • The number of tests to test all control statements equals the cyclomatic complexity • Cyclomatic complexity equals number of conditions in a program • Useful if used with care. Does not imply adequacy of testing • Although all paths are executed, all combinations of paths are not executed Cyclomatic complexity
  • 59. 1 2 3 4 65 7 while bottom <= top if (elemArray [mid] == key (if (elemArray [mid]< key8 9 bottom > top Binary search flow graph
  • 60. • 1, 2, 3, 8, 9 • 1, 2, 3, 4, 6, 7, 2 • 1, 2, 3, 4, 5, 7, 2 • 1, 2, 3, 4, 6, 7, 2, 8, 9 • Test cases should be derived so that all of these paths are executed • A dynamic program analyser may be used to check that paths have been executed Independent paths
  • 61. Feasibility • Pure black box testing (specification) is realistically impossible because there are (in general) too many test cases to consider. • Pure testing to code requires a test of every possible path in a flow chart. This is also (in general) infeasible. Also every path does not guarantee correctness. • Normally, a combination of Black box and Glass box testing is done.
  • 62. Integration testing • Tests complete systems or subsystems composed of integrated components • Integration testing should be black-box testing with tests derived from the specification • Main difficulty is localising errors • Incremental integration testing reduces this problem
  • 64. Approaches to integration testing • Top-down testing – Start with high-level system and integrate from the top-down replacing individual components by stubs where appropriate • Bottom-up testing – Integrate individual components in levels until the complete system is created • In practice, most integration involves a combination of these strategies
  • 65. Top-down testing Level 2Level 2Level 2Level 2 Level 1 Level 1 Testing sequence Level 2 stubs Level 3 stubs . . .
  • 66. Bottom-up testing Level NLevel NLevel NLevel NLevel N Level N–1 Level N–1Level N–1 Testing sequence Test drivers Test drivers
  • 67. Software testing metrics • Defects rates • Errors rates • Number of errors • Number of errors found per person hours expended • Measured by: – individual – module – during development • Errors should be categorized by origin, type, cost
  • 68. More metrics • Direct measures - cost, effort, LOC, etc. • Indirect Measures - functionality, quality, complexity, reliability, maintainability • Size Oriented: – Lines of code - LOC – Effort - person months – errors/KLOC – defects/KLOC – cost/KLOC