Test Adequacy Flashcards
What is static testing?
Testing of a program through analysis of artifacts without executing the code, such as requirements testing, code reviews, and static analysis.
What is dynamic testing?
Testing that involves executing the system to validate its behavior.
What is structural testing?
A testing approach that determines test cases based on the structure of the program, focusing on identifying untested parts of the system.
What are the components of structural testing?
Statements, branches, conditions, and paths.
What is a Control Flow Graph (CFG)?
A directed graph that models the flow of a program, with nodes representing code regions and edges representing transitions.
What is statement testing?
A testing method that ensures each statement in the program is executed at least once.
What is branch testing?
A testing method that ensures all possible branches in the program are executed.
What is the limitation of statement coverage?
It can achieve 100% coverage without testing all branches or conditions, potentially missing faults.
What is condition testing?
A testing method that ensures all individual conditions in a compound expression take all possible truth values.
What is compound condition coverage?
A method that tests all possible combinations of conditions in a compound decision, though it can have exponential complexity.
What is Modified Condition/Decision Coverage (MC/DC)?
A coverage criterion that ensures each basic condition in a compound decision independently affects the outcome.
Why is MC/DC widely used?
It provides a good balance between thoroughness and test suite size.
What is path testing?
A testing method that considers combinations of decisions along paths in the program.
Why is path testing challenging for programs with loops?
Loops create infinite paths, requiring practical compromises like boundary interior path testing.
What is boundary interior path testing?
A technique that focuses on paths up to the first repeated node in a loop.
What is loop boundary adequacy?
A criterion that ensures loops are tested with zero, one, and multiple iterations.
What is cyclomatic coverage?
A measurement of the number of independent paths in a CFG, calculated as e - n + 2 (edges, nodes).
What is the infeasibility problem in testing?
The situation where some testing criteria cannot be satisfied due to unreachable code or interdependent conditions.
What are solutions for the infeasibility problem?
Set realistic coverage goals or require justification for uncovered elements.
Define a test case.
A set of inputs, execution conditions, and a pass/fail criterion.
Define a test suite.
A collection of test cases.
What is an adequacy criterion?
A predicate that determines whether a test suite is thorough enough for a particular program.
What is a test obligation?
A partial test case specification requiring specific properties for thorough testing.