{"title":"Assertion-Driven Test Repair Based on Priority Criteria","authors":"Ruilian Zhao, Shukai Zhang, Yan Wang, Weiwei Wang","volume":207,"journal":"International Journal of Computer and Systems Engineering","pagesStart":133,"pagesEnd":143,"ISSN":"1307-6892","URL":"https:\/\/publications.waset.org\/pdf\/10013549","abstract":"<p>Repairing broken test cases is an expensive and challenging task in evolving software systems. Although an automated repair technique with intent-preservation has been proposed, it does not take into account the association between test repairs and assertions, leading a large number of irrelevant candidates and decreasing the repair capability. This paper proposes a assertion-driven test repair approach. Furthermore, a intent-oriented priority criterion is raised to guide the repair candidate generation, making the repairs closer to the intent of the test. In more detail, repair targets are determined through post-dominance relations between assertions and the methods that directly cause compilation errors. Then, test repairs are generated from the target in a bottom-up way, guided by the the intent-oriented priority criteria. Finally, the generated repair candidates are prioritized to match the original test intent. The approach is implemented and evaluated on the benchmark of 4 open-source programs and 91 broken test cases. The result shows that the approach can fix 89% (81\/91) broken test cases, which are more effective than the existing intent-preserved test repair approach, and our intent-oriented priority criteria work well.<\/p>","references":"[1] B. Daniel, V. Jagannath, D. Dig, and D. Marinov, \u201cReAssert: Suggesting\r\nrepairs for broken unit tests,\u201d ASE2009 - 24th IEEE\/ACM International\r\nConference on Automated Software Engineering, pp. 433\u2013444, 2009.\r\n[2] A. M. Memon and M. L. Soffa, \u201cRegression testing of GUIs,\u201d\r\nProceedings of the ACM SIGSOFT Symposium on the Foundations of\r\nSoftware Engineering, vol. 28, no. 5, pp. 118\u2013127, 2003.\r\n[3] J. Imtiaz, S. Sherin, M. U. Khan, and M. Z. Iqbal, \u201cA systematic\r\nliterature review of test breakage prevention and repair techniques,\u201d\r\nInformation and Software Technology, vol. 113, no. May, pp. 1\u201319,\r\n2019. (Online). Available: https:\/\/doi.org\/10.1016\/j.infsof.2019.05.001\r\n[4] B. Daniel, D. Dig, T. Gvero, V. Jagannath, J. Jiaa, D. Mitchell, J. Nogiec,\r\nS. H. Tan, and D. Marinov, \u201cReAssert: A tool for repairing broken\r\nunit tests,\u201d in Proceedings - International Conference on Software\r\nEngineering, 2011, pp. 1010\u20131012.\r\n[5] M. Mirzaaghaei, F. Pastore, and M. Pezz\u00b4e, \u201cAutomatically repairing\r\ntest cases for evolving method declarations,\u201d in IEEE International\r\nConference on Software Maintenance, ICSM. IEEE, sep 2010, pp.\r\n1\u20135. (Online). Available: http:\/\/ieeexplore.ieee.org\/document\/5609549\/\r\n[6] M. Mirzaaghaei, F. Pastore, and M. Pezz`e, \u201cSupporting test\r\nsuite evolution through test case adaptation,\u201d Proceedings - IEEE\r\n5th International Conference on Software Testing, Verification and\r\nValidation, ICST 2012, vol. 2, pp. 231\u2013240, 2012.\r\n[7] Y. Xu, B. Huang, G. Wu, and M. Yuan, \u201cUsing genetic algorithms to\r\nrepair JUnit test cases,\u201d Proceedings - Asia-Pacific Software Engineering\r\nConference, APSEC, vol. 1, pp. 287\u2013294, 2014.\r\n[8] L. S. Pinto, S. Sinha, and A. Orso, \u201cUnderstanding myths and\r\nrealities of test-suite evolution,\u201d Proceedings of the ACM SIGSOFT 20th\r\nInternational Symposium on the Foundations of Software Engineering,\r\nFSE 2012, vol. 1, pp. 1\u201311, 2012.\r\n[9] X. Li, M. D\u2019Amorim, and A. Orso, \u201cIntent-preserving test repair,\u201d\r\nProceedings - 2019 IEEE 12th International Conference on Software\r\nTesting, Verification and Validation, ICST 2019, pp. 217\u2013227, 2019.\r\n[10] R. A. Assi, W. Masri, and F. Zaraket, \u201cUCov: a user-defined coverage\r\ncriterion for test case intent verification,\u201d Software Testing Verification\r\nand Reliability, vol. 26, no. 6, pp. 460\u2013491, 2016.\r\n[11] T. Xie, D. Marinov, and D. Notkin, \u201cRostra: A framework for\r\ndetecting redundant object-oriented unit tests,\u201d Proceedings - 19th\r\nInternational Conference on Automated Software Engineering, ASE\r\n2004, pp. 196\u2013205, 2004.\r\n[12] D. van Bruggen. JavaParser : Analyse, transform and generate your\r\nJava codebase. (Online). Available: http:\/\/javaparser.org\/\r\n[13] W. Visser, C. S. P\u02c7as\u02c7areanu, and S. Khurshid, \u201cTest input generation with\r\nJava PathFinder,\u201d in ISSTA 2004 - Proceedings of the ACM SIGSOFT\r\nInternational Symposium on Software Testing and Analysis, 2004, pp.\r\n97\u2013107.\r\n[14] B. Daniel, T. Gvero, and D. Marinov, \u201cOn test repair using symbolic\r\nexecution,\u201d ISSTA\u201910 - Proceedings of the 2010 International Symposium\r\non Software Testing and Analysis, pp. 207\u2013217, 2010.\r\n[15] H. A. Nguyen, T. T. Nguyen, T. N. Nguyen, and H. V. Nguyen,\r\n\u201cInteraction-based tracking of program entities for test case evolution,\u201d\r\nProceedings - 2017 IEEE International Conference on Software\r\nMaintenance and Evolution, ICSME 2017, pp. 433\u2013443, 2017.\r\n[16] I. Balaban, F. Tip, and R. Fuhrer, \u201cRefactoring support for class library\r\nmigration,\u201d ACM SIGPLAN Notices, vol. 40, no. 10, pp. 265\u2013279, 2005.\r\n[17] H. Zhong, S. Thummalapenta, T. Xie, L. Zhang, and Q. Wang, \u201cMining\r\nAPI mapping for language migration,\u201d Proceedings - International\r\nConference on Software Engineering, vol. 1, pp. 195\u2013204, 2010.\r\n[18] A. T. Nguyen, H. A. Nguyen, T. T. Nguyen, and T. N. Nguyen,\r\n\u201cStatistical learning approach for mining API usage mappings for\r\ncode migration,\u201d in ASE 2014 - Proceedings of the 29th ACM\/IEEE\r\nInternational Conference on Automated Software Engineering, 2014, pp.\r\n457\u2013468.\r\n[19] Y. Yuan and W. Banzhaf, \u201cARjA: Automated repair of Java programs\r\nvia multi-objective genetic programming,\u201d arXiv, vol. 46, no. 10, pp.\r\n1040\u20131067, 2017.\r\n[20] J. Hua, M. Zhang, K. Wang, and S. Khurshid, \u201cTowards practical\r\nprogram repair with on-demand candidate generation,\u201d pp. 12\u201323, 2018.\r\n[21] S. McMaster and A. M. Memon, \u201cAn extensible heuristic-based\r\nframework for GUI test case maintenance,\u201d IEEE International\r\nConference on Software Testing, Verification, and Validation Workshops,\r\nICSTW 2009, pp. 251\u2013254, 2009.\r\n[22] S. Zhang, H. L\u00fc, and M. D. Ernst, \u201cAutomatically repairing broken\r\nworkflows for evolving GUI applications,\u201d in 2013 International\r\nSymposium on Software Testing and Analysis, ISSTA 2013 - Proceedings,\r\n2013, pp. 45\u201355.\r\n[23] X. Li, N. Chang, Y. Wang, H. Huang, Y. Pei, L. Wang, and\r\nX. Li, \u201cATOM: Automatic Maintenance of GUI Test Scripts for\r\nEvolving Mobile Applications,\u201d Proceedings - 10th IEEE International\r\nConference on Software Testing, Verification and Validation, ICST 2017,\r\npp. 161\u2013171, 2017.\r\n[24] S. R. Choudhary, D. Zhao, H. Versee, and A. Orso, \u201cWATER: Web\r\napplication TEst repair,\u201d in 2011 International Workshop on End-to-End\r\nTest Script Engineering, ETSE 2011 - Proceedings, 2011, pp. 24\u201329.\r\n[25] M. Hammoudi, G. Rothermel, and A. Stocco, \u201cWATERFALL:\r\nAn incremental approach for repairing record-replay tests of web\r\napplications,\u201d in Proceedings of the ACM SIGSOFT Symposium on\r\nthe Foundations of Software Engineering, vol. 13-18-Nove, 2016, pp.\r\n751\u2013762.\r\n[26] A. Stocco, R. Yandrapally, and A. Mesbah, \u201cVisual web test repair,\u201d in\r\nProceedings of the 2018 26th ACM Joint Meeting on European Software\r\nEngineering Conference and Symposium on the Foundations of Software\r\nEngineering. New York, NY, USA: ACM, oct 2018, pp. 503\u2013514.\r\n(Online). Available: https:\/\/dl.acm.org\/doi\/10.1145\/3236024.3236063","publisher":"World Academy of Science, Engineering and Technology","index":"Open Science Index 207, 2024"}