Professional Documents
Culture Documents
…
input_4, expected outcome_4
Coverage?
Test coverage
Reliability Cost
Testing phases
Test of individual units of source code. The
• Unit testing definition of “unit” for test purposes depends on the
actual software. It is done by the programmer most
of the times
• Integration testing
Units are combined and tested as a whole. Typically, it
• System testing uses black-box testing.
Types of Testing
• Functional
• Non-functional
– Performance: test the run-time performance of the software.
– Stress: execute a system in a manner that demands resources in abnormal quantity,
frequency, or volume.
– Usability: attempt to identify discrepancies between the user interfaces of a product
and the human engineering requirements of its potential users.
– Security: verify that protection mechanisms built into a system will, in fact, protect it
from improper penetration
– Dependability: operate the system for long periods of time and estimate the likelihood
that the the requirements for failure rates, mean-time-between-failures, and so on, will
be satisfied. à very, very, very difficult!
– Specific non-functional elements:
Error detection Checkpointing Recovery
Intrusion detection Logging Etc, etc
• In complex systems, the failures caused by software bugs may appear in different way,
defining a very first big types of software faults (bugs):
• Bohrbugs
• Bugs that cause failures deterministically
• Easiest to find during testing
• Fault tolerance à design diversity and redundancy
• Mandelbugs
• Re-execution after a failure caused by a Mandelbug will generally not cause another failure
• Very difficult to find and correct during testing
• Fault tolerance à simple retries and recovery-oriented computing using checkpointing
• Aging-related
• Bugs tend to be activated and cause failures after long periods of system run-time
• Difficult to find during testing (but static code analysis is effective for some of them)
• Fault tolerance à software rejuvenation
10
• Bug locality hypothesis: a bug discovered within a component affects only that
component behavior.
• Control bug dominance: most bugs are in the control structure of programs.
Henrique M adeira Adapted from Prof. M ancoridis, Vokolos slides, Drexel University, PA, USA Analysis of Software Artifacts, DEI-FCTUC, 2022/2023 11
11
Henrique M adeira Adapted from Prof. M ancoridis, Vokolos slides, Drexel University, PA, USA Analysis of Software Artifacts, DEI-FCTUC, 2022/2023 12
12
• Test case: inputs to test the program and the predicted outcomes (according to
the specification). Test cases are formal procedures:
– inputs are prepared;
– outcomes are predicted;
– tests are documented;
– commands are executed;
– results are observed and evaluated.
13
Outcome
14
Expected outcome
• Some times, specifying the expected outcome for a given test case can be quite
difficult:
– For some applications we might not know what the outcome should be.
– Or the program may produce too much output to be able to analyze it in a reasonable
amount of time.
• In general, this (i.e., the oracle) is a fragile part of the testing activity, and can be
very time consuming.
• When possible, automation should be considered as a way of specifying the
expected outcome and comparing it to the actual outcome.
Henrique M adeira Adapted from Prof. M ancoridis, Vokolos slides, Drexel University, PA, USA Analysis of Software Artifacts, DEI-FCTUC, 2022/2023 15
15
Henrique M adeira Adapted from Prof. M ancoridis, Vokolos slides, Drexel University, PA, USA Analysis of Software Artifacts, DEI-FCTUC, 2022/2023 16
16
Limitations of testing
• Testing cannot occur until after the code is written.
• The problem is big!
• Exhaustive testing is not practical even for the simplest programs.
• Even if we “exhaustively” test all execution paths of a program, we
cannot guarantee its correctness. The best we can do is increase our
confidence!
• “Testing can show the presence of bug, not their absence.” Dijkstra
• Testers do not have immunity to bugs.
• Even the slightest modifications – after a program has been tested –
invalidate (some or even all of) our previous testing efforts.
• Lack of testing tools
17
Testing priorities
18