Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
102 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
6 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Reinforcement Learning for Mutation Operator Selection in Automated Program Repair (2306.05792v2)

Published 9 Jun 2023 in cs.SE

Abstract: Automated program repair techniques aim to aid software developers with the challenging task of fixing bugs. In heuristic-based program repair, a search space of program variants, created via mutations on software, is explored to find potential patches for bugs. Most commonly, every selection of a mutation operator during search is performed uniformly at random, whcih can generate many buggy, even uncompilable program variants. Our goal is to reduce the generation of variants that do not compile or break intended functionality which waste considerable resources. In this paper, we investigate the feasibility of a reinforcement learning-based approach for the selection of mutation operators in heuristic-based program repair. Our proposed approach is programming language, granularity-level, and search strategy agnostic and allows for easy augmentation into existing heuristic-based repair tools. We conduct an extensive empirical evaluation of four operator selection techniques, two reward types, two credit assignment strategies, two integration methods, and three sets of mutation operators using 30,080 independent repair attempts. We evaluate our approach on 353 real-world bugs from the Defects4J benchmark.The reinforcement learning-based mutation operator selection results in a higher number of test-passing variants, but does not exhibit a noticeable improvement in the number of bugs patched in comparison with the baseline, which uses random selection. While reinforcement learning has been previously shown to be successful in improving the search of evolutionary algorithms, often used in heuristic-based program repair, it has not shown such improvements when applied to this area of research.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (93)
  1. C. Weiß, R. Premraj, T. Zimmermann, and A. Zeller, “How long will it take to fix this bug?,” MSR, 2007.
  2. M. Böhme, E. O. Soremekun, S. Chattopadhyay, E. Ugherughe, and A. Zeller, “Where is the bug and how is it fixed? An experiment with practitioners,” ESEC/FSE, pp. 117–128, 2017.
  3. C. Liu, J. Lu, G. Li, T. Yuan, L. Li, F. Tan, J. Yang, L. You, and J. Xue, “Detecting TensorFlow Program Bugs in Real-World Industrial Environment,” ASE, pp. 55–66, 2021.
  4. G. Tassey, “The Economic Impacts of Inadequate Infrastructure for Software Testing,” NIST, 2002.
  5. C. L. Goues, M. Pradel, and A. Roychoudhury, “Automated program repair,” Communications of the ACM, 2019.
  6. J. Xuan, M. Martinez, F. Demarco, M. Clément, S. Lamelas, T. Durieux, D. L. Berre, and M. Monperrus, “Nopol: Automatic repair of conditional statement bugs in java programs,” IEEE TSE, vol. 43, pp. 34–55, 2018.
  7. L. Chen, Y. Pei, M. Pan, T. Zhang, Q. Wang, and C. A. Furia, “Program Repair with Repeated Learning,” IEEE TSE, 2022.
  8. S. O. Haraldsson, J. R. Woodward, A. E. I. Brownlee, and K. Siggeirsdottir, “Fixing bugs in your sleep: How genetic improvement became an overnight success,” in GECCO, pp. 1513–1520, ACM, 2017.
  9. A. Marginean, J. Bader, S. Chandra, M. Harman, Y. Jia, K. Mao, A. Mols, and A. Scott, “Sapfix: Automated end-to-end repair at scale,” ICSE-SEIP, 2019.
  10. S. Kirbas, E. Windels, O. Mcbello, K. Kells, M. Pagano, R. Szalanski, V. Nowack, E. Winter, S. Counsell, D. Bowes, T. Hall, S. Haraldsson, and J. Woodward, “On the introduction of automatic program repair in bloomberg,” IEEE Software, 2020.
  11. J. R. Koza, “Genetic programming as a means for programming computers by natural selection,” Statistics and Computing, vol. 4, no. 2, pp. 87–112, 1994.
  12. H. H. Hoos and T. Stützle, Stochastic local search: Foundations and Applications. Morgan Kaufmann Publishers Inc., 2004.
  13. M. Smigielska, A. Blot, and J. Petke, “Uniform Edit Selection for Genetic Improvement: Empirical Analysis of Mutation Operator Efficacy,” Int. Workshop on GI, pp. 1–8, 2021.
  14. M. Soto and C. Le Goues, “Using a probabilistic model to predict bug fixes,” SANER, vol. 2018-March, pp. 221–231, 2018.
  15. L. da Costa, Á. Fialho, M. Schoenauer, and M. Sebag, “Adaptive Operator Selection with Dynamic Multi-Armed Bandits,” GECCO, pp. 913–920, 2008.
  16. Á. Fialho, L. Da Costa, M. Schoenauer, and M. Sebag, “Dynamic Multi-Armed Bandits and Extreme Value-Based Rewards for Adaptive Operator Selection in Evolutionary Algorithms,” LNTCS, vol. 5851, pp. 176–190, 2009.
  17. Á. Fialho, M. Schoenauer, and M. Sebag, “Toward Comparison-based Adaptive Operator Selection,” GECCO, 2010.
  18. D. Thierens, “An adaptive pursuit strategy for allocating operator probabilities,” GECCO, pp. 1539–1546, 2005.
  19. T. Murata and H. Ishibuchi, “Positive and negative combination effects of crossover and mutation operators in sequencing problems,” IEEE CEC, pp. 170–175, 1996.
  20. A. E. Eiben, M. Horvath, W. Kowalczyk, and M. C. Schut, “Reinforcement Learning for Online Control of Evolutionary Algorithms,” LNAI, vol. 4335, pp. 151–160, 2007.
  21. R. E. J. E. Pettinger, “Controlling Genetic Algorithms With Reinforcement Learning,” GECCO, 2002.
  22. M. Sharma, M. López-Ibáñez, A. Komninos, and D. Kazakov, “Deep reinforcement learning based parameter control in differential evolution,” GECCO, pp. 709–717, 2019.
  23. H. Zhang and J. Lu, “Adaptive evolutionary programming based on reinforcement learning,” Information Sciences, vol. 178, no. 4, pp. 971–984, 2008.
  24. Y. Qi, X. Mao, Y. Lei, Z. Dai, and C. Wang, “The strength of random search on automated program repair,” ICSE, pp. 254–265, 2014.
  25. Y. Yuan and W. Banzhaf, “ARJA: Automated Repair of Java Programs via Multi-Objective Genetic Programming,” IEEE TSE, 2018.
  26. M. Soto, “Improving patch quality by enhancing key components of automatic program repair,” ASE, pp. 1230–1233, 2019.
  27. X.-B. D. Le, “Towards Efficient and Effective Automatic Program Repair,” ASE, 2016.
  28. E. K. Smith, E. T. Barr, C. Le Goues, and Y. Brun, “Is the cure worse than the disease? Overfitting in automated program repair,” ESEC/FSE, pp. 532–543, 2015.
  29. D. Kim, J. Nam, J. Song, and S. Kim, “Automatic Patch Generation Learned from Human-Written Patches,” ICSE, 2013.
  30. R. S. Sutton and A. G. Barto, Reinforcement Learning An Introduction. MIT Press, 2018.
  31. J. Maturana, Á. Fialho, F. Saubion, M. Schoenauer, and M. Sebag, “Extreme compass and dynamic multi-armed bandits for adaptive operator selection,” GEC, pp. 365–372, 2009.
  32. Á. Fialho, M. Schoenauer, and M. Sebag, “Analysis of Adaptive Operator Selection Techniques on the Royal Road and Long K-Path Problems,” GECCO, 2009.
  33. L. Davis, “Adapting Operator Probabilities in Genetic Algorithms,” in Int. Conf. on GA, pp. 61–69, 1989.
  34. B. A. Julstrum, “What Have You Done for Me Lately? Adapting Operator Probabilities in a Steady-State Genetic Algorithm,” in Int. Conf. on GA, pp. 81–87, 1995.
  35. J. Maturana and F. Saubion, “A compass to guide genetic algorithms,” LNCS, vol. 5199, pp. 256–265, 2008.
  36. P. Auer, N. Cesa-Bianchi, and P. Fischer, “Finite-time Analysis of the Multiarmed Bandit Problem,” Machine Learning, vol. 47, no. 2, pp. 235–256, 2002.
  37. H. J. C. Barbosa and A. Medeiros, “On Adaptive Operator Probabilities in Real Coded Genetic Algorithms,” Workshop on Advances and Trends in Artificial Intelligence for Problem Solving, 2000.
  38. J. M. Whitacre, T. Q. Pham, and R. A. Sarker, “Use of Statistical Outlier Detection Method in Adaptive Evolutionary Algorithms,” GECCO, 2006.
  39. M. Motwani, M. Soto, Y. Brun, R. Just, and C. Le Goues, “Quality of Automated Program Repair on Real-World Defects,” IEEE TSE, vol. 48, no. 2, pp. 637–661, 2022.
  40. program repair.org, “Tools for automated program repair.” https://program-repair.org/tools.html, 2023. Accessed: 2rd Feb 2023.
  41. C. Le Goues, T. V. Nguyen, S. Forrest, and W. Weimer, “GenProg: A generic method for automatic software repair,” IEEE TSE, vol. 38, no. 1, pp. 54–72, 2012.
  42. Y. Qi, X. Mao, and Y. Lei, “Efficient automated program repair through fault-recorded testing prioritization,” IEEE ICSM, pp. 180–189, 2013.
  43. program repair.org, “Benchmarks for automated program repair.” https://program-repair.org/benchmarks.html, 2023. Accessed: 2rd Feb 2023.
  44. M. Martinez and M. Monperrus, “ASTOR: A program repair library for Java (Demo),” ISSTA, pp. 441–444, 2016.
  45. Defects4J, “Defects4J – version 2.0.0.” https://github.com/rjust/defects4j/, 2023. Accessed: 2rd Feb 2023.
  46. EvoSuite, “Automatic test suite generation for java.” https://www.evosuite.org/, 2023. Accessed: 2rd Feb 2023.
  47. Randoop, “Automatic unit test generation for java.” https://randoop.github.io/randoop/, 2023. Accessed: 2rd Feb 2023.
  48. LASER-UMASS, “Artifact Replication Repository for the study on Quality of Automated Program Repair on Real-World Defects.” https://github.com/LASER-UMASS/JavaRepair-replication-package, 2020. Accessed: 2rd Feb 2023.
  49. D. Sobania, M. Briesch, C. Hanna, and J. Petke, “An analysis of the automatic bug fixing performance of chatgpt,” Proceedings - 2023 IEEE/ACM International Workshop on Automated Program Repair, APR 2023, pp. 23–30, 2023.
  50. N. Jiang, T. Lutellier, and L. Tan, “Cure: Code-aware neural machine translation for automatic program repair,” ICSE, pp. 1161–1173, 2 2021.
  51. Q. Zhu, Z. Sun, Y. A. Xiao, W. Zhang, K. Yuan, Y. Xiong, and L. Zhang, “A syntax-guided edit decoder for neural program repair,” ESEC/FSE, pp. 341–353, 8 2021.
  52. C. S. Xia and L. Zhang, “Less training, more repairing please: Revisiting automated program repair via zero-shot learning,” ESEC/FSE, pp. 959–971, 7 2022.
  53. A. Tuson and P. Ross, “Cost based operator rate adaptation: An investigation,” LNCS, vol. 1141, pp. 461–469, 1996.
  54. A. Aleti and I. Moser, “A Systematic Literature Review of Adaptive Parameter Control Methods for Evolutionary Algorithms,” ACM CSUR, vol. 49, no. 3, 2016.
  55. H. Moazen, S. Molaei, L. Farzinvash, and M. Sabaei, “Pso-elpm: Pso with elite learning, enhanced parameter updating, and exponential mutation operator,” Information Sciences, vol. 628, pp. 70–91, 5 2023.
  56. J. T. Stanczak, J. J. Mulawka, and B. K. Verma, “Genetic algorithms with adaptive probabilities of operator selection,” ICCIMA, pp. 464–468, 1999.
  57. B. A. Julstrom, “Adaptive operator probabilities in a genetic algorithm that applies three operators,” ACM SAC, pp. 233–238, 1997.
  58. F. Vafaee, W. Xiao, P. C. Nelson, and C. Zhou, “Adaptively evolving probabilities of genetic operators,” ICMLA, pp. 292–299, 2008.
  59. J. A. Soria-Alcaraz, G. Ochoa, M. Carpio, and H. Puga, “Evolvability metrics in adaptive operator selection,” GECCO, pp. 1327–1334, 2014.
  60. J. Hesser and R. Mäinner, “Towards an optimal mutation probability for genetic algorithms,” LNCS, vol. 496, pp. 23–32, 1991.
  61. K. I. Ali and K. Brohi, “An adaptive learning automata for genetic operators allocation probabilities,” FIT, pp. 55–59, 2013.
  62. M. T. A. Anik and S. Ahmed, “A mixed mutation approach for evolutionary programming based on guided selection strategy,” ICIEV, 2013.
  63. L. Hong, J. H. Drake, and E. Özcan, “A step size based self-adaptive mutation operator for Evolutionary Programming,” GECCO, pp. 1381–1387, 2014.
  64. D. Jackson, “Mutation as a Diversity Enhancing Mechanism in Genetic Programming,” GECCO, 2011.
  65. M. R. Glickman, M. R. Glickman, and K. Sycara, “Reasons for Premature Convergence of Self-Adapting Mutation Rates,” IEEE CEC, pp. 62–69, 2000.
  66. T. Friedrich, F. Quinzan, and M. Wagner, “Escaping large deceptive basins of attraction with heavy-tailed mutation operators,” GECCO, pp. 293–300, 2018.
  67. X. Yu and Y. Lu, “Reinforcement learning-based multi-objective differential evolution for wind farm layout optimization,” Energy, vol. 284, p. 129300, 12 2023.
  68. X. Yu and J. Zhou, “A robust method based on reinforcement learning and differential evolution for the optimal photovoltaic parameter extraction,” Applied Soft Computing, vol. 148, p. 110916, 11 2023.
  69. X. Yu, Z. Hu, W. Luo, and Y. Xue, “Reinforcement learning-based multi-objective differential evolution algorithm for feature selection,” Information Sciences, vol. 661, p. 120185, 3 2024.
  70. A. Awad, A. Hawash, and B. Abdalhaq, “A genetic algorithm (ga) and swarm based binary decision diagram (bdd) reordering optimizer reinforced with recent operators,” IEEE TEVC, 2022.
  71. T. Li, Y. Meng, and L. Tang, “Scheduling of continuous annealing with a multi-objective differential evolution algorithm based on deep reinforcement learning,” ASE, 2023.
  72. Z. Zhang, Q. Tang, M. Chica, and Z. Li, “Reinforcement learning-based multiobjective evolutionary algorithm for mixed-model multimanned assembly line balancing under uncertain demand,” IEEE Trans. on Cybernetics, pp. 1–14, 1 2023.
  73. C. Le Goues, W. Wemer, and S. Forrest, “Representations and operators for improving evolutionary software repair,” GECCO, pp. 959–966, 2012.
  74. M. Wen, J. Chen, R. Wu, D. Hao, and S. C. Cheung, “Context-aware patch generation for better automated program repair,” ICSE, vol. 2018-Janua, pp. 1–11, 2018.
  75. M. R. Ullah, N. S. Chowdhury, and F. M. Tawsif, “Impact of combining syntactic and semantic similarities on patch prioritization while using the insertion mutation operators,” SEKE, pp. 190–195, 2023.
  76. X. B. D. Le, D. Lo, and C. Le Goues, “History driven program repair,” SANER, vol. 1, pp. 213–224, 2016.
  77. L. Schramm, “Improving Performance of Automatic Program Repair using Learned Heuristics,” ESEC/FSE, 2017.
  78. H. Tian, K. Liu, Y. Li, A. Kader, A. Koyuncu, A. Habib, L. Li, J. Wen, J. Klein, and T. F. Bissyandé, “The best of both worlds: Combining learned embeddings with engineered features for accurate prediction of correct patches,” ACM TOSEM, vol. 1, 2023.
  79. M. Valueian, M. Vahidi-Asl, and A. Khalilian, “SituRepair: Incorporating machine-learning fault class prediction to inform situational multiple fault automatic program repair,” IJCIP, vol. 37, p. 100527, 2022.
  80. C. Liu, J. Yang, L. Tan, and M. Hafiz, “R2Fix: Automatically Generating Bug Fixes from Bug Reports,” ICST, 2013.
  81. N. Parasaram, E. T. Barr, and S. Mechtaev, “Rete: Learning namespace representation for program repair,” Proceedings - International Conference on Software Engineering, pp. 1264–1276, 2023.
  82. J. Jiang, L. Ren, Y. Xiong, and L. Zhang, “Inferring Program Transformations From Singular Examples via Big Code,” ASE, 2019.
  83. Z. Yu, M. Martinez, Z. Chen, T. F. Bissyandé, and M. Monperrus, “Learning the relation between code features and code transforms with structured prediction,” IEEE TSE, pp. 1–29, 2023.
  84. S. Ji, S.-M. Choi, S.-K. Ko, D. Kim, and H. Im, “RepCoder: An Automated Program Repair Framework for Probability-Based Program Synthesis,” ACM/SIGAPP SAC, 2022.
  85. A. Connor, A. Harris, N. Cooper, and D. Poshyvanyk, “Can we automatically fix bugs by learning edit operations?,” SANER, pp. 782–792, 2022.
  86. D. Gopinath, K. Wang, J. Hua, and S. Khurshid, “Repairing Intricate Faults in Code Using Machine Learning and Path Exploration,” ICSME, 2016.
  87. T. Ahmed, N. R. Ledesma, and P. Devanbu, “Synshine: Improved fixing of syntax errors,” IEEE TSE, 2022.
  88. D. Wu, B. Shen, Y. Chen, H. Jiang, and L. Qiao, “Automatically repairing tensor shape faults in deep learning programs,” Information and Software Technology, vol. 151, p. 107027, 2022.
  89. M. Lajko, V. Csuvik, and L. Vidacs, “Towards javascript program repair with generative pre-trained transformer (gpt-2),” Int. Workshop on APR, pp. 61–68, 2022.
  90. S. Kang and S. Yoo, “Glad: Neural predicate synthesis to repair omission faults,” Proceedings - International Conference on Software Engineering, pp. 320–321, 2023.
  91. C. S. Xia, Y. Wei, and L. Zhang, “Automated program repair in the era of large pre-trained language models,” Proceedings - International Conference on Software Engineering, pp. 1482–1494, 2023.
  92. C. Liu, P. Cetin, Y. Patodia, S. Chakraborty, Y. Ding, and B. Ray, “Automated code editing with search-generate-modify,” 6 2024.
  93. C. Geethal, M. Bohme, and V. T. Pham, “Human-in-the-loop automatic program repair,” IEEE Transactions on Software Engineering, vol. 49, pp. 4526–4549, 10 2023.
User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (3)
  1. Carol Hanna (5 papers)
  2. Aymeric Blot (6 papers)
  3. Justyna Petke (16 papers)
X Twitter Logo Streamline Icon: https://streamlinehq.com