Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1109/ICSE.2019.00020acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Harnessing evolution for multi-hunk program repair

Published: 25 May 2019 Publication History

Abstract

Despite significant advances in automatic program repair (APR) techniques over the past decade, practical deployment remains an elusive goal. One of the important challenges in this regard is the general inability of current APR techniques to produce patches that require edits in multiple locations, i.e., multi-hunk patches. In this work, we present a novel APR technique that generalizes single-hunk repair techniques to include an important class of multi-hunk bugs, namely bugs that may require applying a substantially similar patch at a number of locations. We term such sets of repair locations as evolutionary siblings - similar looking code, instantiated in similar contexts, that are expected to undergo similar changes. At the heart of our proposed method is an analysis to accurately identify a set of evolutionary siblings, for a given bug. This analysis leverages three distinct sources of information, namely the test-suite spectrum, a novel code similarity analysis, and the revision history of the project. The discovered siblings are then simultaneously repaired in a similar fashion. We instantiate this technique in a tool called Hercules and demonstrate that it is able to correctly fix 46 bugs in the Defects4J dataset, the highest of any individual APR technique to date. This includes 15 multi-hunk bugs and overall 11 bugs which have not been fixed by any other technique so far.

References

[1]
L. Gazzola, D. Micucci, and L. Mariani, "Automatic software repair: A survey," IEEE Transactions on Software Engineering, pp. 1--1, 2018.
[2]
M. Monperrus, "Automatic software repair: A bibliography," ACM Computing Surveys, vol. 51, no. 1, pp. 17:1--17:24, Jan. 2018.
[3]
C. Le Goues, S. Forrest, and W. Weimer, "Current challenges in automatic software repair," Software quality journal, vol. 21, no. 3, pp. 421--443, 2013.
[4]
H. Zhong and Z. Su, "An empirical study on real bug fixes," in Proceedings of the 37th International Conference on Software Engineering-Volume 1. IEEE Press, 2015, pp. 913--923.
[5]
S. Mechtaev, J. Yi, and A. Roychoudhury, "Angelix: Scalable Multiline Program Patch Synthesis via Symbolic Analysis," in Proceedings of the 38th International Conference on Software Engineering, ser. ICSE '16. New York, NY, USA: ACM, 2016, pp. 691--701.
[6]
R. Just, D. Jalali, and M. D. Ernst, "Defects4j: A database of existing faults to enable controlled testing studies for java programs," in Proceedings of the 2014 International Symposium on Software Testing and Analysis. ACM, 2014, pp. 437--440.
[7]
R. K. Saha, Y. Lyu, W. Lam, H. Yoshida, and M. R. Prasad, "Bugs. jar: a large-scale, diverse dataset of real-world java bugs," in Proceedings of the 15th International Conference on Mining Software Repositories. ACM, 2018, pp. 10--13.
[8]
M. Kim and D. Notkin, "Using a clone genealogy extractor for understanding and supporting evolution of code clones," in ACM SIGSOFT Software Engineering Notes, vol. 30, no. 4. ACM, 2005, pp. 1--5.
[9]
C. K. Roy and J. R. Cordy, "An empirical study of function clones in open source software," in 2008 15th Working Conference on Reverse Engineering. IEEE, 2008, pp. 81--90.
[10]
E. Duala-Ekoko and M. P. Robillard, "Tracking code clones in evolving software," in Software Engineering, 2007. ICSE 2007. 29th International Conference on. IEEE, 2007, pp. 158--167.
[11]
E. Juergens, F. Deissenboeck, B. Hummel, and S. Wagner, "Do code clones matter?" in Software Engineering, 2009. ICSE 2009. IEEE 31st International Conference on. IEEE, 2009, pp. 485--495.
[12]
T. Kamiya, S. Kusumoto, and K. Inoue, "Ccfinder: A multilinguistic token-based code clone detection system for large scale source code," IEEE Trans. Softw. Eng., vol. 28, no. 7, pp. 654--670, Jul. 2002.
[13]
L. Jiang, G. Misherghi, Z. Su, and S. Glondu, "Deckard: Scalable and accurate tree-based detection of code clones," in Proceedings of the 29th international conference on Software Engineering. IEEE Computer Society, 2007, pp. 96--105.
[14]
J. R. Cordy and C. K. Roy, "The nicad clone detector," in Proceedings of the 2011 IEEE 19th International Conference on Program Comprehension, ser. ICPC '11. Washington, DC, USA: IEEE Computer Society, 2011, pp. 219--220.
[15]
N. Meng, M. Kim, and K. S. McKinley, "Systematic editing: Generating program transformations from an example," in Proceedings of the 32Nd ACM SIGPLAN Conference on Programming Language Design and Implementation, ser. PLDI '11. New York, NY, USA: ACM, 2011, pp. 329--342.
[16]
N. Meng, M. Kim, and K. S. McKinley, "Lase: Locating and applying systematic edits by learning from examples," in Proceedings of the 2013 International Conference on Software Engineering, ser. ICSE '13. Piscataway, NJ, USA: IEEE Press, 2013, pp. 502--511.
[17]
N. Meng, L. Hua, M. Kim, and K. S. McKinley, "Does automated refactoring obviate systematic editing?" in Proceedings of the 37th International Conference on Software Engineering - Volume 1, ser. ICSE '15. Piscataway, NJ, USA: IEEE Press, 2015, pp. 392--402.
[18]
C. K. Roy and J. R. Cordy, "A survey on software clone detection research," Queen?s School of Computing TR, vol. 541, no. 115, pp. 64--68, 2007.
[19]
M. Rieger, S. Ducasse, and M. Lanza, "Insights into system-wide code duplication," in Reverse Engineering, 2004. Proceedings. 11th Working Conference on. IEEE, 2004, pp. 100--109.
[20]
J. F. Islam, M. Mondal, and C. K. Roy, "Bug replication in code clones: An empirical study," in Software Analysis, Evolution, and Reengineering (SANER), 2016 IEEE 23rd International Conference on, vol. 1. IEEE, 2016, pp. 68--78.
[21]
E. T. Barr, Y. Brun, P. Devanbu, M. Harman, and F. Sarro, "The plastic surgery hypothesis," in Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering. ACM, 2014, pp. 306--317.
[22]
D. Kim, J. Nam, J. Song, and S. Kim, "Automatic patch generation learned from human-written patches," in Proceedings of the 2013 International Conference on Software Engineering, ser. ICSE '13. Piscataway, NJ, USA: IEEE Press, 2013, pp. 802--811.
[23]
S. H. Tan and A. Roychoudhury, "Relifix: Automated repair of software regressions," in Proceedings of the 37th International Conference on Software Engineering - Volume 1, ser. ICSE '15. Piscataway, NJ, USA: IEEE Press, 2015, pp. 471--482.
[24]
S. H. Tan, H. Yoshida, M. R. Prasad, and A. Roychoudhury, "Anti-patterns in search-based program repair," in Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, ser. FSE 2016. New York, NY, USA: ACM, 2016, pp. 727--738.
[25]
F. Long, P. Amidon, and M. Rinard, "Automatic inference of code transforms for patch generation," in Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering, ser. ESEC/FSE 2017. New York, NY, USA: ACM, 2017, pp. 727--739.
[26]
M. Wen, J. Chen, R. Wu, D. Hao, and S.-C. Cheung, "Context-aware patch generation for better automated program repair," in Proceedings of the 40th International Conference on Software Engineering, ser. ICSE '18. New York, NY, USA: ACM, 2018, pp. 1--11.
[27]
J. Jiang, Y. Xiong, H. Zhang, Q. Gao, and X. Chen, "Shaping program repair space with existing patches and similar code," in Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis, ser. ISSTA 2018. New York, NY, USA: ACM, 2018, pp. 298--309.
[28]
C. Le Goues, M. Dewey-Vogt, S. Forrest, and W. Weimer, "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, ser. ICSE '12. Piscataway, NJ, USA: IEEE Press, 2012, pp. 3--13.
[29]
Y. Xiong, J. Wang, R. Yan, J. Zhang, S. Han, G. Huang, and L. Zhang, "Precise condition synthesis for program repair," in Proceedings of the 39th International Conference on Software Engineering, ser. ICSE '17. Piscataway, NJ, USA: IEEE Press, 2017, pp. 416--426.
[30]
Q. Xin and S. P. Reiss, "Leveraging syntax-related code for automated program repair," in Proceedings of the 32Nd IEEE/ACM International Conference on Automated Software Engineering, ser. ASE 2017. Piscataway, NJ, USA: IEEE Press, 2017, pp. 660--670.
[31]
Z. Qi, F. Long, S. Achour, and M. Rinard, "An analysis of patch plausibility and correctness for generate-and-validate patch generation systems," in Proceedings of the 2015 International Symposium on Software Testing and Analysis, ser. ISSTA 2015. New York, NY, USA: ACM, 2015, pp. 24--36.
[32]
F. Long and M. Rinard, "Staged program repair with condition synthesis," in Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, ser. ESEC/FSE 2015. New York, NY, USA: ACM, 2015, pp. 166--178.
[33]
T. Durieux, M. Martinez, M. Monperrus, R. Sommerard, and J. Xuan, "Automatic repair of real bugs: An experience report on the defects4j dataset," CoRR, vol. abs/1505.07002, 2015. {Online}. Available: http://arxiv.org/abs/1505.07002
[34]
F. Long and M. Rinard, "Automatic patch generation by learning correct code," in Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, ser. POPL '16. New York, NY, USA: ACM, 2016, pp. 298--312.
[35]
J. A. Jones, M. J. Harrold, and J. Stasko, "Visualization of test information to assist fault localization," in Proceedings of the 24th International Conference on Software Engineering, ser. ICSE '02. New York, NY, USA: ACM, 2002, pp. 467--477.
[36]
T. Janssen, R. Abreu, and A. J. van Gemund, "Zoltar: a spectrum-based fault localization tool," in SINTER '09: Proceedings of the 2009 ESEC/FSE workshop on Software integration and evolution @ runtime. New York, NY, USA: ACM, 2009, pp. 23--30.
[37]
R. Abreu, P. Zoeteweij, R. Golsteijn, and A. J. C. van Gemund, "A practical evaluation of spectrum-based fault localization," Journal of Systems and Software, vol. 82, no. 11, pp. 1780--1792, Nov. 2009.
[38]
Y. Qi, X. Mao, Y. Lei, Z. Dai, and C. Wang, "The strength of random search on automated program repair," in Proceedings of the 36th International Conference on Software Engineering, ser. ICSE 2014. New York, NY, USA: ACM, 2014, pp. 254--265.
[39]
W. Weimer, Z. P. Fry, and S. Forrest, "Leveraging program equivalence for adaptive program repair: Models and first results," in Automated Software Engineering (ASE), 2013 IEEE/ACM 28th International Conference on. Piscataway, NJ, USA: IEEE Press, Nov 2013, pp. 356--366.
[40]
R. K. Saha, Y. Lyu, H. Yoshida, and M. R. Prasad, "Elixir: Effective object oriented program repair," in Proceedings of the 32Nd IEEE/ACM International Conference on Automated Software Engineering, ser. ASE 2017. Piscataway, NJ, USA: IEEE Press, 2017, pp. 648--659.
[41]
K. Zhang and D. Shasha, "Simple fast algorithms for the editing distance between trees and related problems," SIAM journal on computing, vol. 18, no. 6, pp. 1245--1262, 1989.
[42]
L. Chen, Y. Pei, and C. A. Furia, "Contract-based program repair without the contracts," in Automated Software Engineering (ASE), 2017 32nd IEEE/ACM International Conference on. IEEE, 2017, pp. 637--647.
[43]
E. T. Barr, M. Harman, Y. Jia, A. Marginean, and J. Petke, "Automated software transplantation," in Proceedings of the 2015 International Symposium on Software Testing and Analysis, ser. ISSTA 2015. New York, NY, USA: ACM, 2015, pp. 257--269.
[44]
S. Sidiroglou-Douskos, E. Lahtinen, F. Long, and M. Rinard, "Automatic error elimination by horizontal code transfer across multiple applications," in Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, ser. PLDI '15. New York, NY, USA: ACM, 2015, pp. 43--54.
[45]
Y. Ke, K. T. Stolee, C. Le Goues, and Y. Brun, "Repairing programs with semantic code search," in 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE), Nov 2015, pp. 295--306.
[46]
X. B. D. Le, D. Lo, and C. Le Goues, "History Driven Program Repair," in 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), vol. 1. Piscataway, NJ, USA: IEEE Press, March 2016, pp. 213--224.
[47]
M. Kim and D. Notkin, "Discovering and representing systematic code changes," in Proceedings of the 31st International Conference on Software Engineering, ser. ICSE '09. Washington, DC, USA: IEEE Computer Society, 2009, pp. 309--319.

Cited By

View all
  • (2024)Evolving Paradigms in Automated Program Repair: Taxonomy, Challenges, and OpportunitiesACM Computing Surveys10.1145/369645057:2(1-43)Online publication date: 10-Oct-2024
  • (2024)Enhancing the Efficiency of Automated Program Repair via Greybox AnalysisProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695602(1719-1731)Online publication date: 27-Oct-2024
  • (2024)Benchmarking and Categorizing the Performance of Neural Program Repair Systems for JavaACM Transactions on Software Engineering and Methodology10.1145/368883434:1(1-35)Online publication date: 19-Aug-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '19: Proceedings of the 41st International Conference on Software Engineering
May 2019
1318 pages

Sponsors

Publisher

IEEE Press

Publication History

Published: 25 May 2019

Check for updates

Author Tags

  1. automatic program repair
  2. code similarity
  3. multi-hunk patches

Qualifiers

  • Research-article

Conference

ICSE '19
Sponsor:

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)31
  • Downloads (Last 6 weeks)6
Reflects downloads up to 17 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Evolving Paradigms in Automated Program Repair: Taxonomy, Challenges, and OpportunitiesACM Computing Surveys10.1145/369645057:2(1-43)Online publication date: 10-Oct-2024
  • (2024)Enhancing the Efficiency of Automated Program Repair via Greybox AnalysisProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695602(1719-1731)Online publication date: 27-Oct-2024
  • (2024)Benchmarking and Categorizing the Performance of Neural Program Repair Systems for JavaACM Transactions on Software Engineering and Methodology10.1145/368883434:1(1-35)Online publication date: 19-Aug-2024
  • (2024)When Automated Program Repair Meets Regression Testing—An Extensive Study on Two Million PatchesACM Transactions on Software Engineering and Methodology10.1145/367245033:7(1-23)Online publication date: 13-Jun-2024
  • (2024)Reality Check: Assessing GPT-4 in Fixing Real-World Software VulnerabilitiesProceedings of the 28th International Conference on Evaluation and Assessment in Software Engineering10.1145/3661167.3661207(252-261)Online publication date: 18-Jun-2024
  • (2024)Detecting, Creating, Repairing, and Understanding Indivisible Multi-Hunk BugsProceedings of the ACM on Software Engineering10.1145/36608281:FSE(2747-2770)Online publication date: 12-Jul-2024
  • (2024)ITER: Iterative Neural Repair for Multi-Location PatchesProceedings of the IEEE/ACM 46th International Conference on Software Engineering10.1145/3597503.3623337(1-13)Online publication date: 20-May-2024
  • (2024)Towards More Precise Coincidental Correctness Detection With Deep Semantic LearningIEEE Transactions on Software Engineering10.1109/TSE.2024.348189350:12(3265-3289)Online publication date: 1-Dec-2024
  • (2024)T5APRJournal of Systems and Software10.1016/j.jss.2024.112083214:COnline publication date: 1-Aug-2024
  • (2024)A survey on machine learning techniques applied to source codeJournal of Systems and Software10.1016/j.jss.2023.111934209:COnline publication date: 14-Mar-2024
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media