Skip to main content
Log in

Automated program repair using genetic programming and model checking

  • Published:
Applied Intelligence Aims and scope Submit manuscript

Abstract

Automated program repair is still a highly challenging problem mainly due to the reliance of the current techniques on test cases to validate candidate patches. This leads to the increasing unreliability of the final patches since test cases are partial specifications of the software. In the present paper, an automated program repair method is proposed by integrating genetic programming (GP) and model checking (MC). Due to its capabilities to verify the finite state systems, MC is employed as an appropriate criterion for evolving programs to calculate the fitness in GP. The application of MC for the fitness evaluation, which is novel in the context of program repair, addresses an important gap in the current heuristic approaches to the program repair. Being focused on fault detection based on the desired aspects, it enables the programmers to detect faults according to the definition of properties. Creating a general method, this characteristic can be effectively customized for different domains of application and the corresponding faults. Apart from various types of faults, the proposed method is capable of handling concurrency bugs which are not the case in many general repair methods. To evaluate the proposed method, it was implemented as a tool, named JBF, to repair Java programs. To meet the objectives of the study, some experiments were conducted in which certain programs with known bugs were automatically repaired by the JBF tool. The obtained results are encouraging and remarkably promising.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

Notes

  1. http://babelfish.arc.nasa.gov/trac/jpf

  2. http://cs.gmu.edu/eclab/projects/ecj/

  3. http://aws.amazon.com/ec2/instance-types/

References

  1. Ammann P, Offutt J (2008) Introduction to software testing. Cambridge University Press

  2. Wilkerson JL, Tauritz DR, Bridges JM (2012) Multi-objective coevolutionary automated software correction. In: Proceedings of the 14th annual conference on Genetic and evolutionary computation. ACM, pp 1229–1236

  3. Ballou MC (2008) Improving software quality to drive business agility. White paper, International Data Corporation

  4. Yin Z, Yuan D, Zhou Y, Pasupathy S, Bairavasundaram LN (2011) How do fixes become bugs?. In: Foundations of Software Engineering, pp 26–36

  5. Jeffrey DB (2009) Dynamic State Alteration Techniques for Automatically Locating Software Errors. Phd Thesis, University of California, Riverside

    Google Scholar 

  6. Kim D, Nam J, Song J, Kim S (2013) Automatic patch generation learned from human-written patches. In: proceedings of the International Conference on Software Engineering (ICSE ’13). IEEE Press, NJ, USA, pp 802–811

  7. Le Goues C (2013) Automatic program repair using genetic programming. PhD Thesis, University of Virginia

  8. Arcuri A, Yao X (2008) A novel co-evolutionary approach to automatic software bug fixing. In: IEEE Congress on Evolutionary Computation

  9. Forrest S, Weimer W, Nguyen T, Le Goues C (2009) A genetic programming approach to automated software repair. In: Genetic and Evolutionary Computation Conference (GECCO)

  10. Arcuri A (2008) On the automation of fixing software bugs. In: proceedings of the Doctoral Symposium of the IEEE International Conference on Software Engineering

  11. Weimer W, Nguyen T, Le Goues C, Forrest S (2009) Automatically finding patches using genetic programming. In: International Conference on Software Engineering

  12. Nguyen T, Weimer W, Le Goues C, Forrest S (2009) Using execution paths to evolve software patches. In: IEEE international conference on software testing, Verification, and Validation Workshops, pp 152–153

  13. Liu P, Zhang C (2012) Axis Automatically fixing atomicity violations through solving control constraints. In: International conference on software engineering, pp 299–309

  14. Dallmeier V, Zeller A, Meyer b. (2009) Generating fixes from object behavior anoMalies. In: IEEE Computer Society, pp 550–554

  15. Jin G, Song L, Zhang W, Lu S, Liblit B (2011) Automated atomicity-violation fixing. In: Proceedings of the 32nd ACM SIGPLAN conference on Programming language design and implementation (PLDI ’11). ACM, NY, USA, pp 389–400

  16. Perkins JH, Kim S, Larsen S, Amarasinghe S, Bachrach J, Carbin M, Pacheco C, Sherwood F, Sidiroglou S, Sullivan G, Wong W, Zibin Y, Ernst MD, Rinard M (2009) Automatically patching errors in deployed software. In: Proceedings of the ACM SIGOPS 22nd symposium on Operating systems principles (SOSP ’09). ACM, NY USA, pp 87–102

  17. Bradbury JS, Jalbert K (2010) Automatic repair of concurrency bugs. In: International Symposium on Search Based Software Engineering - Fast Abstracts, pp 1–2

  18. Staber S, Jobstmann B, Bloem R (2005) Finding and fixing faults. In: Conference on Correct Hardware Design and Verification Methods (CHARME), pp 35–49

  19. Dennis LA, Monroy R, Nogueira P (2006) Proof-directed debugging and repair. In: Seventh Symposium on Trends in Functional Programming, pp 131–140

  20. Demsky B, Ernst MD, Guo PJ, McCamant S, Perkins JH, Rinard M (2006) Inference and enforcement of data structure consistency specifications. In: International Symposium on Software Testing and Analysis, pp 233–244

  21. Deeprasertkul P, Bhattarakosol P, O’Brien F (2005) Automatic detection and correction of programming faults for software applications. J Syst Softw 78(2):101–110

    Article  Google Scholar 

  22. Le Goues C, Nguyen T, Forrest S, Weimer W (2012) Genprog a generic method for automatic software repair. IEEE Trans Softw Eng 38(1):54–72

    Article  Google Scholar 

  23. Le Goues C, Dewey-Vogt M, Forrest S, Weimer W (2012) A systematic study of automated program repair: fixing 55 out of 105 bugs for $8 each. In: Proceedings of the 34th International Conference on Software Engineering (ICSE ’12). IEEE Press, pp 3–13

  24. Babovic V, Keijzer M (2000) Genetic programming as a model induction engine. J Hydro Inf 2(1):35–60

    Google Scholar 

  25. Lin WY, Kuo IC (2004) A genetic selection algorithm for OLAP data cubes. Knowl Inf Syst 6(1):83–102

    Article  Google Scholar 

  26. Rodriguez-Vazquez K, Fleming PJ (2005) Evolution of mathematical models of chaotic systems based on multiobjective genetic programming. Knowl Inf Syst 8(2):235–256

    Article  Google Scholar 

  27. Visser W, Havelund K, Brat G, Park SJ, Lerda F (2003) Model checking programs. Autom Softw Eng J 10:2

    Google Scholar 

  28. Rice HG (1953) Classes of recursively enumerable sets and their decision problems. Trans Am Math Soc 74:358–366

    Article  MathSciNet  MATH  Google Scholar 

  29. Weimer W (2013) Advances in automated program repair and a call to arms. In: Proceedings of symposium on search based software engineering (SSBSE 2013), vol 8084, pp 1–3

  30. Koza JR (1989) Hierarchical genetic algorithms operation on populations of computer programs. In: Proceedings of the 11th International Joint Conference on Artificial Intelligence, pp 768–774

  31. Montana DJ (1995) Strongly typed genetic algorithm. Evol Comput 3(2):199–230

    Article  Google Scholar 

  32. Koza JR, Keane MA, Streeter MJ, Mydlowec W, Yu J, Lanza G (2003) Genetic programming IV Routine human-competitive machine intelligence. Kluwer Academic Publishers, Boston MA

    MATH  Google Scholar 

  33. Haynes TD, Schoenfeld DA, Wainwright RL (1996) Type inheritance in strongly typed genetic programming. In: Angeline PJ, Kinnear KE Jr. (eds) Advances in Genetic Programming. MIT Press Cambridge, MA, pp 359–375

  34. Ratle A, Sebag M (2001) Grammar-guided genetic programming and dimensional consistency: Application to non-parametric identification in mechanics. Appl Soft Comput 1(1):105– 118

    Article  Google Scholar 

  35. Clarke E, Filkorn T, Jha S (1993) Exploiting symmetry in temporal logic model checking. In: Proceedings of the Fifth International Conference for Computer-Aided Verification, vol 697. Lecture Notes in Computer Science

  36. Baier C, Katoen J (2008) Principles of model checking. MIT Press

  37. Leue S, Holzmann G (1999) V-promela: A visual, object-oriented language for Spin. In: 2nd IEEE International Symposium on Object-Oriented Real-Time Distributed Computing, (ISORC’99) Proceedings

  38. Pnueli A (1977) The temporal logic of programs. In: Proceedings of the 18th Annual Symposium on Foundations of Computer Science (FOCS), pp 46–57

  39. Emerson E, Sistla A (1993) Symmetry and model checking. In: CAV ’93: 5th International Conference on Computer Aided Verification, Vol. 697 of Lecture Notes in Computer Science

  40. Clarke E, Emerson E, Jha S, Sistla A (1998) Lect Notes Comput Sci

  41. Ip C, Dill D (1993) Better verification through symmetry. Inproceedings of the Eleventh International Symposium on Computer Hardware Description Languages and their Application, North Holland

  42. Cousot P, Cousot R (1977) Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Proceedings of the 4th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, pp 238–252

  43. Clarke E, Fujita M, Rajan S, Reps T, Shankar S, Teitelbaum T. (1999) Program slicing of hardware description languages. Technical Report CMU-CS-99-103, Carnegie Mellon University, School of Computer Science

  44. Hatcliff J, Corbett J, Dwyer M, Sokolowski S, Zheng H (1999) A Formal Study of Slicing for Multi-threaded Programs with JVM Concurrency Primitives. In: Proceedings on the 1999 International Symposium on Static Analysis, pp 1–18

  45. Millett LI, Teitelbaum T (1998) Slicing Promela and its Application to Model Checking, Simulation, and Protocol Understanding. In: Proceedings of the 4th International SPIN Workshop

  46. Savage S, Burrows M, Nelson G, Sobalvarro P (1997) Eraser a dynamic data race detector for multithreaded programs. ACM Trans Comput Syst 15(4):391–411

    Article  Google Scholar 

  47. Dennis LA (2006) Program slicing and middle-out reasoning for error location and repair. In: Disproving: Non-Theorems, Non-Validity and Non-Provability

  48. Stumptner M, Wotawa F Model-based program debugging and repair. In: Proceedings of the International Conference on Industrial and Engineering Application of Artificial Intelligence and Expert Systems

  49. Wang F, Cheng CH (2008) Program repair suggestions from graphical state-transition specifications. In: Proceedings of the International conference on Formal Techniques for Networked and Distributed Systems, pp 185–200

  50. Johnson CG (2007) Genetic programming with fitness based on model checking. In: EuroGP 2007, LNCS, vol 4445. Springer, pp 114--124

  51. Katz G, Peled D (2008) Genetic programming and model checking: Synthesizing new mutual exclusion algorithms. In: ATVA, Vol. 5311 of LNCS, pp 33–47

  52. Katz G, Peled D (2008) Model checking-based genetic programming with an application to mutual exclusion. In: TACAS, Vol. 4963 of LNCS, pp 141–156

  53. Katz G, Peled D (2010) Code mutation in verification and automatic code correction. In: TACAS, Lecture Notes in Computer Science, vol 6051. Springer, pp 435--450

  54. Koza JR (1992) Genetic programming On the programming of computers by means of natural selection. MIT Press, Cambridge MA

    MATH  Google Scholar 

  55. McKay B, Willis MJ, Barton G.W (1995) Using a tree structured genetic algorithm to perform symbolic regression. In: First International Conference on Genetic Algorithms in Engineering Systems: Innovations and Applications, Sheffield, UK, pp 487--492

  56. Chellapilla K (1998) A preliminary investigation into evolving modular programs without subtree crossover. In: genetic programming proceedings of the third annual conference, vol 1998. Morgan Kaufmann, Wisconsin, pp 22–25

  57. Riccardo P, McPhe N, Vanneschi L (2008) Elitism reduces bloat in genetic programming. In: Genetic and Evolutionary Computation Conference (GECCO)

  58. Penix J, Visser W, Engstrom E, Larson A, Weininger N (2000) Verification of Time Partitioning in the DEOS Scheduler Kernel. In: Proceedings of the 22nd International Conference on Software Engineering (ICSE), Limeric, Ireland

  59. Brat G, Giannakopoulou D, Goldberg A, Havelund K, Lowry M, Pasareanu C, Venet A, Visser W, Washington R (2003) Experimental evaluation of verification and validation tools on martian rover software. In: Proceedings of the SEI/CM Software Model Checking Workshop, Pittsburgh

  60. Raynal M (1986) Algorithms for mutual exclusion. MIT Press

  61. Britton T, Jeng L, Carver G, Cheak P, Katzenellenbogen T (2013) Reversible debugging software. Technical Report, University of Cambridge Judge Business School

  62. Clarke EM, Grumberg O, Peled D (1999) Model checking. MIT Press

  63. Arcuri A (2011) Evolutionary repair of faulty software. Appl Soft Comput 11(4):3494–3514

    Article  Google Scholar 

  64. Weimer W (2013) Advances in automated program repair and a call to arms. In: The 5th International Symposium on Search Based Software Engineering (SSBSE), St. Petersburg, Russia, pp 1–3

  65. Barnes JGP (2003) High integrity software: the spark approach to safety and security: sample chapters. Pearson Education

  66. De Moura L, Bjørner N (2008) Z3: An efficient SMT solver. In: Tools and Algorithms for the Construction and Analysis of Systems. Springer Berlin Heidelberg, pp 337–340

  67. Flanagan C, Leino KRM, Lillibridge M, Nelson G, Saxe JB, Stata R (2002) Extended static checking for Java. In: Programming Language Design and Implementation, pp 234–245

  68. Weimer W (2006) Patches as better bug reports. In: Proceedings of the 5th international conference on Generative programming and component engineering. ACM, pp 181–190

  69. Myers GJ, Sandler C, Badgett T (2011) The art of software testing. Wiley

  70. Penix J (2012) Large-scale test automation in the cloud (invited industrial talk). In: 2012 34th International Conference on Software Engineering (ICSE). IEEE, pp 1122–1122

  71. Smith EK, Barr ET, Le Goues C, Brun Y (2015) Is the cure worse than the disease? overfitting in automated program repair. In: Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering. ACM, pp 532–543

  72. Le Goues C, Weimer W, Forrest S (2012) Representations and operators for improving evolutionary software repair. In: Proceedings of the 14th annual conference on Genetic and evolutionary computation. ACM, pp 959–966

  73. Pei YU, Furia C, Nordio M, Yi Wei, Meyer B, Zeller A (2014) Automated fixing of programs with contracts. IEEE Trans Softw Eng 40(5):427–449

    Article  Google Scholar 

  74. Le Goues C, Holtschulte N, Smith E, Brun Y, Devanbu P, Forrest S, Weimer W (2015) The ManyBugs and IntroClass benchmarks for automated repair of C programs. IEEE Transactions on Software Engineering, In Press

  75. Schulte E, DiLorenzo J, Weimer W, Forrest S (2013) Automated repair of binary and assembly programs for cooperating embedded devices. ACM SIGARCH Comput Archit News 41(1):317–328

  76. Le G, Claire SF, Weimer W (2013) Current challenges in automatic software repair. Softw Qual J 21 (3):421–443

    Article  Google Scholar 

  77. Harman M (2010) Automated patching techniques: the fix is in: technical perspective. Commun ACM 53 (5):108–108

    Article  Google Scholar 

  78. Qi Y, Mao X, Lei Y (2013) Efficient automated program repair through fault-recorded testing prioritization. In: 2013 IEEE International Conference on Software Maintenance. IEEE, pp 180–189

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Alireza Khalilian.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Zojaji, Z., Ladani, B.T. & Khalilian, A. Automated program repair using genetic programming and model checking. Appl Intell 45, 1066–1088 (2016). https://doi.org/10.1007/s10489-016-0804-0

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10489-016-0804-0

Keywords

Navigation