创业管理(李雪灵part 2-blackbox.ppt

创业管理(李雪灵part 2-blackbox

As an example, suppose that pc: ab+c and pi: ab+c. Consider a test set T={t1, t2} where t1: a=0, b=0, c=0 and t2: a=0, b=1, c=1. The fault in pi is not revealed by t1 as both pc and pi evaluate to false when evaluated against t1. However, the fault is revealed by t2 as pc evaluates to true and pi to false when evaluated against t2. Goal of predicate testing (contd.) Correct predicate: a ? b Extra Boolean variable fault: a ? b?c Missing Boolean variable fault: a Missing or extra Boolean variable faults Consider the following Boolean-Relational set of BR-symbols: BR={t, f, , =, , +?, -?} For example, consider the predicate E: ab and the constraint “” . A test case that satisfies this constraint for E must cause E to evaluate to false. A BR symbol is a constraint on a Boolean variable or a relational expression. Predicate constraints: BR symbols A constraint C is considered infeasible for predicate pr if there exists no input values for the variables in pr that satisfy c. For example, the constraint t is infeasible for the predicate ab? bd if it is known that da. Infeasible constraints Let pr denote a predicate with n, n0, ? and ? operators. A predicate constraint C for predicate pr is a sequence of (n+1) BR symbols, one for each Boolean variable or relational expression in pr. When clear from context, we refer to “predicate constraint” as simply constraint. Test case t satisfies C for predicate pr, if each component of pr satisfies the corresponding constraint in C when evaluated against t. Constraint C for predicate pr guides the development of a test for pr, i.e. it offers hints on what the values of the variables should be for pr to satisfy C. Predicate constraints pr(C) denotes the value of predicate pr evaluated using a test case that satisfies C. C is referred to as a true constraint when pr(C) is true and a false constraint otherwise. A set of constraints S is partitioned into subsets St and Sf, respectively, such that for

文档评论(0)

1亿VIP精品文档

相关文档