arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.00180cs.SEcs.AI
收藏

基于规范的开发:在AI编码助手时代的代码与合同

Spec-Driven Development:From Code to Contract in the Age of AI Coding Assistants

Deepak Babu Piskala

AI总结:

本文探讨了在AI编码助手时代基于规范的开发方法,通过规范优先的哲学和不同领域的案例研究,提供了一种新的软件开发思路和实践框架。

摘要:

随着AI编码助手的兴起,一个古老的想法再次引起关注:如果规范而不是代码是软件开发的主要产物呢?基于规范的开发(SDD)通过将规范视为事实来源,将传统的工作流程颠倒,使代码成为生成或验证的次要产物。本文为从业者提供了全面的SDD指南,涵盖其原则、工作流程模式和支持工具。我们提出了三种规范严谨性层次——先规范、规范锚定和规范作为源,并明确指导每种层次何时适用。通过分析从行为驱动开发框架到现代AI辅助工具包如GitHub Spec Kit等工具,我们展示了规范优先哲学如何映射到实际实现。我们还通过API开发、企业系统和嵌入式软件的案例研究,说明不同领域如何应用SDD。最后,我们提供了一个决策框架,帮助从业者判断何时SDD具有价值,何时简单的做法更合适。

英文摘要:

The rise of AI coding assistants has reignited interest in an old idea: what if specifications-not code-were the primary artifact of software development? Spec-driven development (SDD) inverts the traditional workflow by treating specifications as the source of truth and code as a generated or verified secondary artifact. This paper provides practitioners with a comprehensive guide to SDD, covering its principles, workflow patterns, and supporting tools. We present three levels of specification rigor-spec-first, spec-anchored, and spec-as-source-with clear guidance on when each applies. Through analysis of tools ranging from Behavior-Driven Development frameworks to modern AI-assisted toolkits like GitHub Spec Kit, we demonstrate how the spec-first philosophy maps to real implementations. We present case studies from API development, enterprise systems, and embedded software, illustrating how different domains apply SDD. We conclude with a decision framework helping practitioners determine when SDD provides value and when simpler approaches suffice.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑