This chapter introduces test criteria based on logical expressions. While logic coverage criteria have been known for a long time, their use has been steadily growing in recent years. One cause for their use in practice has been their incorporation in standards such as those accepted by the US Federal Aviation Administration (FAA) for safety critical avionics software in commercial aircraft. As in Chapter 2, we start with a sound theoretical foundation for logic predicates and clauses with the goal of making the subsequent testing criteria simpler. As before, we take a generic view of the structures and criteria, then discuss how logic expressions can be derived from various software artifacts, including code, specifications, and finite state machines.
Readers who are already familiar with some of the common criteria may have difficulty recognizing them at first. This is because we introduce a generic collection of test criteria, and thus choose names that best help articulate all of the criteria. That is, we are abstracting a number of existing criteria that are closely related, yet use conflicting terminology.
OVERVIEW: LOGIC PREDICATES AND CLAUSES
We formalize logical expressions in a common mathematical way. A predicate is an expression that evaluates to a boolean value, and is our topmost structure. A simple example is: ((a > b) ∨ C) ∧ p(x). Predicates may contain boolean variables, non-boolean variables that are compared with the comparator operators {>, <, =, ≥, ≤, ≠}, and function calls.