Java
计算机科学
单元测试
背景(考古学)
初始化
弹簧(装置)
Java 标注
软件工程
测试用例
实时Java
程序设计语言
数据库
软件
机器学习
工程类
机械工程
古生物学
回归分析
生物
作者
Kirill Alexandrovich Shishin,Ilia Vladimirovich Muravev,E. K. Kulikov
标识
DOI:10.15514/ispras-2024-36(2)-5
摘要
This paper considers the automated unit tests generation for programs written in Java using the Spring framework. Although several test generation tools for “pure” Java applications have been developed in recent decades, the features of this framework are mostly not taken into account. However, Spring is used to develop many industrial Java applications. At the same time, the presence of Spring components in the application for which the tests are generated imposes additional requirements not only on the code analysis approaches, but also on the structure of the generated tests. The main source of the information about object types and their properties is the Spring application context. The paper proposes an instrument for analyzing the application context, that in some cases allows generating test scenarios corresponding to real program executions and avoiding excessive mocking. The full initialization of the application context does not occur during this analysis. It makes the test generation safe for user data. The proposed instrument for analyzing the Spring context has been integrated into the UnitTestBot Java automatic test generation tool. We also provide examples of tests generated for real open-source projects.
科研通智能强力驱动
Strongly Powered by AbleSci AI