Software Development Life Cycle và delivery models
Process tốt làm feedback nhanh hơn và risk hiển thị sớm hơn. Không có mô hình đúng cho mọi dự án; chọn theo uncertainty, compliance, coupling và khả năng release.
SDLC là lifecycle, không phải riêng Scrum
| Giai đoạn | Output cần có | Failure hay gặp |
|---|---|---|
| Discovery/Planning | Problem, user outcome, scope/non-goals, constraints, risks, success metric | Nhận feature request như requirement hoàn chỉnh. |
| Requirements/Analysis | Functional/non-functional requirements, acceptance criteria, domain rules | Mơ hồ về failure, security, migration và operations. |
| Design | Architecture/data/API, ADR, threat model, rollout/rollback | Big design upfront hoặc code trước khi làm rõ irreversible decisions. |
| Implementation | Code, review, automated checks, feature flag, docs | Branch sống lâu, integration muộn, review chỉ soi style. |
| Verification | Unit/integration/contract/E2E/performance/security evidence | QA là phase cuối; chỉ test happy path. |
| Release/Deployment | Immutable artifact, migration sequence, canary, observability, rollback | Deploy đồng nghĩa release; DB change phá old version. |
| Operate/Learn | SLO, telemetry, incident/reconciliation, feedback và improvement | Team “done” khi merge; không ownership production outcome. |
| Retire | Deprecation, data retention/migration, dependency removal | Endpoint/flag/service cũ tồn tại vô hạn. |
So sánh các delivery model
| Mô hình | Cơ chế | Phù hợp | Rủi ro |
|---|---|---|---|
| Waterfall | Các phase tuần tự, baseline/sign-off mạnh | Scope ổn định, dependency vật lý/pháp lý, change cost cao | Feedback và integration quá muộn nếu uncertainty cao. |
| V-Model | Mỗi design level ánh xạ một verification level | Safety/regulatory cần traceability và verification planning | Nặng tài liệu nếu biến thành handoff cứng. |
| Iterative | Lặp để cải thiện solution qua feedback | Problem đã rõ nhưng solution còn uncertainty | Lặp mà không có measurable learning. |
| Incremental | Giao từng vertical slice có giá trị | Có thể chia outcome và release độc lập | Chia theo layer khiến mỗi increment chưa usable. |
| Spiral | Mỗi vòng ưu tiên identify/mitigate risk | Dự án lớn, novel technology, risk cao | Chi phí quản trị lớn; cần năng lực risk analysis. |
| Agile | Short feedback, inspect/adapt, collaboration | Requirement biến động và có user feedback thường xuyên | “Agile” bị dùng để bỏ planning, architecture hoặc documentation. |
| Lean/Kanban | Visual flow, limit WIP, giảm queue/batch/waste | Continuous flow, ops/platform/support, priority thay đổi | Thiếu product goal nếu chỉ tối ưu ticket flow. |
Scrum, Kanban, XP và DevOps khác nhau
- Scrum là framework quản product development bằng Product Goal, Sprint Goal, Increment, accountabilities và inspect/adapt cadence.
- Kanban là strategy quản flow: visualize workflow, control WIP, explicit policies, service level expectation và flow metrics.
- XP tập trung engineering practices: TDD, pair programming, continuous integration, refactoring, simple design và small releases.
- DevOps là operating model/culture nối development và operations qua shared ownership, automation, telemetry và fast feedback; không phải chỉ Jenkins/Kubernetes.
Một path từ ý tưởng tới production
- Product/engineering làm rõ problem, baseline, metric, compliance và non-goals.
- Chia thin vertical slice; spike unknown rủi ro cao nhưng time-box và có decision output.
- Viết acceptance criteria, API/schema compatibility, test strategy, telemetry và rollout plan.
- Code trên short-lived branch hoặc trunk; review nhỏ, CI chạy unit/static/security/contract checks.
- Deploy cùng immutable artifact qua environments; migration expand-first, feature flag và canary.
- Release theo metric/error budget; quan sát, rollback/roll-forward khi gate fail.
- Đo outcome, cycle time, escaped defects và incident/toil; đưa learning về backlog/process.
Definition of Ready và Definition of Done
Ready không nên là approval gate nặng. Nó là working agreement tối thiểu: outcome/acceptance hiểu được, dependency/risk lộ rõ và item đủ nhỏ để bắt đầu.
Done là quality transparency: code review, tests, security/observability, documentation, migration/rollback và deployable increment theo tiêu chuẩn team. “Code complete” hoặc “đã đưa QA” chưa phải Done.
Metrics không được dùng sai
- Flow: lead time, cycle time, throughput, WIP, work item age và deployment frequency.
- Stability: change failure rate, failed deployment recovery time, escaped defects và SLO/error budget.
- Outcome: adoption, conversion, task success, cost/risk reduction — tùy product.
- Không dùng story points, commit count hay lines of code để xếp hạng cá nhân/team.
Câu hỏi phỏng vấn tình huống
1. Chọn Waterfall hay Agile?
2. Scrum và Kanban khác gì?
3. Requirement thay đổi giữa Sprint xử lý sao?
4. Team luôn trễ vì QA ở cuối Sprint?
5. Dự án ngân hàng cần compliance có Agile được không?
6. DevOps có nghĩa developer tự làm tất cả operations?
Practice: thiết kế process cho banking feature
Scenario: thêm scheduled bank transfer, liên quan Mobile, Order/Transfer Service, Ledger, Notification, fraud rule và schema migration.
- Viết one-page discovery: outcome, non-goals, compliance, SLO và unknowns.
- So sánh Waterfall, Scrum và Kanban/hybrid bằng decision matrix có weight.
- Chia 4–6 vertical increments; mỗi increment deployable và backward-compatible.
- Vẽ flow từ Ready tới production, đặt WIP limits và owner cho blocked work.
- Định nghĩa CI gates, test pyramid/contract tests, database migration và canary gates.
- Inject change: regulator đổi retention rule giữa Sprint; mô tả re-plan và communication.
- Chọn flow/stability/outcome metrics; giải thích hành vi xấu metric có thể tạo ra.
Gate: process phải tạo feedback/evidence sớm, support rollback và compliance; không chỉ liệt kê ceremony.