DeepTC-Enhancer: Improving the Readability of Automatically Generated Tests

DeepTC-Enhancer: Improving the Readability of Automatically Generated Tests
复制标题

DeepTC-Enhancer:提高自动生成测试的可读性

DOI:
10.1145/3324884.3416622
复制
发表时间:
2020
期刊:
2020 35th IEEE/ACM International Conference on Automated Software Engineering (ASE)
影响因子:
--
通讯作者:
Mehdi Mirakhorli
Mehdi Mirakhorli
中科院分区:
--
文献类型:
--
作者:
Devjeet Roy;Ziyi Zhang;Maggie Ma;Venera Arnaoudova;Annibale Panichella;Sebastiano Panichella;Danielle Gonzalez;Mehdi Mirakhorli

文献摘要

参考文献

被引文献

相似文献

已经成功提出了自动测试案例生成工具,以减少编写和运行测试用例所需的人类和基础设施资源的数量。但是,最近的研究表明,由于(i)不信息标识符和(ii)缺乏适当的文档,生成的测试的可读性非常有限。先前的研究提出了通过生成自然语言摘要或有意义的方法名称来提高测试可读性的拟议技术。尽管这些方法被证明可以提高测试可读性,但它们也受到两个局限性的影响:(1)开发人员通常认为生成的摘要过于冗长和冗余,并且(2)可读测试需要两个适当的方法名称,但也需要有意义的标识符(也需要有意义的标识符(方法内可读性)。在这项工作中,我们结合了基于模板的方法和深度学习(DL)方法,以自动生成测试案例场景(从测试案例语句的自然语言模式中引起),并在基于路径的源代码表示源代码上训练DL模型以生成生成的表示有意义的标识符名称。我们的方法称为DeepTC-Enhancer,推荐文档和标识符名称,其最终目标是增强自动生成的测试用例的可读性。对36个外部和内部开发人员进行的经验评估表明,(1)DeepTC-Emhancer的表现明显优于生成摘要的基线方法,并与基线方法相同地进行了测试案例案例重置的方法,(2)DeepTC-Enhancer结果在A中提出的转换。自动生成的测试用例的可读性显着提高,(3)外部开发人员和内部开发人员之间的特征偏好存在显着差异。
Automated test case generation tools have been successfully proposed to reduce the amount of human and infrastructure resources required to write and run test cases. However, recent studies demonstrate that the readability of generated tests is very limited due to (i) uninformative identifiers and (ii) lack of proper documentation. Prior studies proposed techniques to improve test readability by either generating natural language summaries or meaningful methods names. While these approaches are shown to improve test readability, they are also affected by two limitations: (1) generated summaries are often perceived as too verbose and redundant by developers, and (2) readable tests require both proper method names but also meaningful identifiers (within-method readability). In this work, we combine template based methods and Deep Learning (DL) approaches to automatically generate test case scenarios (elicited from natural language patterns of test case statements) as well as to train DL models on path-based representations of source code to generate meaningful identifier names. Our approach, called DeepTC-Enhancer, recommends documentation and identifier names with the ultimate goal of enhancing readability of automatically generated test cases. An empirical evaluation with 36 external and internal developers shows that (1) DeepTC-Enhancer outperforms significantly the baseline approach for generating summaries and performs equally with the baseline approach for test case renaming, (2) the transformation proposed by DeepTC-Enhancer results in a significant increase in readability of automatically generated test cases, and (3) there is a significant difference in the feature preferences between external and internal developers.
DOI: 10.1109/icse-seip.2017.27
发表时间: 2017-05
期刊: 2017 IEEE/ACM 39th International Conference on Software Engineering: Software Engineering in Practice Track (ICSE-SEIP)
影响因子: --
作者:
M. Almasi;H. Hemmati;G. Fraser;Andrea Arcuri;Janis Benefelds
通讯作者: M. Almasi;H. Hemmati;G. Fraser;Andrea Arcuri;Janis Benefelds
DOI: 10.1109/icst.2013.11
发表时间: 2013-03
期刊: 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation
影响因子: --
作者:
S. Afshan;Phil McMinn;Mark Stevenson
通讯作者: S. Afshan;Phil McMinn;Mark Stevenson
DOI: 10.1145/3092703.3092727
发表时间: 2017-07
期刊: Proceedings of the 26th ACM SIGSOFT International Symposium on Software Testing and Analysis
影响因子: --
作者:
Ermira Daka;J. Rojas;G. Fraser
通讯作者: Ermira Daka;J. Rojas;G. Fraser
DOI: 10.1016/j.jss.2013.02.061
发表时间: 2013-08-01
影响因子: 3.5
作者:
Anand, Saswat;Burke, Edmund K.;Zhu, Hong
通讯作者: Zhu, Hong