21
Constraint-Based Error Localization Mohammed, Bekkouche, Hélène Collavizza, Michel Rueher University of Nice Sophia-Antipolis I3S – CNRS France Réunion VACSIM – 14 Octobre 2014

Error localization

Embed Size (px)

Citation preview

Page 1: Error localization

Dra

ftConstraint-Based Error Localization

Mohammed, Bekkouche, Hélène Collavizza, MichelRueher

University of Nice Sophia-Antipolis I3S – CNRS

France

Réunion VACSIM – 14 Octobre 2014

Page 2: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Plan

1 Problem

2 Motivating example

3 Experiments

4 Conclusion

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 2

Page 3: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Problem: informal presentation

• Model checking, testing

Generation of counterexamples• Input data & wrong output (testing)• Input data & violated post condition / property

→ Execution trace

• Problems

• Execution trace: often lengthy and difficult to understand• Location of the portions of code that contain errors

→ Very expensive

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 3

Page 4: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Goals

• Provide helpful information for error localization on numericconstraint systems

• Two categories of information

• How much of an unsatisfiable constraint set can besatisfied ?→ Minimal Correction Set (MCS)

MaxSAT, Max CSP, MaxFS

• Where in the constraint set the “problem” lies ?→ Minimal Unsatisfiable Core (MUC),

Irreducible Inconsistent Subsystems (IIS)

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 4

Page 5: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Definitions

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 5

Page 6: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Computing all MCS : CAMUS (Liffiton &Sakallah-2007

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 6

Page 7: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Computing all MCS – Example

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 7

Page 8: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Computing one MUS from a set of MCSes (Liffiton& Sakallah-2007

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 8

Page 9: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

LocFaults

→ Computing MCS on programs with numericalcomputations

• Input :• A faulty program: postcondition does not hold• A counter-example

• Output : A small set of suspicious statements

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 9

Page 10: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

LocFaults : détails (1)

• Process

1 Building of the CFG of a program in DSA form2 Translating of the program and its specification in a set of

numerical constraints3 ComputingMCS with the counter-example CE , constraints

of the corresponding PATH and the postcondition POSTNote : CSP C = CE ∪ PATH ∪ POST is inconsistant

• Key points : MCS on paths “closely” related to the CE

→ Path of CE→ Paths with at most k deviations from the CE

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 10

Page 11: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

LocFaults : details (2)

• Computing bounded MCS along the path of CE

• DFS Exploration of the CFG : propagation of CE and atmost k deviations of conditional statements: c1, .., ck :

• C: contraints along the path before ck

• IF P ∪ POST holds:

• {¬c1, ..,¬ck} is a potential correction,

• The MCS of C ∪ {¬c1, ..,¬ck} are potential corrections

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 11

Page 12: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Example (1)Program AbsMinus : an error has been introduced in line 10,thus for the input data {i = 0, j = 1}, it returns −1

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 12

Page 13: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Example (2)

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 13

Page 14: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Example (3)

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 14

Page 15: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Experiments - Processsystems and tools

• LocFaults:

→ MIP solver of IBM ILOG CPLEX

→ CPBPV system to generate the CFG and CE

→ Benchmarks: Java programs

• BugAssist:

→ MaxSAT solverMSUnCore2

→ Benchmarks: ANSI-C programs

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 15

Page 16: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Experiments - Benchmarks

• TCAS : an aircraft collision avoidance system. Theprogram contains 173 lines of C code with almost noarithmetic operations. The suite contains 41 faulty versions

• Tritype takes three positive integers as inputs (i , j , k) thetriangle sides, and returns the value 2 if the inputscorrespond to an isosceles triangle, the value 3 if theycorrespond to an equilateral triangle, the value 1 if theycorrespond to some other triangle, and the value 4otherwise.

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 16

Page 17: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Experiments - Results on TCAS suite

• Computation times: no significant difference• At most one deviation required except for version V41

where two deviations were required• Size of the set of suspicious instructions identified by

BUGASSISTin general larger than the sum of the sizes ofthe sets of suspicious instructions generated byLOCFAULTS

• BUGASSISTidentifies a bit more errors than LOCFAULTS

• LOCFAULTSreports a set of MCS for each faulty path→ the error localization process is much more easier thanwith the single set of suspicious errors reported byBUGASSIST

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 17

Page 18: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Experiments - Error on Tritype

• TritypeV1 : error in the last assignment statement of theprogram

• TritypeV2 : error in a nested condition, just before thelast assignment

• TritypeV3 : the error an assignment and will entail a badbranching

• TritypeV4: error in condition, at the beginning of theprogram

• TritypeV5 : wo wrong conditions in this program• TritypeV6 : a variation that returns the perimeter of the

triangle• TritypeV7 : a variation that computes the square of the

surface of the triangle by using Heron’s formula

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 18

Page 19: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Experiments - Results on Tritype (2)

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 19

Page 20: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Experiments - Results on Tritype (3)

ProgramLocFaults BugAssist

P L P L= 0 ≤ 1 ≤ 2 ≤ 3

TritypeV7 0, 722s 0, 051s 0, 112s 0, 119s 0, 144s 0, 140s 20, 373sTritypeV8 0, 731s 0, 08s 0, 143s 0, 156s 0, 162s 0, 216s 25, 562s

Computation times for non linear Trityp programs

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 20

Page 21: Error localization

Dra

ft

Problem Motivating example Experiments Conclusion

Conclusion and Discussion

• Flow-based and incremental approach of LOCFAULTSis agood way to help the programmer with bug hunting since itlocates the errors around the path of t he counter-example

• Constraint-based framework is well adapted for handlingarithmetic operations and it can be extended instraightforward way for handling programs withfloating-point numbers computations

Réunion VACSIM - Cachan Octobre 2014 Verifying FP-programs Michel Rueher 21