Agile Kanban
Agile Kanban Visual Management Board WIP Limit Continuous Flow Pull System Lead Time Cycle Time Throughput Toyota Production System Support Operations
| Aspect | Kanban | Scrum | Scrumban | XP |
|---|---|---|---|---|
| Cadence | Continuous | Sprint 1-4w | Hybrid | 1-2 weeks |
| Roles | ไม่กำหนด | PO SM Team | Optional | Coach Programmer |
| WIP Limit | Per Column | Sprint Capacity | Per Column | Pair Programming |
| Planning | On-demand | Sprint Planning | On-demand | Planning Game |
| Change | Anytime | Next Sprint | Anytime | Next Iteration |
| เหมาะกับ | Support Ops | Product Dev | Mixed | Engineering |
Board Design
# === Kanban Board Implementation ===
from dataclasses import dataclass, field
from datetime import datetime, timedelta
import random
@dataclass
class KanbanCard:
card_id: str
title: str
priority: str
assignee: str
created_at: datetime
started_at: datetime = None
completed_at: datetime = None
blocked: bool = False
tags: list = field(default_factory=list)
@dataclass
class KanbanColumn:
name: str
wip_limit: int
cards: list = field(default_factory=list)
@property
def count(self):
return len(self.cards)
@property
def is_over_wip(self):
return self.count > self.wip_limit if self.wip_limit > 0 else False
class KanbanBoard:
def __init__(self, name):
self.name = name
self.columns = [
KanbanColumn("Backlog", 0),
KanbanColumn("To Do", 5),
KanbanColumn("In Progress", 3),
KanbanColumn("Review", 2),
KanbanColumn("Done", 0),
]
def display(self):
print(f"=== {self.name} ===")
for col in self.columns:
wip = f"WIP: {col.count}/{col.wip_limit}" if col.wip_limit > 0 else f"Count: {col.count}"
status = " [OVER WIP!]" if col.is_over_wip else ""
print(f"\n [{col.name}] {wip}{status}")
for card in col.cards[:3]:
blocked = " [BLOCKED]" if card.blocked else ""
print(f" - [{card.priority}] {card.title} (@{card.assignee}){blocked}")
if len(col.cards) > 3:
print(f" ... +{len(col.cards)-3} more")
# Create board
board = KanbanBoard("DevOps Team Board")
now = datetime.now()
# Add sample cards
board.columns[0].cards = [
KanbanCard("K-10", "Upgrade K8s cluster", "High", "Som", now - timedelta(days=5)),
KanbanCard("K-11", "Setup monitoring alerts", "Medium", "Unassigned", now - timedelta(days=3)),
KanbanCard("K-12", "Document CI/CD pipeline", "Low", "Unassigned", now - timedelta(days=2)),
]
board.columns[1].cards = [
KanbanCard("K-07", "Fix SSL certificate renewal", "High", "Nid", now - timedelta(days=7)),
KanbanCard("K-08", "Optimize Docker images", "Medium", "Pom", now - timedelta(days=4)),
]
board.columns[2].cards = [
KanbanCard("K-05", "Deploy Redis cluster", "High", "Som", now - timedelta(days=10), now - timedelta(days=3)),
KanbanCard("K-06", "Configure backup automation", "Medium", "Nid", now - timedelta(days=8), now - timedelta(days=2), blocked=True),
]
board.columns[3].cards = [
KanbanCard("K-04", "Update Nginx config", "Medium", "Pom", now - timedelta(days=12), now - timedelta(days=5)),
]
board.display()
Flow Metrics
# === Kanban Flow Metrics ===
@dataclass
class FlowMetric:
week: str
items_started: int
items_completed: int
avg_lead_time: float
avg_cycle_time: float
wip_avg: float
blockers: int
metrics = [
FlowMetric("Week 1", 8, 6, 5.2, 2.8, 4.5, 1),
FlowMetric("Week 2", 7, 8, 4.8, 2.5, 3.8, 0),
FlowMetric("Week 3", 9, 7, 5.5, 3.1, 5.2, 2),
FlowMetric("Week 4", 6, 7, 4.2, 2.2, 3.2, 0),
FlowMetric("Week 5", 8, 9, 3.8, 2.0, 3.0, 0),
FlowMetric("Week 6", 7, 8, 3.5, 1.8, 2.8, 0),
]
print("\n=== Flow Metrics (6 Weeks) ===")
for m in metrics:
print(f" [{m.week}] Started: {m.items_started} | Done: {m.items_completed}")
print(f" Lead: {m.avg_lead_time}d | Cycle: {m.avg_cycle_time}d | WIP: {m.wip_avg} | Blockers: {m.blockers}")
# Summary
total_done = sum(m.items_completed for m in metrics)
avg_lead = sum(m.avg_lead_time for m in metrics) / len(metrics)
avg_cycle = sum(m.avg_cycle_time for m in metrics) / len(metrics)
throughput = total_done / len(metrics)
print(f"\n Summary:")
print(f" Total Completed: {total_done} items")
print(f" Avg Throughput: {throughput:.1f} items/week")
print(f" Avg Lead Time: {avg_lead:.1f} days")
print(f" Avg Cycle Time: {avg_cycle:.1f} days")
print(f" Trend: Lead Time ลดลง {metrics[0].avg_lead_time - metrics[-1].avg_lead_time:.1f} days (improving!)")
# Little's Law: WIP = Throughput × Cycle Time
littles_wip = throughput * avg_cycle / 7 # convert to weeks
print(f" Little's Law WIP: {littles_wip:.1f} (optimal WIP)")
Continuous Improvement
# === Kanban Improvement Practices ===
@dataclass
class KanbanPractice:
practice: str
frequency: str
participants: str
output: str
duration: str
practices = [
KanbanPractice("Daily Standup", "Daily", "Team", "Blockers identified, Flow updated", "15 min"),
KanbanPractice("Replenishment Meeting", "Weekly", "PO + Team Lead", "Backlog prioritized, To Do filled", "30 min"),
KanbanPractice("Service Delivery Review", "Bi-weekly", "Team + Stakeholders", "Metrics reviewed, SLA checked", "45 min"),
KanbanPractice("Retrospective", "Monthly", "Team", "Process improvements identified", "60 min"),
KanbanPractice("Risk Review", "Weekly", "Team Lead", "Blockers and risks assessed", "15 min"),
KanbanPractice("Board Design Review", "Quarterly", "Team", "Board columns WIP limits updated", "60 min"),
]
print("Kanban Cadences:")
for p in practices:
print(f" [{p.practice}] {p.frequency} | {p.duration}")
print(f" Who: {p.participants}")
print(f" Output: {p.output}")
improvements = {
"Week 2": "ลด WIP Limit In Progress จาก 5 เป็น 3 → Cycle Time ลดลง",
"Week 3": "เพิ่ม Column 'Waiting for Deploy' → เห็น Bottleneck ชัดขึ้น",
"Week 4": "เพิ่ม Blocker Tag สีแดง → แก้ Blocker เร็วขึ้น",
"Week 5": "ตั้ง SLA Lead Time < 5 days → ทีมมี Target ชัดเจน",
"Week 6": "เพิ่ม Automation deploy → ลด Cycle Time อีก 0.5 วัน",
}
print(f"\n\nContinuous Improvement Log:")
for week, improvement in improvements.items():
print(f" [{week}]: {improvement}")
เคล็ดลับ
- WIP: เริ่ม WIP = จำนวนคน แล้วค่อยลด ดู Flow ดีขึ้นหรือไม่
- Visual: ใช้ Board จริง (Physical/Digital) ให้ทุกู้คืนเห็น
- Metrics: วัด Lead Time Cycle Time Throughput ทุกสัปดาห์
- Blocker: จัดการ Blocker ทันที อย่าปล่อยค้าง
- Kaizen: ปรับปรุงกระบวนการทุกเดือน เล็กๆ สม่ำเสมอ
การนำความรู้ไปประยุกต์ใช้งานจริง
แหล่งเรียนรู้ที่แนะนำ ได้แก่ Official Documentation ที่อัพเดทล่าสุดเสมอ Online Course จาก Coursera Udemy edX ช่อง YouTube คุณภาพทั้งไทยและอังกฤษ และ Community อย่าง Discord Reddit Stack Overflow ที่ช่วยแลกเปลี่ยนประสบการณ์กับนักพัฒนาทั่วโลก
Agile Kanban คืออะไร
Visual Management Board WIP Limit Continuous Flow Pull System Toyota Lead Time Cycle Time Throughput Support Operations ไม่มี Sprint
WIP Limit คืออะไร
จำกัดงานพร้อมกัน Per Column เช่น In Progress 3 ลด Context Switching เพิ่ม Focus Quality ลด Lead Time เริ่ม = จำนวนคน
วัดผล Kanban อย่างไร
Lead Time Cycle Time Throughput WIP Blocker CFD Cumulative Flow Diagram Bottleneck Distribution Little's Law คาดการณ์
Kanban ต่างจาก Scrum อย่างไร
Kanban Continuous ไม่มี Sprint Roles ยืดหยุ่น WIP Limit Scrum Sprint PO SM Planning Daily Review Retro Product Development
สรุป
Agile Kanban Visual Board WIP Limit Continuous Flow Lead Time Cycle Time Throughput Pull System Continuous Improvement Kaizen Production Team Management
