Example of Multicondition coverage (Multiple condition coverage - MCC)Simple exampleAssume we want to test the following code extract: if ( (A || B) && C ) where A, B and C represent atomic boolean expressions (i.e. not divisible in other boolean sub-expressions). In order to ensure Multicondition coverage criteria for this example, each combination of values for A, B and C should be tested at least one time. So, in our example, we need 23=8 testes leading to the following evaluations of A, B and C to valid Multicondition coverage:
However, Testwell CTC++ used to ensure Multicondition coverage ("-i m" option of instrumentation) will present the results of testes in the following way:
E.g., for the 1st case, if A is "true", system will not calculate the value of B since in every way (A or B) will be evaluated to "true". In fact, it means that the 1st and 2nd cases of the 1st list will be evaluated in the same way by the system and that Testwell CTC++ will follow this logic while presenting the results. More complex exampleAssume we replace the condition: ( (A || B) & C ) A full Test Coverage would consist into building the following truth table and testing each combination:
And to ensure a full Multicondition coverage, we should test each combination, i.e. the 9 possible testes here-before underlined in yellow. Go back to Test Coverage Levels Glossary: Condition: a logical indivisible (atomic) expression. It is often called boolean variable, represented by a capital letter (A, B, C, etc.), can only be equal to "true" or "false", but can not be divided in other simpler "sub-conditions". Decision : a logical expression which can be composed of several conditions separated by logical operators like "or", "and", "xor". The Test Coverage Analyzer Testwell CTC++ can do measurements for all kinds of test coverage criteria (particularly for MC/DC and MCC) requested for "critical software development" in order to get certifications, such as DO-178B of the Federal Aviation Administration (FAA). last updated: 03.08.2010 © 2010 Verifysoft Technology GmbH |