SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
Draft
Constraint-Based Fault-Localization
Michel RUEHER
joined work with
Mohammed Bekkouche and Hélène Collavizza
University of Nice Sophia-Antipolis I3S – CNRS
France
INFORMS Computing Society Conference 2015
Sunday, January 11th, 2015
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Plan
1 Problem statement & Motivating example
2 Formalization & Algorithms
3 Experiments
4 Related Work & Conclusion
ICS 2015 CP-Based Fault-Localization Michel Rueher 2
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Problem statement & Motivating example
ICS 2015 CP-Based Fault-Localization Michel Rueher 3
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Context: program verification / debugging
Input An imperative program with numeric statements (over
integers or floating-point numbers)
An assertion to be checked
A counterexample that violates the assertion
Output Information on locations of potentially faulty statements
ICS 2015 CP-Based Fault-Localization Michel Rueher 4
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Fault-Localization – a major problem
• Model checking, testing
→ Generation of counterexamples:
• Input data & wrong outputs (testing)
• Input data & violated post condition / property
→ Execution trace
• Problems
• Execution trace: often lengthy and difficult to understand
• Difficult to locate the faulty statements
Debugging ⇒ difficult and time consuming
ICS 2015 CP-Based Fault-Localization Michel Rueher 5
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Fault-Localization – Key issues
• What paths to analyse ?
• Path from the counterexample
• Deviations from the path from the counterexample
• How to identify the suspicious program statements
• Computing Maximal sets of statements satisfying the
postcondition → Maximal Satisfiable Subset
• Computing Minimal sets of statements to withdraw
→ Minimal Correction Set ?
ICS 2015 CP-Based Fault-Localization Michel Rueher 6
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Example
AbsMinus.java
1 class AbsMinus {
2 / * returns | i−j | , the absolute value of i minus j * /
3 / *@ requires ( i ==0) && ( j ==1) ;
4 @ ensures ( r ==1) ;
5 @* /
6 int AbsMinusKO ( int i , int j ) {
7 int r ;
8 int k = 0;
9 i f ( i <= j ) {
10 k = k+2; / / error in assignement k = k+2 instead of k = k+1
11 }
12 i f ( k == 1 && i != j ) {
13 r = j−i ;
14 }
15 else {
16 r = i−j ;
17 }
18 return r ;
19 }
20 }
An error has been introduced in line 10
→ for the input data {i = 0, j = 1}, r =−1
ICS 2015 CP-Based Fault-Localization Michel Rueher 7
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Example (cont.)
CFG of AbsMinus Faulty path for {i = 0, j = 1}
→ suspicious statement: {r = i - j}
ICS 2015 CP-Based Fault-Localization Michel Rueher 8
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Example (cont.)
Change decision for 1st IF Change decision fort 2d IF
Post-condition is violated Post-condition holds
→ Path diversion Rejected → suspicious statements:
{cond. of 2d IF}, {k=0}, { k = k+2}
ICS 2015 CP-Based Fault-Localization Michel Rueher 9
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Proposed approach
• Explore the path of the counter-example and paths with at
most k deviations
• Compute sets with at most bmc suspicious statements
Bounds k and bmc are mandatory
because there are an
exponential number
of paths and sets of suspicious statements
ICS 2015 CP-Based Fault-Localization Michel Rueher 10
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Formalization & Algorithms
ICS 2015 CP-Based Fault-Localization Michel Rueher 11
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Defining suspicious statements
Aim: Provide helpful information for error localization on
numeric constraint systems:
ICS 2015 CP-Based Fault-Localization Michel Rueher 12
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Computing all MCS : CAMUS (Liffiton &
Sakallah-2007
ICS 2015 CP-Based Fault-Localization Michel Rueher 13
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
LocFaults – Overall scheme
1 Building of the CFG of a program in DSA form
2 Translating the program and its specification in a set of
numerical constraints
3 Computing bounded MCS of:
• C = CE ∪ PATH ∪ POST
CE: the counter-example
PATH : constraints of the path of CE or of a diverted path
POST: constraints of the post condition
• C = CE ∪ PATH’ ∪ POST where PATH’ is a path with at
most k deviations from the CE
→ MCS on paths “closely” related to the CE
ICS 2015 CP-Based Fault-Localization Michel Rueher 14
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
LocFaults – Computing diverted paths
Process for k = 1
1 Decision for 1st conditional statement is switched and
the input data of CE are propagated → new path P’
Iff the CSP of P’ is satisfiable, MCS are computed for P’
2 The process is restarted and the decision of the next
conditional statement of P is switched (only one
decision is changed on the whole path)
Process for k > 1
• A conditional node n is marked with the number of
successful switches done on the current path before
reaching n
• At step l, decision for a node marked l is only diverted
iff I < l
ICS 2015 CP-Based Fault-Localization Michel Rueher 15
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
LocFaults – Computing MCS for diverted paths
• Let be :
• P, a path generated by the propagation of CE and by k
decision switches of conditional statements
cond1, .., condk
• C, the constraints of P, and Ck, the constraints generated
by the assignments occurring before condk along Pk
If C ∪ POST holds:
• {¬cond1, .., ¬condk} is a potential correction,
• The MCS of Ck ∪ {¬cond1, .., ¬condk} are potential
corrections
Note: {¬cond1, .., ¬condk } is a ”hard” constraint
ICS 2015 CP-Based Fault-Localization Michel Rueher 16
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Computing MCS for diverted paths – Example
CE: {i = 0, j = 1}
cond1 : ¬(k1 = 1 & i = j)
Pk: path in blue
Ck ∪ ¬cond1 : k0 = 0 ∧ k1 = k0 + 2 ∧
¬((k1 = 1 & i = j))
Potential corrections:
{k0 = 0}, {k = k + 2}, {k = 1 & i = j}
ICS 2015 CP-Based Fault-Localization Michel Rueher 17
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Experiments
ICS 2015 CP-Based Fault-Localization Michel Rueher 18
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Experiments - Systems and tools
• LocFaults:
→ CPBPV (Constraint-Programming Framework for Bounded
Program Verification) to generate the CFG and CE
→ CP solver of IBM ILOG CPLEX
• BugAssist (Rupak Majumdar and Manu Jose):
→ CBMC
→ MaxSAT solver MSUnCore2
ICS 2015 CP-Based Fault-Localization Michel Rueher 19
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Experiments - Benchmarks
• TCAS :
• Aircraft collision avoidance system
• 173 lines of C code with almost no arithmetic operations
• The suite contains 41 faulty versions
• Tritype
Input: three positive integers, the triangle sides
Output:
• value 2 if the inputs correspond to an isosceles triangle
• value 3 if the inputs correspond to an equilateral triangle
• value 1 if the inputs correspond to a scalene triangle
• value 4 otherwise.
ICS 2015 CP-Based Fault-Localization Michel Rueher 20
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Experiments - Results on TCAS suite
• Computation times: no significant difference
• At most one deviation required except for version V41 ( 2
deviations required)
• Size of the set of suspicious instructions identified : in
general larger for BUGASSIST than for LOCFAULTS
• BUGASSIST identifies a bit more errors than
LOCFAULTS
• LOCFAULTS reports a set of MCS for each faulty path
→ error localization process is much more easier than with the
single set of suspicious errors reported by BUGASSIST
ICS 2015 CP-Based Fault-Localization Michel Rueher 21
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Experiments - Error on Tritype
• TritypeV1 : error in the last assignment of the program
• TritypeV2 : error in a nested condition, just before the last
assignment
• TritypeV3 : the error is an assignment and will entail a bad
branching
• TritypeV4: error in condition, at the beginning of the
program
• TritypeV5 : two wrong conditions in this program
• TritypeV6 : a variation that returns the perimeter of the
triangle
• TritypeV7 : a variation that returns the product of the 3
sides
• TritypeV8 : a variation that computes the square of the
surface of the triangle by using Heron’s formula
ICS 2015 CP-Based Fault-Localization Michel Rueher 22
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Experiments - Results on Tritype (cont.)
P CE E
LocFaults
BugAssist
0 1 2 3
V1 {i = 2, j = 3, 54 {54}
{26}
{29, 32}
/
{26, 27, 32,
{48},{30},{25}
{53, 57},{30}, 33, 36, 48,
k = 2} {25} 57, 68}
V2 {i = 2, j = 2, 53 {54}
{21}
{29, 57}
/
{21, 26, 27,
{26}
{32, 44}
29, 30, 32,
{35},{27},{25}
33, 35, 36,
k = 4}
{53},{27},{25}
33, 35, 36,
53, 68}
V3 {i = 1, j = 2, 31 {50}
{21}
{33, 45} /
{21, 26, 27,
{26}
29, 31, 33,
{29}
34, 36, 37,
k = 1} {36},{31},{25}
49, 68}
{49},{31},{25}
V4 {i = 2, j = 3, 45 {46} {45},{33},{25} {26, 32}
{32, 35, 49}
{26, 27, 29,
{32, 35, 53}
30, 32, 33,
{32, 35, 57}
35, 45, 49,
k = 3} 68}
V5 {i = 2, j = 3, 32, {40}
{26}
{32, 45}
/
{26, 27, 29,
{29}
{35, 49},{25}
30, 32, 33,
{35, 53},{25}
35, 49, 68}
k = 3} 45 {35, 57},{25}
V6 {i = 2, j = 1, 58 {58}
{31}
/ /
{28, 29, 31,
{37},{32},{27}
32, 35, 37,
k = 2} 65, 72}
Suspicious statements on Tritype V1 – V7
ICS 2015 CP-Based Fault-Localization Michel Rueher 23
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Experiments - Results on Tritype (cont.)
P CE E
LocFaults
BugAssist
0 1
V7 {i = 2, j = 1, 58 {58}
{31}
{72, 37, 53,
{37},{27},{32}
49, 29, 35,
32, 31, 28,
k = 2} 65, 34, 62}
V8 {i = 3, j = 4, 61 {61}
{29}
{19,61,79,
{35},{30},{25}
35, 27, 33,
30, 42, 29,
26, 71, 32,
k = 3} 48, 51, 54}
Suspicious statements on Tritype V8 – V9
ICS 2015 CP-Based Fault-Localization Michel Rueher 24
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Experiments - Results on Tritype (cont.)
Program
LocFaults BugAssist
P
L
P L
= 0 ≤ 1 ≤ 2 ≤ 3
TritypeV7 0, 722s 0, 051s 0, 112s 0, 119s 0, 144s 0, 140s 20, 373s
TritypeV8 0, 731s 0, 08s 0, 143s 0, 156s 0, 162s 0, 216s 25, 562s
Computation times for non linear Trityp programs (V8 – V9)
ICS 2015 CP-Based Fault-Localization Michel Rueher 25
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Related Work & Conclusion
ICS 2015 CP-Based Fault-Localization Michel Rueher 26
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Related Work
• BugAssist:
+ Global approach based on MaxSat
- Merges the complement of MaxSat in a single set of
suspicious statements
- Not efficient for programs with numeric statements
• System based on ranking of suspicious statements
(Tarantula, Ochiai, AMPLE Debugging JUnit Tests in
Eclipse, Jaccard,...)
+ Easy to implement
- Require a huge number of test case and an accurate
Oracle
ICS 2015 CP-Based Fault-Localization Michel Rueher 27
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Conclusion
• Flow-based and incremental approach
→ locates the errors around the path of the
counter-example
• Constraint-based framework
→ well adapted for handling arithmetic operations
→ can be extended in straightforward way for handling
programs with floating-point numbers computations
ICS 2015 CP-Based Fault-Localization Michel Rueher 28
Draft
Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion
Further Work: Improving constraint solving
process
• Adding redundant constraints
res = s*(s-i)*(s-j);
→ res ≥ s, res ≥ (s-i), res ≥ (s-j)
• Combining symbolic simplification with CSP filtering
techniques
res = s*(s-i)*(s-j)*(s-i);
→ identifying the square expression
ICS 2015 CP-Based Fault-Localization Michel Rueher 29

Contenu connexe

Similaire à Constraint-Based Fault-Localization

Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Enkitec
 
Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0
PMILebanonChapter
 
Mumbai University M.E computer engg syllabus
Mumbai University M.E computer engg syllabusMumbai University M.E computer engg syllabus
Mumbai University M.E computer engg syllabus
Shini Saji
 
Cross-Project Build Co-change Prediction
Cross-Project Build Co-change PredictionCross-Project Build Co-change Prediction
Cross-Project Build Co-change Prediction
Shane McIntosh
 
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to PracticeWorkflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Frederic Desprez
 
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Carlos Sierra
 

Similaire à Constraint-Based Fault-Localization (20)

Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
Understanding how is that adaptive cursor sharing (acs) produces multiple opt...
 
Automated Program Repair, Distinguished lecture at MPI-SWS
Automated Program Repair, Distinguished lecture at MPI-SWSAutomated Program Repair, Distinguished lecture at MPI-SWS
Automated Program Repair, Distinguished lecture at MPI-SWS
 
Advanced Econometrics L13-14.pptx
Advanced Econometrics L13-14.pptxAdvanced Econometrics L13-14.pptx
Advanced Econometrics L13-14.pptx
 
APSEC2020 Keynote
APSEC2020 KeynoteAPSEC2020 Keynote
APSEC2020 Keynote
 
Metrics
MetricsMetrics
Metrics
 
Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0Monte Carlo Simulation for project estimates v1.0
Monte Carlo Simulation for project estimates v1.0
 
Mumbai University M.E computer engg syllabus
Mumbai University M.E computer engg syllabusMumbai University M.E computer engg syllabus
Mumbai University M.E computer engg syllabus
 
talk1
talk1talk1
talk1
 
A process to improve the accuracy of mk ii fp to cosmic charles symons
A process to improve the accuracy of mk ii fp to cosmic    charles symonsA process to improve the accuracy of mk ii fp to cosmic    charles symons
A process to improve the accuracy of mk ii fp to cosmic charles symons
 
Scientific calculator project in c language
Scientific calculator project in c languageScientific calculator project in c language
Scientific calculator project in c language
 
LP.ppt
LP.pptLP.ppt
LP.ppt
 
Cross-Project Build Co-change Prediction
Cross-Project Build Co-change PredictionCross-Project Build Co-change Prediction
Cross-Project Build Co-change Prediction
 
Survey on Software Defect Prediction
Survey on Software Defect PredictionSurvey on Software Defect Prediction
Survey on Software Defect Prediction
 
Survey on Software Defect Prediction
Survey on Software Defect PredictionSurvey on Software Defect Prediction
Survey on Software Defect Prediction
 
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to PracticeWorkflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
 
Automated Program Repair Keynote talk
Automated Program Repair Keynote talkAutomated Program Repair Keynote talk
Automated Program Repair Keynote talk
 
SAST, fight against potential vulnerabilities
SAST, fight against potential vulnerabilitiesSAST, fight against potential vulnerabilities
SAST, fight against potential vulnerabilities
 
Survey on Software Defect Prediction (PhD Qualifying Examination Presentation)
Survey on Software Defect Prediction (PhD Qualifying Examination Presentation)Survey on Software Defect Prediction (PhD Qualifying Examination Presentation)
Survey on Software Defect Prediction (PhD Qualifying Examination Presentation)
 
SSBSE 2020 keynote
SSBSE 2020 keynoteSSBSE 2020 keynote
SSBSE 2020 keynote
 
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
Understanding How is that Adaptive Cursor Sharing (ACS) produces multiple Opt...
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Constraint-Based Fault-Localization

  • 1. Draft Constraint-Based Fault-Localization Michel RUEHER joined work with Mohammed Bekkouche and Hélène Collavizza University of Nice Sophia-Antipolis I3S – CNRS France INFORMS Computing Society Conference 2015 Sunday, January 11th, 2015
  • 2. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Plan 1 Problem statement & Motivating example 2 Formalization & Algorithms 3 Experiments 4 Related Work & Conclusion ICS 2015 CP-Based Fault-Localization Michel Rueher 2
  • 3. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Problem statement & Motivating example ICS 2015 CP-Based Fault-Localization Michel Rueher 3
  • 4. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Context: program verification / debugging Input An imperative program with numeric statements (over integers or floating-point numbers) An assertion to be checked A counterexample that violates the assertion Output Information on locations of potentially faulty statements ICS 2015 CP-Based Fault-Localization Michel Rueher 4
  • 5. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Fault-Localization – a major problem • Model checking, testing → Generation of counterexamples: • Input data & wrong outputs (testing) • Input data & violated post condition / property → Execution trace • Problems • Execution trace: often lengthy and difficult to understand • Difficult to locate the faulty statements Debugging ⇒ difficult and time consuming ICS 2015 CP-Based Fault-Localization Michel Rueher 5
  • 6. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Fault-Localization – Key issues • What paths to analyse ? • Path from the counterexample • Deviations from the path from the counterexample • How to identify the suspicious program statements • Computing Maximal sets of statements satisfying the postcondition → Maximal Satisfiable Subset • Computing Minimal sets of statements to withdraw → Minimal Correction Set ? ICS 2015 CP-Based Fault-Localization Michel Rueher 6
  • 7. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Example AbsMinus.java 1 class AbsMinus { 2 / * returns | i−j | , the absolute value of i minus j * / 3 / *@ requires ( i ==0) && ( j ==1) ; 4 @ ensures ( r ==1) ; 5 @* / 6 int AbsMinusKO ( int i , int j ) { 7 int r ; 8 int k = 0; 9 i f ( i <= j ) { 10 k = k+2; / / error in assignement k = k+2 instead of k = k+1 11 } 12 i f ( k == 1 && i != j ) { 13 r = j−i ; 14 } 15 else { 16 r = i−j ; 17 } 18 return r ; 19 } 20 } An error has been introduced in line 10 → for the input data {i = 0, j = 1}, r =−1 ICS 2015 CP-Based Fault-Localization Michel Rueher 7
  • 8. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Example (cont.) CFG of AbsMinus Faulty path for {i = 0, j = 1} → suspicious statement: {r = i - j} ICS 2015 CP-Based Fault-Localization Michel Rueher 8
  • 9. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Example (cont.) Change decision for 1st IF Change decision fort 2d IF Post-condition is violated Post-condition holds → Path diversion Rejected → suspicious statements: {cond. of 2d IF}, {k=0}, { k = k+2} ICS 2015 CP-Based Fault-Localization Michel Rueher 9
  • 10. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Proposed approach • Explore the path of the counter-example and paths with at most k deviations • Compute sets with at most bmc suspicious statements Bounds k and bmc are mandatory because there are an exponential number of paths and sets of suspicious statements ICS 2015 CP-Based Fault-Localization Michel Rueher 10
  • 11. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Formalization & Algorithms ICS 2015 CP-Based Fault-Localization Michel Rueher 11
  • 12. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Defining suspicious statements Aim: Provide helpful information for error localization on numeric constraint systems: ICS 2015 CP-Based Fault-Localization Michel Rueher 12
  • 13. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Computing all MCS : CAMUS (Liffiton & Sakallah-2007 ICS 2015 CP-Based Fault-Localization Michel Rueher 13
  • 14. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion LocFaults – Overall scheme 1 Building of the CFG of a program in DSA form 2 Translating the program and its specification in a set of numerical constraints 3 Computing bounded MCS of: • C = CE ∪ PATH ∪ POST CE: the counter-example PATH : constraints of the path of CE or of a diverted path POST: constraints of the post condition • C = CE ∪ PATH’ ∪ POST where PATH’ is a path with at most k deviations from the CE → MCS on paths “closely” related to the CE ICS 2015 CP-Based Fault-Localization Michel Rueher 14
  • 15. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion LocFaults – Computing diverted paths Process for k = 1 1 Decision for 1st conditional statement is switched and the input data of CE are propagated → new path P’ Iff the CSP of P’ is satisfiable, MCS are computed for P’ 2 The process is restarted and the decision of the next conditional statement of P is switched (only one decision is changed on the whole path) Process for k > 1 • A conditional node n is marked with the number of successful switches done on the current path before reaching n • At step l, decision for a node marked l is only diverted iff I < l ICS 2015 CP-Based Fault-Localization Michel Rueher 15
  • 16. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion LocFaults – Computing MCS for diverted paths • Let be : • P, a path generated by the propagation of CE and by k decision switches of conditional statements cond1, .., condk • C, the constraints of P, and Ck, the constraints generated by the assignments occurring before condk along Pk If C ∪ POST holds: • {¬cond1, .., ¬condk} is a potential correction, • The MCS of Ck ∪ {¬cond1, .., ¬condk} are potential corrections Note: {¬cond1, .., ¬condk } is a ”hard” constraint ICS 2015 CP-Based Fault-Localization Michel Rueher 16
  • 17. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Computing MCS for diverted paths – Example CE: {i = 0, j = 1} cond1 : ¬(k1 = 1 & i = j) Pk: path in blue Ck ∪ ¬cond1 : k0 = 0 ∧ k1 = k0 + 2 ∧ ¬((k1 = 1 & i = j)) Potential corrections: {k0 = 0}, {k = k + 2}, {k = 1 & i = j} ICS 2015 CP-Based Fault-Localization Michel Rueher 17
  • 18. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Experiments ICS 2015 CP-Based Fault-Localization Michel Rueher 18
  • 19. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Experiments - Systems and tools • LocFaults: → CPBPV (Constraint-Programming Framework for Bounded Program Verification) to generate the CFG and CE → CP solver of IBM ILOG CPLEX • BugAssist (Rupak Majumdar and Manu Jose): → CBMC → MaxSAT solver MSUnCore2 ICS 2015 CP-Based Fault-Localization Michel Rueher 19
  • 20. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Experiments - Benchmarks • TCAS : • Aircraft collision avoidance system • 173 lines of C code with almost no arithmetic operations • The suite contains 41 faulty versions • Tritype Input: three positive integers, the triangle sides Output: • value 2 if the inputs correspond to an isosceles triangle • value 3 if the inputs correspond to an equilateral triangle • value 1 if the inputs correspond to a scalene triangle • value 4 otherwise. ICS 2015 CP-Based Fault-Localization Michel Rueher 20
  • 21. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Experiments - Results on TCAS suite • Computation times: no significant difference • At most one deviation required except for version V41 ( 2 deviations required) • Size of the set of suspicious instructions identified : in general larger for BUGASSIST than for LOCFAULTS • BUGASSIST identifies a bit more errors than LOCFAULTS • LOCFAULTS reports a set of MCS for each faulty path → error localization process is much more easier than with the single set of suspicious errors reported by BUGASSIST ICS 2015 CP-Based Fault-Localization Michel Rueher 21
  • 22. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Experiments - Error on Tritype • TritypeV1 : error in the last assignment of the program • TritypeV2 : error in a nested condition, just before the last assignment • TritypeV3 : the error is an assignment and will entail a bad branching • TritypeV4: error in condition, at the beginning of the program • TritypeV5 : two wrong conditions in this program • TritypeV6 : a variation that returns the perimeter of the triangle • TritypeV7 : a variation that returns the product of the 3 sides • TritypeV8 : a variation that computes the square of the surface of the triangle by using Heron’s formula ICS 2015 CP-Based Fault-Localization Michel Rueher 22
  • 23. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Experiments - Results on Tritype (cont.) P CE E LocFaults BugAssist 0 1 2 3 V1 {i = 2, j = 3, 54 {54} {26} {29, 32} / {26, 27, 32, {48},{30},{25} {53, 57},{30}, 33, 36, 48, k = 2} {25} 57, 68} V2 {i = 2, j = 2, 53 {54} {21} {29, 57} / {21, 26, 27, {26} {32, 44} 29, 30, 32, {35},{27},{25} 33, 35, 36, k = 4} {53},{27},{25} 33, 35, 36, 53, 68} V3 {i = 1, j = 2, 31 {50} {21} {33, 45} / {21, 26, 27, {26} 29, 31, 33, {29} 34, 36, 37, k = 1} {36},{31},{25} 49, 68} {49},{31},{25} V4 {i = 2, j = 3, 45 {46} {45},{33},{25} {26, 32} {32, 35, 49} {26, 27, 29, {32, 35, 53} 30, 32, 33, {32, 35, 57} 35, 45, 49, k = 3} 68} V5 {i = 2, j = 3, 32, {40} {26} {32, 45} / {26, 27, 29, {29} {35, 49},{25} 30, 32, 33, {35, 53},{25} 35, 49, 68} k = 3} 45 {35, 57},{25} V6 {i = 2, j = 1, 58 {58} {31} / / {28, 29, 31, {37},{32},{27} 32, 35, 37, k = 2} 65, 72} Suspicious statements on Tritype V1 – V7 ICS 2015 CP-Based Fault-Localization Michel Rueher 23
  • 24. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Experiments - Results on Tritype (cont.) P CE E LocFaults BugAssist 0 1 V7 {i = 2, j = 1, 58 {58} {31} {72, 37, 53, {37},{27},{32} 49, 29, 35, 32, 31, 28, k = 2} 65, 34, 62} V8 {i = 3, j = 4, 61 {61} {29} {19,61,79, {35},{30},{25} 35, 27, 33, 30, 42, 29, 26, 71, 32, k = 3} 48, 51, 54} Suspicious statements on Tritype V8 – V9 ICS 2015 CP-Based Fault-Localization Michel Rueher 24
  • 25. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Experiments - Results on Tritype (cont.) Program LocFaults BugAssist P L P L = 0 ≤ 1 ≤ 2 ≤ 3 TritypeV7 0, 722s 0, 051s 0, 112s 0, 119s 0, 144s 0, 140s 20, 373s TritypeV8 0, 731s 0, 08s 0, 143s 0, 156s 0, 162s 0, 216s 25, 562s Computation times for non linear Trityp programs (V8 – V9) ICS 2015 CP-Based Fault-Localization Michel Rueher 25
  • 26. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Related Work & Conclusion ICS 2015 CP-Based Fault-Localization Michel Rueher 26
  • 27. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Related Work • BugAssist: + Global approach based on MaxSat - Merges the complement of MaxSat in a single set of suspicious statements - Not efficient for programs with numeric statements • System based on ranking of suspicious statements (Tarantula, Ochiai, AMPLE Debugging JUnit Tests in Eclipse, Jaccard,...) + Easy to implement - Require a huge number of test case and an accurate Oracle ICS 2015 CP-Based Fault-Localization Michel Rueher 27
  • 28. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Conclusion • Flow-based and incremental approach → locates the errors around the path of the counter-example • Constraint-based framework → well adapted for handling arithmetic operations → can be extended in straightforward way for handling programs with floating-point numbers computations ICS 2015 CP-Based Fault-Localization Michel Rueher 28
  • 29. Draft Problem statement & Motivating example Formalization & Algorithms Experiments Related Work & Conclusion Further Work: Improving constraint solving process • Adding redundant constraints res = s*(s-i)*(s-j); → res ≥ s, res ≥ (s-i), res ≥ (s-j) • Combining symbolic simplification with CSP filtering techniques res = s*(s-i)*(s-j)*(s-i); → identifying the square expression ICS 2015 CP-Based Fault-Localization Michel Rueher 29