skip to main content
10.1145/2950290.2950295acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Anti-patterns in search-based program repair

Published:01 November 2016Publication History

ABSTRACT

Search-based program repair automatically searches for a program fix within a given repair space. This may be accomplished by retrofitting a generic search algorithm for program repair as evidenced by the GenProg tool, or by building a customized search algorithm for program repair as in SPR. Unfortunately, automated program repair approaches may produce patches that may be rejected by programmers, because of which past works have suggested using human-written patches to produce templates to guide program repair. In this work, we take the position that we will not provide templates to guide the repair search because that may unduly restrict the repair space and attempt to overfit the repairs into one of the provided templates. Instead, we suggest the use of a set of anti-patterns --- a set of generic forbidden transformations that can be enforced on top of any search-based repair tool. We show that by enforcing our anti-patterns, we obtain repairs that localize the correct lines or functions, involve less deletion of program functionality, and are mostly obtained more efficiently. Since our set of anti-patterns are generic, we have integrated them into existing search based repair tools, including GenProg and SPR, thereby allowing us to obtain higher quality program patches with minimal effort.

References

  1. M. Böhme and A. Roychoudhury. CoREBench: Studying complexity of regression errors. In Proceedings of the 2014 International Symposium on Software Testing and Analysis, ISSTA 2014, pages 105–115, New York, NY, USA, 2014. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. W. H. Brown, R. C. Malveau, and T. J. Mowbray. AntiPatterns: refactoring software, architectures, and projects in crisis. Wiley, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. F. DeMarco, J. Xuan, D. Le Berre, and M. Monperrus. 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, CSTVA 2014, pages 30–39, New York, NY, USA, 2014. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. B. Demsky, M. D. Ernst, P. J. Guo, S. McCamant, J. H. Perkins, and M. Rinard. Inference and enforcement of data structure consistency specifications. In Proceedings of the 2006 International Symposium on Software Testing and Analysis, ISSTA ’06, pages 233–244, New York, NY, USA, 2006. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Gopinath, M. Z. Malik, and S. Khurshid. Specification-based program repair using sat. In Tools and Algorithms for the Construction and Analysis of Systems, pages 173–188. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. Kaleeswaran, V. Tulsian, A. Kanade, and A. Orso. Minthint: Automated synthesis of repair hints. In Proceedings of the 36th International Conference on Software Engineering, ICSE 2014, pages 266–276, New York, NY, USA, 2014. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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, ICSE ’13, pages 802–811, Piscataway, NJ, USA, 2013. IEEE Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Koenig. Patterns and antipatterns. Journal of Object Oriented Programming, 8(1), 1995.Google ScholarGoogle Scholar
  9. J. R. Koza. Genetic Programming: On the Programming of computers by Means of Natural Selection. MIT Press, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 Software Engineering (ICSE), 2012 34th International Conference on, pages 3–13. IEEE, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. F. Long and M. Rinard. Staged program repair with condition synthesis. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2015, pages 166–178, New York, NY, USA, 2015. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. F. Long and M. Rinard. An analysis of the search spaces for generate and validate patch generation systems. In Proceedings of the 38th International Conference on Software Engineering, ICSE ’16, pages 702–713, New York, NY, USA, 2016. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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, POPL ’16, pages 298–312, New York, NY, USA, 2016. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Mechtaev, J. Yi, and A. Roychoudhury. DirectFix: Looking for simple program repairs. In Proceedings of the 37th International Conference on Software Engineering, ICSE 2015, pages 448–458. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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, ICSE ’16, pages 691–701, New York, NY, USA, 2016. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. M. Monperrus. A critical review of ”automatic patch generation learned from human-written patches”: Essay on the problem statement and the evaluation of automatic software repair. In Proceedings of the 36th International Conference on Software Engineering, ICSE 2014, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. H. D. T. Nguyen, D. Qi, A. Roychoudhury, and S. Chandra. Semfix: Program repair via semantic analysis. In Proceedings of the 2013 International Conference on Software Engineering, pages 772–781. IEEE Press, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. F. S. Ocariza, Jr., K. Pattabiraman, and A. Mesbah. Vejovis: Suggesting fixes for javascript faults. In Proceedings of the 36th International Conference on Software Engineering, ICSE 2014, pages 837–847, New York, NY, USA, 2014. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Y. Pei, C. Furia, M. Nordio, Y. Wei, B. Meyer, and A. Zeller. Automated fixing of programs with contracts. Software Engineering, IEEE Transactions on, 40(5):427–449, May 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. J. H. Perkins, S. Kim, S. Larsen, S. Amarasinghe, J. Bachrach, M. Carbin, C. Pacheco, F. Sherwood, S. Sidiroglou, G. Sullivan, W.-F. Wong, Y. Zibin, M. D. Ernst, and M. Rinard. Automatically patching errors in deployed software. In Proceedings of the ACM SIGOPS 22Nd Symposium on Operating Systems Principles, SOSP ’09, pages 87–102, New York, NY, USA, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. R. Purushothaman and D. E. Perry. Towards understanding the rhetoric of small changes-extended abstract. In International Workshop on Mining Software Repositories (MSR 2004), International Conference on Software Engineering, pages 90–94, 2004.Google ScholarGoogle Scholar
  22. 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, ICSE 2014, New York, NY, USA, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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, ISSTA 2015, pages 24–36, New York, NY, USA, 2015. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. R. Samanta, O. Olivo, and E. Emerson. Cost-aware automatic program repair. In M. Müller-Olm and H. Seidl, editors, Static Analysis Symposium, volume 8723 of Lecture Notes in Computer Science, pages 268–284. Springer International Publishing, 2014.Google ScholarGoogle ScholarCross RefCross Ref
  25. J. Śliwerski, T. Zimmermann, and A. Zeller. When do changes induce fixes? In Proceedings of the 2005 International Workshop on Mining Software Repositories, MSR ’05, pages 1–5, New York, NY, USA, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. E. K. Smith, E. T. Barr, C. Le Goues, and Y. Brun. Is the cure worse than the disease? overfitting in automated program repair. In Proceedings of the 10th Joint Meeting of the European Software Engineering Conference and ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE), Bergamo, Italy, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. S. H. Tan and A. Roychoudhury. Relifix: Automated repair of software regressions. In Proceedings of the 37th International Conference on Software Engineering, ICSE 2015, pages 471–482. ACM, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. W. Weimer, Z. 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, Nov 2013.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Z. Yin, D. Yuan, Y. Zhou, S. Pasupathy, and L. Bairavasundaram. How do fixes become bugs? In Proceedings of the 19th ACM SIGSOFT Symposium and the 13th European Conference on Foundations of Software Engineering, ESEC/FSE ’11, pages 26–36, New York, NY, USA, 2011. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Anti-patterns in search-based program repair

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          FSE 2016: Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering
          November 2016
          1156 pages
          ISBN:9781450342186
          DOI:10.1145/2950290

          Copyright © 2016 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 November 2016

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate17of128submissions,13%

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader