Unformatted text preview:

Today’s AgendaQuick ReviewPredicate TestingMotivationApplicationsSlide 6PredicateClausePredicate FaultsExampleSlide 11Predicate CoverageClause CoveragePredicate vs Clause CoverageCombinatorial CoverageActive ClauseActive Clause Coverage (ACC)General Active Clause Coverage (GACC)Correlated Active Clause Coverage (CACC)CACC (2)Restricted Active Clause Coverage (RACC)CACC vs RACC (1)CACC vs RACC (2)Inactive Clause Coverage (ICC)GICC & RICCMaking Active ClausesExample (1)Example (2)Example (3)Finding Satisfying ValuesSlide 31Slide 32Slide 33Example (4)Example (5)Slide 36Reachability & ControllabilityTriTypePredicatesReachabilitySolving Internal VarsReduced ReachabilitySlide 43Slide 44CACC CoverageSlide 46SubsumptionRecapToday’s AgendaQuick ReviewFinish Graph-Based TestingPredicate TestingSoftware Testing and Maintenance 1Quick ReviewWhat is a definition? What is a use?Software Testing and Maintenance 2Software Testing and Maintenance 3Predicate Testing Introduction Basic Concepts Predicate Coverage Program-Based Predicate Testing SummarySoftware Testing and Maintenance 4Motivation Predicates are expressions that can be evaluated to a boolean value, i.e., true or false. Many decision points can be encoded as a predicate, i.e., which action should be taken under what condition? Predicate-based testing is about ensuring those predicates are implemented correctly.Software Testing and Maintenance 5Applications Program-based: Predicates can be identified from the branching points of the source codee.g.: if ((a > b) || c) { … } else { … }  Specification-based: Predicates can be identified from both formal and informal requirements as well as behavioral models such as FSM“if the printer is ON and has paper then send the document for printing” Predicate testing is required by US FAA for safety critical avionics software in commercial aircraftSoftware Testing and Maintenance 6Predicate Testing Introduction Basic Concepts Predicate Coverage Program-Based Predicate Testing SummarySoftware Testing and Maintenance 7Predicate A predicate is an expression that evaluates to a Boolean value Predicates may contain:Boolean variablesNon-boolean variables that are compared with the relational operators {, , , , , }Boolean function calls The internal structure is created by logical operators:, , , , , Software Testing and Maintenance 8Clause A clause is a predicate that does not contain any of the logical operators Example: (a = b)  C  p(x) has three clauses: a relational expression (a = b), a boolean variable C, and a boolean function call p(x)Software Testing and Maintenance 9Predicate Faults An incorrect boolean operator is used An incorrect boolean variable is used Missing or extra boolean variables An incorrect relational operator is used Parentheses are used incorrectlySoftware Testing and Maintenance 10Example Assume that (a < b)  (c > d)  e is a correct boolean expression:(a < b)  (c > d)  e(a < b)  (c > d)  f(a < b)  (c > d)(a = b)  (c > d)  e(a = b)  (c  d)  e(a < b  c > d)  eSoftware Testing and Maintenance 11Predicate Testing Introduction Basic Concepts Predicate Coverage Program-Based Predicate Testing SummarySoftware Testing and Maintenance 12Predicate Coverage For each predicate p, TR contains two requirements: p evaluates to true, and p evaluates to false. Example: ((a > b)  C)  p(x))a b C p(x)1 5 4 true true2 5 6 false falseSoftware Testing and Maintenance 13Clause Coverage For each clause c, TR contains two requirements: c evaluates to true, and c evaluates to false. Example: ((a > b)  C)  p(x))a b C p(x)1 5 4 true true2 5 6 false falseSoftware Testing and Maintenance 14Predicate vs Clause Coverage Does predicate coverage subsume clause coverage? Does clause coverage subsume predicate coverage? Example: p = a  ba b a  b1 T T T2 T F T3 F T T4 F F FSoftware Testing and Maintenance 15Combinatorial Coverage For each predicate p, TR has test requirements for the clauses in p to evaluate to each possible combination of truth values Example: (a  b)  ca b c (a  b)  c1 T T T T2 T T F F3 T F T T4 T F F F5 F T T T6 F T F F7 F F T F8 F F F FSoftware Testing and Maintenance 16Active Clause The major clause is the clause on which we are focusing; all of the other clauses are minor clauses.Typically each clause is treated in turn as a major clause Determination: Given a major clause c in predicate p, c determines p if the minor clauses have values so that changing the truth value of c changes the truth value of p.Note that c and p do not have to have the same value. Example: p = a  bSoftware Testing and Maintenance 17Active Clause Coverage (ACC) For each predicate p and each major clause c of p, choose minor clauses so that c determines p. TR has two requirements for each c: c evaluates to true and c evaluates to false. Example: p = a  ba bT fF ff Tf Fc = ac = bSoftware Testing and Maintenance 18General Active Clause Coverage (GACC) The same as ACC, and it does not require the minor clauses have the same values when the major clause evaluates to true and false. Does GACC subsume predicate coverage?Software Testing and Maintenance 19Correlated Active Clause Coverage (CACC) The same as ACC, but it requires the entire predicate to be true for one value of the major clause and false for the other.  Example: a  bSoftware Testing and Maintenance 20CACC (2)a b c a  (b  c)1 T T T T2 T T F T3 T F T T5 F T T F6 F T F F7 F F T F Example: a  (b  c)Software Testing and Maintenance 21Restricted Active Clause Coverage (RACC) The same as ACC, but it requires the minor clauses have the same values when the major clause evaluates to true and false. Example: a  (b  c)a b c a  (b  c)1 T T T T5 F T T F2 T T F T6 F T F F3 T F T T7 F F T FSoftware Testing and Maintenance 22CACC vs RACC (1) Consider a system with a valve that might be either open or closed, and several modes, two of which are “operational” and “standby”.  Assume the following two constraints: (1) The valve must be open in “operational” and closed in all other modes; (2) The mode cannot be both “operational” and “standby” at the same time.


View Full Document

UT Arlington CSE 4321 - Predicate Testing

Download Predicate Testing
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Predicate Testing and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Predicate Testing 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?