Example of Condition coverageSimple 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 Condition coverage criteria for this example, A, B and C should be evaluated at least one time "true" and one time "false" during testes. So, in our example, the 3 following testes would be sufficient to valid Condition coverage:
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:
On the other hand, to ensure Condition coverage, we should test (for example) just the 3 combinations 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 |