Advertisement

Ultra-Large Repair Search Space with Automatically Mined Templates: The Cardumen Mode of Astor

  • Matias MartinezEmail author
  • Martin Monperrus
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11036)

Abstract

Astor is a program repair library which has different modes. In this paper, we present the Cardumen mode of Astor, a repair approach based mined templates that has an ultra-large search space. We evaluate the capacity of Cardumen to discover test-suite adequate patches (aka plausible patches) over the 356 real bugs from Defects4J [11]. Cardumen finds 8935 patches over 77 bugs of Defects4J. This is the largest number of automatically synthesized patches ever reported, all patches being available in an open-science repository. Moreover, Cardumen identifies 8 unique patches, that are patches for Defects4J bugs that were never repaired in the whole history of program repair.

Keywords

Automated program repair Test-suite based repair approaches Code templates Patch dataset 

References

  1. 1.
    Barr, E.T., Brun, Y., Devanbu, P., Harman, M., Sarro, F.: The plastic surgery hypothesis. In: Proceedings of the 22Nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2014, pp. 306–317. ACM, New York (2014)Google Scholar
  2. 2.
    Campos, J., Riboira, A., Perez, A., Abreu, R.: GZoltar: an eclipse plug-in for testing and debugging. In: 2012 Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering, pp. 378–381, September 2012Google Scholar
  3. 3.
    Chen, L., Pei, Y., Furia, C.A.: Contract-based program repair without the contracts. In: Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering, ASE 2017, pp. 637–647. IEEE Press, Piscataway (2017)Google Scholar
  4. 4.
    Debroy, V., Wong, W.E.: Using mutation to automatically suggest fixes for faulty programs. In: Proceedings of the 2010 Third International Conference on Software Testing, Verification and Validation, ICST 2010, pp. 65–74 (2010)Google Scholar
  5. 5.
    Durieux, T., Cornu, B., Seinturier, L., Monperrus, M.: Dynamic patch generation for null pointer exceptions using metaprogramming. In: 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER), pp. 349–358, February 2017Google Scholar
  6. 6.
    Durieux, T., Danglot, B., Yu, Z., Martinez, M., Urli, S., Monperrus, M.: The patches of the Nopol automatic repair system on the bugs of Defects4J version 1.1.0. Research Report hal-01480084, Université Lille 1 - Sciences et Technologies (2017)Google Scholar
  7. 7.
    Durieux, T., Monperrus, M.: DynaMoth: dynamic code synthesis for automatic program repair. In: Proceedings of the 11th International Workshop on Automation of Software Test, AST 2016, pp. 85–91. ACM, New York 2016Google Scholar
  8. 8.
    Le Goues, C., et al.: The ManyBugs and introclass benchmarks for automated repair of C programs. IEEE Trans. Softw. Eng. 41(12), 1236–1256 (2015)CrossRefGoogle Scholar
  9. 9.
    Le Goues, C., Nguyen, T., Forrest, S., Weimer, W.: GenProg: a generic method for automatic software repair. IEEE Trans. Softw. Eng. 38(1), 54–72 (2012)CrossRefGoogle Scholar
  10. 10.
    Jiang, J., Xiong, Y.: Can defects be fixed with weak test suites? An analysis of 50 defects from defects4j. arXiv preprint arXiv:1705.04149 (2017)
  11. 11.
    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), San Jose, CA, USA, 23–25 July 2014, pp. 437–440 (2014)Google Scholar
  12. 12.
    Ke, Y., Stolee, K.T., Le Goues, C., Brun, Y.: Repairing programs with semantic code search (t). In: Proceedings of the 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE), ASE 2015, pp. 295–306. IEEE Computer Society, Washington, D.C. (2015)Google Scholar
  13. 13.
    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 2013, pp. 802–811. IEEE Press, Piscataway (2013)Google Scholar
  14. 14.
    Le, X.-B.D., Chu, D.-H., Lo, D., Le Goues, C., Visser, W.: S3: syntax- and semantic-guided repair synthesis via programming by examples. In Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2017, pp. 593–604. ACM, New York (2017)Google Scholar
  15. 15.
    Le, X.B.D., Lo, D., Le Goues, C.: History driven program repair. In: 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), vol. 1, pp. 213–224. IEEE (2016)Google Scholar
  16. 16.
    Liu, X., Zeng, M., Xiong, Y., Zhang, L., Huang, G.: Identifying patch correctness in test-based automatic program repair (2017)Google Scholar
  17. 17.
    Long, F., Amidon, P., Rinard, M.: Automatic inference of code transforms for patch generation. In: Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2017, pp. 727–739. ACM, New York (2017)Google Scholar
  18. 18.
    Long, F., Rinard, M.: Staged program repair with condition synthesis. In: Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2015, pp. 166–178. ACM, New York (2015)Google Scholar
  19. 19.
    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 2016, pp. 702–713. ACM, New York (2016)Google Scholar
  20. 20.
    Long, F., Rinard, M.: Automatic patch generation by learning correct code. SIGPLAN Not. 51(1), 298–312 (2016)CrossRefGoogle Scholar
  21. 21.
    Martinez, M., Durieux, T., Sommerard, R., Xuan, J., Monperrus, M.: Automatic repair of real bugs in Java: a large-scale experiment on the Defects4J dataset. Empirical Softw. Eng. 22, 1–29 (2016)Google Scholar
  22. 22.
    Martinez, M., Monperrus, M.: Mining software repair models for reasoning on the search space of automated program fixing. Empirical Softw. Eng. 20, 1–30 (2013)Google Scholar
  23. 23.
    Martinez, M., Monperrus, M.: ASTOR: a program repair library for Java (demo). In: Proceedings of the 25th International Symposium on Software Testing and Analysis, ISSTA 2016, pp. 441–444. ACM, New York (2016)Google Scholar
  24. 24.
    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 Companion 2014, pp. 492–495 (2014)Google Scholar
  25. 25.
    Nguyen, H.D.T., Qi, D., Roychoudhury, A., Chandra, S.: SemFix: program repair via semantic analysis. In Proceedings of the 2013 International Conference on Software Engineering, ICSE 2013, pp. 772–781. IEEE Press, Piscataway (2013)Google Scholar
  26. 26.
    Pawlak, R., Monperrus, M., Petitprez, N., Noguera, C., Seinturier, L.: Spoon: a library for implementing analyses and transformations of java source code. Softw.: Pract. Exp. 49, 1155–1179 (2015)Google Scholar
  27. 27.
    Qi, Y., Mao, X., Lei, Y., Dai, Z., Wang, C.: Does genetic programming work well on automated program repair? In: 2013 Fifth International Conference on Computational and Information Sciences (ICCIS), pp. 1875–1878. IEEE (2013)Google Scholar
  28. 28.
    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 2015 International Symposium on Software Testing and Analysis, ISSTA 2015, pp. 24–36. ACM, New York (2015)Google Scholar
  29. 29.
    Reps, T., Ball, T., Das, M., Larus, J.: The use of program profiling for software maintenance with applications to the year 2000 problem. In: Jazayeri, M., Schauer, H. (eds.) ESEC/SIGSOFT FSE - 1997. LNCS, vol. 1301, pp. 432–449. Springer, Heidelberg (1997).  https://doi.org/10.1007/3-540-63531-9_29CrossRefGoogle Scholar
  30. 30.
    Smith, E.K., Barr, E.T., Le Goues, C., Brun, Y.: Is the cure worse than the disease? Overfitting in automated program repair. In: Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering, pp. 532–543. ACM (2015)Google Scholar
  31. 31.
    Tu, Z., Su, Z., Devanbu, P.: On the localness of software. In: Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE 2014, pp. 269–280. ACM, New York (2014)Google Scholar
  32. 32.
    Weimer, W., Fry, Z.P., Forrest, S.: Leveraging program equivalence for adaptive program repair: models and first results. In: 2013 IEEE/ACM 28th International Conference on Automated Software Engineering (ASE), pp. 356–366, November 2013Google Scholar
  33. 33.
    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 2009, pp. 364–374 (2009)Google Scholar
  34. 34.
    Wen, M., Chen, J., Wu, R., Hao, D., Cheung, S.-C.: An empirical analysis of the influence of fault space on search-based automated program repair (2017)Google Scholar
  35. 35.
    White, M., Tufano, M., Martinez, M., Monperrus, M., Poshyvanyk, D.: Sorting and transforming program repair ingredients via deep learning code similarities (2017)Google Scholar
  36. 36.
    Xin, Q., Reiss, S.P.: Identifying test-suite-overfitted patches through test case generation. In: Proceedings of the 26th ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA 2017, pp. 226–236. ACM, New York (2017)Google Scholar
  37. 37.
    Xin, Q., Reiss, S.P.: Leveraging syntax-related code for automated program repair. In: Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE), pp. 660–670. IEEE (2017)Google Scholar
  38. 38.
    Xiong, Y., et al.: Precise condition synthesis for program repair. In: Proceedings of the 39th International Conference on Software Engineering, ICSE 2017, pp. 416–426. IEEE Press, Piscataway (2017)Google Scholar
  39. 39.
    Xuan, J., et al.: Nopol: automatic repair of conditional statement bugs in Java programs. IEEE Trans. Softw. Eng. 43, 34–55 (2016)CrossRefGoogle Scholar
  40. 40.
    Yang, J., Zhikhartsev, A., Liu, Y., Tan, L.: Better test cases for better automated program repair. In: Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering, ESEC/FSE 2017, pp. 831–841. ACM, New York (2017)Google Scholar
  41. 41.
    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. Empirical Softw. Eng., 1–35 (2018)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2018

Authors and Affiliations

  1. 1.University of ValenciennesValenciennesFrance
  2. 2.KTH Royal Institute of TechnologyStockholmSweden

Personalised recommendations