automated fixing of programs with contracts.pptx
TRANSCRIPT
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
1/30
MIDHUN
MOHAN S7
ROLL NO
Automated Fixing of Programswith ontra!ts
"
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
2/30
OUTLINE
#
IntroductionBackgroundPreliminariesHow Auto Fix WorksExperimental results.Coclusion
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
3/30
INTRODUCTION
$
A programmer always faces two c allenges !.Finding faults ".Correcting t em
• %Is a tec ni#ue and supportingtool
• t t at can generate correction forfaults faults of general purposesoftware
• completely automatically.
What isAutofix
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
4/30
A$%&FI' I( AC%I&(..
A dou)ly*linked list implementing %W&+WA,+-& %E/+-E% &
'
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
5/30
-ome features of class %W&+WA,+-& %E/+-E% &
(
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
6/30
Continues0
)
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
7/30
Correction of t e error in 1mo2e+item3automatically generated )y AutoFix &
7
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
8/30
P E4I5I(A IE-
*
Contracts
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
9/30
How Auto Fix Works666
+
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
10/30
",
Auto Fix starts wit a set of test cases t at expose a specific f
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
11/30
Candidate fixes...
""
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
12/30
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
13/30
"$
collection of predicates t at all old at passing in2ariant *>Failing in2ariant
Passing In2ariant 7 8? l:7Collection of predicates t at oldin all passing test.Failing In2ariant 78@ l:7 collection of predicates t at old in allfailing tests .
In2ariant Analysis
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
14/30
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
15/30
Fault 4ocali ation
"(
% e goal of t e fault locali ation p ase is todetermine w ic snaps ots in snap8%: are relia)lec aracteri ations of t e reasons for t e faultunder analysis
% e static analysis performed )y
Auto Fix is )ased on simple measures of proximityand similarity
Control dependence
Expression dependence
-tatic Analysis
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
16/30
C&(% &4
/EPE(/E(CE E'P E--I&(
/EPE(/E(CE
")
Auto Fix uses controldependence torank locations 8insnaps ots: according toproximity to t e
location of failure .
Auto Fix usesexpressiondependence to rankexpressions 8insnaps ots: accordingto similarity to t econtract clause2iolated in a failure
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
17/30
"7
It is used to determine w ic locations are likely to ost t e cause
of failure.• /ynamic score dyn 8l9p92: measure ow often it appears in failing runs
as opposed to passing runs.
• Principle for computing t e dynamic score7 li 8l9p92: t if li loc 8t:9 l;li and 2;Dp
t•
For e2ery test t9 t ere is 8t: descri)es t=s contri)ution to t edynamic score8l9p92:.
• 4arge 8t: implies 8l9p92: is a source of error if t is a failing testcases.
/ynamic Analysis
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
18/30
meets t e following re#uirements
"*
If t ere is at least onefailing test case9t e o2erall score
assigned to8l9p92:must)e positi2e
% e magnitude of eacfailing test case=s
contri)ution 8t: to t edynamic score assigned
to8l9p92:decreases asmore failing test casesfor t at snap s ots are
a2aila)le
% e e2idencepro2ided )y onefailing test casealone is stronger
t an t e e2idencepro2ided )y onepassing test case
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
19/30
"+
AutoFix com)ines t e2arious metrics8staticand dynamic: into ano2erall score
susp8l9p92:
&2erall score
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
20/30
Fix Action -ynt esis
#,
AutoFix tries to )uild fixing actions 8snippets ofinstructions: t at modify t e 2alue of p at l so t att e execution can opefully continue wit outtriggering t e fault &
Find an action snip t at satisfies t e specification re#uire p ; 2 do snip ensure p G 2 end• Auto fix uses " strategies for generating fixing
actions
-etting 7 5odifying t e 2alue of 2aria)les oro) ects t roug assignments or routine calls eplacement7 5odifying t e 2alue of expression
directly w ere t ey are used in t e program
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
21/30
-.
try to modify t e program state )y calling routines on t e current or ot er o) ects &
#"
Be a2ioral 5odels
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
22/30
Candidate Fix eneration
##
For a gi2en snap s ot 8l9p92:9 In ecting any fixactions at location < gi2es a modified program t atis a candidate fixWe in ect fix actions in two p ases
Fix sc ema7A template t at a)stracts commoninstruction patterns -c ema Instantiation7 we instantiate t e fixsc ema wit t e snaps ot=s predicate p and somefixing action it induces
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
23/30
Fix 2alidation
#$
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
24/30
Fix anking
#'
% e AutoFix algorit m often finds se2eral 2alidfixes for a gi2en fault.
It is programmer=s responsi)ility to select w icone to deploy
AutoFix ranks t e 2alid fixes according to t e1suspiciousness3 score susp8l9p92: of t e snaps ot8l9p92: t at determined eac fix &
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
25/30
Experimental E2aluation
#(
It addresses t e following #uestions
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
26/30
Experimental setup
#)
Experimental su) ects 7 % e experiments targeted J code )ases
Base7 Is a data structure.
%xt4i) 7 Is a li)rary to manipulate textdocumentsCards7Is an on*line card gaming systemE*4earn7 Is an application supporting e*learning.
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
27/30
Kc7no of classes9Kk4&C7t ousands of lines codes9K 7no ofroutines99KL7)oolean #ueries9Kpre7no of cotract clause in preconditions9Kpost7post conditions and class in2ariants8Kin2:
#7
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
28/30
Experimental results
#*
Auto Fix produced2alid fixes forMN8J"O: of " Jfaults
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
29/30
&t er results..
#+
Auto /x 0rodu!ed 1a.id /xes in'
-
8/17/2019 Automated Fixing of Programs with Contracts.pptx
30/30
conclusion
$
Auto fix is an important contri)ution towards t eideal of automatic de)uggingAutoFix generated fixes for J" percent of t efaults.running on standard ardware9 it re#uired ana2erage time per fix under " minutesContracts plays an immediate role.Wit AutoFix9 t e programmer=s de)ugging effortcould )e reduced to almost ero in many cases