Technical Practices: CI/CD, TDD, Pair Programming
Overview
- What you’ll learn: Why technical excellence matters for Agile, Continuous Integration and Continuous Delivery (CI/CD), Test-Driven Development (TDD), pair and mob programming, refactoring, and how these practices enable Scrum’s promise of delivering “Done” Increments.
- Prerequisites: Modules 1–4.
- Estimated reading time: 15 minutes
Introduction
The ninth principle of the Agile Manifesto states: “Continuous attention to technical excellence and good design enhances agility.” This is not a nice-to-have — it is a requirement. Without technical practices, Scrum teams accumulate technical debt Sprint after Sprint until the codebase is so fragile that every change risks breaking something, and the Definition of Done becomes meaningless.
Continuous Integration (CI)
CI means every developer integrates their code into the shared repository multiple times per day. Each integration is verified by automated build and test. This catches integration problems early, when they are small and cheap to fix.
Without CI, teams batch up changes and integrate at the end of the Sprint. The result: a multi-day “integration hell” where conflicts, broken builds, and unexpected bugs consume the last days of the Sprint. CI eliminates this by making integration continuous and painless.
Continuous Delivery (CD)
CD extends CI by keeping the codebase in a deployable state at all times. Every commit that passes automated tests can be released to production. This does not mean you deploy every commit — it means you can deploy any commit.
CD requires: automated testing (unit, integration, end-to-end), automated deployment pipelines, feature flags for incomplete features, and monitoring/alerting for production issues.
Test-Driven Development (TDD)
TDD follows a simple cycle: Red → Green → Refactor.
- Red: Write a failing test for the next piece of functionality.
- Green: Write the minimum code to make the test pass.
- Refactor: Clean up the code while keeping the test green.
TDD produces code with high test coverage by default. It also drives better design because writing tests first forces you to think about interfaces and dependencies before implementation.
Pair and Mob Programming
Pair Programming: Two developers, one machine. One types (driver), one reviews and thinks ahead (navigator). They switch roles frequently. Benefits: fewer bugs, shared knowledge, better design decisions.
Mob Programming: The whole team works on the same thing at the same time on the same machine. Sounds inefficient? Research shows it produces fewer defects, eliminates code review delays, and creates deep shared understanding.
Refactoring
Refactoring means improving the internal structure of code without changing its external behavior. It is how you pay down technical debt incrementally. Refactoring should be continuous — part of every task, not a separate “refactoring Sprint.”
Key Takeaways
- Technical excellence is a requirement for Agile, not a nice-to-have.
- CI eliminates integration hell; CD keeps code always deployable.
- TDD drives high test coverage and better design through Red-Green-Refactor.
- Pair and mob programming reduce defects and build shared knowledge.
- Refactor continuously — don’t save it for a “refactoring Sprint.”
本課中文版
概述
敏捷宣言第九原則:「持續關注技術卓越和良好設計能增強敏捷性。」這不是可有可無的——是必要條件。沒有技術實踐,Scrum 團隊每個 Sprint 都在累積技術債,直到程式碼脆弱到每次改動都有風險。
持續整合(CI)
CI 意味著每個開發者每天多次將程式碼整合到共享儲存庫。每次整合都由自動化建置和測試驗證。沒有 CI,團隊在 Sprint 結束時批量整合——結果是多天的「整合地獄」。
持續交付(CD)
CD 延伸 CI,讓程式碼庫隨時保持可部署狀態。每個通過自動化測試的提交都可以發佈到產品環境。
測試驅動開發(TDD)
紅 → 綠 → 重構。先寫失敗的測試,再寫最少的程式碼讓測試通過,然後重構。TDD 默認產生高測試覆蓋率。
結對和群體程式設計
結對:兩個開發者,一台電腦。群體:整個團隊在同一時間做同一件事。研究顯示產生更少缺陷,消除程式碼審查延遲。
重點整理
- 技術卓越是敏捷的必要條件。
- CI 消除整合地獄;CD 保持程式碼隨時可部署。
- TDD 通過紅-綠-重構驅動高測試覆蓋率。
- 持續重構——不要留到「重構 Sprint」。
日本語版
概要
アジャイルマニフェストの第9原則:「技術的卓越性と優れた設計への継続的な注意がアジリティを向上させる。」これはあれば良いものではなく、必須条件だ。
継続的インテグレーション(CI)
開発者が1日に複数回コードを統合。各統合は自動ビルドとテストで検証。CIなしでは、スプリント終了時にバッチ統合——「統合地獄」の結果。
継続的デリバリー(CD)
CDはCIを拡張し、コードベースを常にデプロイ可能な状態に保つ。
テスト駆動開発(TDD)
レッド→グリーン→リファクタリング。まず失敗するテストを書き、最小限のコードでテストを通し、リファクタリングする。
ペアプログラミングとモブプログラミング
ペア:2人の開発者、1台のマシン。モブ:チーム全体が同時に同じものに取り組む。研究は欠陥の減少とコードレビュー遅延の排除を示している。
重要ポイント
- 技術的卓越性はアジャイルの必須条件。
- CIは統合地獄を排除、CDはコードを常にデプロイ可能に。
- TDDはレッド-グリーン-リファクタリングで高テストカバレッジ。
- 継続的にリファクタリング——「リファクタリングスプリント」に残さない。