arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1811.08330cs.SE
收藏

利用DSpot进行自动测试改进:十个成熟开源项目的研究

Automatic Test Improvement with DSpot: a Study with Ten Mature Open-Source Projects

Benjamin Danglot, Oscar Luis Vera-Pérez, Benoit Baudry, Martin Monperrus

摘要:

在文献中,开发人员手动编写的测试和自动生成的测试之间有相当明确的分离。在本文中,我们将探索第三种解决方案:自动改进开发人员编写的现有测试用例。我们提出的概念,设计和实现的系统称为\dspot,开发人员编写的测试用例作为输入(Java中的junit测试),并合成改进版本的输出。这些测试改进作为补丁或拉取请求返回给开发人员,可以直接集成到测试代码库的主要分支中。我们已经对DSpot进行了深入、系统的评估,其中包括来自10个著名开源软件项目的40个真实单元测试类。我们从这40个单元测试类中扩展了所有的测试方法。在26/40的情况下,DSpot能够通过触发新的行为和添加新的有价值的断言来自动改进正在研究的测试。接下来,对于正在考虑的十个项目,我们已经向主要开发人员提出了由\dspot自动合成的测试改进。总的来说,13/19的测试改进被开发人员接受并合并到主代码库中。这表明DSpot能够自动改进真实世界中的大型Java软件的单元测试。

英文摘要:

In the literature, there is a rather clear segregation between manually written tests by developers and automatically generated ones. In this paper, we explore a third solution: to automatically improve existing test cases written by developers. We present the concept, design, and implementation of a system called \dspot, that takes developer-written test cases as input (junit tests in Java) and synthesizes improved versions of them as output. Those test improvements are given back to developers as patches or pull requests, that can be directly integrated in the main branch of the test code base. We have evaluated DSpot in a deep, systematic manner over 40 real-world unit test classes from 10 notable and open-source software projects. We have amplified all test methods from those 40 unit test classes. In 26/40 cases, DSpot is able to automatically improve the test under study, by triggering new behaviors and adding new valuable assertions. Next, for ten projects under consideration, we have proposed a test improvement automatically synthesized by \dspot to the lead developers. In total, 13/19 proposed test improvements were accepted by the developers and merged into the main code base. This shows that DSpot is capable of automatically improving unit-tests in real-world, large-scale Java software.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑