Software Development Magazine - Project Management, Programming, Software Testing |
Scrum Expert - Articles, tools, videos, news and other resources on Agile, Scrum and Kanban |
Click here to view the complete list of archived articles
This article was originally published in the Winter 2002 issue of Methods & Tools
Extreme Programming as Nested Conversations - Page 4
William C. Wake, http://www.xp123.com
Emergence at the Code Level
One of the unexpected aspects of XP is its flipping around the development cycle from "analyze-design-code-test" to "analyze-test-code-design" (Ralph Johnson). One way to design is to speculate on the full design that will be needed. Another approach is to intertwine design and development. XP follows the latter approach: build a little something, then evolve and generalize the code to reflect the design.
Martin Fowler’s book Refactoring catalogs "code smells" (indicators of design problems) and "refactorings" (safe transformations that can address problems). These provide (usually) local improvements to code.
The team also looks for more global improvements. Pair swapping and shared ownership mean that people will be exposed to more areas of the code, so able to spot similarities among disparate sections. The team’s search for a metaphor (shared understanding of the system) can help this too.
Why is this emergence? Because simple rules (smells and transformations) lead to something perhaps unexpected: globally good design.
Lean Manufacturing
The automobile industry has moved from assembly lines to lean manufacturing. Traditional assembly lines "push product" as fast as possible; inventory is regarded as an asset. In lean approaches, a product is "pulled" from the system, and inventory is regarded as a source of waste.
XP’s approach to planning and implementation strives for "just in time" work.
- At first, stories described with just enough detail to allow an estimate.
- For each iteration, just enough stories are expanded with tests and details so the stories can be broken into tasks.
- For the current task, then the pair will write a test and implement just enough code to make the test pass.
- For the resulting code, the pair will refactor to reflect the design as it’s now understood.
Suppose a team is doing 100 stories, at the rate of ten per week. This might be the schedule for an XP team:
- Week 1: 100 stories described and estimated
- Week 2: 10 stories get customer tests; those same 10 stories get unit-tested, coded, and refactored.
- …
- Week 11: The last 10 stories get customer tests, unit-tested, coded, and refactored.
Because the team is completes the highest-value stories first, the earliest iterations are the most valuable.
Compare this to a strict waterfall:
- 100 stories get analyzed
- 100 stories get designed
- 100 stories get coded and unit-tested
- 100 stories get tested
At some level, there’s the same amount of total work (though my bet would be on the first team). But look at it from a flow perspective: we don’t see any results until stories come out of testing.
Think of a story as inventory. When it has been analyzed, designed, and coded, but not tested or deployed, it has a substantial investment at risk. The XP pipeline lowers the risk: a story gets everything done at once, and spends less time at risk.
Conclusion
XP challenges traditional software development processes in several ways: everything from how a team is structured to how code is implemented comes in for scrutiny. The XP practices represent an effective way to help a team learn what software is needed and develop that software, while respecting and valuing each person on the team.
Further Reading
- The XP series from Addison-Wesley: Extreme Programming Explained (Kent Beck) is the first in the series; Extreme Programming Explored is my contribution; Testing Extreme Programming (Lisa Crispin and Tip House) is the latest addition.
- The Agile Software series, also from Addison-Wesley: Agile Software Development (Alistair Cockburn) is a good starting point.
- Managing the Design Factory: The Product Developer’s Toolkit by Donald Reinertsen
- Pair Programming Illuminated, by Laurie Williams and Robert Kessler
- XP web sites: www.extremeprogramming.org,www.xp123.com, and www.xprogramming.com
- "XP on One Page" is a mini-poster available at http://www.xp123.com/xplor/xp0202/index.shtml
More Agile Knowledge
Methods & Tools Testmatick.com Software Testing Magazine The Scrum Expert |