From Code Generation to Software Testing: AI Copilot with Context-Based RAG

📅 2025-04-02
🏛️ IEEE Software
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
To address low testing efficiency, insufficient defect detection rates, and limited coverage in large-scale software development, this paper proposes a test-oriented AI Copilot framework. Methodologically, it introduces a test-scenario-specific dynamic context-aware retrieval-augmented generation (RAG) mechanism, integrating LLM fine-tuning, code semantic graph construction, and incremental test-knowledge retrieval to enable real-time co-execution of test case generation and defect detection—synchronized with code evolution. Crucially, it models code generation and defect detection as symbiotic tasks sharing a common “low-defect” objective—the first such formulation. Experimental results demonstrate a 31.2% improvement in bug detection accuracy, a 12.6% increase in critical-path test coverage, and a 10.5% rise in user acceptance rate, validating the framework’s effectiveness in enhancing both automated testing quality and developer productivity.

Technology Category

Application Category

📝 Abstract
The rapid pace of large-scale software development places increasing demands on traditional testing methodologies, often leading to bottlenecks in efficiency, accuracy, and coverage. We propose a novel perspective on software testing by positing bug detection and coding with fewer bugs as two interconnected problems that share a common goal, which is reducing bugs with limited resources. We extend our previous work on AI-assisted programming, which supports code auto-completion and chatbot-powered Q&A, to the realm of software testing. We introduce Copilot for Testing, an automated testing system that synchronizes bug detection with codebase updates, leveraging context-based Retrieval Augmented Generation (RAG) to enhance the capabilities of large language models (LLMs). Our evaluation demonstrates a 31.2% improvement in bug detection accuracy, a 12.6% increase in critical test coverage, and a 10.5% higher user acceptance rate, highlighting the transformative potential of AI-driven technologies in modern software development practices.
Problem

Research questions and friction points this paper is trying to address.

Improving software testing efficiency and accuracy with AI
Connecting bug detection and coding to reduce software bugs
Enhancing test coverage and user acceptance via AI Copilot
Innovation

Methods, ideas, or system contributions that make the work stand out.

AI Copilot for automated software testing
Context-based RAG enhances LLM capabilities
Synchronizes bug detection with code updates
🔎 Similar Papers
No similar papers found.
Y
Yuchen Wang
Nanyang Technological University, Singapore
S
Shangxin Guo
City University of Hong Kong, Hong Kong
Chee Wei Tan
Chee Wei Tan
Nanyang Technological University, Singapore
NetworksDistributed OptimizationGen AI