期刊文献+

基于代码相似性的测试用例重用及生成方法

Test case reuse and generation method based on code similarity
下载PDF
导出
摘要 为在测试用例自动化生成中有效利用现有用例信息,降低测试用例生成成本,提高生成效率,提出一种基于代码相似性的测试用例重用及生成方法。设计基于文本和度量的被测代码相似性检测方法,分别从语法和语义上检测并划分相似类型;针对不同相似类型,采用更名重用和补充重用生成测试用例。将代码相似性应用于测试用例生成,综合考虑代码的语法、语义等多维相似信息,提升代码相似性检测的准确性,能更有效运用重用技术提升测试用例生成效率。实验结果表明,所提方法具有更高的重用召回率和重用精度,在相同时间成本下生成的测试用例覆盖率更高。 To make effective use of existing use case information,reduce test case generation cost and improve generation efficiency in automatic test case generation,a test case reuse and generation method based on code similarity was proposed.A similarity detection method based on text and measurement was designed to detect and classify similar types from syntax and semantics respectively.For different similar types,test cases were generated with renaming reuse and supplementary reuse.Code similarity was applied to test case generation,the syntax,semantics and other multi-dimensional similar information of the code were comprehensively considered.The accuracy of code similarity detection was improved,and the reuse technology was more effectively utilized to improve the efficiency of test case generation.Experimental results show that the proposed method has higher reuse recall and reuse accuracy,and the coverage is higher at the same time cost.
作者 刘巧韵 杨秋辉 洪玫 刘美英 刘盈盈 LIU Qiao-yun;YANG Qiu-hui;HONG Mei;LIU Mei-ying;LIU Ying-ying(College of Computer Science,Sichuan University,Chengdu 610065,China)
出处 《计算机工程与设计》 北大核心 2023年第10期2950-2955,共6页 Computer Engineering and Design
基金 国家重点研发计划基金项目(2020YFB1711801) 四川省自然科学基金项目(23NSFSC3752) 四川大学专职博士后研发基金项目(2022SCU12077)。
关键词 单元测试 测试用例自动化生成 测试用例重用 代码相似性检测 代码克隆 语法相似性 语义相似性 unit test automatic test case generation test case reuse code similarity detection code cloned text-based similarity measurement-based similarity
  • 相关文献

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部