What is a control-flow graph?
Flow chart
- Directed graph
- Nodes are blocks of sequential statements
- Edges are transfers of control & may be labelled with predicate repping condition of control transfer
- Several conventions for these models with slight diffs e.g. hierarchical & concurrent)
- Blocks include if-then-else, while loops & switches
- UML activity diagrams can also be used to model CFGs
What is the subsumption hierarchy?
All-Coupling-Paths → All-Coupling-Uses → All-Coupling-Defs → Call Coupling
What is Integration test coverage criteria?
What is a coupling du-path?
Path from last-def to first-use across 2 units (caller & callee)
What is the mutation coverage/score?
What are the types of mutant?
Stillborn, trivial and equivalent
Only mutants which behave differently to og program with no test cases to ID them are interesting
Stillborn mutant
Syntactically incorrect, killed by compiler
Trivial mutant
Killed by almost any test case
Equivalent mutant
Always acts in same behaviour as og program
What are the types of control-flow coverage?
Statement, decision, condition and path
Statement control-flow coverage
Same as =Node =Line
- Hypothesis/motivation for coverage criterion: Faults can’t be discovered if parts containing them not executed
- Statement coverage criterion: Equiv to covering all nodes in CFG
- Executing statement (code line) is weak guarantee of correctness but easy to achieve
- Several statements can execute same statements
- Can help with detecting certain types of detects but may lead to incompleteness
Decision control-flow coverage
Condition control-flow coverage
Modified condition-decision coverage
Path control-flow coverage
What are the 3 types of coupling between units?
Parameter, shared data (non-local vars) and external resource device) couple (refs of several modules to same external resource)
Call sites
statements in caller (A) where callee (B) invoked
Last defs
Set of nodes (in CFGs) that define x (var) for
which there’s def-clear path from node through call site or return to use in caller
First uses
Set of nodes (in CFGs) that “use” x & for which
there exists def-clear path between call site (if use is in caller) or callee entry point (if use in callee)
Coupling-Based Criteria
Definitions in coupling-based criteria
Comparison criteria
Sandwich
Top-down