DORA / SPACE:AI SDLC 工程生产力
一句话:
DORA / SPACE / AI SDLC Engineering Productivity 解读
面向对象: AI Engineering Manager / AI Platform PM / Product Architect / Enterprise Architect / Senior BA / CTO Staff。 核心问题: AI code agent 和自动化开发会让团队更快, 但如果只看故事点、代码行数或 PR 数量, 很容易把局部产出误认为系统生产力。企业 AI SDLC 还要同时关注交付速度、可靠性、安全、开发者体验、认知负载、质量门禁和业务价值。 学习目标: 用 DORA 和 SPACE 的度量思想, 设计 AI-assisted SDLC 的工程生产力 operating system, 让 code agent、eval、security、architecture review 和 release governance 形成闭环。
Source Anchors
| Source | Link | 用途 |
|---|---|---|
| DORA | https://dora.dev/ | 参考软件交付性能、组织能力和度量实践 |
| The SPACE of Developer Productivity | https://queue.acm.org/detail.cfm?id=3454124 | 参考 Satisfaction、Performance、Activity、Communication、Efficiency 的多维生产力框架 |
| NIST Secure Software Development Framework | https://csrc.nist.gov/Projects/ssdf | 把 AI-assisted SDLC 连接到安全软件开发实践 |
| NIST AI RMF | https://www.nist.gov/itl/ai-risk-management-framework | 把 AI engineering productivity 与 AI 风险治理、度量和持续管理连接 |
一句话:
AI SDLC 生产力不是“代码写得更多”, 而是团队在安全、质量、可靠和可治理的前提下, 更快把正确变更交付到业务价值流。
1. 为什么不能只看产出量
AI code agent 会放大:
- 代码生成速度。
- 测试生成速度。
- 文档生成速度。
- 重构建议。
- PR 创建数量。
但也会放大:
- 未理解的代码。
- 安全缺陷。
- 低质量测试。
- 架构漂移。
- 依赖膨胀。
- 评审负载。
- merge 后故障。
所以 AI engineering productivity 的问题不是:
开发者每周多写了多少代码?
而是:
从需求到生产价值的流动是否更快、更安全、更可恢复?
2. DORA 到 AI SDLC
经典 DORA 维度可迁移为:
| DORA 维度 | AI SDLC 问法 |
|---|---|
| Deployment Frequency | AI-assisted changes 是否能更频繁安全发布 |
| Lead Time for Changes | 从需求/bug 到生产的周期是否缩短 |
| Change Failure Rate | AI 生成或辅助变更是否增加故障率 |
| Failed Deployment Recovery Time | AI 相关问题能否快速回滚、修复和补证据 |
AI 需要补充:
| AI-specific Metric | 说明 |
|---|---|
| AI-assisted PR share | 多少变更使用 code agent 辅助 |
| AI-generated code defect density | AI 辅助代码的缺陷密度 |
| Review amplification | AI 生成内容是否增加 reviewer 负载 |
| Test usefulness | AI 生成测试是否真正捕获风险 |
| Architecture drift rate | 变更是否偏离架构约束 |
| Secure coding violation rate | 是否引入 secrets、注入、权限、依赖风险 |
| Eval gate pass rate | AI 产品变更是否通过 eval/release gate |
3. SPACE 到 AI SDLC
SPACE 框架提醒我们不要单指标管理生产力。
| SPACE | AI SDLC 解释 | 指标例子 |
|---|---|---|
| Satisfaction | 开发者是否信任工具, 是否降低挫败感 | dev survey、AI tool satisfaction、flow interruptions |
| Performance | 业务和系统结果是否更好 | lead time、defects、incident rate、business outcome |
| Activity | 可观察活动, 不能单独作为目标 | PR count、commits、agent sessions |
| Communication | 协作和知识流是否改善 | review cycle、handoff delay、architecture questions |
| Efficiency | 是否减少等待和无效工作 | rework rate、context switching、build/test wait |
AI agent adoption 不能只看 activity:
agent sessions 增加
PR count 增加
代码行数增加
这些可能是好事, 也可能是噪音。必须和 quality、failure、review load、developer satisfaction 一起看。
4. AI SDLC Metrics Taxonomy
| 层级 | 指标 |
|---|---|
| Flow | lead time、cycle time、queue time、review time、deployment frequency |
| Quality | defect escape、test failure caught pre-merge、regression rate、architecture drift |
| Reliability | change failure rate、MTTR、rollback time、incident severity |
| Security | secret leakage、dependency risk、SAST/DAST findings、policy violations |
| AI Use | agent-assisted tasks、accepted suggestions、manual rewrite rate、prompt patterns |
| Review Load | reviewer time、AI diff size、comment density、re-review count |
| Developer Experience | satisfaction、cognitive load、context switching、tool trust |
| Business Outcome | feature adoption、risk reduction、cost saving、customer impact |
原则:
- 不用单指标排名个人。
- 指标服务系统改进。
- 活动指标必须和结果指标配对。
- AI 工具采用率不是最终目标。
5. Code Agent Governance
企业 code agent 需要 guardrails:
| 控制点 | 说明 |
|---|---|
| Repository policy | 哪些 repo 可用 agent, 哪些高风险 repo 限制 |
| Context boundary | agent 可读哪些代码、文档、issue、secret |
| Prompt / instruction standard | 安全编码、测试、架构约束、合规约束 |
| PR labeling | 标识 AI-assisted changes |
| Review policy | 高风险文件、人类 mandatory review |
| Test gate | unit、integration、security、eval |
| Dependency gate | 新依赖审批、license、vulnerability |
| Evidence | agent log、diff rationale、test results、security scan |
| Incident loop | AI-assisted defect postmortem |
6. AI Product Release Gate
AI 产品变更比普通软件多几类 artifact:
Code diff
Prompt diff
Model / provider config
RAG corpus version
Tool schema change
Eval dataset version
Eval result
Risk control change
Monitoring threshold
Rollback plan
Release gate:
| Gate | 问题 |
|---|---|
| Code Quality | 是否通过测试、lint、review |
| Security | 是否引入注入、secret、依赖、权限风险 |
| AI Eval | 是否通过 regression、safety、RAG、agent eval |
| Architecture | 是否符合 ADR 和平台边界 |
| Observability | 是否有 trace、metric、alert |
| Rollback | 是否可回滚 prompt/model/index/tool |
| Evidence | 是否形成 release bundle |
7. 金融零售案例
7.1 核心银行变更
AI agent 可辅助:
- 读遗留代码。
- 生成测试。
- 解释接口。
- 生成迁移脚本。
但必须加强:
- mandatory human review。
- regression suite。
- data migration checks。
- dual control。
- rollback rehearsal。
7.2 客服 RAG
AI-assisted SDLC 覆盖:
- prompt change。
- policy corpus ingestion。
- chunking strategy。
- retrieval config。
- eval dataset。
- UI disclosure。
DORA/SPACE 需要和 AI eval 结合, 否则“发布更快”可能意味着“错误政策更快进入生产”。
7.3 风控模型
AI code agent 可提升 notebook 到 production pipeline 的速度, 但要控制:
- data leakage。
- point-in-time correctness。
- model validation evidence。
- feature lineage。
- approval workflow。
8. 模板: AI SDLC Productivity Dashboard
# AI SDLC Productivity Dashboard
## Flow
- Lead time:
- Review time:
- Deployment frequency:
## Quality
- Change failure rate:
- Defect escape:
- Regression caught pre-merge:
## AI Assistance
- AI-assisted PR share:
- Accepted suggestion quality:
- Manual rewrite rate:
- Review amplification:
## Security and Risk
- Critical findings:
- Dependency violations:
- Policy exceptions:
## Developer Experience
- Satisfaction:
- Cognitive load:
- Tool trust:
## Business Outcome
- Value shipped:
- Incident avoided:
- Operational cost reduced:
9. 反模式
| 反模式 | 表现 | 修正 |
|---|---|---|
| Lines-of-code productivity | 用代码行数证明 AI 工具价值 | 看 flow、quality、reliability、DX 和业务结果 |
| PR spam | AI 让 PR 变多变大 | 限制 diff size, 强化 review policy |
| Generated tests theater | 测试覆盖率升高但不抓 bug | mutation/regression/bug replay 测试 |
| Security afterthought | 先提速后补安全 | SSDF 和 security gate 前置 |
| Agent without architecture | agent 自动改架构边界 | ADR、fitness function、architecture review |
10. 面试回答
Q: 你如何衡量 AI code agent 是否提升工程生产力?
30 秒版本:
我不会只看代码量或 PR 数量, 会用 DORA + SPACE 组合看系统生产力: lead time 是否缩短、change failure rate 是否可控、review load 是否下降、开发者满意度和认知负载是否改善, 同时补 AI-specific 指标, 如 AI-assisted defect density、test usefulness、architecture drift 和 security violations。
Q: AI-assisted SDLC 的最大风险是什么?
30 秒版本:
最大风险是局部加速掩盖系统风险。AI 可以更快生成代码, 也可以更快生成缺陷、依赖、架构漂移和无效测试。必须用 PR gate、security gate、architecture gate、eval gate 和 incident feedback loop 把速度放进治理系统。
11. 作品集交付物
- AI SDLC Metrics Taxonomy。
- DORA + SPACE Dashboard。
- Code Agent Governance Policy。
- AI-assisted PR Gate Checklist。
- AI Product Release Bundle Template。
- Secure AI SDLC Control Map。
- Engineering Productivity Decision Memo。
这套材料能展示你理解 AI 工程效率不是“多写代码”, 而是端到端交付系统的速度、质量、风险和人类体验共同改善。