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

从集成测试增强单元测试套件

Augmenting unit test suites from integration tests

Athens University of Economics and Business(雅典大学经济与商业学院);University of Ioannina(约阿尼纳大学)

Katerina Paltoglou, Vassilis E. Zafeiris

AI总结:

本文提出利用静态和动态分析生成单元测试的方法,针对测试金字塔结构不合规的测试套件,通过集成测试生成隔离的组件依赖测试,提升覆盖率和故障定位能力。

摘要:

我们提出一种方法,利用静态和动态分析来增强测试套件中的自动生成单元测试。该方法最适合用于测试套件中单元、集成和系统测试的分层不遵循推荐的测试金字塔结构的情况:大量单元测试提供高代码覆盖率并形成基础,较少的集成测试在中间验证组件协作,以及极少数的系统或UI测试在顶部测试接受或其他使用场景。相反,集成和系统测试代表了大多数测试用例,导致粒度粗、故障定位困难和执行时间长。该方法利用集成测试,测试组件及其依赖项,以生成验证组件依赖项隔离的单元测试。我们展示了并在Node.js平台上实证评估了所提出的方法,尽管它可以被移植和适应到其他语言和平台。评估基于一个作为Node.js工具实现的研究原型,并在十二个开源JS应用(基准项目)的上下文中进行。评估结果支持我们方法的有效性和实用性。

英文摘要:

We propose a method that employs static and dynamic analysis for augmenting a test suite with automatically generated unit tests. The method is most suitable for test suites where the stratification of unit, integration and system tests does not conform to the recommended test pyramid structure: numerous unit tests providing high code coverage and forming the base, fewer integration tests in the middle that verify component collaboration, and far fewer system or UI tests at the top that exercise acceptance or other scenarios of use. Instead, integration and system tests represent the majority of test cases, resulting in coarse-grained tests with limited fault localization and longer execution times. The method leverages integration tests, exercising a component and its dependencies, to generate unit tests that verify component dependencies in isolation. We showcase and empirically evaluate the proposed method in the Node.js platform, although it can be ported and adapted to other languages and platforms. The evaluation is based on a research prototype implemented as a Node.js tool and is conducted in the context of twelve open source JS applications (benchmark projects). Evaluation results support the effectiveness and practicality of our approach.

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

↑