1 / 21

Using query checking to generate test sequences

Using query checking to generate test sequences. Maryam Rashidian January, 2004. Why use query checking to generate test sequences?. Testing is our tool to uncover errors Test sets Coverage criteria Statement coverage Branch coverage Logical Expression coverage … Test requirements

swaantje
Download Presentation

Using query checking to generate test sequences

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using query checking to generate test sequences Maryam Rashidian January, 2004

  2. Why use query checking to generate test sequences? • Testing is our tool to uncover errors • Test sets • Coverage criteria • Statement coverage • Branch coverage • Logical Expression coverage • … • Test requirements • Manual construction vs. automatic generation

  3. Using model checking to generate test sequences • Counterexamples • Trap properties • Another alternative …

  4. Temporal logic queries • What is a query? • A query is an expression obtained by replacing a single atomic proposition in a temporal logic formula by the symbol ?x, which is referred to as the placeholder of the query. • Examples: AG(?x), EF(?x  p) • What is the solution to the query? • A propositional formula  is a solution to a query , relative to state s of Kripke structure K, if K,s ⊨ []. • Restricting atomic propositions • Example: AG(?x{p,q}) • Using queries with multiple placeholders • Example: EF(?x{cc}  EX?y{cc}) • What is a witness? • A path through the model that explains why the solution is as computed.

  5. query TLQ CTL SMV model (With fairness) CTL Check engine Solution + Witness/ counter-example Witness query witness KEGVis TLQSolver

  6. SCR requirements model • Four Variable Model

  7. SCR Constructs • Mode class • Mode • Term • Condition • Event • Input event: @T or @F • Conditioned event: @T(c) WHEN d

  8. SCR tables • Condition table • Event table • Mode transition table

  9. Case study: Cruise Control System • SCR requirements model for CCS • Modeling CCS with SMV • Finding queries for Logical Expression coverage criteria

  10. SCR requirements model for CCS • SCR constructs • Monitored variables • Ignition • Brake • Accel • Button • Speed • Mode class • CC • Off, Inactive, Cruise, Override • Controlled variable • Throttle

  11. SCR requirements … • SCR tables • Mode transition table for CC

  12. SCR requirements … • SCR tables • Event table for controlled variable Throttle

  13. Modeling CCS with SMV • Variable definition • Implementing mode class • Implementing controlled variable Throttle • Environmental assumptions 47 next(CC) := case 48 CC=Off & (!(Ignition) & (next(Ignition))) : Inactive; 49 CC=Inactive & ((Ignition) & !(next(Ignition))) : Off; 50 CC=Inactive & Ignition & Running & !(Toofast) & !(Brake) & !(Accel) & (!(Button = b_Cruise) & (next(Button) = b_Cruise)) : Cruise; 51 CC=Cruise & ((Ignition) & !(next(Ignition))) : Off; 52 CC=Cruise & (!(Toofast) & (next(Toofast))) : Inactive; 53 CC=Cruise & ((Running) & !(next(Running))) : Inactive; 54 CC=Cruise & (!(Brake) & (next(Brake))) : Override; 55 CC=Cruise & (!(Accel) & (next(Accel))) : Override; 56 CC=Cruise & (!(Button = b_Off) & (next(Button) = b_Off)) : Override; 57 CC=Override & ((Ignition) & !(next(Ignition))) : Off; 58 CC=Override & Ignition & ((Running) & !(next(Running))) : Inactive; 59 CC=Override & Ignition & Running & !(Brake) & !(Accel) & !(Toofast) & (!(Button = b_Resume) & (next(Button) = b_Resume)) : Cruise; 60 CC=Override & Ignition & Running & !(Brake) & !(Accel) & !(Toofast) & (!(Button = b_Cruise) & (next(Button) = b_Cruise)) : Cruise; 61 1 : CC; 62 esac;

  14. Finding queries for Logical Expression coverage criteria • Logical Expression coverage building • Find predicates and clauses • Find test sequences for: • Predicate Coverage (PC) • Clause Coverage (CC) • General Active Clause Coverage (GACC) • Correlated Active Clause Coverage (CACC) • Restricted Active Clause Coverage (RACC)

  15. Find predicates and clauses

  16. Predicate Coverage (PC) • Two requirements • Predicate should evaluate to TRUE • Predicate should evaluate to FALSE

  17. Predicate Coverage (PC) …

  18. Predicate Coverage (PC) …

  19. Predicate Coverage (PC) …

  20. Query checker limitations • Do not accept Integer variables. • Do not accept more than 4 or 5 placeholders, based on the type of the variable.

  21. Thank you Questions and Answers

More Related