Software Testing Seminar: Mooly Sagiv Tel Aviv University 640-6706 Sunday 16-18 Monday 10-12 Schrieber 317
Software Testing Seminar: Mooly Sagiv Tel Aviv University 640-6706 Sunday 16-18 Monday 10-12 Schrieber 317
Mooly Sagiv
http://www.math.tau.ac.il/~sagiv/courses/testing.html
Tel Aviv University
640-6706
Sunday 16-18
Monday 10-12 Schrieber 317
Bibliography
• Find faults
– Glenford Myers, The Art of Software Testing
• Provide confidence
– of reliability
– of (probable) correctness
– of detection (therefore absence) of particular
faults
Testing Theory (such as it is)
• (In)adequacy criteria
– If significant parts of program structure are not
tested, testing is surely inadequate
• Control flow coverage criteria
– Statement (node, basic block) coverage
– Branch (edge) and condition coverage
– Data flow (syntactic dependency) coverage
– Various control-flow criteria
• Attempted compromise between the
impossible and the inadequate
Basic structural criteria (ex.)
f
Data flow coverage criteria (ex.)
x := 7
Rationale: An untested def-
use association could hide
y := x an erroneous computation
• Specifications
– sufficiently formal (e.g., Z spec)
– but possibly incomplete (e.g., assertions in Anna,
ADL, APP, Nana)
• Design models
– treated as specifications, as in protocol
conformance testing
• Prior runs (capture/replay)
– especially important for regression testing and
GUIs; hard problem is parameterization
What can be automated?
• Oracles
– assertions; replay; from some specifications
• Selection (Generation)
– scripting; specification-driven; replay variations
– selective regression test
• Coverage
– statement, branch, dependence
• Management
Design for Test: 3 Principles
Adapted from circuit and chip design
• Observability
– Providing the right interfaces to observe the
behavior of an individual unit or subsystem
• Controllability
– Providing interfaces to force behaviors of interest
• Partitioning
– Separating control and observation of one
component from details of others
Problems & Opportunities
• Compositionality
– for components; for regression
• Specifications
– low entry barrier, incremental payoff
• Synergy with Analysis
– conformance test w/ verified models
– “backstop” for unsafe assumptions
• … (your idea here)
A recent success story
• The Prefix program analysis tool
• Analyzes C/C++ sources
• Scans for cleanness bugs, e.g., dereferences
to NULL pointers
• Symbolically executes the program on some
paths
• May miss some errors and generate false
alarms
• Tried on Windows 2000
• Located 65,000 potential bugs
28,000 out of which are real bugs