ABSTRACT
The effectiveness of search-based automated program repair is limited in the number of correct patches that can be successfully generated. There are two causes of such limitation. First, the search space does not contain the correct patch. Second, the search space is huge and therefore the correct patch cannot be generated (i.e., correct patches are either generated after incorrect plausible ones or not generated within the time budget).
To increase the likelihood of including the correct patches in the search space, we propose to work at a fine granularity in terms of AST nodes. This, however, will further enlarge the search space, increasing the challenge to find the correct patches. We address the challenge by devising a strategy to prioritize the candidate patches based on their likelihood of being correct. Specifically, we study the use of AST nodes' context information to estimate the likelihood.
In this paper, we propose CapGen, a context-aware patch generation technique. The novelty which allows CapGen to produce more correct patches lies in three aspects: (1) The fine-granularity design enables it to find more correct fixing ingredients; (2) The context-aware prioritization of mutation operators enables it to constrain the search space; (3) Three context-aware models enable it to rank correct patches at high positions before incorrect plausible ones. We evaluate CapGen on Defects4J and compare it with the state-of-the-art program repair techniques. Our evaluation shows that CapGen outperforms and complements existing techniques. CapGen achieves a high precision of 84.00% and can prioritize the correct patches before 98.78% of the incorrect plausible ones.
- 2017. https://github.com/xuanbachle/bugfixes. (2017). Accessed: 2017-03-22.Google Scholar
- 2017. http://www.gzoltar.com. (2017). Accessed: 2017-03-22.Google Scholar
- 2017. Understand. https://scitools.com. (2017). Accessed: 2017-03-22.Google Scholar
- Earl T Barr, Yuriy Brun, Premkumar Devanbu, Mark Harman, and Federica Sarro. 2014. The plastic surgery hypothesis. In FSE'14. ACM, 306--317. Google ScholarDigital Library
- Marcel Böhme, Ezekiel Olamide Soremekun, Sudipta Chattopadhyay, Emamurho Ugherughe, and Andreas Zeller. 2017. Where is the Bug and How is it Fixed? An Experiment with Practitioners. In ESEC/FSE'2017 (ESEC/FSE 2017). 1--11.Google Scholar
- Tom Britton, Lisa Jeng, Graham Carver, Paul Cheak, and Tomer Katzenellenbogen. 2013. Reversible debugging software. Judge Bus. School, Univ. Cambridge, Cambridge, UK, Tech. Rep (2013).Google Scholar
- Loris DâĂŹAntoni, Roopsha Samanta, and Rishabh Singh. 2016. Qlose: Program repair with quantitative objectives. In International Conference on Computer Aided Verification. Springer, 383--401.Google Scholar
- Vidroha Debroy and WEric Wong. 2010. Using mutation to automatically suggest fixes for faulty programs. In 2010 Third International Conference on Software Testing, Verification and Validation. IEEE, 65--74. Google ScholarDigital Library
- Favio DeMarco, Jifeng Xuan, Daniel Le Berre, and Martin Monperrus. 2014. Automatic repair of buggy if conditions and missing preconditions with smt. In Proceedings of the 6th International Workshop on Constraints in Software Testing, Verification, and Analysis. ACM, 30--39. Google ScholarDigital Library
- Thomas Durieux and Martin Monperrus. 2016. IntroClassJava: A Benchmark of 297 Small and Buggy Java Programs. Ph.D. Dissertation. Universite Lille 1.Google Scholar
- Stephanie Forrest, ThanhVu Nguyen, Westley Weimer, and Claire Le Goues. 2009. A genetic programming approach to automated software repair. In GECCO'2009. ACM, 947--954. Google ScholarDigital Library
- Mark Gabel and Zhendong Su. 2010. A study of the uniqueness of source code. In FSE'10. ACM, 147--156. Google ScholarDigital Library
- Guoliang Jin, Linhai Song, Wei Zhang, Shan Lu, and Ben Liblit. 2011. Automated atomicity-violation fixing. In ACM SIGPLAN Notices, Vol. 46. ACM, 389--400. Google ScholarDigital Library
- René Just, Darioush Jalali, and Michael D Ernst. 2014. Defects4J: A database of existing faults to enable controlled testing studies for Java programs. In ISSTA'2014. ACM, 437--440. Google ScholarDigital Library
- Yalin Ke, Kathryn T Stolee, Claire Le Goues, and Yuriy Brun. 2015. Repairing programs with semantic code search (T). In ASE'2015. IEEE, 295--306.Google ScholarDigital Library
- Dongsun Kim, Jaechang Nam, Jaewoo Song, and Sunghun Kim. 2013. Automatic patch generation learned from human-written patches. In ICSE'2013. IEEE Press, 802--811. Google ScholarDigital Library
- Xuan-Bach D Le. 2016. Towards efficient and effective automatic program repair. In ASE'2016. ACM, 876--879. Google ScholarDigital Library
- Xuan-Bach D Le, Duc-Hiep Chu, David Lo, Claire Le Goues, and Willem Visser. 2017. JFIX: semantics-based repair of Java programs via symbolic PathFinder. In ISSTA'17. ACM, 376--379. Google ScholarDigital Library
- Xuan Bach D Le, David Lo, and Claire Le Goues. 2016. History Driven Program Repair. In SANER'2016, Vol. 1. IEEE, 213--224.Google Scholar
- Claire Le Goues, Michael Dewey-Vogt, Stephanie Forrest, and Westley Weimer. 2012. A systematic study of automated program repair: Fixing 55 out of 105 bugs for 8 each. In ICSE'2012. IEEE, 3--13. Google ScholarDigital Library
- Claire Le Goues, Stephanie Forrest, and Westley Weimer. 2013. Current challenges in automatic software repair. Software Quality Journal 21, 3 (2013), 421--443. Google ScholarDigital Library
- Claire Le Goues, Neal Holtschulte, Edward K Smith, Yuriy Brun, Premkumar Devanbu, Stephanie Forrest, and Westley Weimer. 2015. The ManyBugs and IntroClass benchmarks for automated repair of C programs. IEEE Transactions on Software Engineering 41, 12 (2015), 1236--1256.Google ScholarDigital Library
- Fan Long and Martin Rinard. 2015. Staged program repair with condition synthesis. In FSE'2015. ACM, 166--178. Google ScholarDigital Library
- Fan Long and Martin Rinard. 2016. An analysis of the search spaces for generate and validate patch generation systems. In ICSE'2016. ACM, 702--713. Google ScholarDigital Library
- Fan Long and Martin Rinard. 2016. Automatic patch generation by learning correct code. In ACM SIGPLAN Notices, Vol. 51. ACM, 298--312. Google ScholarDigital Library
- Henry B Mann and Donald R Whitney. 1947. On a test of whether one of two random variables is stochastically larger than the other. The annals of mathematical statistics (1947), 50--60.Google Scholar
- Matias Martinez, Thomas Durieux, Romain Sommerard, Jifeng Xuan, and Martin Monperrus. 2016. Automatic repair of real bugs in Java: Alarge-scale experiment on the Defects4J dataset. Empirical Software Engineering (2016), 1--29. Google ScholarDigital Library
- Matias Martinez and Martin Monperrus. 2015. Mining software repair models for reasoning on the search space of automated program fixing. Empirical Software Engineering 20, 1 (2015), 176--205. Google ScholarDigital Library
- Matias Martinez and Martin Monperrus. 2016. ASTOR: A Program Repair Library for Java. In Proceedings of ISSTA, Demonstration Track. Google ScholarDigital Library
- Matias Martinez, Westley Weimer, and Martin Monperrus. 2014. Do the fix ingredients already exist? an empirical inquiry into the redundancy assumptions of program repair approaches. In Companion Proceedings of the 36th International Conference on Software Engineering. ACM, 492--495. Google ScholarDigital Library
- Sergey Mechtaev, Jooyong Yi, and Abhik Roychoudhury. 2015. Directfix: Looking for simple program repairs. In ICSE'2015, Vol. 1. IEEE, 448--458. Google ScholarDigital Library
- Sergey Mechtaev, Jooyong Yi, and Abhik Roychoudhury. 2016. Angelix: Scalable multiline program patch synthesis via symbolic analysis. In ICSE'2016. ACM, 691--701. Google ScholarDigital Library
- Hoang Duong Thien Nguyen, Dawei Qi, Abhik Roychoudhury, and Satish Chandra. 2013. SemFix: program repair via semantic analysis. In ICSE'2013. IEEE Press, 772--781. Google ScholarDigital Library
- Renaud Pawlak, Martin Monperrus, Nicolas Petitprez, Carlos Noguera, and Lionel Seinturier. 2015. Spoon: A Library for Implementing Analyses and Transformations of Java Source Code. Software: Practice and Experience 46 (2015), 1155--1179. Google ScholarDigital Library
- Jeff H Perkins, Sunghun Kim, Sam Larsen, Saman Amarasinghe, Jonathan Bachrach, Michael Carbin, Carlos Pacheco, Frank Sherwood, Stelios Sidiroglou, Greg Sullivan, and others. 2009. Automatically patching errors in deployed software. In Proceedings of the ACM SIGOPS 22nd symposium on Operating systems principles. ACM, 87--102. Google ScholarDigital Library
- Yuhua Qi, Xiaoguang Mao, Yan Lei, Ziying Dai, and Chengsong Wang. 2014. The strength of random search on automated program repair. In ICSE'2014. ACM, 254--265. Google ScholarDigital Library
- Yuhua Qi, Xiaoguang Mao, Yan Lei, and Chengsong Wang. 2013. Using automated program repair for evaluating the effectiveness of fault localization techniques. In ISSTA'2013. ACM, 191--201. Google ScholarDigital Library
- Zichao Qi, Fan Long, Sara Achour, and Martin Rinard. 2015. An analysis of patch plausibility and correctness for generate-and-validate patch generation systems. In ISSTA'2015. ACM, 24--36. Google ScholarDigital Library
- Dong Qiu, Bixin Li, Earl T Barr, and Zhendong Su. 2017. Understanding the syntactic rule usage in java. Journal of Systems and Software 123 (2017), 160--172.Google ScholarCross Ref
- Sina Shamshiri, René Just, José Miguel Rojas, Gordon Fraser, Phil McMinn, and Andrea Arcuri. 2015. Do Automatically Generated Unit Tests Find Real Faults? An Empirical Study of Effectiveness and Challenges (T). In ASE'2015. IEEE, 201--211.Google ScholarDigital Library
- Stelios Sidiroglou-Douskos, Eric Lahtinen, Fan Long, and Martin Rinard. 2015. Automatic error elimination by horizontal code transfer across multiple applications. In ACM SIGPLAN Notices, Vol. 50. ACM, 43--54. Google ScholarDigital Library
- Edward K Smith, Earl T Barr, Claire Le Goues, and Yuriy Brun. 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, 532--543. Google ScholarDigital Library
- Shin Hwei Tan and Abhik Roychoudhury. 2015. relifix: Automated repair of software regressions. In ICSE'2015. IEEE Press, 471--482. Google ScholarDigital Library
- Yi Wei, Yu Pei, Carlo A Furia, Lucas S Silva, Stefan Buchholz, Bertrand Meyer, and Andreas Zeller. 2010. Automated fixing of programs with contracts. In ISSTA'2010. ACM, 61--72. Google ScholarDigital Library
- Westley Weimer, Zachary P Fry, and Stephanie Forrest. 2013. Leveraging program equivalence for adaptive program repair: Models and first results. In ASE'2013. IEEE, 356--366. Google ScholarDigital Library
- Westley Weimer, Thanh Vu Nguyen, Claire Le Goues, and Stephanie Forrest. 2009. Automatically finding patches using genetic programming. In ICSE'2009. IEEE Computer Society, 364--374. Google ScholarDigital Library
- Mark Weiser. 1981. Program slicing. In ICSE'1981. IEEE Press, 439--449. Google ScholarDigital Library
- Ming Wen, Junjie Chen, Rongxin Wu, Dan Hao, and Shing-Chi Cheung. 2017. An Empirical Analysis of the Influence of Fault Space on Search-Based Automated Program Repair. arXiv preprint arXiv: 1707.05172 (2017).Google Scholar
- Ming Wen, Rongxin Wu, and Shing-Chi Cheung. 2016. Locus: locating bugs from software changes. In ASE'2016. ACM, 262--273 Google ScholarDigital Library
- W Eric Wong, Ruizhi Gao, Yihao Li, Rui Abreu, and Franz Wotawa. 2009. A survey on software fault localization. (2009).Google Scholar
- Rongxin Wu, Ming Wen, Shing-Chi Cheung, and Hongyu Zhang. 2017. Change-Locator: locate crash-inducing changes based on crash reports. Empirical Software Engineering (2017), 1--35.Google Scholar
- Qi Xin and Steven P Reiss. 2017. Identifying test-suite-overfitted patches through test case generation. In ISSTA, 17. ACM, 226--236. Google ScholarDigital Library
- Yingfei Xiong, Jie Wang, Runfa Yan, Jiachen Zhang, Shi Han, Gang Huang, and Lu Zhang. 2017. Precise condition synthesis for program repair. In ICSE'17. IEEE Press, 416--426. Google ScholarDigital Library
- Jifeng Xuan, Matias Martinez, Favio Demarco, Maxime Clément, Sebastian Lamelas Marcote, Thomas Durieux, Daniel Le Berre, and Martin Monperrus. 2016. Nopol: Automatic repair of conditional statement bugs in java programs. (2016).Google Scholar
- D Le Xuan-Bach, Chu Duc-Hiep, Lo David, Goues Claire, Le, and Willem Visser. 2017. S3: Syntax- and Semantic-Guided Repair Synthesis via Programming by Examples. In FSE'2017. ACM, to appear. Google ScholarDigital Library
- Jinqiu Yang, Alexey Zhikhartsev, Yuefei Liu, and Lin Tan. 2017. Better test cases for better automated program repair. In FSE'17. ACM, 831--841. Google ScholarDigital Library
- Luciano Zemín, Simón Gutiérrez Brida, Ariel Godio, César Cornejo, Renzo Degiovanni, Germán Regis, Nazareno Aguirre, and Marcelo Frias. 2017. An analysis of the suitability of test-based patch acceptance criteria. In Proceedings of the 10th International Workshop on Search-Based Software Testing. IEEE Press, 14--20. Google ScholarDigital Library
- Hao Zhong and Zhendong Su. 2015. An empirical study on real bug fixes. In ICSE'15. IEEE Press, 913--923. Google ScholarDigital Library
Index Terms
- Context-aware patch generation for better automated program repair
Recommendations
Revisiting object similarity-based patch ranking in automated program repair: an extensive study
APR '22: Proceedings of the Third International Workshop on Automated Program RepairTest-based generate-and-validate automated program repair (APR) systems often generate plausible patches that pass the test suite without fixing the bug. So far, several approaches for automatic assessment of the APR-generated patches are proposed. ...
Context-aware single image super-resolution using sparse representation and cross-scale similarity
Methods for single image super-resolution (SR) are broadly divided into two categories: (i) edge-focused SR and (ii) example-based SR. Edge-focused methods are focused on producing sharp edges with minimal artifacts; however, these methods cannot ...
Better test cases for better automated program repair
ESEC/FSE 2017: Proceedings of the 2017 11th Joint Meeting on Foundations of Software EngineeringAutomated generate-and-validate program repair techniques (G&V techniques) suffer from generating many overfitted patches due to in-capabilities of test cases. Such overfitted patches are incor- rect patches, which only make all given test cases pass, ...
Comments