Automated test generation¶
Generates MC/DC (Modified Condition / Decision Coverage) tests for a circuit.
The circuit is a Circuit subclass that registers its decision
and condition nets by name in self.nets; compute_mcdc builds it twice and
searches, with the engines, for the independence pair of each condition.
mcdc ¶
Automated Test Generation for MC/DC (Modified Condition / Decision Coverage).
MC/DC asks, for every decision (a boolean expression) and each of its conditions (the atomic boolean sub-expressions), for a pair of tests that show the condition independently flips the decision: the two tests differ in that one condition, agree on the others, and the decision differs between them. Such a pair is an independence pair, and the generated table collects one per condition.
The circuit is given as a subclass of :class:intrepyd.circuit.Circuit (the
same class the translators use). compute_mcdc builds it twice in the same
context, as instances InstA and InstB under their own namespaces, and
looks up the decision and condition nets by name in each instance's nets
dictionary — so the circuit must register, in self.nets, every net named by
decisions. See the documentation and tests/test_atg.py for an example.
compute_mcdc ¶
Computes MC/DC tests in the form of a table, one per decision.
Args:
context: the intrepyd context to use
class_ (class): a subclass of :class:intrepyd.circuit.Circuit that
builds the circuit and registers every decision and
condition net, by name, in self.nets
decisions (Dictionary): maps each decision to its conditions, all by
net name (the names used as keys in the circuit's nets)::
{ decisionName : [conditionName, ...] }
max_depth (int): the maximum BMC depth to search for each test
Returns:
a triple (tables, independence_pairs, unreachable): the raw MC/DC
table per decision, the independence pair (two test indices) per
condition, and the conditions whose objective is unreachable
get_tables_as_dataframe ¶
Postprocess table to turn into a dataframe
compute_pretty_tables ¶
Postprocess raw MC/DC tables to get something presentation ready.