Files
nexus/wiki/concepts/ScopeCreep.md
2026-05-03 05:42:12 +08:00

38 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "ScopeCreep"
type: concept
tags: [engineering, code-quality, scope-management]
last_updated: 2026-05-02
---
## Definition
范围蔓延ScopeCreep是指在项目或任务执行过程中变更范围超出最初明确要求的渐进式扩展。常见形式包括"顺便..."while I'm here行为、审阅阶段引入的新需求、以及未经批准的"改进"。
## Core Characteristics
- **渐进性**:变更随时间逐步扩大,而非一次性大规模变更
- **伪装性**:往往以"改进""清理""优化"等名义包装
- **累积性**:单次范围蔓延看似无害,但累积效应显著
## Patterns of ScopeCreep
| 模式 | 描述 | 最小变更工程师的应对 |
|------|------|---------------------|
| "while I'm here" | 任务外发现值得修改的内容并顺手修改 | 记录为 follow-up不包含在当前 PR |
| "for future flexibility" | 为假设的未来需求添加配置标志或抽象 | 等待第二个调用者出现再提取 |
| "defensive coding" | 为不可能发生的场景添加防御性代码 | 仅在系统边界(用户输入、外部 API验证 |
| "modernization" | 重写旧的但正常工作的代码为新风格 | 不重写未修改区域的代码 |
| "consistency" | 因"其他代码都用了 X"而修改无关文件 | 不因一致性而触碰无关文件 |
| "cleanup" | 移除假设是死代码的内容 | 用"删除并运行测试"确认,不做假设 |
## Connections
- [[engineering-minimal-change-engineer]]:最小变更工程师的核心对抗目标
- [[engineering-code-reviewer]]:代码审查者应警惕并指出范围蔓延
- [[PrematureAbstraction]]:范围蔓延的常见诱因之一
## Sources
- [[engineering-minimal-change-engineer]]