Lecture 05 Final
Lecture 05 Final
Outline
Introduction
Software Life Cycle
Quality Control
Infrastructure
Management
Standards
Conclusion & Summary
III.1 Foundations
Static analysis:
The process of evaluating a system or component based on
its form, structure, content, or documentation.
Contrast with: dynamic analysis.
See also: inspection; walk-through.
[IEEE-610.12-1990]
Dynamic vs. Static Analysis
Dynamic analysis (testing):
execution of system components;
running the software
Static analysis:
investigation without operation;
pencil and paper reviews etc.
Modelling (mathematical representation)
Terminology: Testing
Several definitions:
“Testing is the process of executing a program or
system with the intent of finding errors.”
[Myers1979]
Product completion
Personal reviews contribute to the overall
Source: Ciolkowski, M., Laitenberger, O., & Biffl, S. (2003). Software reviews,
the state of the practice. Software, IEEE, 20(6), 46-51.
Survey of Reviews (2/2)
What were common review goals?
Quality improvement
Project status evaluation
Means to enforce standards
Common obstacles
Time pressures
Cost
Lack of training (most train by participation)
Do We Really Need a Meeting?
“Phantom Inspector” (Fagan)
The “synergism” among the review team
that can lead to the discovery of defects not
found by any of the participants working
individually
Meetings are perceived as higher quality
What about false positives and duplicates?
A Study of Review Meetings
The need for face-to-face meetings has never
been questioned
Meetings are expensive!
Simultaneous attendance of all participants
Preparation
Readiness of work product under review
High quality moderation
Team personalities
Adds to project time and cost
(15-20% overhead)
A Study of Review Meetings (2/3)
Studied the impact of:
Real (face-to-face) vs. nominal (individual)
groups
Detection effectiveness (number of defects
detected)
Detection cost
Significant differences were expected
A Study of Review Meetings (3/3)
Results
Defect detection effectiveness was not
significantly different for either group
Cost was less for nominal than for real groups
(average time to find defects was higher)
Nominal groups generated more issues, but
had higher false positives and more duplication
Does Openness and Anonymity
Impact Meetings?
“Working in a group helped me find errors
faster and better.”
“Working in a group helped me understand
the code better.”
“You spent less time arguing the issue
validity when working alone.”
“I could get a lot more done in a given
amount of time when working by myself.”
Study on Successful Industry Uses
Lack of systematic execution during preparation
and detection
60% don’t prepare at all, only 50% use
checklist, less than 10% use advance reading
techniques
Reviews are not part of an overall improvement
program
Only 23% try to optimize the review process
Study on Successful Industry Uses
(2/3)
Factors for sustained success
Top-management support is required
Need evidence (external, internal) to warrant
using reviews
Process must be repeatable and measurable for
continuous improvement
Techniques need to be easily adaptable to
changing needs
Study on Successful Industry Uses
(3/3)
Repeatable success tends to use well defined
techniques
Reported success (NASA, Motorola, IBM)
95% defect detection rates before testing
50% overall cost reduction
50% reduction in delivery time
Future of FTR
1. Provide tighter integration between FTR and the
development method
2. Minimize meetings and maximize asynchronicity in
FTR
3. Shift the focus from defect removal to improved
developer quality
4. Build organizational knowledge bases on review
5. Outsource review and in-source review knowledge
6. Investigate computer-mediated review technology
7. Break the boundaries on review group size
Category/Attribute Management Technical Inspection Walkthrough
Objective Ensure Progress. Evaluate conformance to Detect and identify Detect defects.
Recommend corrective specifications and plans. defects. Examine alternatives.
action. Ensure proper Ensure change integrity. Verify resolution. Forum for learning.
allocation of resources.
Delegated Controls Management team charts Review team petitions Team chooses All decisions made by
Decision making course of action. management of technical predefined product producer. Change is the
Decisions leadership to act on dispositions. Defects prerogative of the
are made at the meeting recommendations. must be removed. producer.
or as a result of
recommendations.
Change verification Change verification left to Leader verifies as part of Moderator verifies rewo rk.Change verification left to
other project controls. review other project controls.
report.
Group Dynamics 2 or more people 3 or more people 3-6 people 2-7 people
Recommended size
Attendance Management, technical Technical leadership and College of peers meet Technical leadership and
leadership, and peer mix. peer mix. with documented peer mix.
attendance.
Leadership Usually the responsible Usually the lead engineer. Trained moderator. Usually producer.
manager.
Procedures Moderate to high, Moderate to high, Relatively low. Relatively low.
Material volume depending depending
on the specific on the specific
“statement “statement
of objectives” of objective”
at the for the
meeting. meeting.
Presenter Project representative Software element Presentation by “reader” Usually the producer
representative. other than producer.
Data collection As required by applicable Not a formal project Formally required. Not a formal project
policies, standards, or requirement. May be requirement. May be
plans. done locally. done locally.
Outputs Management review Technical review report. Defect list. Defect Walkthrough report.
Reports report. summary. Inspection
report.
Database entries Any schedule changes No formal database Defect counts, No formal database
must be entered into the required. characteristics, severity, required.
Cost-Benefit Analysis
Fagan reported that IBM inspections found
90% of all defects for a 9% reduction in
average project cost
Johnson estimates that rework accounts for
44% of development cost
Finding defects, finding defects early and
reducing rework can impact the overall cost of
a project
Cost of Defects
What is the impact of the annual cost of software
defects in the US?
$59 billion
Estimated that $22 billion could be avoided by
introducing a best-practice defect detection
infrastructure
Source: NIST, The Economic Impact of Inadequate
Infrastructure for Software Testing, May 2002
Software Inspections
Why are software inspections not widely used?
Lack of time
Not seen as a priority
Not seen as value added (measured by loc)
Lack of understanding of formalized techniques
Improper tools used to collect data
Lack of training of participants
Pits programmer against reviewers
Other Techniques
Covered: Static analysis:
Static Code Analysis
The process of
Formal Methods
evaluating a system
Model Checking
or component based
on its form,
Static analysis:
structure, content,
investigation without
operation; or documentation.
pencil and paper reviews [IEEE-610.12-1990]
etc.
Modelling (mathematical
representation)
Static Analysis Techniques (1/2)
Static Code Analysis
Control flow analysis
data flow analysis
symbolic execution
Timing analysis
Performance/scheduling theories
Formal Methods
Discrete mathematics, logics, temporal logics, process
algebra, …
Model Checking
Fully automatic analysis of formal models w.r.t. a
formal specification
III.3 Dynamic Testing Techniques
Common definition [Myers1979] :
Testing is a process of executing a program with the
intent of finding an error.
A good test case is one that has high probability of finding
an undiscovered error.
A successful test is one that uncovers an as-yet
undiscovered error.
Also: testing to assess reliability
(not considered here)
Test:
System
The Program
program model Tests
Not orthogonal!
(1) Function Testing
variable in isolation. Test each function / feature /
Usually start with fairly simple function testing
focuses on a single function and tests it with
middle-of-the-road values don’t expect the
program to fail but if it fails the algorithm is
fundamentally wrong, the build is broken, or …
Later switch to a different style which often
involves the interaction of several functions
These tests are highly credible and easy to evaluate
but not particularly powerful
(2) Domain Testing
Essence: sampling
Equivalence class testing:
Look at each variable domains (including invalid values)
reduce a massive set of possible tests (domain) into a small group by
partitioning
picking one or two representatives from each subset.
look for "best representative“: a value that is at least as likely to
expose an error as any other
Boundary value analysis: A good test set for a numeric variable hits
every boundary value because boundary / extreme-value errors are
common use the minimum, the maximum, a value barely below the
minimum, and a value barely above the maximum bugs are sometimes
dismissed, especially when you test extreme values of several variables at
the same time (corner cases)
Equivalence Partitioning
Input data and output
results often fall into
Valid inputs
different classes Invalid inputs
in an “equivalent” way
Test cases should be
chosen from each partition
Outputs
Equivalence Partitioning
an approach that divides the input domain of a program
into classes of data from which test cases can be derived.
Example: Suppose a program computes the value of the
function. ( X − 1) ∗ ( X + 2) This function defines
the following
valid and invalid equivalence classes:
X < = -2 valid
-2 < X < 1 invalid
X >= 1 valid
Test cases would be selected from each equivalence
class.
Boundary Value Analysis (1/2)
a testing technique where test cases are
designed to test the boundary of an input
domain. “Bugs lurk in corners
Boundary value analysis complements and congregate at
boundaries…”
and can be used in conjunction with Boris Beizer
equivalence partitioning.
Example (cont.): boundary values of the
three ranges have to be included in the test
data. That is, we might choose the following
test cases:
X <= -2 MIN, -100, -2.1, -2
-1.9, -1, 0, 0.9
-2 < X < 1 1, 1.1,100, MAX
X >= 1
Boundary Value Analysis (2/2)
If an input condition specifies a range [a, b]: Example: [-3, 10],
test values: 0 (interior point); 0 is always good candidate!
test values: -3, 10 (extreme points)
test values: -2, 9 (boundary points)
test values: -4, 11 (off points)
If an input condition specifies a number values:
minimum and maximum
values just above and below minimum and
maximum
Also for more complex data (data structures):
array
input condition: empty, single element, full element, out-of-
boundary
search for element: element is inside array or not
You can think about other data structures: list, set, stack, queue,
and tree
(3) Specification-Based Testing
Check the program against a reference document design specification,
a requirements list, a user interface description, a model, or a user
manual.
Rational:
the specification might be part of a contract products must conform to
their advertisements safety-critical products must conform to any
safety-related specification.
Observation
Specification-driven tests are often weak, not particularly powerful
representatives of the class of possible tests
Different approaches:
focus on the specification: the set of test cases should include an
unambiguous and relevant test for each claim made in the spec. look
further, for problems in the specification: explore ambiguities in the
spec. or examine aspects of the product that were not well-specified
(4) Risk-Based Testing
Process
(1) Imagine a way the program could fail (cf. error guessing)
(2) design one or more tests to check for it
a good risk-based test = a powerful representative that address
a given risk.
“complete”: a list of every way the program could fail.
If tests tie back to
significant failures in the field or
well known failures in a competitor’s product failure will be
highly credible and highly motivating
However, many risk-based tests are dismissed as academic
(unlikely to occur in real use).
Test for possible problem carry high information value
(We learn a lot whether the program passes the test or not)
(5) Stress Testing
Different definitions of stress testing:
Hit the program with a peak burst of activity and see it fail.
Testing conducted to evaluate a system or component at or beyond the
limits of its specified requirements with the goal of causing the system to
fail. [IEEE Standard 610.12-1990]
Driving the program to failure in order to watch how the program fails.
Keep increasing the size or rate of input until either the program finally fails
or
you become convinced that further increases won’t yield a failure.
Look at the failure and ask what vulnerabilities have been exposed and which
of them might be triggered under less extreme circumstances.
Discussion:
stress test results as not representative of customer use
One problem with stress testing is that a failure may not be easily analyzed
(must includes enough diagnostic support)
stress-like tests can expose failures that are hard to see if the system is not
running with a high load (e.g., many concurrent tasks)
(6) Regression Testing
Process
(1) design tests with the intent of regularly reusing them
(2) repeat the tests after making changes to the program.
A good regression test is designed for reuse.
adequately documented and maintainable
designed to be likely to fail if changes induce errors
in the addressed part of the program
Discussion:
First run of the tests may have been powerful,
but after passed
many times detecting defects is not very
likely (unless there have
been major changes or changes in part of the
code directly involved with this test.) Usually carries little
information value
Automation can make regression testing very “cheap”
Regression Testing Process
Requirements changes
Affect design, coding, and Software Change
Analysis
testing document update
Design changes Software Change
Impact Analysis
Document changes
Affect other document
Regression Testing Strategies
Random: The test cases are randomly selected from the
existing test suite.
Retest-all: Run all the tests in the existing suite.
Safe: The test selection algorithm excludes no test from the
original test suite that if executed would reveal faults in the
modified program.
Based on modifications: Place an emphasis on selecting
existing
test cases to cover modified program components and
those that
may be affected by the modifications.
Dataflow/coverage based: Select tests that exercise data
interactions that have been affected by modifications.
Remark ([Juriso+2004]):
For small programs and set of test cases is small, then retest-all.
Use safe techniques for large programs and programs with a
large
number of test cases.
(7) User Testing
The testing done by real users (Not testers pretending to be users)
User tests might be designed by
the users,
the testers, or
other people (sometimes even by lawyers;
acceptance tests in a contract)
Continuum:
tests can be designed in such detail that the user merely executes them
reports whether the program passed or failed
a carefully scripted demonstration, without much opportunity to detect
defects
Leave the user some freedom to
cognitive activity while providing enough structure to ensure effective reports (in a
way that helps readers understand and troubleshoot the problem)
detect problems a user will encounter in real use is much more
difficult
Failures found in user testing are typically credible
Beta tests:
often described as cheap, effective
user tests
but in practice they can be quite
expensive to administer
you may not yield much information.
automation required!
(8) Scenario Testing
Check how the program copes with a scenario
Good scenario test should be
credible,
motivating,
easy to evaluate, and
complex.
How often run a given scenario test?
Some create a pool of scenario tests as regression tests
Others run a scenario once or a small number of times and then design
another scenario rather than sticking with the ones they’ve used before
Scenarios help to develop insight into the product
Early in testing (understand the product at all) or
Late in testing (understand advanced uses of a stabilized product)
harsher test: rarely be used by typical users (cf. stress testing)
(9) State-Model-Based Testing
Model the visible behavior of the program as a state machine
Checking for conformance with the state machine model
Approach is credible, motivating and easy to troubleshoot
Tradeoffs:
state-based testing often involves simplification and if the model is
oversimplified, failures exposed by the model can be false negatives
and
difficult to troubleshoot
more detailed models find more bugs, but can be much harder to
read and
maintain
Experiences shows that much of the bug-finding happens while
modeling the state models rather than testing
coverage criteria / stopping rule (cf. [Al-Ghafees&Whittaker2002])
State-Model-Based Testing
Uncovers the following issues:
Wrong number of states.
Wrong transition for a given state-input combination.
Wrong output for a given transition.
States or sets of states that have become dead.
States or sets of states that have become unreachable.
Test sequence:
Define a set of covering input sequences that
starting from the initial state and get back to the initial state
For each step in the input sequence, defines the expected next state, the
expected transition, and the expected output code
Remarks:
Completeness: transitions and outputs for every combination of input and
states
Instrument the transitions to also capture the sequence of states (not just the
outputs)
Count the states
Variant: Syntax Testing
Test model: BNF-based syntax instead of state machine
E.g., for testing command-driven software
Dirty syntax testing:
a) to exercise a good sample of single syntactic errors in all
commands in an attempt to break the software.
b) to force every diagnostic message appropriate to that
command to be executed.
Example test cases: Syntax Graph for <real_number>:
.
correct ones <digital> <digital>
1.54683e5,
1.6548
incorrect without loops:
.05 E
1. e <digital>
1.1e
D +
incorrect with loops: d -
123456.78901.1
1.12345e6789D-123
(10) High-Volume Automated Testing
Massive numbers of tests, comparing the results against a partial
oracles.
The simplest partial oracle: crashing
State-model-based testing (if the stopping rule is not based on a
coverage
criterion) or also more general notion of stochastic state-based
testing
[Whittaker1997].
Randomly corrupt input data
Repeatedly feeds random data to the application under test and a
reference
oracle in parallel [Kaner2000] (back-to-back testing)
Run arbitrarily long random sequence of regression tests to let
memory
leaks, stack corruption, wild pointers or other garbage that
cumulates over
time finally causes failures. Probes (tests built into the program)
can be
(11) Exploratory Testing
any testing which uses information gained while testing to better test
continuum between
purely scripted (the tester does precisely what the script
specifies and nothing else) to purely exploratory (no pre-specified
activities, not documentation beyond bug reports is required)
prototypic case/ “freestyle exploratory testing”
exploratory testers continually learn about the software, the
context, the ways it could fail, its
weaknesses, and the best ways to test the software.
At the same time they are also test the software and report the
problems
Test cases are good to the extent that they advance the tester’s
knowledge (goal-driven)
as the tester gains new knowledge the goals may also change
quickly
which type of testing: what is most likely to reveal the
information the tester is looking for
Not purely spontaneous:
studying competitive products,
review failure histories of this and
analogous products
interviewing programmers and users,
reading specifications, and
working with the product.
state models can serve as an exploratory testing
tool
III.3.3 White Box Testing Techniques
Black box testing:
Requirements
fulfilled
Interfaces
available
and working
But can we also exploit
the internal
structure
of a
component,
interactions
between
objects?
white box
testing
White box testing:
(1) Control Flow Testing: Example
procedure XYZ is 1
A,B,C: INTEGER;
begin 2
1. GET(A); GET(B); GET(C);
2. if (A > 15 and C > 20) then
3 9
3. if B < 10 then
4. B := A + 5;
5. else 4 6
6. B := A - 5;
7. end if
8. else 7
9. A := B + 5;
10. end if;
10
end XYZ;
Control Flow Testing
a) Statement coverage: The test cases are
generated so that all the program statements are
executed at least once.
b) Decision coverage (branch coverage): The test
cases are generated so that the program
decisions take the value true or false.
c) Condition coverage: The test cases are
generated so that all the program conditions
(predicates) that form the logical expression of the
decision take the value true or false.
d) Path coverage: Test cases are generated to
execute all/some program paths.
a) Statement Coverage
Statement 1
coverage: 2
The test cases are generated
so that all the program
statements are executed at 3 9
least once.
4 6
10
b) Decision / Branch Coverage
Decision 1
coverage 2
(branch
coverage): The 3 9
test cases are
generated so 4 6
that the program
decisions take
the value true or 7
false.
10
c) Condition Coverage (1/2)
1
Conditioncoverage: The
test cases are generated 2
so that all the program
conditions (predicates) 3 9
that form the logical
expression of the
decision take the value 4 6
true or false.
7
10
Simple Condition Coverage
Composed condition:
((A and B) or C) A B C (A and B) or C
Test cases must cover all TRUE TRUE TRUE TRUE
the values true or false for TRUE TRUE FALSE TRUE
each conditions (predicates)
TRUE FALSE TRUE TRUE
of the logical expression
TRUE FALSE FALSE FALSE
combinatorial explosion
only coverage for simple FALSE TRUE TRUE TRUE
condition coverage FALSE TRUE FALSE FALSE
FALSE FALSE TRUE TRUE
Simple condition: (A) FALSE FALSE FALSE FALSE
degenerates to decision
coverage but simple Remarks:
condition coverage does not complete condition evaluation
ensure decision coverage assumed
Otherwise compiler dependent
execution semantics
Other Condition Coverage Types
Simple condition coverage: require that the tests must
cover both true and false for each conditions
(predicates) of the logical expression.
Condition/decision coverage: require in addition that
the coverage w.r.t. the decision is also complete.
Minimal multiple condition coverage: also cover all
sub expressions of the Boolean formula
Modified condition/decision coverage: requires that
every atomic condition can influence the overall output
(required for level A equipment by RTCA DO-178 B).
Multiple condition coverage: test all combinations of
the atomic conditions.
d) Path Coverage
1
Path coverage: Test cases are
generated to 2
execute all/some program paths.
Why path coverage?
logic errors and incorrect 3 9
assumptions are inversely
proportional to a path’s execution
4 6
probability we often believe that
a path is not likely to be
executed; in fact, reality is often 7
counter intuitive it’s likely that
untested paths will contain some
undetected defects 10
Exhaustive Testing Not Possible
There are 1014 possible
paths!
If we execute one test
per millisecond, it
would take 3.170 years
to test this program!!
Out of question
Basic Path Testing
Terminology:
execution path: a path that connects a start node and a
terminal node.
Two paths are independent if they have disjoint node or edge
sets
Steps:
convert the unit into a “flow graph”
compute a measure of the unit's logical complexity
use the measure to derive a “basic” set of independent
execution paths for which test cases are determined
Remark: Path coverage set is not unique!
Cyclomatic Complexity
Cyclomatic complexity (McCabe complexity) is a metric,
V(G), that
describes the logical complexity of a flow graph, G.
V(G) = E - N + 2 where E = #edges in G and N = #nodes in G
Studies have shown:
V(G) is directly related to the number of errors in source
code
V(G) = 10 is a
practical upper modules in this range
limit for testing are more error prone
modules
V(G)
Path Coverage Testing
Next, we derive the independent paths:
Since V(G) = 4, we have 4 paths 1
Path 1: 1,2,3,6,7,8
Path 2: 1,2,3,5,7,8 2
Path 3: 1,2,4,7,8 4 3
Path 4: 1,2,4,7,2,4…7,8 5 6
Finally, we derive test cases to
exercise these paths, i.e. choose
inputs that lead to traversing the
paths 7
8
Testing Loops
simple loop
nested
loops
concatenated unstructured
loops loops
Loop Testing: Simple Loops
Minimum conditions - simple loops
1. skip the loop entirely
2. only one pass through the loop
(boundary)
3. two passes through the loop
(interior)
4. m passes through the loop m < n
5. (n-1), n, and (n+1) passes through the loop
b) Decision
Condition/decision
coverage
coverage
Minimal multiple
condition coverage
Basic
path
coverage
Modified
condition/decision
coverage
Path
coverage
Multiple condition
coverage
(2) Data Flow Testing
Basic Definitions:
1
V = the set of variables.
N = the set of nodes
E = the set of edges 2 read(x,y) def (2) = {i}
i:=1; c-use(2) = {x,y}
Definition/write on variables (nodes):
p-use(3,4) = {i}
def(i) = { x in V | x has a global i<=2 3 i>2 p-use(3,5) = {i}
def in block I }
4 5
p-use(6,8) = {y}
Computational-use of variables (nodes): writeln(“hello”); p-use(6,7) = {y}
y>=0
y<0 6
c-use(i) = { x in V | x has a global i:= i+1;
8
c-use in block i } def (4) = {i} 7
c-use(4) = {i}
Predicate-use of variables (edges): 9 writeln(x);
c-use(8) = {x}
p-use(i,j) = { x in V | x has a p-use
in edge (i,j) } 10
Idea of Data Flow Testing
Idea: coverage of the a def-clear 1
paths)
Data Flow Testing
1
All node with an effective path from a def to a c-use
for variable x:
dcu(x, j) = { j in N | x in c-use(j) and read(x,y) def (2) = {i,x,y}
there is a def-clear path wrt 2
x from i to j } i:=1; c-use(2) = {}
All edges with an effective path from a def to a p-p-use(3,4) = {i} i>2 p-use(3,5) = {i}
use for variable x: i<=2 3
Characteristics: Characteristics:
Good for independence of Simplifies diagnosis of
tester results
But not good for formative Can compromise
tests independence
Hard to test individual How much do they need to
modules... know?
III.4 Testing Process & Activities
Beforehand:
Requirement analysis
design analysis
Testing Process & Activities
(1) Unit test
(2) Integration test
(3) Function test
(4) Performance test
System test
(5) Acceptance test
(6) Installation test
Testing Activities
Unit Design System Other Customer User
test specifications functional software requirements environment
requirements requirements specification
Unitcode
Unit
test
Unitcode
Integration Function Performance Acceptance Installation
test test test test test
Equivalence Classes
Boundary Points
(1 , 0) 1
(-1 , 0) 1
(0 , 1) 1
(0 , -1) 1
Test Implementation
Once one has determined the testing strategy, and the
units to tested, and completed the unit test plans, the
next concern is how to carry on the tests.
If you are testing a single, simple unit that does not
interact with other units (like the GCD unit), then one can
write a program that runs the test cases in the test plan.
Integration testers:
either developers and/or test engineers.
III.4.2 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
Integration Testing Strategies
Incremental testing strategies:
Bottom-up testing: Integrate individual components in levels
until the complete system is created
Top-down testing: Start with high-level system and integrate
from the top-down replacing individual components by stubs
where appropriate
Outside-in integration: Do bottom-up and top-down testing
at the same time such that the final integration step occurs in a
middle layer
Non incremental testing strategies:
Big bang testing: put all together and test it
Remark: In practice, most integration involves a combination
of these strategies
Big Bang Integration Testing
combine (or integrate) all parts at once.
Advantages:
simple
Disadvantages:
hard to debugging, not easy to isolate errors
not easy to validate test results
impossible to form an integrated system
Bottom Up Integration Testing
Idea:Modules at the lowest levels are integrated at first,
then by moving upward through the control structure.
Integration process (five steps):
1. Low-level modules are combined into clusters that
perform a specific
software sub-function
2. A driver is written to coordinate test case input and
output
3. Test cluster is tested
4. Drivers are removed and clusters are combined
moving upward in the
program structure
Bottom Up Integration Testing
Pros and cons of bottom-up integration:
no stubs cost
need test drivers
no controllable system until the last step
Bottom Up Integration Testing
Stage 4 M11
Integration B Integration c
Stage 3 M9 M10
Integration A
Stage 2 M8
Stage 1 M1 M2 M3 M4 M5 M6 M7
Top Down Integration Testing
Idea:
Modules are integrated by moving downward through
the control structure.
Modules subordinate to the main control module are
incorporated into the
system in either a depth-first or breadth-first manner.
Integration process (five steps):
1. the main control module is used as a test driver, and the
stubs are substituted
for all modules directly subordinate to the main control
module.
2. subordinate stubs are replaced one at a time with actual
modules
3. tests are conducted as each module is integrated
4. On completion of each set of tests, another stub is replaced
with the real
module
5. regression testing may conducted
Pros and cons top-down integration:
stub construction cost
major control function can be tested early.
Top Down Integration Testing
Integration D
Integration C
Integration B
Integration A
Stage 1 M11
Stage 2 M9 M10
Stage 3 M8
Stage 4 M6 M7
Stage 5 M1 M2
Stage 6 M3 M4 M5
Test Stubs and Test Drivers
Top-down testing of module M8 Bottom-up testing of module M8
Module
tested in an Drive
M9 earlier of M9
stage
M8 Module M8 Module
on test on test
Modules
Stub Stub tested in an
of M1 of M2 M1 M2 earlier
stage
Regression Testing & Integration
A module firewall:
closure of all possible
affected modules and
in a program based on a
control-flow graph. Main
Reduction of the 4
software regression
testing to a smaller M1 M2 M3
scope (the firewall)
3
This implies that: Changed Module
re-test of the changed
M4 1 M5 M6 M7
module and its affected
modules 2
Must address:
a) What to test?
b) Which sources to be used for the test?
c) Who is performing the tests?
d) Where to perform the tests?
e) When to terminate the tests?
a) What to test?
Must address:
Which modules should be unit tested?
Which integrations should be tested?
Determine priorities for allocating test resources
to the individual tasks or applications
Rating:
Damage severity level: estimate the severity of
results in case the module/application fails
Software risk level: probability of failure
Damages to Customers and Users
1. Endangers the safety of human beings
2. Affects an essential organizational function with no system
replacement capability available
3. Affects functioning of firmware, causing malfunction of an
entire system
4. Affects an essential organizational function but a
replacement is available
5. Affects proper functioning of software packages for
business applications
6. Affects proper functioning of software packages for a
private customer
7. Affects functioning of a firmware application but without
affecting the entire system.
8. Inconveniences the user but does not prevent accomplishment of the
system’s capabilities
Damages to the Software Developer
1. Financial losses
Damages paid for physical injuries
Damages paid to organizations for
malfunctioning of software
Purchase cost reimbursed to customers
High maintenance expanses for repair of failed
systems
2. Non-quantitative damages
Expected to affect future sales
Substantially reduced current sales
Issues Affecting Software Risk Level
Module/application issues
1. Magnitude
2. Complexity and difficulty
3. Percentage of original software (vs. percentage of
reused software)
Programmer issues
4. Professional qualifications
5. Experience with the module's specific subject matter.
6. Availability of professional support (backup of
knowledgeable and experience).
7. Acquaintance with the programmer and the ability to
evaluate his/her capabilities.
Priorities/Ratings for
Modules/Applications
A = Damage severity level
B = Software risk level
Combined Ratings
C=A+B
C=k*A+m*B
C=A*B (≈ Risk = Severity x Probability)
Employ Ratings to:
Assign testing priorities
Allocate resources for testing
Determine required techniques
Example: Super Teacher
Combined rating method
Application Damage Software A +B 7xA+2xB AxB
Severity risk
Factor A Factor B
1. Input of test results 3 2 5 (4) 25 (5) 6 (4)
2. Interface for input and output of pupils’ data to 4 8 (1) 36 (1) 16 (1)
4
and from other teachers
3. Preparation of lists of low achievers 2 2 4 (5-6) 18 (7) 4 (5-6)
4. Printing letters to parents of low achievers 1 2 3 (7-8) 11 (8) 2 (8)
5. Preparation of reports for the school principal 3 3 6 (3) 27 (3) 9 (3)
6. Display of a pupil’s achievements profile 4 3 7 (2) 34 (2) 12 (2)
Systamatic
Level 1: Initial Test Execution
Systematic solutions to Control
Level 1: Initial
create, update, and Systematic Test
manage all types of Information
software test information Management
Maturity Levels and
Level 4: Automatic test measurement
Tools test coverage and metrics
measurement
test cost and complexity measurement
Level 3: Automatic test generation
black-box/white-box test generation
Level 2: Automatic test execution
Level 4: Optimal test control and execution
Level 1: Automatic test management
Systematic Test test case management, and
Measurement &
Optimization Level 3:Automatic documentation
test script management
Systematic
Test Generation Level 2: Repeatable
Systematic
Test Execution
Control Level 1: Initial
Systematic Test
Information
Management
Essential Needs & Basic Issues
Essential Needs: Basic Issues:
A dedicated work force for Poor manually performed
test automation software test process
The commitment from Late engagement of
senior managers and software test automation in
a software product life
engineers cycle
The dedicated budget and Unrealistic goals and
project schedule unreasonable expectations
A well-defined plan and Organization issues
strategy Lack of good
Talent engineers and cost- understanding and
effective testing tools experience of software test
automation
Maintenance of automated
software tests and tools
A Software Test Automation Process
Steps:
Test automation planning: identify test
automation focuses, objectives, strategies,
Plan Software requirements, schedule and budget.
Test Automation
Test automation design: draw out the
detailed test automation solutions to
Design Test Automation achieve the major objectives and meet the
Strategies & Solutions
given requirements in a test automation
Select and plan.
Develop & Implement Test
Automation Solutions
Evaluate
Available
Test tool development: realize the test
Software
Testing
automation solutions; the developed tools
Introduce and Deploy Test
Tools must be reliable, usable and reusable
Automation Solutions Test tool deployment: introduce and
deploy the tools; including basic user
Review and Evaluate
training and user support
Software Test Automation Review and evaluation : a review should
be conducted to identify limitations and
evaluate the provided features; valuable
feedback to the test automation group for
further improvements and enhancements.
Test Tool Types
Test Tool Types Basic Descriptions of Different Types of Test Tools
Test Information Systematic solutions and tools support test engineers and
Management quality assurance people to
create, update, and maintain diverse test information,
including test cases, test scripts,
test data, test results, and discovered problems.
Test Execution and Systematic solutions and tools help engineer set up and run
Control tests, and collect and
validate test results.
Test Generation Systematic solutions and tools generate program tests in an
automatic way.
Test Coverage Systematic solutions and tools analyze the test coverage
Analysis during a test process based
on selected test criteria.
Performance Systematic solutions and tools support program
Testing and performance testing and performance
Measurement measurement.
Software Programs are developed to simulate the functions and
Simulators behaviors of external systems,
or dependent subsystems/components for a under test
program.
Regression Testing Test tools support the automation performance of
regression testing and activities,
including test recording and re-playing.
Classification of Software Test Tools
There are three types of test information
management systems and tools.
Test information management tool: It supports engineers to create, update,
and
manage all types of test information, such as testing requirements, test cases,
data, procedures, and results.
Test suite management tool: It enables engineers to create, update, and
manage various software test scripts for test execution.
Problem management tool: It helps engineer
bookkeeping and manage the discovered problems during a test process.
There are three types of software simulators:
Model-driven program simulators: based on a specific model, such as a finite
state machine
Data-driven program simulators: functional program based on the given
inputs and return the pre-defined outputs.
Message-driven program simulators: communication process to generate
outgoing messages, based on the pre-defined incoming messages.
Regression test tools:
Software change analysis: This refers to a systematic facility that
identifies various types of software changes and discovers their ripple effects
and impacts.
Software test selection: This refers to a systematic facility that assists
engineers to select reusable tests for regression testing based on software
change information.
Test change analysis: This refers to a systematic solution that identifies the
necessary test changes based on the given software changes. The major task of
test change analysis is to find reusable tests and identify obsolete tests so that
new tests could be added, and existing tests will be updated.
Test recorder and re-player: This refers to a software tool that records the
executed tests, and re-plays them for re-testing. Mercury
Interactive’s Winrunner is a typical re-testing
tool that is able to record and re-play user-
system interactive sequences for window-
based programs using pre-defined test scripts.
Classification of Software Test Tools
Types of Test Tools Test Tool Vendors Test Tools
Problem Management Tools Rational Inc. ClearQust, ClearDDTS
Microsoft Corp. PVCS Tracker
Imbus AG Imbus Fehlerdatenbank
Test Information Management Rautional Inc. TestManager
Tools Mercury Interactive TestDirectory
Evalid TestSuiter
Test Suite Management Tools Rational Inc. TestFactory
SUN JavaTest, JavaHarness
White-Box Test Tools McCabe & Associates McCabe IQ2
Junit
IBM IBM COBOL Unit Tester
IBM ATC
- Coverage Assistant
- Source Audit Assistant
- Distillation Assistant
- Unit Test Assistant
Classification of Software Test Tools
Test Execution Tools OC Systems Aprob
Softbridge ATF/TestWright
AutoTester AutoTester
Rational Inc. Visual Test
SQA Robot
Mercury Interactive WinRunner
Sterling Software Vision TestPro
Compuware QARun
Seque Software SilkTest
RSW Software Inc. e-Test
Cyrano Gmbh Cyrano Robot
Code Coverage Analysis Tools Case Consult Corp. Analyzer, Analyzer Java
OC Systems Aprob
IPL Software Product Cantata/Cantata++
Group
ATTOL Testware SA Coverage
Compuware NuMega TruCoverage
Software Research TestWorks Coverage
Rational Inc PureCoverage
SUN JavaScope
ParaSoft TCA
Software Automation Inc Panorama
Classification of Software Test Tools
Load Test and Performance Tools Rational Inc. Rational Suite PerformanceStudio
InterNetwork AG sma@rtTest
Compuware QA-Load
Mercury Interactive LoadRunner
RSW Software Inc. e- Load
SUN JavaLoad
Seque Software SilkPerformer
Client/Server Solutions, Inc. Benchmark Factory
Regression Testing Tools IBM Regression Testing Tool(ARTT)
Distillation Assistant
GUI Record/Replay Software Research eValid
Mercury Interactive Xrunner
Astra Astra QuickTest
AutoTester AutoTester, AutoTester One
Automated Testing
Advantages
Reduce manual software testing operations and eliminate redundant
testing efforts.
Few manpower resources required for performing of tests.
Shorter duration of testing.
Execute much more software tests and achieve a better testing
coverage in a very limited schedule.
Accuracy and completeness of performance.
Accuracy of results log and summary reports.
Comprehensiveness of information.
Produce more systematic repeatable software tests, and generate more
consistent testing results.
Performance of complete regression tests.
Performance of test classes beyond the scope of manual testing.
Automated Testing
Disadvantages
High investments required in package purchasing and
training.
High package development investment costs.
High manpower requirements for test preparation.
Considerable testing areas left uncovered.
III.6 Paradigm & Domain Specific
Aspects
Paradigms: object-oriented, component-
based, agent-oriented, …
Testing of systems which apply object-
oriented technologies (OOA/OOD/OOP/…)
Applications domains: business, finance,
web, embedded systems, …
Testing embedded systems
III.6.1 Testing Object-Oriented Systems
Relatively little attention has been paid to considerations for testing OO
implementations
Lack of attention is not lack of need; New opportunities for error come with
the increased power of OO languages:
each lower level in an inheritance hierarchy is a new context for
inherited features
correct behavior at an upper level in no way guarantees behavior at a
lower level
polymorphism with dynamic binding dramatically increases the number
of execution paths static analysis of source code is of relatively little
help with these situations
encapsulation is an obstacle to controllability and operability of
implementation state
Components offered for reuse should be highly reliable:
each reuse is a new context of usage and re-testing is warranted
likely that more testing is needed to obtain high reliability in OO systems
OO & Unit Testing
Unit of testing in OO context:
encapsulation drives definition of classes and objects:
each class and class instance (object), package
attributes (data),
and operations (methods or services) that manipulate
data
smallest testable unit is encapsulated class or object, rather
than the conventional module, because
a class can have a number of operations/methods and
particular
methods may exist in a number of different classes
class testing for OO software ≡ unit testing for
conventional
software
class testing driven by encapsulated operations and state
behavior of class
OO Testing: Easier vs. Harder
Easier
Modularity Inheritance Harder
Quicker
Polymorphism
development
Dynamic
Encapsulation binding
Small methods
Complex
Reuse interfaces
Interfaces
identified More integration
early
Class Testing & States
Functional
model of
processing
OO model of
processing
3
4
4.1 ButtonList Sensor
AG 3.4
AS AS
AG 3.3
AS
AS
AS
4.2 Event Scene
Button
AS AS I 3.1
I 2
ButtonState AG
3 TextButton 3.2 World I
AS
AS
AS
I
1 I 1 2
1.1 5.2 I
Subject Control CanvasRep Canvas
AS
I
AS
AS AS AS
MonoScene
Feedback-simulation (model-in-the-loop)
Let the models of the plant and the
embedded software interact
Rapid Prototyping
Let the “real” plant (or a
simplified version) interact
with the model of the
embedded software (on
high performance hardware;
floating-point arithmetic)
(2) Prototyping (1/3)
(1) Embedded software
Compiled for host
Compiled for target
platform
(2) Processor
High performance host
Target platform
emulator
(3) Rest of the embedded
system
Simulated on the host
Experimental hardware
platform
Prototype hardware
platform
(4) Plant
Statically (signal
generator)
Dynamically
(simulation model)
Prototyping (2/3)
(1) Software unit and software
integration test
Same environment as MIL
Final software instead of model
a) Host environment
b) Target (emulator)
(2) Hardware/software
integration
test
Test hardware integration
Signal processors
Output monitoring with
oscilloscopes
or logic analyzers
In-circuit test equipment (not
restricted to outputs)
Real-time simulation of the plant
Prototyping (3/3)
(3) System integration test
Integrate all hardware parts (often prototypes)
Similar to hardware integration (but complete!)
(4) Environmental test
Measuring influence of the system on the environment
(EMC)
Measuring roboustness of the system w.r.t.
environment
conditions (temperature, humidity, EMI, shock or
vibration, …)
(3) Pre-Production
Test a pre-production unit Applicable tests:
Use pre-production unit Acceptance test
Execute with the real plant Qualification test
Safety execution test
Goals: Test of the production and
Prove that all requirements are maintenance
met test facilities
Demonstrate conformity with Inspection and/or test by government
officials
relevant
standards/norms Typical test techniques:
Demonstrate that production Real-life testing
effort and schedule can be met Random testing
Demonstrate maintainability Fault injection
and mean- time-to-repair Remark:
requirements Special tools for gathering and
Demonstrate product to recording
(potential) the data as well as fault injection are
customers required
Often environment test facilities
(climate
chambers, vibration tables, …) are also
used
(4) Production
Production (or Post-development stage):
Development and test of the production
facilities (often equally important for quality)
Often a first article inspection of similar
style as the pre-production test is required
Production and maintenance tests on
production units may be required for quality
control
Comparison of the Test Levels
III.7 Discussion & Summary
Besides dynamic analysis (testing), which includes the execution
of the software, also effective manual static analysis techniques
such as reviews or inspections are available.
Automatic or semi-automatic static analysis techniques are static
code analysis, formal methods, or model checking.
Two main approaches to testing (dynamic analysis) are black
box
testing, which ignores the internal mechanism of the system or
component (sometimes named functional testing), or white box
testing, which takes into account the internal mechanism of a
system or component (sometimes named structural testing).
The testing activities during development should include, unit
tests,
integration tests, and system tests. System tests may be divided
into
function tests, performance tests, acceptance tests, and
installation
tests.
III.7 Discussion & Summary
Test management should result in a testing process which includes (1)
determining the test methodology, (2) planning the tests, (3) design the
individual tests, and (4) implement the designed tests.
The criteria when to terminate the tests is of critical importance.
Mathematical models, error seeding, or dual independent testing teams
are available approaches to guide termination.
Test automation can help to reduce software testing time, cost, and
efforts while increase the quality of software testing by applying well-
defined test methods through tools. Systematically employed can they
relieve some complicated and redundant work from test engineers.
The paradigm employed for the system development is relevant for
testability: e.g., object-oriented systems have advantages as well as
drawbacks w.r.t. testing
The application domain is relevant for the required testing: e.g.,
embedded systems and their software must be subject to a whole series
of test configurations