skip to main content
10.1145/3194810.3194814acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

Comparing line and AST granularity level for program repair using PyGGI

Published: 02 June 2018 Publication History

Abstract

PyGGI is a lightweight Python framework that can be used to implement generic Genetic Improvement algorithms at the API level. The original version of PyGGI only provided lexical modifications, i.e., modifications of the source code at the physical line granularity level. This paper introduces new extensions to PyGGI that enables syntactic modifications for Python code, i.e., modifications that operates at the AST granularity level. Taking advantage of the new extensions, we also present a case study that compares the lexical and syntactic search granularity level for automated program repair, using ten seeded faults in a real world open source Python project. The results show that search landscapes at the AST granularity level are more effective (i.e. eventually more likely to produce plausible patches) due to the smaller sizes of ingredient spaces (i.e., the space from which we search for the material to build a patch), but may require longer time for search because the larger number of syntactically intact candidates leads to more fitness evaluations.

References

[1]
Gabin An, Jinhan Kim, Seongmin Lee, and Shin Yoo. 2017. PyGGI: Python General framework for Genetic Improvement. In Proceedings of Korea Software Congress (KSC 2017).
[2]
Earl T. Barr, Yuriy Brun, Premkumar Devanbu, Mark Harman, and Federica Sarro. 2014. The Plastic Surgery Hypothesis. In Proceedings of the 22Nd ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE 2014). ACM, New York, NY, USA, 306--317.
[3]
David Binkley, Daniel Heinz, Dawn Lawrie, and Justin Overfelt. 2014. Understanding LDA in source code analysis. In Proceedings of the 22Nd International Conference on Program Comprehension. ACM, 26--36.
[4]
François-Michel De Rainville, Félix-Antoine Fortin, Marc-André Gardner, Marc Parizeau, and Christian Gagné. 2012. DEAP: A Python Framework for Evolutionary Algorithms. In Proceedings of the 14th Annual Conference Companion on Genetic and Evolutionary Computation (GECCO '12). ACM, New York, NY, USA, 85--92.
[5]
Stephanie Forrest, ThanhVu Nguyen, Westley Weimer, and Claire Le Goues. 2009. A Genetic Programming Approach to Automated Software Repair. In Proceedings of the 11th Annual Conference on Genetic and Evolutionary Computation (GECCO '09). ACM, New York, NY, USA, 947--954.
[6]
Fred Glover and Manuel Laguna. 2013. Tabu Search. In Handbook of combinatorial optimization. Springer, 3261--3362.
[7]
Nicolas Gold, David Binkley, Mark Harman, Syed Islam, Jens Krinke, and Shin Yoo. 2017. Generalized Observational Slicing for Tree-Represented Modelling Languages. In Proceedings of the 11th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering (ESEC/FSE 2017). 547--558.
[8]
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 Proceedings of the 34th International Conference on Software Engineering. 3--13.
[9]
Saemundur O. Haraldsson, John R. Woodward, Alexander E. I. Brownlee, and Kristin Siggeirsdottir. 2017. Fixing Bugs in Your Sleep: How Genetic Improvement Became an Overnight Success. In Proceedings of the Genetic and Evolutionary Computation Conference Companion (GECCO '17). ACM, New York, NY, USA, 1513--1520.
[10]
Dongsun Kim, Jaechang Nam, Jaewoo Song, and Sunghun Kim. 2013. Automatic Patch Generation Learned from Human-written Patches. In Proceedings of the 2013 International Conference on Software Engineering (ICSE '13). IEEE Press, Piscataway, NJ, USA, 802--811.
[11]
W.B. Langdon and M. Harman. 2015. Optimizing Existing Software With Genetic Programming. Transactions on Evolutionary Computation 19, 1 (2015), 118--135.
[12]
Fan Long, Peter Amidon, and Martin Rinard. 2017. Automatic Inference of Code Transforms for Patch Generation. In Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2017). ACM, New York, NY, USA, 727--739.
[13]
Matias Martinez and Martin Monperrus. 2016. ASTOR: A Program Repair Library for Java. In Proceedings of ISSTA.
[14]
Sergey Mechtaev, Jooyong Yi, and Abhik Roychoudhury. 2015. Directfix: Looking for simple program repairs. In 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering. IEEE, 448--458.
[15]
S. Mechtaev, J. Yi, and A. Roychoudhury. 2016. Angelix: Scalable Multiline Program Patch Synthesis via Symbolic Analysis. In 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE). 691--701.
[16]
A Ochiai. 1957. Zoogeographic studies on the soleoid fishes found in Japan and its neighbouring regions. Bulletin of the Japanese Society of Scientific Fisheries 22, 9 (1957), 526--530.
[17]
J. Petke, S. Haraldsson, M. Harman, w. langdon, D. White, and J. Woodward. 2017. Genetic Improvement of Software: a Comprehensive Survey. IEEE Transactions on Evolutionary Computation PP, 99 (2017), 1--1.
[18]
Justyna Petke, Mark Harman, William B. Langdon, and Westley Weimer. 2014. Using Genetic Improvement and Code Transplants to Specialise a C++ Program to a Problem Class. In 17th European Conference on Genetic Programming (LNCS), Miguel Nicolau, Krzysztof Krawiec, Malcolm I. Heywood, Mauro Castelli, Pablo Garcia-Sanchez, Juan J. Merelo, Victor M. Rivas Santos, and Kevin Sim (Eds.), Vol. 8599. Springer, 137--149.
[19]
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 Proceedings of the 2015 International Symposium on Software Testing and Analysis (ISSTA 2015). ACM, New York, NY, USA, 24--36.
[20]
Westley Weimer, ThanhVu Nguyen, Claire Le Goues, and Stephanie Forrest. 2009. Automatically Finding Patches Using Genetic Programming. In Proceedings of the 31st IEEE International Conference on Software Engineering (ICSE '09). IEEE, Vancouver, Canada, 364--374.
[21]
David R White. 2017. GI in no time. In Proceedings of the Genetic and Evolutionary Computation Conference Companion. ACM, 1549--1550.
[22]
W. E. Wong, Ruizhi Gao, Yihao Li, Rui Abreu, and Franz Wotawa. 2016. A Survey on Software Fault Localization. IEEE Transactions on Software Engineering 42, 8 (August 2016), 707.

Cited By

View all

Index Terms

  1. Comparing line and AST granularity level for program repair using PyGGI

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    GI '18: Proceedings of the 4th International Workshop on Genetic Improvement Workshop
    June 2018
    63 pages
    ISBN:9781450357531
    DOI:10.1145/3194810
    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]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 02 June 2018

    Permissions

    Request permissions for this article.

    Check for updates

    Qualifiers

    • Research-article

    Funding Sources

    • National Research Foundation Korea

    Conference

    ICSE '18
    Sponsor:

    Upcoming Conference

    ICSE 2025

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)19
    • Downloads (Last 6 weeks)1
    Reflects downloads up to 15 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2025)Deep imperative mutations have less impactAutomated Software Engineering10.1007/s10515-024-00475-432:1Online publication date: 1-Jun-2025
    • (2024)Automated Program Repair for Introductory Programming AssignmentsIEEE Transactions on Learning Technologies10.1109/TLT.2024.340371017(1745-1760)Online publication date: 21-May-2024
    • (2023)Genetically Improved Software with fewer Data Cache MissesProceedings of the Companion Conference on Genetic and Evolutionary Computation10.1145/3583133.3590542(799-802)Online publication date: 15-Jul-2023
    • (2023)Program transformation landscapes for automated program modification using GinEmpirical Software Engineering10.1007/s10664-023-10344-528:4Online publication date: 14-Jul-2023
    • (2022)Py2CyProceedings of the Genetic and Evolutionary Computation Conference Companion10.1145/3520304.3534037(1950-1955)Online publication date: 9-Jul-2022
    • (2021)Evolving JavaScript Code to Reduce Load TimeIEEE Transactions on Software Engineering10.1109/TSE.2019.292829347:8(1544-1558)Online publication date: 1-Aug-2021
    • (2021)Empirical Comparison of Search Heuristics for Genetic Improvement of SoftwareIEEE Transactions on Evolutionary Computation10.1109/TEVC.2021.307027125:5(1001-1011)Online publication date: Oct-2021
    • (2021)Multiplicative Weights Algorithms for Parallel Automated Software Repair2021 IEEE International Parallel and Distributed Processing Symposium (IPDPS)10.1109/IPDPS49936.2021.00107(984-993)Online publication date: May-2021
    • (2020)Impact of Test Suite Coverage on Overfitting in Genetic Improvement of SoftwareSearch-Based Software Engineering10.1007/978-3-030-59762-7_14(188-203)Online publication date: 7-Oct-2020
    • (2019)PyGGI 2.0: language independent genetic improvement frameworkProceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3338906.3341184(1100-1104)Online publication date: 12-Aug-2019
    • 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

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media