Automated Program Repair Opportunities, Challenges, Advances Chris - - PowerPoint PPT Presentation

automated program repair
SMART_READER_LITE
LIVE PREVIEW

Automated Program Repair Opportunities, Challenges, Advances Chris - - PowerPoint PPT Presentation

Automated Program Repair Opportunities, Challenges, Advances Chris Timperley 1 About me... Research Interests: Postdoc Carnegie Mellon University, USA Automated Program Repair w/ Claire Le Goues Fault Localisation GI for


slide-1
SLIDE 1

Automated Program Repair

Opportunities, Challenges, Advances

1

Chris Timperley

slide-2
SLIDE 2

2

Research Interests:

  • Automated Program Repair
  • Fault Localisation
  • GI for Robotics
  • Automated Test Generation

Recent Projects:

  • BugZoo: reproducible studies of

historical bugs

  • Rooibos: language-independent,

syntax-aware search and transformation.

  • Houston: automated testing for

robotics

Postdoc Carnegie Mellon University, USA w/ Claire Le Goues MEng (2013), PhD (2017) University of York, UK w/ Susan Stepney

ctimperley@cmu.edu

About me...

slide-3
SLIDE 3

Purpose of Talk: Challenge existing views, and identify opportunities.

3

slide-4
SLIDE 4

4

slide-5
SLIDE 5

5

2008

Genetic Programming to modify existing programs, rather than building them from scratch. Demonstrates concept of automated program repair.

Evolutionary repair of faulty software. Andrea Arcuri. 2011. Applied Soft Computing 11, 4 (June 2011), 3494-3514.

slide-6
SLIDE 6

6

2009

GenProg demonstrates program repair on real-world C programs

Automatically Finding Patches Using Genetic Programming. Westley Weimer, ThanVu Nguyen, Claire Le Goues, Stephanie Forrest. Proceedings of International Conference on Software Engineering. ICSE ‘09. 2009.

slide-7
SLIDE 7

7

BUGGY CODE

Fault Localisation

LOCALISED CODE FIXED CODE

Patch Generation Program Analysis

2009–

slide-8
SLIDE 8

Where are the program repair bots?

8

Or, why aren’t we all filthy rich yet?

slide-9
SLIDE 9

9

How to Design a Program Repair Bot? Insights from the Repairnator Project. Simon Urli, Zhongxing Yu, Lionel Seinturier, and Martin Monperrus. Proceedings of the International Conference on Software Engineering . ICSE ‘18.

ICSE SEIP ‘18

they exist!

(note: we found out about them a few weeks ago)

slide-10
SLIDE 10

How do we deploy?

10

slide-11
SLIDE 11

What do developers need?

11

Easy Integration Timeliness Bug Information Patches

slide-12
SLIDE 12

The big assumption: The existence of tests

12

requires test cases

slide-13
SLIDE 13

Software engineering has changed since APR was introduced.

13

slide-14
SLIDE 14

14

slide-15
SLIDE 15

15

[ triggers CI build ] [ pushes results ]

slide-16
SLIDE 16

16

requires test cases

slide-17
SLIDE 17

17

slide-18
SLIDE 18

What are the challenges?

18

slide-19
SLIDE 19

Challenges

19

Patch Quality Scalability Expressiveness

slide-20
SLIDE 20

20 max = 0; if(a > b) max = a; if(b > a) max = b; max = a; if(a > b) max = a; if(b > a) max = b; CORRECT BUGGY max = 7; if(a > b) largest = a; if(b > a) largest = b; PLAUSIBLE

a b max 3 2 3 4 5 5 7 7 a b max 3 2 3 4 5 5 7 7 7 a b max 3 2 3 4 5 5 7 7 7

Challenges: Patch Quality

slide-21
SLIDE 21

Not all good patches are correct.

21

C O N T R O V E R S I A L

slide-22
SLIDE 22

22

“Bug reports also accompanied by [machine-generated] patches were three times as likely to be addressed as standard bug reports.” “In many cases the Kali patch cleanly identifies the exact functionality and location that the developer patch modifies” “The Kali and developer patches typically modify common functionality and variables.”

GPCE ‘06 ISSTA ‘15

slide-23
SLIDE 23

Correctness is a major challenge, but overfitted patches can still be useful.

23

slide-24
SLIDE 24

Challenges

24

Patch Quality Scalability Expressiveness

slide-25
SLIDE 25

Challenges: Expressiveness vs. Scalability

25

Expressiveness

Allows the program to be changed in a greater number of ways, increasing the odds of finding a modification that produces a repair.

  • larger corpus of fix ingredients
  • wider set of program transformations
  • granular modifications to the program
slide-26
SLIDE 26

Challenges: Expressiveness vs. Scalability

26

Time taken to discover a patch is a function of:

  • patch size
  • program size
  • expressiveness
  • ...

Scalability

slide-27
SLIDE 27

27

Scalability Expressiveness

slide-28
SLIDE 28

How can we make APR both scalable and expressive?

28

slide-29
SLIDE 29

Observation: APR inherited most of its technologies.

29

slide-30
SLIDE 30

30

Fault Localisation Patch Generation Program Analysis

compiler optimisation test suite prioritisation abstract syntax trees concolic execution specification mining ... genetic algorithms delta-debugging minimisation random search program synthesis metaprogramming mutation testing ...

Program Analysis Patch Generation

BUGGY CODE LOCALISED CODE FIXED CODE

slide-31
SLIDE 31

31

APPEND 12 3 SWAP 5 6 DELETE 4 Abstract Syntax Tree Patch Representation

slide-32
SLIDE 32

32

Fault Localisation Patch Generation Program Analysis

compiler optimisation test suite prioritisation abstract syntax trees concolic execution specification mining ... genetic algorithms delta-debugging minimisation random search program synthesis metaprogramming mutation testing ...

Program Analysis Patch Generation Fault Localisation

spectrum-based fault localisation BUGGY CODE LOCALISED CODE FIXED CODE

slide-33
SLIDE 33

Everyone is still using spectrum-based fault localisation!

  • 2017: ssFix, Repairnator, NOPOL, ...
  • 2016: History-Driven Program Repair, ...
  • 2015: Angelix, SearchRepair, ...
  • 2014: Astor, RSRepair, ...
  • 2013: SemFix, ...
  • 2011: AE, ...
  • ...
  • 2009: GenProg

33

slide-34
SLIDE 34

Recap: Spectra-Based Fault Localisation

34

int year, days; year = 1980; days = atoi(argv[1]); while (days > 365) { if (isLeapYear(year)){ if (days > 366) { days -= 366; year += 1; } else { } } else { days -= 365; year += 1; } } return year; int year, days; year = 1980; days = atoi(argv[1]); while (days > 365) { if (isLeapYear(year)){ if (days > 366) { days -= 366; year += 1; } else { } } else { days -= 365; year += 1; } } return year; int year, days; year = 1980; days = atoi(argv[1]); while (days > 365) { if (isLeapYear(year)){ if (days > 366) { days -= 366; year += 1; } else { } } else { days -= 365; year += 1; } } return year; int year, days; year = 1980; days = atoi(argv[1]); while (days > 365) { if (isLeapYear(year)){ if (days > 366) { days -= 366; year += 1; } else { } } else { days -= 365; year += 1; } } return year;

Passing Test #1 Failing Test #1 Passing Test #2 Passing Test #3

slide-35
SLIDE 35

35

Shin Yoo. 2012. Evolving human competitive spectra-based fault localisation techniques. In Proceedings of the 4th international conference on Search Based Software Engineering (SSBSE'12), Gordon Fraser and Jerffeson Teixeira de Souza (Eds.). Springer-Verlag, Berlin, Heidelberg, 244-258.

GenProg AMPLE Jaccard Ochiai Tarantula

slide-36
SLIDE 36

36

Assumption: several failing test cases (6 is optimal). Reality: usually one failing test. Takes > 12 hours to run GenProg and SearchRepair.

slide-37
SLIDE 37

Can we tailor fault localisation to CI-based program repair?

37

slide-38
SLIDE 38

38

time

slide-39
SLIDE 39

39

BugZoo