What You See Is What You Get: Attention-based Self-guided Automatic Unit Test Generation
Software defects heavily affect software’s functionalities and may cause huge losses. Recently, many AI-based approaches have been proposed to detect defects, which can be divided into two categories: software defect prediction and automatic unit test generation. While these approaches have made great progress in software defect detection, they still have several limitations in practical application, including the low confidence of prediction models and the inefficiency of unit testing models.
To address these limitations, we propose a WYSIWYG (i.e., What You See Is What You Get) approach: \textbf{A}ttention-based Self-guided Automatic \textbf{U}nit Test \textbf{G}en\textbf{ER}ation (AUGER), which contains two stages: defect detection and error triggering. In the former stage, \toolname first detects the proneness of defects. Then, in the latter stage, it guides to generate unit tests for triggering such an error with the help of critical information obtained by the former stage. To evaluate the effectiveness of \toolname, we conduct a large-scale experiment by comparing with the state-of-the-art (SOTA) approaches on the widely used datasets (i.e., Bears, Bugs.jar, and Defects4J). AUGER makes great improvements by 4.7% to 35.3% and 17.7% to 40.4% in terms of F1-score and Precision in defect detection, and can trigger 23 to 84 more errors than SOTAs in unit test generation. Besides, we also conduct a further study to verify the generalization in practical usage by collecting a new dataset from real-world projects.
Wed 30 AprDisplayed time zone: Eastern Time (US & Canada) change
16:00 - 17:30 | AI for Testing and QA 2Research Track / SE In Practice (SEIP) at 214 Chair(s): Michael Pradel University of Stuttgart | ||
16:00 15mTalk | Faster Configuration Performance Bug Testing with Neural Dual-level Prioritization Research Track Youpeng Ma University of Electronic Science and Technology of China, Tao Chen University of Birmingham, Ke Li University of Exeter Pre-print | ||
16:15 15mTalk | Metamorphic-Based Many-Objective Distillation of LLMs for Code-related Tasks Research Track Annibale Panichella Delft University of Technology | ||
16:30 15mTalk | NIODebugger: A Novel Approach to Repair Non-Idempotent-Outcome Tests with LLM-Based Agent Research Track Kaiyao Ke University of Illinois at Urbana-Champaign | ||
16:45 15mTalk | Test Intention Guided LLM-based Unit Test Generation Research Track Zifan Nan Huawei, Zhaoqiang Guo Software Engineering Application Technology Lab, Huawei, China, Kui Liu Huawei, Xin Xia Huawei | ||
17:00 15mTalk | What You See Is What You Get: Attention-based Self-guided Automatic Unit Test Generation Research Track Xin Yin Zhejiang University, Chao Ni Zhejiang University, xiaodanxu College of Computer Science and Technology, Zhejiang university, Xiaohu Yang Zhejiang University | ||
17:15 15mTalk | Improving Code Performance Using LLMs in Zero-Shot: RAPGen SE In Practice (SEIP) Spandan Garg Microsoft Corporation, Roshanak Zilouchian Moghaddam Microsoft, Neel Sundaresan Microsoft |