Generating meaningful assert statements is one of the key challenges in automated test case generation, which requires understanding the intended functionality of the tested code. Recently, deep learning based models ...
详细信息
Generating meaningful assert statements is one of the key challenges in automated test case generation, which requires understanding the intended functionality of the tested code. Recently, deep learning based models have shown promise in improving the performance of assert statement generation. However, the existing models only rely on the test prefixes along with their corresponding focal methods, yet ignore the developer-written summarization. Based on our observations, the summarization contents usually express the intended program behavior or contain parameters that will appear directly in the assert statement. Such information will help existing models address their current inability to accurately predict assert statements. This paper presents a summarization-guided approach for automatically generating assert statements. To derive generic representations for natural language (i.e., summarization) and programming language (i.e., test prefixes and focal methods), we leverage a pre-trained language model as the reference architecture and fine-tune it on the task of assert statement generation. To the best of our knowledge, the proposed approach makes the first attempt to leverage the summarization of focal methods as the guidance for making the generated assert statements more accurate. We demonstrate the effectiveness of our approach on two real-world datasets compared with state-of-the-art models.
A tool to automatically generate natural language documentation summaries for methods is presented. The approach uses prior work by the authors on stereotyping methods along with the source code analysis framework src...
详细信息
ISBN:
(纸本)9781538675700
A tool to automatically generate natural language documentation summaries for methods is presented. The approach uses prior work by the authors on stereotyping methods along with the source code analysis framework srcML. First, each method is automatically assigned a stereotype(s) based on static analysis and a set of heuristics. Then, the approach uses the stereotype information, static analysis, and predefined templates to generate a natural-language summary for each method. This summary is automatically added to the code base as a comment for each method. The predefined templates are designed to produce a generic summary for specific method stereotypes.
The software maintenance process is not an easy job, especially when the source code becomes more complex and less documented. Software developers and engineers may spend plenty of time to understand the structures an...
详细信息
ISBN:
(纸本)9781728130125
The software maintenance process is not an easy job, especially when the source code becomes more complex and less documented. Software developers and engineers may spend plenty of time to understand the structures and features of the source code in order to maintain their software projects. Using an automated code summarization technique is a key factor to save time and cost of the maintenance process. Generating descriptive documents from the source code helps the software developers to understand their software. In this paper, a code summarization framework is proposed to document the source code. A set of software features are extracted and displayed to the developers based on mapping the target source code segments to an XML representation. The proposed framework has been conducted on an open source project to evaluate its effectiveness. The generated results showed that the proposed approach is useful in understanding the different structural aspects of the source code.
暂无评论