Writing software tests is laborious and time-consuming. To address this, prior studies introduced various automated test-generation techniques. A well-explored research direction in this field is unit test generation, wherein artificial intelligence (AI) techniques create tests for a method/class under test. While many of these techniques have primarily found applications in a research context, existing tools (e.g., EvoSuite, Randoop, and AthenaTest) are not user-friendly and are tailored to a single technique. This paper introduces TestSpark, a plugin for IntelliJ IDEA that enables users to generate unit tests with only a few clicks directly within their Integrated Development Environment (IDE). Furthermore, TestSpark also allows users to easily modify and run each generated test and integrate them into the project workflow. TestSpark leverages the advances of search-based test generation tools, and it introduces a technique to generate unit tests using Large Language Models (LLMs) by creating a feedback cycle between the IDE and the LLM. Since TestSpark is an open-source (https://github.com/JetBrains-Research/TestSpark), extendable, and well-documented tool, it is possible to add new test generation methods into the plugin with the minimum effort. This paper also explains our future studies related to TestSpark and our preliminary results. Demo video: https://youtu.be/0F4PrxWfiXo
翻译:编写软件测试既繁琐又耗时。为解决此问题,先前研究引入了多种自动化测试生成技术。该领域中一个深入探索的方向是单元测试生成,即利用人工智能(AI)技术为被测方法/类创建测试。尽管许多这些技术主要应用于研究场景,但现有工具(如EvoSuite、Randoop和AthenaTest)并不用户友好,且仅针对单一技术。本文介绍TestSpark,一个IntelliJ IDEA插件,使用户只需在集成开发环境(IDE)内点击几下即可生成单元测试。此外,TestSpark还允许用户轻松修改和运行每个生成的测试,并将其集成到项目工作流中。TestSpark利用了基于搜索的测试生成工具的进展,并通过在IDE与大语言模型(LLMs)之间创建反馈循环,引入了一种使用LLM生成单元测试的技术。由于TestSpark是一个开源(https://github.com/JetBrains-Research/TestSpark)、可扩展且文档完善的工具,因此可以以最小努力向插件中添加新的测试生成方法。本文还解释了未来与TestSpark相关的初步研究及成果。演示视频:https://youtu.be/0F4PrxWfiXo