Abstract
Automated program repair aims at finding the correct patch of a bug using a specification such as test cases. An existing study found that almost 82.40% repair actions are associated with expressions such as method invocation or assignment expression. However, handling expression level bugs enhances the search space and increases the probability of finding incorrect plausible patches before the correct one. Consequently, existing program repair approaches either avoid or limitedly focus on expression level bugs. This study proposes two automated program repair approaches that extensively deals with expression level bugs. The devised techniques combine syntactic and semantic similarities to handle the enlarged search space and rank the correct patch higher. Genealogical and variable similarity are used to measure semantic similarity since these are good at differentiating between correct and incorrect patches. Two popular metrics namely normalized longest common subsequence and token similarity are considered individually for capturing syntactic similarity. To evaluate the proposed techniques, these are compared with baseline approaches that use either semantic or syntactic similarity. Single line bugs from Defects4J and QuixBugs benchmark are used for comparison. Result reveals that the proposed techniques can correctly repair 22 and 21 expression level bugs which are higher than approaches using only semantic or syntactic similarity. Furthermore, the devised approaches obtain 64.71% and 61.76% precision and outperform the baseline program repair techniques.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Asad, M., Ganguly, K.K., Sakib, K.: Impact of similarity on repairing small programs: a case study on quixbugs benchmark. In: Proceedings of the 42nd International Conference on Software Engineering Workshops (ICSEW), pp. 21–22. ACM (2020)
Asad, M., Ganguly, K.K., Sakib, K.: Impact of combining syntactic and semantic similarities on patch prioritization. In: Proceedings of the 15th International Conference on Evaluation of Novel Approaches to Software Engineering (ENASE), pp. 170–180. SCITEPRESS (2020)
Barr, E.T., Brun, Y., Devanbu, P., Harman, M., Sarro, F.: The plastic surgery hypothesis. In: Proceedings of the 22nd International Symposium on Foundations of Software Engineering (FSE), pp. 306–317. ACM (2014)
Campos, J., Riboira, A., Perez, A., Abreu, R.: Gzoltar: an eclipse plug-in for testing and debugging. In: Proceedings of the 27th International Conference on Automated Software Engineering (ASE), pp. 378–381. ACM (2012)
Chauhan, N.: Software Testing: Principles and Practices. Oxford University Press, Oxford (2010)
Chen, Z., Monperrus, M.: The remarkable role of similarity in redundancy-based program repair. Computing Research Repository (CoRR) abs/1811.05703 (2018). http://arxiv.org/abs/1811.05703
Durieux, T., Madeiral, F., Martinez, M., Abreu, R.: Empirical review of Java program repair tools: a large-scale experiment on 2,141 bugs and 23,551 repair attempts. In: Proceedings of the 27th Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE), pp. 302–313. ACM (2019)
Gabel, M., Jiang, L., Su, Z.: Scalable detection of semantic clones. In: Proceedings of the 30th International Conference on Software Engineering (ICSE), pp. 321–330. ACM (2008)
Gallardo, R., Hommel, S., Kannan, S., Gordon, J., Zakhour, S.B.: The Java Tutorial: A Short Course on the Basics. Addison-Wesley Professional (2014)
Gazzola, L., Micucci, D., Mariani, L.: Automatic software repair: a survey. IEEE Trans. Softw. Eng. (TSE) 45, 34–67 (2017)
Ghanbari, A., Benton, S., Zhang, L.: Practical program repair via bytecode mutation. In: Proceedings of the 28th International Symposium on Software Testing and Analysis (ISSTA), pp. 19–30. ACM (2019)
Ji, T., Chen, L., Mao, X., Yi, X.: Automated program repair by using similar code containing fix ingredients. In: Proceedings of the 40th Annual Computer Software and Applications Conference (COMPSAC), vol. 1, pp. 197–202. IEEE (2016)
Jiang, J., Xiong, Y., Zhang, H., Gao, Q., Chen, X.: Shaping program repair space with existing patches and similar code. In: Proceedings of the 27th International Symposium on Software Testing and Analysis (ISSTA), pp. 298–309. ACM (2018)
Just, R., Jalali, D., Ernst, M.D.: Defects4j: a database of existing faults to enable controlled testing studies for java programs. In: Proceedings of the International Symposium on Software Testing and Analysis (ISSTA), pp. 437–440. ACM (2014)
Ke, Y., Stolee, K.T., Le Goues, C., Brun, Y.: Repairing programs with semantic code search. In: Proceedings of the 30th International Conference on Automated Software Engineering (ASE), pp. 295–306. IEEE (2015)
Kim, D., Nam, J., Song, J., Kim, S.: Automatic patch generation learned from human-written patches. In: Proceedings of the 2013 International Conference on Software Engineering (ICSE), pp. 802–811. IEEE (2013)
Le, T.D.B., Thung, F., Lo, D.: Theory and practice, do they match? A case with spectrum-based fault localization. In: Proceedings of the International Conference on Software Maintenance (ICSM), pp. 380–383. IEEE (2013)
Le, X.B.D., Lo, D., Le Goues, C.: History driven program repair. In: Proceedings of the 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), vol. 1, pp. 213–224. IEEE (2016)
Le Goues, C., Nguyen, T., Forrest, S., Weimer, W.: GenProg: a generic method for automatic software repair. IEEE Trans. Softw. Eng. (TSE) 38(1), 54–72 (2011)
Liu, K., Kim, D., Koyuncu, A., Li, L., Bissyandé, T.F., Le Traon, Y.: A closer look at real-world patches. In: Proceedings of the International Conference on Software Maintenance and Evolution (ICSME), pp. 275–286. IEEE (2018)
Liu, K., Koyuncu, A., Bissyandé, T.F., Kim, D., Klein, J., Le Traon, Y.: You cannot fix what you cannot find! an investigation of fault localization bias in benchmarking automated program repair systems. In: Proceedings of the 12th IEEE Conference on Software Testing, Validation and Verification (ICST), pp. 102–113. IEEE (2019)
Liu, K., Koyuncu, A., Kim, D., Bissyandé, T.F.: TBAR: revisiting template-based automated program repair. In: Proceedings of the 28th International Symposium on Software Testing and Analysis (ISSTA), pp. 31–42. ACM (2019)
Liu, K., Koyuncu, A., Kim, K., Kim, D., Bissyande, T.F.D.A.: LSRepair: live search of fix ingredients for automated program repair. In: Proceedings of the 25th Asia-Pacific Software Engineering Conference (APSEC), pp. 658–662 (2018)
Liu, K., et al.: On the efficiency of test suite based program repair: a systematic assessment of 16 automated repair systems for Java programs. In: Proceedings of the 42nd International Conference on Software Engineering (ICSE) (2020)
Long, F., Rinard, M.: An analysis of the search spaces for generate and validate patch generation systems. In: Proceedings of the 38th International Conference on Software Engineering (ICSE), pp. 702–713. IEEE (2016)
Madeiral, F., Urli, S., Maia, M., Monperrus, M.: Bears: an extensible Java bug benchmark for automatic program repair studies. In: Proceedings of the 26th International Conference on Software Analysis, Evolution and Reengineering (SANER), pp. 468–478. IEEE (2019)
Martinez, M., Monperrus, M.: Astor: exploring the design space of generate-and-validate program repair beyond GenProg. J. Syst. Softw. 151, 65–80 (2019)
Martinez, M., Weimer, W., Monperrus, M.: 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 (ICSE), pp. 492–495. ACM (2014)
Monperrus, M.: 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), pp. 234–242 (2014)
Monperrus, M.: Automatic software repair: a bibliography. ACM Comput. Surv. (CSUR) 51(1), 17 (2018)
Qi, Y., Mao, X., Lei, Y., Dai, Z., Wang, C.: The strength of random search on automated program repair. In: Proceedings of the 36th International Conference on Software Engineering (ICSE), pp. 254–265. ACM (2014)
Qi, Z., Long, F., Achour, S., Rinard, M.: An analysis of patch plausibility and correctness for generate-and-validate patch generation systems. In: Proceedings of the International Symposium on Software Testing and Analysis (ISSTA), pp. 24–36. ACM (2015)
Ragkhitwetsagul, C., Krinke, J., Clark, D.: A comparison of code similarity analysers. Empir. Softw. Eng. 23(4), 2464–2519 (2018)
Saha, R., Lyu, Y., Lam, W., Yoshida, H., Prasad, M.: Bugs.jar: a large-scale, diverse dataset of real-world Java bugs. In: Proceedings of the 15th International Conference on Mining Software Repositories (MSR), pp. 10–13. IEEE (2018)
Saha, R.K., Lyu, Y., Yoshida, H., Prasad, M.R.: Elixir: effective object-oriented program repair. In: Proceedings of the 32nd International Conference on Automated Software Engineering (ASE), pp. 648–659. IEEE (2017)
Shamshiri, S., Just, R., Rojas, J.M., Fraser, G., McMinn, P., Arcuri, A.: Do automatically generated unit tests find real faults? An empirical study of effectiveness and challenges. In: Proceedings of the 30th International Conference on Automated Software Engineering (ASE), pp. 201–211. IEEE (2015)
Sobreira, V., Durieux, T., Madeiral, F., Monperrus, M., de Almeida Maia, M.: Dissection of a bug dataset: anatomy of 395 patches from defects4j. In: Proceedings of the 25th International Conference on Software Analysis, Evolution and Reengineering (SANER), pp. 130–140. IEEE (2018)
Thada, V., Jaglan, V.: Comparison of Jaccard, Dice, Cosine similarity coefficient to find best fitness value for web retrieved documents using genetic algorithm. Int. J. Innov. Eng. Technol. 2(4), 202–205 (2013)
Wang, S., Mao, X., Niu, N., Yi, X., Guo, A.: Multi-location program repair strategies learned from successful experience (S). In: Perkusich, A. (ed.) Proceedings of the 31st International Conference on Software Engineering and Knowledge Engineering (SEKE), pp. 713–777. KSI Research Inc. and Knowledge Systems Institute Graduate School (2019)
Wang, S., Wen, M., Mao, X., Yang, D.: Attention please: consider Mockito when evaluating newly proposed automated program repair techniques. In: Proceedings of the Evaluation and Assessment on Software Engineering (EASE), pp. 260–266. ACM (2019)
Weimer, W., Nguyen, T., Le Goues, C., Forrest, S.: Automatically finding patches using genetic programming. In: Proceedings of the 31st International Conference on Software Engineering (ICSE), pp. 364–374. IEEE (2009)
Wen, M., Chen, J., Wu, R., Hao, D., Cheung, S.C.: Context-aware patch generation for better automated program repair. In: Proceedings of the 40th International Conference on Software Engineering (ICSE), pp. 1–11. ACM (2018)
Wilcoxon, F.: Individual comparisons by ranking methods. In: Kotz, S., Johnson, N.L. (eds.) Breakthroughs in Statistics. SSS, pp. 196–202. Springer, New York (1992). https://doi.org/10.1007/978-1-4612-4380-9_16
Xin, Q., Reiss, S.P.: Identifying test-suite-overfitted patches through test case generation. In: Proceedings of the 26th International Symposium on Software Testing and Analysis (ISSTA), pp. 226–236. ACM (2017)
Xin, Q., Reiss, S.P.: Leveraging syntax-related code for automated program repair. In: Proceedings of the 32nd International Conference on Automated Software Engineering (ASE), pp. 660–670. IEEE (2017)
Xiong, Y., Liu, X., Zeng, M., Zhang, L., Huang, G.: Identifying patch correctness in test-based program repair. In: Proceedings of the 40th International Conference on Software Engineering (ICSE), pp. 789–799. ACM (2018)
Ye, H., Martinez, M., Durieux, T., Monperrus, M.: A comprehensive study of automatic program repair on the quixbugs benchmark. In: Proceedings of the 1st International Workshop on Intelligent Bug Fixing (IBF), pp. 1–10. IEEE (2019)
Ye, H., Martinez, M., Monperrus, M.: Automated patch assessment for program repair at scale. arXiv preprint arXiv:1909.13694 (2019)
Yu, Z., Martinez, M., Danglot, B., Durieux, T., Monperrus, M.: Alleviating patch overfitting with automatic test generation: a study of feasibility and effectiveness for the nopol repair system. Empir. Softw. Eng. 24(1), 33–67 (2019)
Zhang, J., Wang, X., Zhang, H., Sun, H., Wang, K., Liu, X.: A novel neural source code representation based on abstract syntax tree. In: Proceedings of the 41st International Conference on Software Engineering (ICSE), pp. 783–794. IEEE (2019)
Zhong, H., Su, Z.: An empirical study on real bug fixes. In: Proceedings of the 37th International Conference on Software Engineering (ICSE), vol. 1, pp. 913–923. IEEE (2015)
Acknowledgement
This research is supported by the fellowship from Information and Communication Technology Division, Bangladesh. No-56.00.0000.028.33.093.19-427; Dated 20.11.2019. The virtual machine facilities used in this research is provided by the Bangladesh Research and Education Network (BdREN).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Asad, M., Ganguly, K.K., Sakib, K. (2021). Combined Similarity Based Automated Program Repair Approaches for Expression Level Bugs. In: Ali, R., Kaindl, H., Maciaszek, L.A. (eds) Evaluation of Novel Approaches to Software Engineering. ENASE 2020. Communications in Computer and Information Science, vol 1375. Springer, Cham. https://doi.org/10.1007/978-3-030-70006-5_13
Download citation
DOI: https://doi.org/10.1007/978-3-030-70006-5_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-70005-8
Online ISBN: 978-3-030-70006-5
eBook Packages: Computer ScienceComputer Science (R0)