IGTG&R:意図分析主導の単体テスト生成および改良フレームワーク
Xiaojian Liu1, Yangyang Zhang2
1College of Computer Science, Beijing University of Technology, Beijing 100124, China.
Abstract:
Code coverage-guided unit test generation (CGTG) and large language model-based test generation (LLMTG) are two principal approaches for the generation of unit tests. Each of these approaches has its inherent advantages and drawbacks. Tests generated by CGTG have been shown to exhibit high code coverage and high executability. However, they lack the capacity to comprehend code intent, which results in an inability to identify deviations between code implementation and design intent (i.e., functional defects). Conversely, although LLMTG demonstrates an advantage in terms of code intent analysis, it is generally characterized by low executability and necessitates iterative debugging. In order to enhance the ability of unit test generation to identify functional defects, a novel framework has been proposed, entitled the intent analysis-guided unit test generation and refinement (IGTG&R) model. The IGTG&R model consists of a two-stage process for test generation. In the first stage, we introduce coverage path entropy to enhance CGTG to achieve high executability and code coverage of test cases. The second stage refines the test cases using LLMs to identify functional defects. We quantify and verify the interference of incorrect code implementation on intent analysis through conditional entropy. In order to reduce this interference, the focal method body is excluded from the code context information during intent analysis. Using these two-stage process, IGTG&R achieves a more profound comprehension of the intent of the code and the identification of functional defects. The IGTG&R model has been demonstrated to achieve an identification rate of functional defects ranging from 65% to 89%, with an execution success rate of 100% and a code coverage rate of 75.8%. This indicates that IGTG&R is superior to the CGTG and LLMTG approaches in multiple aspects.
関連する概念動画
Measurement: Standard Units
Measurement: Derived Units
Units of Measurement
There are various well-known historical measurement systems, such as the Babylonian system, the Roman system, the Egyptian system, the Olympian system, the British system, and the Indus...
International System of Units
Prefixes are used to define both larger and smaller quantities in the SI system. For example, milli, micro, and nano define smaller quantities, while kilo, mega, and giga are used to define...
Motor Units
Motor Units
Motor units come in different sizes, with smaller units...


