Extreme Programming

Layers of Management ThoughtLayer 8: Methodologies and Operating SystemsMethodologyAlso known as XP, eXtreme Programming

Developed by Kent Beck on the Chrysler Comprehensive Compensation program in the mid-1990s, with Ron Jeffries joining the project, and set out in Extreme Programming Explained: Embrace Change (1999; second edition, with Cynthia Andres, 2004).

An agile method that makes engineering discipline its center: a small team sits together, works in short cycles, writes tests first, pairs on code, and integrates constantly, so the software stays easy to change as the customer's needs move.

One week of extreme programming on a route-pricing change, and the move at each step that keeps the code easy to change

At each of the programmers' turns pick the move. The reply shows what follows, and the line under the panel counts the moves that keep the code easy to change. Illustrative.

Programmers

Customer

Programmers

Customer

Select a stage to read it, or play the sequence.The stories. The Customer, a person from operations who sits with the team, chooses which stories to build this week and says what each one is worth.Planning. Pick how the team plans.Pick a move to see the reply.By week three the customer's priorities have changed, and half the plan is out of date.Detail spent on work that will move.The team commits to four stories. The quarterly plan stays rough and gets revised each Monday.A weekly cycle inside a quarterly one.Writing the code. Pick how the team starts on the pricing rule.Pick a move to see the reply.The tests never get written, and a later change breaks the rule without anyone noticing.The code is hard to change safely.The rule is built in small steps, and the test stays as a guard for every later change.Each change can be made with confidence.The risky part. Pick how the team handles the part of the code that few understand.Pick a move to see the reply.She finishes, and then she is ill the next week. Nobody else can change the code.Knowledge sits in one head.Two people understand the code by Thursday, and a third has seen it.Understanding spreads while the work is done.Integration. Pick how the team combines its changes.Pick a move to see the reply.Friday afternoon brings a clash of changes and a late night to untangle them.Problems stack up and show late.A clash shows up within the hour and is fixed while it is small.Feedback arrives while the cause is fresh.Commitments. Pick how full to make the week.Pick a move to see the reply.One estimate runs over, and the whole week slips with it.No room to absorb a bad estimate.Two estimates run over and the week still finishes on time.Slack covers the variation in estimates.

Moves that keep the code easy to change: 0 of 5Moves that keep the code easy to change: 1 of 5Moves that keep the code easy to change: 2 of 5Moves that keep the code easy to change: 3 of 5Moves that keep the code easy to change: 4 of 5Moves that keep the code easy to change: 5 of 5

  1. The stories (Customer). The Customer, a person from operations who sits with the team, chooses which stories to build this week and says what each one is worth.
  2. Planning (Programmers). Pick how the team plans.
    • Estimate every story for the quarter in detail and fix the order now. By week three the customer's priorities have changed, and half the plan is out of date. Detail spent on work that will move.
    • Plan this week's stories in detail and the quarter loosely, then replan weekly. The team commits to four stories. The quarterly plan stays rough and gets revised each Monday. A weekly cycle inside a quarterly one.
  3. Writing the code (Programmers). Pick how the team starts on the pricing rule.
    • Write the pricing rule and add tests at the end if time allows. The tests never get written, and a later change breaks the rule without anyone noticing. The code is hard to change safely.
    • Write a failing test for the rule first, then the code that passes it. The rule is built in small steps, and the test stays as a guard for every later change. Each change can be made with confidence.
  4. The risky part (Programmers). Pick how the team handles the part of the code that few understand.
    • Give it to the one developer who knows it, and let her work alone. She finishes, and then she is ill the next week. Nobody else can change the code. Knowledge sits in one head.
    • Have two developers pair on it, and swap partners in the week. Two people understand the code by Thursday, and a third has seen it. Understanding spreads while the work is done.
  5. Integration (Programmers). Pick how the team combines its changes.
    • Merge everyone's work on Friday, when each part is finished. Friday afternoon brings a clash of changes and a late night to untangle them. Problems stack up and show late.
    • Merge many times a day into one build that runs in ten minutes. A clash shows up within the hour and is fixed while it is small. Feedback arrives while the cause is fresh.
  6. Commitments (Programmers). Pick how full to make the week.
    • Schedule every hour of the week to hit the largest possible number of stories. One estimate runs over, and the whole week slips with it. No room to absorb a bad estimate.
    • Leave slack in the week to absorb estimates that run over. Two estimates run over and the week still finishes on time. Slack covers the variation in estimates.

An example

A logistics software company shipped quarterly releases and spent the last month of each in testing and repair. The new engineering head moved one team to extreme programming for a year. The team sat together with a customer representative from operations, who chose the stories to build each week. Developers wrote a test before each piece of code, worked in pairs on anything risky, and merged their changes many times a day to a build that ran in under ten minutes.

The first month was slower than the quarterly team. By the third month the difference showed in the numbers: defects found after release had fallen by more than half, and a customer's request to change how routes were priced took four days against the usual three weeks. The team also began to leave an afternoon a week unplanned, which absorbed the estimates that ran over. The other teams asked which of the practices they could borrow.

The core idea

Extreme programming sets out to keep software cheap to change for as long as it lives, and of the agile methods it says the most about how the code itself gets written. Five values anchor it: communication, simplicity, feedback, courage, and respect. The practices that carry them, in the 2004 second edition, include a whole team sitting together, a weekly cycle inside a quarterly one, slack in every plan, a build that runs in ten minutes, continuous integration, tests written before the code, pair programming, and a design that grows in small steps.

The insight is that the practices hold each other up. Tests written first make it safe to restructure code, restructuring keeps the design simple, a simple design keeps the build fast, and a fast build lets the team integrate many times a day and release in small pieces. Take one practice away and the others weaken. The roles are few: a Customer who makes the business decisions, the programmers, and, where useful, a coach who has done it before.

The thinking behind it

Kent Beck Kent Beck was brought onto the Chrysler Comprehensive Compensation program, a payroll system begun in the mid-1990s, to fix its performance, and the project became the first to run on extreme programming. He brought in Ron Jeffries among others, and the practices took shape on that team before its members' books carried them further. Beck set the method out in Extreme Programming Explained (1999). Its subtitle, Embrace Change, names the bet: teams fixed requirements early because a late change was assumed to cost far more than an early one, and Beck argued that disciplined practice could keep late changes cheap. The 2004 second edition, written with Cynthia Andres, refined the practices from experience.

Where it sits in the layers

Extreme programming sits in Layer 8, Methodologies and Operating Systems, because it bundles values, roles, practices, and cycles for a team to adopt together. It takes for granted the improvement philosophy of the Agile Manifesto in Layer 6, with its stress on working software and responding to change, and it depends on the trust described in Psychological Safety in Layer 5, since pairing and open code reviews ask people to be seen working. Its daily practices are carried below it in Layer 10, as in Pair Programming. The common mistake is to ask it to run a company. It governs how one team builds software, and it says little about portfolio, funding, or how many teams there should be.

How organizations put it to work

A company adopts extreme programming at the level of a software team, usually led by an engineering manager or a coach, with the product owner or business sponsor providing the Customer. It fits work whose requirements keep moving, a small team that can sit together, and technology that allows automated tests, and it earns the most where a fixed date meets unfamiliar technology.

The change is in routine and measures. Teams work in weekly and quarterly cycles, test before building, pair, and integrate continuously. Measures turn toward defects found after release, the time from request to delivery, and the stability of the build. The Customer role changes the business side too. Someone from the business must be present and able to decide.

Sustaining it takes technical discipline that does not fade under deadline pressure, an engineering leader who protects slack and the tests, and a business partner who stays available. In the first year a leader should expect a slower start, some resistance to pairing, and a steady drop in rework once the build and tests mature. The business gains software that stays cheap to change, and a team whose knowledge is spread across several people.

Where it goes wrong

The first failure is the half-adopted method. A team takes the stand-up and the stories and skips the tests, pairing, and continuous integration, which carry the value. The sign is a team that calls itself extreme and still has a long repair phase before each release.

The second is the absent customer. The method assumes a business person who is on hand and able to decide. The sign is stories that arrive late, change after the work is done, or are chosen by developers.

The third is a mismatch of context. Applied to a large distributed program or to hardware with long lead times, its practices strain or break. The sign is a team working around its own rules.

A common criticism is that pairing and strict test-first work look costly in the short run, and leaders who judge by early output may abandon it first.

Related and rival frameworks

  • Scrum. A lightweight frame of roles and events with little to say about engineering. The better pick when the problem is managing the work, and it pairs with XP's practices when quality is also an issue.
  • DevOps. Extends the same fast-feedback habits from the team to the path into production. The better pick when the bottleneck is release and operation.
  • The Agile Manifesto. The statement of values that XP puts into daily practice. Read it for the reasons, and XP for the routine that follows.

Go to the source

Back to the catalog