用AI自动检测代码漏洞,边改代码边测,效率提升三成。
From Code Generation to Software Testing: AI Copilot with Context-Based RAG
- 用上下文增强的检索生成技术,让大模型更懂代码背景。
- 漏洞检测准确率提高31.2%,关键测试覆盖率达12.6%提升。
- 适合开发团队快速迭代、希望降低人工测试成本的人看。
大规模软件开发速度加快,传统测试方法在效率、准确性和覆盖率上日益成为瓶颈。本文提出将缺陷检测与编写少缺陷代码视为相互关联的问题,共享以有限资源减少缺陷的共同目标。我们在先前AI编程辅助工作基础上,扩展至软件测试领域,提出测试用例自动生成系统Copilot for Testing。该系统通过基于上下文的检索增强生成(RAG)技术,使大语言模型(LLMs)能动态响应代码库更新,实现缺陷检测与代码修改同步。评估显示,漏洞检测准确率提升31.2%,关键测试覆盖率增加12.6%,用户接受度提高10.5%,展现了AI驱动技术在现代软件开发中的变革潜力。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。