AI Chat Paper
Note: Please note that the following content is generated by AMiner AI. SciOpen does not take any responsibility related to this content.
{{lang === 'zh_CN' ? '文章概述' : 'Summary'}}
{{lang === 'en_US' ? '中' : 'Eng'}}
Chat more with AI
Article Link
Collect
Submit Manuscript
Show Outline
Outline
Show full outline
Hide outline
Outline
Show full outline
Hide outline
Regular Paper

SAGA: Summarization-Guided Assert Statement Generation

Key Laboratory of High Confidence Software Technologies (Peking University), Ministry of Education, Beijing 100871, China
School of Computer Science, Peking University, Beijing 100871, China
School of Artificial Intelligence, Beijing University of Posts and Telecommunications, Beijing 100876, China
Show Author Information

Abstract

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.

Electronic Supplementary Material

Download File(s)
JCST-2209-12878-Highlights.pdf (173.5 KB)

References

【1】
【1】
 
 
Journal of Computer Science and Technology
Pages 138-157

{{item.num}}

Comments on this article

Go to comment

< Back to all reports

Review Status: {{reviewData.commendedNum}} Commended , {{reviewData.revisionRequiredNum}} Revision Required , {{reviewData.notCommendedNum}} Not Commended Under Peer Review

Review Comment

Close
Close
Cite this article:
Zhang Y-W, Jin Z, Wang Z-J, et al. SAGA: Summarization-Guided Assert Statement Generation. Journal of Computer Science and Technology, 2025, 40(1): 138-157. https://doi.org/10.1007/s11390-023-2878-6

686

Views

2

Crossref

2

Web of Science

2

Scopus

0

CSCD

Received: 30 September 2022
Accepted: 30 December 2023
Published: 23 February 2025
© Institute of Computing Technology, Chinese Academy of Sciences 2025