Predicates and Relational Operators:
A predicate is implemented as a process, The outcomes of the process is a truth functional value
Predicates are based on relational operators of which the arithmetic relational operators are the most commonly used
Almost all programming languages have arithmetic relational operators
Using the primitive arithmetic relations, one can construct predicates as specified in requirements
Case Statements and Multi-valued Logics:
Predicates are not necessarily restricted to binary truth values
Multiway predicates such as switch can be notorious and most useful
Multi valued logics can be used to analyze predicate structures
Too many case statements require a lot of book keeping that probably affect the applicability of logic based testing
What Goes Wrong with Predicates:
The following are some for the several things that can go wrong with predicates especially when the predicated needs to be interrupted to express it as a predicate over input values
1. A wrong relational operator might be used
For example: > can be used in place of <=
2. The predicate expression of a compound predicate might be written wrong
For example: A+b instead of AB
3. The wrong operands are used
For example: A<X instead of A<Y
4. The processing that leads to the predicates is faulty
Logic based testing is useful against the first 2 types of bugs. For bugs 3 and 4, data flow testing will be more useful
0 comments:
Post a Comment