Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Phương pháp Phát triển

Overview

Các phương pháp phát triển phần mềm (development methodologies) là các frameworks và practices giúp teams tổ chức và thực hiện công việc một cách hiệu quả. Mỗi method có ưu điểm và phù hợp với các tình huống khác nhau.

Main Categories

1. Traditional/Plan-Based Methods

Waterfall

Requirements → Design → Implementation → Verification → Maintenance
     ↓              ↓            ↓                ↓              ↓
   1990s       1990s-2000s   2000s           2000s         present
  • Sequential, document-driven
  • Each phase complete before next begins
  • Good for: Fixed requirements, stable projects
// Waterfall in practice - comprehensive upfront design
public class ProjectPlan
{
    // Detailed specification before coding
    public RequirementsSpec Requirements { get; set; }
    public ArchitectureSpec Architecture { get; set; }
    public TestPlan TestPlan { get; set; }
    public DeploymentPlan DeploymentPlan { get; set; }
}

V-Model

Requirements ←────────────── Acceptance Testing
    ↓                              ↓
System Design ←─────────────── Integration Testing
    ↓                              ↓
Detailed Design ←─────────────── Unit Testing
    ↓
Coding
  • Extension of Waterfall
  • Testing integrated into each phase
  • Good for: Safety-critical systems

2. Agile Methods

Scrum

Sprint Planning → Daily Scrum → Sprint Review → Sprint Retrospective
       ↓              ↓              ↓                ↓
     2-4 weeks     15 min         1-4 hours       1-3 hours
// Scrum artifacts
public class ProductBacklog
{
    public List<ProductBacklogItem> Items { get; set; }
    public void Prioritize() { } // Ranks by business value
}

public class Sprint
{
    public List<SprintBacklogItem> Backlog { get; set; }
    public SprintGoal Goal { get; set; }
    public Timebox Duration { get; set; } // Usually 2-4 weeks
}

public class DailyScrum
{
    // 3 questions:
    // 1. What did I do yesterday?
    // 2. What will I do today?
    // 3. Are there any blockers?
}

Kanban

To Do → In Progress → Review → Done
  ↓        ↓          ↓        ↓
 limits   limits     limits   limits
// Kanban board in code
public class KanbanBoard
{
    public Column ToDo { get; set; }
    public Column InProgress { get; set; } // WIP limit: 3
    public Column Review { get; set; }     // WIP limit: 2
    public Column Done { get; set; }
    
    public void MoveToInProgress(WorkItem item)
    {
        if (InProgress.Count >= InProgress.WipLimit)
            throw new Exception("WIP limit exceeded");
            
        InProgress.Add(item);
    }
}

Extreme Programming (XP)

Core Practices:
- Pair Programming
- Test-Driven Development
- Continuous Integration
- Refactoring
- Simple Design
- Customer Collaboration
// XP practices
public class XPPractice
{
    // Pair Programming: Two developers at one workstation
    // Continuous Integration: Every commit triggers build + tests
    // TDD: Red → Green → Refactor
}

3. Lean Methods

Principles

  1. Eliminate waste
  2. Amplify learning
  3. Decide as late as possible
  4. Deliver as fast as possible
  5. Build quality in
  6. See the whole
public class LeanPractice
{
    // Waste elimination
    // - Partially done work
    // - Extra features
    // - Waiting
    // - Handoffs
}

4. Modern Approaches

DevOps

Plan → Code → Build → Test → Deploy → Operate → Monitor
    ↑__________________________________________|
           Continuous feedback loop
# DevOps pipeline example
name: CI/CD Pipeline
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Run tests
        run: dotnet test
      - name: Build
        run: dotnet publish
      - name: Deploy
        run: deploy.sh

Continuous Delivery/Deployment

// CI/CD Pipeline stages
public class PipelineStage
{
    public const string BUILD = "Build";
    public const string TEST = "Test";
    public const string STAGING = "Deploy to Staging";
    public const string PRODUCTION = "Deploy to Production";
}

Comparison

MethodFlexibilityDocumentationSpeedTeam Size
WaterfallLowHighLowAny
ScrumHighLowHigh5-9
KanbanHighMediumHighAny
XPHighMediumHighSmall
DevOpsHighLowVery HighAny

Choosing Right Method

Project TypeRecommended Method
Fixed requirements, safety-criticalWaterfall, V-Model
Complex, changing requirementsScrum, Kanban
Small team, fast iterationXP, Scrum
Operations-focusedDevOps
Startup, MVPAgile, Lean

Hybrid Approaches

// Many teams use hybrid approaches
public class HybridMethod
{
    // Scrumban - Scrum + Kanban
    // Water-Scrum-Fall - Waterfall for planning, Scrum for execution
    // SAFe - Scaled Agile Framework for large projects
}

Key Practices

1. Iteration

public class Iteration
{
    // Short, time-boxed cycles
    // Each iteration produces working software
    // Feedback drives next iteration
}

2. Incremental Delivery

public class IncrementalDelivery
{
    // Deliver small pieces frequently
    // Each increment adds functionality
    // Early value to customers
}

3. Empirical Process

public class EmpiricalProcess
{
    // Transparency: Visible progress
    // Inspection: Frequent checkpoints
    // Adaptation: Change based on feedback
}

References