Professional Documents
Culture Documents
Quality
Part 1:
Basic Definitions
Effective and Efficient Testing
Lots of Personal Notes
Overview
Testing and Inspections – two very important concepts / activities in
software development.
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 2
Tests – just a few types of tests….
White box testing; Black Box Testing
Verification and validation (V&V)
Coverage Testing:
Branch testing, Path testing, Statement testing
Acceptance Testing
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 3
Organizational Considerations
Deficiency Report (DIREP)
Burroughs Hardware / UNISYS
Field Assistance Branch; Customer Service
Tracked, prioritized, resources allocated...
Reported to senior levels of management
Incident Report –
Honeywell
Problem Ticket –
Fix Tickets (LPS)
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 4
Basic Definitions
• A failure is an unacceptable behavior exhibited by a system
—The frequency of failures measures the reliability
- a high reliability.
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 5
Basic definitions: Failure Causes:
• Specific
—functional requirement;
—non-functional requirements…
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 6
Basic definitions: MTBF MTTR Metrics
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 7
Basic Definitions - continued
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 8
Effective and Efficient Testing
To test effectively, you must use a strategy that
uncovers as many defects as possible.
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 9
Effective and Efficient Testing
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 10
Effective and Efficient Testing – more…
Testing must be efficient. So what do we test??
We cannot test everything.
(Exhaustive Testing is not possible – proven mathematically)
Rather, we design different kinds of tests for ‘sufficient coverage.’
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 11
Black-Box Testing
Testers provide the system with inputs; observe outputs
• They can see none of:
— Source code
— Internal data (no algorithms or data structures, …)
— Design documentation describing the system’s internals
• They simply do inputting based on requirements and observe
outputs.
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 12
Black-Box Testing - more
• Kind of testing end-users most frequently undertake – for obvious reasons.
• Sometimes called
• validation testing /
• acceptance testing - IF done when system is declared ‘finished.’
• Black box testing may sometimes be called other things (alpha testing;
beta testing…) but these tests (alpha and beta) usually have other
connotations associated with them…
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 13
Verification and Validation (V&V)
• Developers usually do their own testing first (verification)
—Usually unit testing; testing within development team.
—May involve subsystem testing, integrated testing. …
—But, in general, the developers are testing their products.
—Generally their testing is white box testing, but can be
black box testing.
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 16
Glass-Box - White Box Testing - More
Path Testing – exhaustive; impossible; there is an infinite number of
paths in a non-trivial program.
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 17
White Box: Branch Testing - Flow Graphs
Want minimum number of tests assuring high degree of reliability.
Given a flow graph (next slides), there are a couple of formulas that
will provide the minimum number of tests . They are:
• (number of nodes – number of edges + 1)
• Number of Regions + 1 ….(cyclomatic complexity)
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 18
http://www.scism.sbu.ac.uk/law/Section5/chap3/s5c3p22.html
Consider: The number of possible paths through a subprogram is equal to the number
of regions in the subprogram's flowgraph.
The flowgraph below is for a SquareRoot function and has regions numbered, as shown.
Can see there are four regions, as numbered, plus the outer region, or 5 in total.
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 19
http://www.scism.sbu.ac.uk/law/Section5/chap3/s5c3p22.html
This indicates that there are five possible paths through the flowgraph which can be described
by listing the sequence in which the nodes must are visited.
The five paths in the SquareRoot flowgraph are as follows.
etc…
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 20
White Box: Equivalence Class Testing
• This is a Bigee!
• It is inappropriate to test by brute force, using every possible
input value
—Discuss; Takes a huge amount of time
—Is impractical and is pointless!
• Far better: divide the possible inputs into groups which you
believe will be treated similarly by all algorithms.
—Such groups are called equivalence classes.
—Remember Computational Structures?? (COT 3100??)
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 21
Equivalence Class Testing
• Recall ramdomizing in File Structures (hashing…).
• If we used an ‘Equivalence mod 4’, we essentially divided the set of all non-
negative integers by four and only take their ‘remainders’ 0, 1, 2, and 3.
• If a numeric key was used as a primary or relative key, this approach was often
used to arrive at a disk address or an address in a hash table.
• Thus ‘Equivalence mod 4’ effectively partitions the set of all integers into one
of five disjoint equivalent classes.
• ALL divisions result in one of these remainders – and those having the same
remainder (members of the same equivalence class) need only require one of
its members to be tested to represent ALL values that fall into this
equivalence class..
• We applied this equivalence relation to the set of integers and obtained a set of
equivalence classes the Union of which constitutes the original set of Integers.
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 22
Example of Equivalence Classes
—A tester need only to test one member of an
equivalence class rather than ALL numbers of that
class.
—The tester has to
- understand the required input,
- appreciate how the software may have been designed
• Example:
—Valid integer input is a month number (1-12)
—Equivalence classes are: [-∞..0], [1..12], [13.. ∞]
• These are the three equivalence classes.
• In Equivalence Class Testing, we select an input from
each of the equivalence classes as inputs to testing.
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 23
More on Equivalence Class Testing
• So, to test for valid integers ranging from 1 through 12,
we have three equivalence classes as indicated:
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 24
Combinations of Equivalence Classes
• Combinatorial explosion means that you may not be
able to realistically test every possible system-wide
equivalence class.
—Let’s say there are 4 inputs each of which have 5
possible values. This means that are 54 (i.e.625)
possible system-wide equivalence classes.
• While you should first make sure that at least one test is
run with every equivalence class of every individual
input, you should also test all combinations where one
input is likely to affect the interpretation of another.
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 25
Compatibility Tests; Associativity Tests
• Compatibility tests; Associativity tests.
—Example of Associativity Test: Example from a Manpower
Project in the USAF.
- Field/attribute: Rated Performance Indicator (rpi);
- Rule: If the rpi input value for an individual had a value of non-
zero (individual had to be on an aircrew), then the ‘rank’ attribute
for this individual (s/he must be an officer), must be in the range
between O1-O10 (and could NOT be in the range E1-E9).
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 26
Testing at Boundaries of Equivalence Classes
Boundary Value Testing
© Lethbridge/Laganière 2001 Chapter 10: Testing and Inspecting for High Quality 28