arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1811.05005cs.SE
收藏

一种用于JUnit断言到英语的自动转换的细粒度方法

A Fine-Grained Approach for Automated Conversion of JUnit Assertions to English

Danielle Gonzalez, Suzanne Prentice, Mehdi Mirakhorli

摘要:

将源代码或单元测试代码转换为英文已被证明可以提高软件和测试的可维护性、可理解性和分析性。代码摘要器识别源代码/测试中的重要语句,并使用静态分析和NLP技术将其转换为易于理解的英语句子。然而,目前的测试汇总方法只处理JUnit断言API(测试用例的关键组件)中允许的变化和定制的一个子集,这可能会影响转换的准确性。在本文中,我们提出了我们的工作,以改善JUnit测试摘要的详细过程,共45个独特的JUnit断言转换为英语,包括37个以前未处理的assertThat方法的变化。这个过程也已经实现并作为AssertConvert工具发布。初步评估表明,该工具生成的英语转换准确地表示了各种断言语句,可用于代码摘要或其他NLP分析。

英文摘要:

Converting source or unit test code to English has been shown to improve the maintainability, understandability, and analysis of software and tests. Code summarizers identify important statements in the source/tests and convert them to easily understood English sentences using static analysis and NLP techniques. However, current test summarization approaches handle only a subset of the variation and customization allowed in the JUnit assert API (a critical component of test cases) which may affect the accuracy of conversions. In this paper, we present our work towards improving JUnit test summarization with a detailed process for converting a total of 45 unique JUnit assertions to English, including 37 previously-unhandled variations of the assertThat method. This process has also been implemented and released as the AssertConvert tool. Initial evaluations have shown that this tool generates English conversions that accurately represent a wide variety of assertion statements which could be used for code summarization or other NLP analyses.

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

↑