Using Genetic Algorithms to Repair JUnit Test Cases

Yong Xu, Bo Huang, Guoqing Wu, Mengting Yuan
{"title":"Using Genetic Algorithms to Repair JUnit Test Cases","authors":"Yong Xu, Bo Huang, Guoqing Wu, Mengting Yuan","doi":"10.1109/APSEC.2014.51","DOIUrl":null,"url":null,"abstract":"JUnit test repair has been proposed as a way to alleviate the burden of maintaining the broken tests caused by evolving software. Existing techniques for JUnit test repair either focus on repairing failing assertions or fixing test case compilation errors rendered by evolving method declarations. The empirical work suggests that the synthesis of new method calls is often needed when repairing test cases in practice. In this work, we propose Test Fix, an approach to fix broken JUnit test cases by synthesizing new method calls. Test Fix reduces the synthesis to a search problem and uses a genetic algorithm to solve it. Evaluated on real world applications, preliminary experimental results show that Test Fix can repair broken tests with adding or deleting method calls. Evaluations on the performance of JUnit test repair technique using a genetic algorithm against a random search algorithm are also conducted. Experimental results indicate the clear superiority of genetic algorithms over random search algorithm.","PeriodicalId":380881,"journal":{"name":"2014 21st Asia-Pacific Software Engineering Conference","volume":"22 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2014-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2014 21st Asia-Pacific Software Engineering Conference","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/APSEC.2014.51","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

Abstract

JUnit test repair has been proposed as a way to alleviate the burden of maintaining the broken tests caused by evolving software. Existing techniques for JUnit test repair either focus on repairing failing assertions or fixing test case compilation errors rendered by evolving method declarations. The empirical work suggests that the synthesis of new method calls is often needed when repairing test cases in practice. In this work, we propose Test Fix, an approach to fix broken JUnit test cases by synthesizing new method calls. Test Fix reduces the synthesis to a search problem and uses a genetic algorithm to solve it. Evaluated on real world applications, preliminary experimental results show that Test Fix can repair broken tests with adding or deleting method calls. Evaluations on the performance of JUnit test repair technique using a genetic algorithm against a random search algorithm are also conducted. Experimental results indicate the clear superiority of genetic algorithms over random search algorithm.
使用遗传算法修复JUnit测试用例
JUnit测试修复已经被提议作为一种方法来减轻维护由不断发展的软件造成的损坏测试的负担。现有的JUnit测试修复技术要么专注于修复失败的断言,要么专注于修复由不断发展的方法声明呈现的测试用例编译错误。实证研究表明,在实践中修复测试用例时,经常需要合成新的方法调用。在这项工作中,我们提出了测试修复,一种通过合成新的方法调用来修复损坏的JUnit测试用例的方法。Test Fix将合成简化为搜索问题,并使用遗传算法来解决它。在实际应用程序中进行了评估,初步实验结果表明,测试修复可以通过添加或删除方法调用来修复损坏的测试。利用遗传算法和随机搜索算法对JUnit测试修复技术的性能进行了评价。实验结果表明,遗传算法明显优于随机搜索算法。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信