a model checking perspective on - icst...

124

Upload: others

Post on 03-Mar-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation
Page 2: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

A Model Checking Perspective on White-Box Testing

Helmut Veith Technische Universität Wien [email protected]

Page 3: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Students and Collaborators

Andreas Holzer (Toronto) Michael Tautschnig (Queen Mary) Christian Schallhart (Google) Azadeh Farzan (Toronto) Niloofar Razavi (Toronto) Visar Januzaj (Darmstadt) Stefan Kugele (Munich) Boris Langer (Diehl Aerospace) Raimund Kirner (Hertfordshire) 3

DFG / FWF

National Research Network (FWF)

Page 4: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Main Publications on Testing 2008-2013 Dirk Beyer, Andreas Holzer, Michael Tautschnig, Helmut Veith: Information Reuse for

Multi-goal Reachability Analyses. ESOP 2013: 472-491 Andreas Holzer, Christian Schallhart, Michael Tautschnig, Helmut Veith: On the Structure

and Complexity of Rational Sets of Regular Languages. FSTTCS 2013: 377-388 Azadeh Farzan, Andreas Holzer, Niloofar Razavi, Helmut Veith: Con2colic testing.

ESEC/SIGSOFT FSE 2013: 37-47 Andreas Holzer, Visar Januzaj, Stefan Kugele, Boris Langer, Christian Schallhart, Michael

Tautschnig, Helmut Veith: Seamless Testing for Models and Code. FASE 2011: 278-293

Andreas Holzer, Michael Tautschnig, Christian Schallhart, Helmut Veith: An Introduction to

Test Specification in FQL. Haifa Verification Conference 2010: 9-22 Andreas Holzer, Christian Schallhart, Michael Tautschnig, Helmut Veith: How did you

specify your test suite. ASE 2010: 407-416 Andreas Holzer, Christian Schallhart, Michael Tautschnig, Helmut Veith: Query-Driven

Program Testing. VMCAI 2009: 151-166 Andreas Holzer, Christian Schallhart, Michael Tautschnig, Helmut Veith: FShell: Systematic

Test Case Generation for Dynamic Analysis and Measurement. CAV 2008: 209-213

4

Page 5: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Model Checking and Testing Theoretical Background How we came to work on Testing

Page 6: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Undecidability (of Verification)

Incompleteness.

Non-elementary complexity.

NP-completeness.

Plains of Theoretical Computer Science

Page 7: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

7

Turing's Quote on Program Verification

“How can one check a routine in the sense of making sure that it is right?” “The programmer should make a number of definite assertions which can be checked

individually, and from which the correctness of

the whole program easily follows.”

Quote by A. M. Turing on 24 June 1949 at the inaugural conference of the EDSAC computer at the Mathematical Laboratory, Cambridge.

Page 8: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

“ the first open admission of the

software crisis.” (Dijkstra, The Humble Programmer)

Garmisch-Partenkirchen 1968 NATO Conference on Software Engineering

Page 9: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Dijkstra’s Turing Award Lecture 1972

9

The only effective way to raise the confidence level of a program significantly is to give a convincing proof of its correctness. By definition this approach is only applicable when we restrict ourselves to intellectually manageable programs

Page 10: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Limitations of Human Reasoning

Lines of Code in Modern Computer Programs

0

10000000

20000000

30000000

40000000

50000000

60000000

70000000

80000000

90000000

100000000

100 km printout

Expected Errors per 10.000 Lines = 500m 250 Errors (typical software) 20 Errors (good software) 1 Error (space shuttle quality)

Page 11: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Software Model Checking

critical property program executable

compilation

model checking

Property violations documented by program traces ! I know a bug when I see it.

code assertions absence of deadlocks termination correct API use path feasibility memory violations safety & liveness

Page 12: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Software Model Checking

critical property program executable

compilation

model checking

Property violations documented by program traces ! I know a bug when I see it.

Page 13: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Software Model Checking Paradigms

�Predicate abstraction overapproximation of the state space Formal evidence for unreachability, spurious counterexamples due to abstract semantics e.g. SLAM (MSR), BLAST (Berkeley), CPA (Passau)

�Bounded Model Checking underapproximation of the state space Formal evidence for reachability, precise semantics, bounded size counterexamples e.g. CBMC (Kröning)

de facto combined using SAT / SMT solvers

15

Page 14: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Predicate Abstraction

Memory

State Memory

State Memory

State Memory

State Memory

State Memory

State Memory

State Memory

State

Abstraction

Abstract memory states are formulas describing properties of the memory content.

Graf, Saidi 1997

(x ¸ y) Æ (z + 5 < y)

Memory

State Memory

State Memory

State Memory

State Memory

State Memory

State Memory

State Memory

State

Memory

State Memory

State Memory

State Memory

State Memory

State Memory

State Memory

State Memory

State

► Decision procedures, SAT solver, SMT, … ► Need for classical logic!

Page 15: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

M System

Mh Initial Abstraction Function

CEGAR (Counterexample-Guided Abstraction Refinement)

Adaptive Strategy

Page 16: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

M System

Mh Initial Abstraction Function

SPURIOUS

Abstract Counterexample

Refinement required.

CEGAR (Counterexample-Guided Abstraction Refinement)

Adaptive Strategy

Check if counterexample is feasible: SAT / SMT solver Refinement: Craig Interpolation

Page 17: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

M System

Refined Abstraction

Refined Abstraction

Mh Initial Abstraction Function

Validation or Counterexample Correct !

CEGAR (Counterexample-Guided Abstraction Refinement)

Adaptive Strategy

Check if counterexample is feasible: SAT / SMT solver Refinement: Craig Interpolation

Page 18: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

SAT/SMT for path feasibility

i. Choose a program path ii. Convert to single static assignment form iii. Replace if-then-else by assume:

if (x > 5) then A assume(!(x>5)); else B B;

iv. Extract a formula representing the path x1=x0+5; assume(!(x1>5)); x2 = x1-5; (x1=x0+5) & (!(x1>5)) & (x2 = x1-5)

v. Logical satisfiability of the formula = feasibility of the path Iidealizing assumption: SMT is a reliable oracle.

Page 19: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Software Model Checking

Spec

Abstract Counterexample

Yes / No

► 2000s: development of industrial strength C model checkers ► “ rivals theorem proving for many verification tasks” (Rushby) ► ÆMicrosoft product for Windows device driver verification

Model Checker

Static Analysis

Abstract Model

Counterexample Analysis

Counterexample

C Code

spurious

good

SMT SAT

Page 20: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Bill Gates 2002 on SW Model Checking

22

“device drivers we’re building tools that do actual proofs about the software and how it works in order to guarantee the reliability.”

Page 21: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Dijkstra’s Turing Award Lecture 1972

23

“Model checking is an acceptable crutch.”

Page 22: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Dijkstra’s Turing Award Lecture 1972

24

“Program testing can be a very effective way to show the presence of bugs, but it is hopelessly inadequate for showing their absence.”

Page 23: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Bill Gates 2002 on SW Model Checking

25

“device drivers we’re building tools that do actual proofs about the software and how it works in order to guarantee the reliability.”

Page 24: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Reduction of Model Checking to Testing

26

MC specification: no assertions are violated AG(pc=l → assertion) Program rewrite assert(F) if (!F) goto err; Testing for coverage of err (or basic block coverage) test case covering err = counterexample Disadvantage � assumes perfect test case generation � similar to perfect oracle for path feasibility

Page 25: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

high level programming language executable hardware

“The purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise. [Dijkstra, Turing Award Lecture]”

compilation

execution

high level model

synthesis / implementation

We are not there yet.

Execution time. Power consumption. Processor bugs. Production errors.

Compiler errors.

Proper semantics ?

Testing

Page 26: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FORTAS 2008-2011 (DFG/FWF)

Execution time analysis in a white box setting

• C source code • Focus on automatically

generated code Abstracts from platform Execution times obtained

through measurements Requires large data sets,

possibly with code coverage

Source Code

Expected Time System

(jointly with Real Time Systems Group, TU Vienna)

Page 27: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Reduction of Testing to Model Checking

29

Test goal: Cover line 4242 of the program. Model Checking Specification: AG(pc != 4242) Property correct: line 4242 is dead code Counterexample: trace leading to line 4242 Disadvantages � one model checking call per test goal � redundant calls � does not scale to large programs � no support for coverage criteria beyond simple test goals

Page 28: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

„Condition Coverage“

cover all program conditions

Precision of Coverage Criteria

1 void foo( int x) { 2 int a = x > 2 && x < 5; 3 if (a) { 0; } else { 1; } 4 }

Test suite x =1; x = 4 Condition coverage ?

Commercial Tools Coverage Meter, CTC++ 100% coverage BullseyeCoverage 83% coverage

There is no general purpose formalism for white box test case specification !

Page 29: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Is there a systematic way to specify coverage criteria and leverage model checking for test case generation?

Query-Driven Test Case Generation

Page 30: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

32

Query-Driven Program Testing

Programs as Databases

Coverage Criterion Program

Test Input Generator

Test Suite

Query Database Database

Engine

Query Result

FQL Query

C Source Code

FShell CPA-Tiger

Separation of Concerns

Æ clean semantics Æ multiple engines Æ query dispatcher Æ stable query interface

Vision

SQL for Test Specifications

Page 31: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Query-Driven Test Case Generation I. Test Specification Language FQL

II. Test Case Generation Backends

a. FShell: Based on CBMC / SAT b. CPA-Tiger: Based on CPA / abstraction

III. FQL Theoretical Background

Page 32: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

� Test Case Generation (generic and ad hoc coverage criteria)

� Systematic Reasoning about Test Specifications (Optimization, Subsumption etc.) cf. database theory

� Certification & Coverage Evaluation e.g. measure coverage achieved by existing test suite

� Requirement-Driven Testing translate requirements into FQL

FQL Design Challenge Usage Scenarios

Page 33: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL Design Challenge Language Design Principles

Precise Semantics

Expressive Power

small number of orthogonal concepts suffice to express large classes of specifications

Simplicity and Code Independence

tool for the working programmer simple specs easily expressible relative stability during code refactoring

Encapsulation of Language Specifics easily adaptable to a large class of imperative programming languages

Tool Support for Real World Code

test case generation engines

SQL/Database Analogy

Page 34: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL Design Challenge More Language Desiderata

FQL should capture � Syntax of the program � Semantics of the program � Reasonably language independent User friendly: � Easy to write � Easy to understand � Natural to use � Predictable performance Logic and Algorithms � High expressive power � Tractable to evaluate

Page 35: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

„for each basic block in the program there is a test case in the test suite which covers the basic block“ 1. Specifies a test suite, i.e., multiple test cases 2. Contains a universal quantifier 3. Assumes knowledge about programs.

What IS a basic block for a logic ? 4. Has a meaning independent of the program under test.

Can be translated into concrete specifications for a fixed program.

FQL Challenge Example: Basic Block Coverage

Page 36: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.Line 5.Line 8.Line 9.Line 10

38

Page 37: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.Line 5.Line 8.Line 9.Line 10

39

Page 38: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.Line 5.Line 8.Line 9.Line 10

40

Page 39: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.Line 5.Line 8.Line 9.Line 10

41

Page 40: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.Line 5.Line 8.Line 9.Line 10

42

Page 41: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.Line 5.Line 8.Line 9.Line 10

43

Page 42: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.Line 5.Line 8.Line 9.Line 10

44

Page 43: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.Line 5.Line 8.Line 9.Line 10

45

Page 44: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.Line 5.Line 8.Line 9.Line 10

46

Page 45: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

47

Page 46: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

� Several Paths

48

Page 47: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.(Line 5 + Line 7).Line 8.Line 9.Line 10

� Several Paths

49

Page 48: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.(Line 5 + Line 7).Line 8.Line 9.Line 10

� Several Paths � Language: Set of

program executions

50

Page 49: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.(Line 5 + Line 7).Line 8.Line 9.Line 10

� Several Paths � Language: Set of

program executions � Test goals are also sets

of program executions

51 In practice, the alphabet is more complex than line numbers.

Page 50: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Program Executions as Regular Expressions

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 1.Line 2.Line 3.Line 4.(Line 5 + Line 7).Line 8.Line 9.Line 10

� Several Paths � Language: Set of

program executions � Test goals are also sets

of program executions � Practical test goals can

be expressed using regular languages

� How to express sets of test goals?

52 In practice, the alphabet is more complex than line numbers.

Page 51: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

53

FShell Query Language (FQL)

Quoted Regular Expressions

a*.b.a* + c.d

“a*.b.a* + c.d*“

ℒ 𝐴𝐴2 = { 𝑎𝑎∗. 𝑏𝑏. 𝑎𝑎∗ + 𝑐𝑐.𝑑𝑑∗ }

𝐴𝐴2

ℒ 𝐴𝐴1 = { 𝑏𝑏, 𝑎𝑎𝑏𝑏, 𝑏𝑏𝑎𝑎, 𝑎𝑎𝑏𝑏𝑎𝑎, 𝑎𝑎𝑎𝑎𝑏𝑏, 𝑎𝑎𝑎𝑎𝑏𝑏𝑎𝑎, … , 𝑐𝑐, 𝑐𝑐𝑑𝑑, 𝑐𝑐𝑑𝑑𝑑𝑑, … }

a

a a a

b

b

c

d

a*.b.a* + c.d*

𝐴𝐴1

“a*.b.a*“ + “c.d*“

a*.b.a*

c.d

ℒ 𝐴𝐴3 = { 𝑎𝑎∗. 𝑏𝑏. 𝑎𝑎∗, 𝑐𝑐.𝑑𝑑∗ }

𝐴𝐴3

Infinite number of specific paths

One test goal Two test goals

Page 52: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

Filter Functions 1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

54

Page 53: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

� @ID

Filter Functions: knowledge about programs

Line 1 + Line 2 + Line 3 + Line 4 + Line 5 + Line 6 + Line 7 + Line 8 + Line 9 + Line 10

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

55

Page 54: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

� @ID

� @BASICBLOCKENTRY

Filter Functions: knowledge about programs

Line 2 + Line 5 + Line 7 + Line 9

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

56

Page 55: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

� @ID

� @BASICBLOCKENTRY

� @ENTRY

Filter Functions: knowledge about programs

Line 1

1 int max(int x, int y) { 2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

57

Page 56: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

� @ID

� @BASICBLOCKENTRY

� @ENTRY

� @EXIT

Filter Functions: knowledge about programs 1 int max(int x, int y) {

2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 10

58

Page 57: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

� @ID

� @BASICBLOCKENTRY

� @ENTRY

� @EXIT

� @LINE(7)

Filter Functions: knowledge about programs 1 int max(int x, int y) {

2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

Line 7

59

Page 58: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

� @ID

� @BASICBLOCKENTRY

� @ENTRY

� @EXIT

� @LINE(7)

� ...

Filter Functions: knowledge about programs 1 int max(int x, int y) {

2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

60

Page 59: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

� @ID

� @BASICBLOCKENTRY

� @ENTRY

� @EXIT

� @LINE(7)

� ...

� Filter functions can be combined:

Filter Functions: knowledge about programs 1 int max(int x, int y) {

2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

61

Page 60: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FQL

� @ID

� @BASICBLOCKENTRY

� @ENTRY

� @EXIT

� @LINE(7)

� ...

� Filter functions can be combined: • @BASICBLOCKENTRY(@FUNCTION(f))

• @BASICBLOCKENTRY(@FUNCTION(f)|@FUNCTION(g))

• ...

Filter Functions: knowledge about programs 1 int max(int x, int y) {

2 int tmp; 3 4 if (x >= y) 5 tmp = x; 6 else 7 tmp = y; 8 9 return tmp; 10 }

62

Page 61: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

63

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

“for each basic block in the program there is a test case in the test suite which covers the basic block“

Page 62: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

1 if (x > 10) 2 f1 = false; 3 else 4 f1 = true; 5 if (x == 100) 6 f2 = false; 7 if (f1) 8 s = f2; 9 else 10 s = f1;

64

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

C Source Code

“for each basic block in the program there is a test case in the test suite which covers the basic block“

Page 63: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

cover “@ID*“.@LINE(10).“@ID*“

cover “@ID*“.@LINE(8).“@ID*“

65

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query C Source Code

Test Suite

x = 10 x = 11

a)

a)

b)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

...

...

1 if (x > 10) 2 f1 = false; 3 else 4 f1 = true; 5 if (x == 100) 6 f2 = false; 7 if (f1) 8 s = f2; 9 else 10 s = f1;

Page 64: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

66

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

...

a) @ID* @LINE(8) @ID*

Page 65: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

67

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

...

a) @ID* @LINE(8) @ID*

b) @ID* @LINE(10) @ID*

Page 66: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

68

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

...

a) @ID* @LINE(8) @ID*

b) @ID* @LINE(10) @ID*

...

word = regular expression

Page 67: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

69

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

...

a) @ID* @LINE(8) @ID*

b) @ID* @LINE(10) @ID*

Page 68: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

70

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

...

a) @ID* @LINE(8) @ID*

b) @ID* @LINE(10) @ID*

Page 69: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

71

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

... ...

@LINE(10) @ID*

@LINE(8)

@ID*

Page 70: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

72

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

... ...

@LINE(10) @ID*

@LINE(8)

@ID*

cover “@ID*“.(@LINE(8) + @LINE(10) + ...).“@ID*“

Page 71: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

73

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

... ...

@LINE(10) @ID*

@LINE(8)

@ID*

cover “@ID*“.(@LINE(8) + @LINE(10) + ...).“@ID*“

FQL allows the Kleene-star only inside of quotes!

Page 72: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

74

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

... ...

@LINE(10) @ID*

@LINE(8)

@ID*

cover “@ID*“.(@LINE(8) + @LINE(10) + ...).“@ID*“

Page 73: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

75

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

... ...

@LINE(10) @ID*

@LINE(8)

@ID*

cover “@ID*“.(@LINE(8) + @LINE(10) + ...).“@ID*“

Do we have to express a coverage criterion for each

program individually?

Page 74: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

76

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

... ...

@LINE(10) @ID*

@LINE(8)

@ID*

cover “@ID*“.(@LINE(8) + @LINE(10) + ...).“@ID*“

Do we have to express a coverage criterion for each

program individually?

Page 75: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

1 if (x > 10)

2 f1 = false;

3 else

4 f1 = true;

5 if (x == 100)

6 f2 = false;

7 if (f1)

8 s = f2;

9 else

10 s = f1;

77

FShell Query Language (FQL)

Filter Functions

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

Page 76: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

1 if (x > 10)

2 f1 = false;

3 else

4 f1 = true;

5 if (x == 100)

6 f2 = false;

7 if (f1)

8 s = f2;

9 else

10 s = f1;

78

FShell Query Language (FQL)

� @ID

Filter Functions Revisited

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

Line 1 + Line 2 + Line 3 + Line 4 + Line 5 + Line 6 + Line 7 + Line 8 + Line 9 + Line 10

Page 77: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

1 if (x > 10)

2 f1 = false;

3 else

4 f1 = true;

5 if (x == 100)

6 f2 = false;

7 if (f1)

8 s = f2;

9 else

10 s = f1;

79

FShell Query Language (FQL)

� @ID

� @LINE(8)

Filter Functions Revisited

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

Line 8

Page 78: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

1 if (x > 10)

2 f1 = false;

3 else

4 f1 = true;

5 if (x == 100)

6 f2 = false;

7 if (f1)

8 s = f2;

9 else

10 s = f1;

80

FShell Query Language (FQL)

� @ID

� @LINE(8)

� NOT(@LINE(8))

Filter Functions Revisited

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

Line 1 + Line 2 + Line 3 + Line 4 + Line 5 + Line 6 + Line 7 + Line 9 + Line 10

Page 79: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

1 if (x > 10)

2 f1 = false;

3 else

4 f1 = true;

5 if (x == 100)

6 f2 = false;

7 if (f1)

8 s = f2;

9 else

10 s = f1;

81

FShell Query Language (FQL)

� @ID

� @LINE(8)

� NOT(@LINE(8))

� @BASICBLOCKENTRY

Filter Functions Revisited

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

Line 2 + Line 4 + Line 6 + Line 8 + Line 10

Page 80: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

1 if (x > 10)

2 f1 = false;

3 else

4 f1 = true;

5 if (x == 100)

6 f2 = false;

7 if (f1)

8 s = f2;

9 else

10 s = f1;

82

FShell Query Language (FQL)

� @ID

� @LINE(8)

� NOT(@LINE(8))

� @BASICBLOCKENTRY

� ...

Filter Functions Revisited

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

Page 81: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

83

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

... ...

@LINE(10) @ID*

@LINE(8)

@ID*

cover “@ID*“.(@LINE(8) + @LINE(10) + ...).“@ID*“

Page 82: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

84

FShell Query Language (FQL)

Coverage Criteria as FQL Queries

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

FQL Query

cover “@ID*“.@LINE(8).“@ID*“

cover “@ID*“.@LINE(10).“@ID*“

a)

b)

“for each basic block in the program there is a test case in the test suite which covers the basic block“

... ...

@LINE(10) @ID*

@LINE(8)

@ID*

cover “@ID*“.(@LINE(8) + @LINE(10) + ...).“@ID*“ cover “@ID*“.@BASICBLOCKENTRY.“@ID*“

Page 83: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

85

FShell Query Language (FQL)

Passing Clauses in Coverage Criteria

cover “@ID*“.@BASICBLOCKENTRY.“@ID*“ passing “@ID*.NOT(@FUNCTION(unimplemented)).@ID*“

VMCAI’09, ASE’10, HVC’10: Holzer , Schallhart, Tautschnig, Veith

Page 84: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

„Block Coverage“ cover all program blocks

„Condition Coverage“

cover all program conditions

Simple Coverage Criteria

cover @CONDITIONEDGE

cover EDGES(INTERSECT(@CONDITIONEDGE, @STMTTYPE(if,switch,for,while,?:)))

cover @BASICBLOCKENTRY

Page 85: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Complex Coverage Criteria

“Restricted Scope of Analysis” Condition coverage in function partition with test cases that reach line 7 at least once.

“Condition/Decision Coverage”

Condition/decision coverage (the union of condition and decision coverage) “Interaction Coverage”

Cover all possible pairs between conditions in function sort and basic blocks in function eval, i.e., cover all possible interactions between sort and eval.

“Cartesian Block Coverage”

Cover all pairs of basic blocks in function partition.

in @FUNC(partition) cover @CONDITIONEDGE passing @7

cover @CONDITIONEDGE + @DECISIONEDGE

cover (@CONDITIONEDGE & @FUNC(sort)) . “ID*“ . (@BASICBLOCKENTRY & @FUNC(eval))

cover @BASICBLOCKENTRY. “ID*“ . @BASICBLOCKENTRY

Page 86: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Complex Coverage Criteria

“Constrained Program Paths” Basic block coverage with test cases that satisfy the assertion j > 0 before executing line 3.

“Constrained Inputs”

Basic block coverage in function sort with test cases that use a list with 2 to 15 elements.

“Recursion Depth”

Cover function eval with condition coverage and require each test case to perform three recursive invocations of eval.

cover @BASICBLOCKENTRY passing @LINE(2) .{j>0}

cover @ENTRY(sort).{len>=2}.{len<=15}. .“NOT(@EXIT(sort))*“. @BASICBLOCKENTRY

in @FUNC(eval) cover @CONDITIONEDGE passing @CALL(eval).NOT(@EXIT(eval))*.@CALL(eval) .NOT(@EXIT(eval))*.@CALL(eval)

Page 87: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Complex Coverage Criteria

“Acyclic Path Coverage” Cover all acyclic paths through functions main and insert.

“Loop-Bounded Path Coverage”

Cover all paths through main and insert which pass each statement at most twice.

“Def Coverage”

Cover all statements defining variable t. “Use Coverage”

Cover all statements which use variable t as right hand side value. “Def-Use Coverage”

Cover all def-use pairs of variable t.

cover PATHS(@FUNC(main) | @FUNC(insert),1)

cover PATHS(@FUNC(main) | @FUNC(insert),2)

cover @DEF(t)

cover @USE(t)

cover @DEF(t) . “NOT(@DEF(t))*” . @USE(t)

Page 88: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Query-Driven Test Case Generation I. Test Specification Language FQL

II. Test Case Generation Backends

a. FShell: Based on CBMC / SAT b. CPA-Tiger: Based on CPA / abstraction

III. FQL Theoretical Background

Page 89: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

96

Query-Driven Program Testing

Programs as Databases

Coverage Criterion Program

Test Input Generator

Test Suite

Query Database Database

Engine

Query Result

FQL Query

C Source Code

FShell CPAtiger

Page 90: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

97

Query-Driven Program Testing

� Bounded Model Checking

� Loop Bounds

� Can‘t show non-existence of test case

FShell

Test Input Generator

Database Engine

� Predicate Abstraction

� No Loop Bounds

� Proves existence and non-existence of test cases

CPAtiger

FShell CPAtiger

Page 91: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FShell: Approach

Query: test specification COVER @basicblockentry

Step 1: Program Instrumentation

Add monitoring layer to C program + query specific monitor Encode all test goals into monitor

Step 2: Test Case Generation

Use Kroening’s CBMC + Guided SAT Enumeration for Efficient Enumeration of Test Cases

Page 92: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Background: Kröning’s CBMC

C Bounded Model Checker Clean and stable code base Full ANSI-C support SAT solver = decision procedure

Page 93: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

FShell: Architecture

Reuses parts of CBMC Interactive command-line

frontend

Page 94: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Iterative Constraint Strengthening for Fast Test Case Generation

� Fast computation of solutions by SAT enumeration

� Incremental SAT solving � Clause database is updated on-the-fly � SAT solver suspended during database update by FShell � Conflict database is kept and reused

� Instance becomes unsatisfiable iff remaining goals infeasible

� Complex coverage criteria: groupwise constraint strengthening

Page 95: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Iterative Constraint Strengthening

Program + monitors described by CNF formula Example test goals Initial constraint: “reach some test goal”

Assume and are satisfied by first solution: “reach new test goal”

Page 96: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

103

Query-Driven Program Testing

� Bounded Model Checking

� Loop Bounds

� Can‘t show non-existence of test case

FShell

Test Input Generator

Database Engine

� Predicate Abstraction

� No Loop Bounds

� Proves existence and non-existence of test cases

CPAtiger

FShell CPAtiger

Page 97: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

104

Query-Driven Program Testing

CPAtiger

Test Input Generator

Test Inputs & Proofs of Non-existence

FQL Query

C Source Code

Automata 𝐴𝐴1,𝐴𝐴2, … ,𝐴𝐴𝑛𝑛

Repeated Invocation of an Automaton-guided Reachability Analysis

𝐴𝐴𝑖𝑖

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

For real-world programs the

number of automata becomes huge!

How can we reuse analysis results across different

automata?

Model Checker: Is there a program execution that is

accepted by the automaton?

Page 98: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

106

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

For this automaton we ran a

reachability analysis

Page 99: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

108

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

6 4

Page 100: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

109

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

6 4

For this automaton we want to run a

reachability analysis

Page 101: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

For this automaton we want to run a

reachability analysis

110

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

6 4

Page 102: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

For this automaton we want to run a

reachability analysis

111

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

6 4

Page 103: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

For this automaton we want to run a

reachability analysis

112

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

6 4

Reuse all reachability infos!

Page 104: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

113

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

6 4

Simulation Relation

Page 105: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

114

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

6 4

Simulation Relation

„for each transition in the second automaton, we find a corresponding transition in the first

automaton“

Page 106: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

115

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

6 4

Page 107: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

116

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7

6 4

Page 108: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

117

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7

6 4

Page 109: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

118

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7

6 4

Empty Simulation Relation

Page 110: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

119

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7

6 4

Empty Simulation Relation

Page 111: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

120

Information Reuse

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7

6 4

Ignore

Ignore!

Page 112: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

121

Information Reuse

Simulation Relation modulo { 𝑞𝑞2, 7, 𝑞𝑞2 }

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

𝑝𝑝3

8,10

𝑝𝑝1 𝑝𝑝0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7 6 4

8,10

𝑝𝑝2

8,10

𝑞𝑞2 𝑞𝑞1 𝑞𝑞0

1,2,5,6,7,8,10

1,2,4,5,7,8,10

7

6 4

Ignore

Ignore!

Page 113: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

CPAtiger

� Based on Dirk Beyer´s SW model checker CPAchecker

� Experiments in Holzer´s thesis • Windows NT Drivers

• Variants of Basic Block Coverage: − 𝐵𝐵𝐵𝐵: Cover each basic block − 𝐵𝐵𝐵𝐵2: Cover each pair of basic blocks − 𝐵𝐵𝐵𝐵3: Cover each triple of basic blocks

• Bounded-Path Coverage

122 [ESOP‘13] Beyer, Holzer, Tautschnig, Veith

Page 114: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Experiments (𝐵𝐵𝐵𝐵2 Coverage)

1

10

100

1000

10000

100000

All OptimizationsNo ARG Reuse

Time-out (>15000s) t [s]

123

Improvements over naive iteration approach

[ESOP‘13] Beyer, Holzer, Tautschnig, Veith

Page 115: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Query-Driven Test Case Generation I. Test Specification Language FQL

II. Test Case Generation Backends

a. FShell: Based on CBMC / SAT b. CPA-Tiger: Based on CPA / abstraction

III. FQL Theoretical Background

Page 116: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

125

Semantic Foundations of FQL

Σ∗ 𝑎𝑎

Σ∗ 𝑏𝑏 𝑐𝑐

{ Σ∗ ⋅ {𝑎𝑎} ⋅ Σ∗ , Σ∗ ⋅ {𝑏𝑏} ⋅ Σ∗ , Σ∗ ⋅ {𝑐𝑐} ⋅ Σ∗ }

Page 117: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

126

Semantic Foundations of FQL

Regular Sets of Rational Languages (RSRL) [Afonin and Khazova, 2005]

Σ∗ 𝑎𝑎

Σ∗ 𝑏𝑏 𝑐𝑐

{ Σ∗ ⋅ {𝑎𝑎} ⋅ Σ∗ , Σ∗ ⋅ {𝑏𝑏} ⋅ Σ∗ , Σ∗ ⋅ {𝑐𝑐} ⋅ Σ∗ }

Page 118: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

𝐾𝐾 = { 𝛿𝛿1𝛿𝛿2𝛿𝛿1 , 𝛿𝛿1𝛿𝛿3𝛿𝛿1 , 𝛿𝛿1𝛿𝛿4𝛿𝛿1 }

127

Semantic Foundations of FQL

Regular Sets of Rational Languages (RSRL) [Afonin and Khazova, 2005]

Σ∗ 𝑎𝑎

Σ∗ 𝑏𝑏 𝑐𝑐

𝛿𝛿1 𝛿𝛿2

𝛿𝛿1 𝛿𝛿3 𝛿𝛿4

{ Σ∗ ⋅ {𝑎𝑎} ⋅ Σ∗ , Σ∗ ⋅ {𝑏𝑏} ⋅ Σ∗ , Σ∗ ⋅ {𝑐𝑐} ⋅ Σ∗ }

Page 119: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

𝐾𝐾 = { 𝛿𝛿1𝛿𝛿2𝛿𝛿1 , 𝛿𝛿1𝛿𝛿3𝛿𝛿1 , 𝛿𝛿1𝛿𝛿4𝛿𝛿1 }

128

Semantic Foundations of FQL

Regular Sets of Rational Languages (RSRL) [Afonin and Khazova, 2005]

Σ∗ 𝑎𝑎

Σ∗ 𝑏𝑏 𝑐𝑐

𝛿𝛿1 𝛿𝛿2

𝛿𝛿1 𝛿𝛿3 𝛿𝛿4

{ Σ∗ ⋅ {𝑎𝑎} ⋅ Σ∗ , Σ∗ ⋅ {𝑏𝑏} ⋅ Σ∗ , Σ∗ ⋅ {𝑐𝑐} ⋅ Σ∗ }

• 𝜑𝜑 𝛿𝛿1 = Σ∗ • 𝜑𝜑 𝛿𝛿2 = {𝑎𝑎} • 𝜑𝜑 𝛿𝛿3 = {𝑏𝑏} • 𝜑𝜑 𝛿𝛿4 = {𝑐𝑐}

𝜑𝜑 maps to a regular language

≡ 𝐾𝐾,𝜑𝜑

Page 120: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Closure Properties 1

� The complement of an RSRL is not an RSRL � RSRL are closed under product, Kleene star, union

129

Operator Finite Case (FQL) Finite Case,

fixed 𝝋𝝋 (FQL)

⋅,∪,∩,− Closed Not closed

Under submission: Holzer , Schallhart, Tautschnig, Veith

Page 121: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

130

Closure Properties 2

Point-wise Operators

cover “@ID*“.@BASICBLOCKENTRY.“@ID*“ passing @ID*.NOT(@FUNCTION(unimplemented)).@ID*

ℛ ⩀ 𝑅𝑅 = { 𝐿𝐿 ∩ 𝑅𝑅 ∣ 𝐿𝐿 ∈ ℛ }

Point-wise

Operators

Finite RSRL,

fixed 𝝋𝝋 (FQL)

Finite RSRL

(FQL)

RSRL

∗, � ,∪,∩,− Not closed Closed Not Closed

Under submission: Holzer , Schallhart, Tautschnig, Veith

Page 122: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Complexities of Decision Problems

131 Under submission: Holzer , Schallhart, Tautschnig, Veith

Decision

Problem

Kleene-star free

case (FQL)

General case

Equivalence ℛ1 = ℛ2 PSPACE-complete ? Inclusion ℛ1 ⊆ ℛ2 PSPACE-complete ? Membership 𝐿𝐿 ∈ ℛ PSPACE-complete O(2EXPSPACE)

Page 123: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Further Work

Model-Based Testing with FQL Case Studies Automotive, Avionic Con2colic testing Extension of concolic testing to systematically

explore inputs and thread interference Æ Proceedings Testing for Distributed Algorithms Systems with vast non-determinism

132

Page 124: A Model Checking Perspective on - ICST 2015icst2015.ist.tu-graz.ac.at/wp-content/uploads/2014/03/... · 2015. 5. 13. · Software Model Checking Paradigms Predicate abstraction overapproximation

Conclusion

FQL is an automata-based framework for specification of coverage criteria.

� Simple well-understood semantics

� Based on quoted regular expressions

� Separation between test specification and test case generation engine

� Easy to use for non-specialists

� Prototype implementations based on CBMC and CPA.

133