Extreme programming

Also known as: XP

On this page 7

Extreme programming (XP) is an agile software development method that organizes the software lifecycle around very short release cycles, continuous customer feedback and a set of tightly linked engineering practices, such as test-driven development, pair programming and continuous integration. It takes proven practices and applies them to the extreme: if code review is useful, code is reviewed continuously; if testing is useful, tests are written before the code.

Kent Beck formulated XP in the late 1990s during the Chrysler Comprehensive Compensation project and described it in the book Extreme Programming Explained. Within the software lifecycle, XP stands out among agile methods because it prescribes concrete technical practices, whereas Scrum and Kanban focus mainly on planning and workflow.

Values and principles of extreme programming

XP rests on five values that guide every practice and decision. The values explain why the practices exist, so a team that understands them can adapt the method without losing its intent. The 2004 second edition added respect to the original four values.

ValueMeaning in practice
CommunicationKnowledge moves through conversation, pairing and shared code
SimplicityBuild the simplest solution that works for today
FeedbackTests, customers and the build report problems within minutes or days
CourageRefactor, discard code and report bad news openly
RespectEvery team member and stakeholder contributes and is heard
The five XP values

From these values XP derives principles such as small steps, rapid feedback and the economic argument that change should be cheap. The method assumes that a disciplined team can keep the cost of change low throughout the project, which reverses the traditional view that late changes are inevitably expensive.

Core practices of XP

The XP practices are designed to reinforce one another, so adopting only some of them weakens the whole. For example, refactoring is safe only because automated tests catch regressions, and collective code ownership works because pairing spreads knowledge.

PracticeWhat the team doesProblem it addresses
Test-driven developmentWrite a failing test, then the code that passes itRegressions and unclear requirements
Pair programmingTwo developers work at one workstationDefects and knowledge silos
Continuous integrationIntegrate and run all tests several times a dayPainful late merges
RefactoringImprove design without changing behaviorGrowing technical debt
Small releasesDeliver working software every few weeks or more oftenLate discovery of wrong features
Planning gameCustomers rank user stories, developers estimate themUnrealistic scope and dates
Collective code ownershipAnyone may improve any part of the codeBottlenecks on single experts
Sustainable paceAvoid sustained overtimeBurnout and declining quality
Key engineering and planning practices

Other practices include simple design, coding standards, an on-site customer who answers questions immediately, and acceptance tests written together with that customer. The later edition of the method regrouped them into primary and corollary practices, but the substance remained the same.

The XP lifecycle and iterations

An XP project runs as a sequence of releases, each divided into short iterations, traditionally one to two weeks long. Requirements are captured as user stories, short descriptions of a capability written from the user’s perspective and estimated in points or ideal days.

  1. Exploration: the team and customer write initial stories and try out the technology.
  2. Release planning: the customer selects the stories for the next release based on estimates and velocity.
  3. Iterations: the team implements stories test-first, integrates continuously and demonstrates results.
  4. Productionizing: the release is hardened, verified and deployed.
  5. Maintenance: new iterations continue while the system runs in production.

Progress is measured by velocity, the amount of story work completed per iteration, which the team uses to forecast the next plan. Because stories can be reprioritized at every iteration boundary, XP embraces changing requirements instead of freezing them early.

Extreme programming compared with other methods

XP differs from Scrum and the waterfall model mainly in how much engineering discipline it prescribes. Many teams combine XP practices with Scrum events, a hybrid that is common in industry. In such a hybrid, Scrum supplies the roles and the sprint rhythm, while XP supplies the technical discipline that keeps each increment releasable.

AspectExtreme programmingScrumWaterfall model
Iteration length1-2 weeksSprints of up to one monthNo iterations
Engineering practicesPrescribed in detailNot prescribedNot prescribed
Scope changesAllowed between iterationsDiscouraged within a sprintFormal change control
Customer involvementContinuous, ideally on siteThrough the product ownerMainly at start and end
TestingTest-first, automatedLeft to the teamSeparate late phase
XP, Scrum and waterfall at a glance

Where XP fits and where it struggles

XP works best for small to medium co-located teams, typically up to about a dozen developers, building software with volatile or unclear requirements. It also suits environments where automated testing and frequent deployment are technically feasible.

The method faces real limitations. Pair programming roughly doubles person-hours per task in the short term, and its quality benefits vary between studies and teams. Large distributed organizations, safety-critical systems with heavy documentation duties and fixed-price contracts often need additional structure.

  • Partial adoption: dropping tests while keeping short iterations produces fast delivery of fragile code.
  • Missing customer: without a reachable customer, stories become guesses and feedback slows down.
  • Misread simplicity: simple design means no speculative features, not neglecting architecture.

The idea in brief

Extreme programming is a way for software teams to work in very small, safe steps. Programmers often work in pairs, check every small change with automatic tests and show new results to the customer every week or two.

It resembles cooking with the guest tasting each dish while it is being prepared. Mistakes are noticed early, and the menu can change without throwing away the whole meal. The key idea is that frequent feedback keeps change cheap.

A practical scenario

A team of eight developers at a regional insurer builds a new claims portal. The business rules are still being negotiated with regulators, so the requirements change almost every month. A traditional plan with a fixed specification would be outdated before the first release, and the insurer cannot afford a long stabilization phase at the end.

The team adopts XP with one-week iterations. A claims specialist sits with the developers three days a week, writes acceptance criteria and ranks the stories. Developers pair on all production code, write tests first and integrate into the main branch several times a day, keeping the build green.

When a regulator changes the rules for water-damage claims in the sixth week, the team rewrites the affected logic within one iteration, because about 1,500 automated tests confirm that nothing else broke. The portal goes live on schedule, and defects reported in the first month stay in single digits.