Extreme Programming: Cs2340 Spring 2004
Extreme Programming: Cs2340 Spring 2004
CS2340
Spring 2004
XP References
Fall 2004 2
Three Core Contributors
• Ward Cunningham
• Kent Beck
• Ron Jefferies
• Other notables:
• Robert Martin
• Martin Fowler
Fall 2004 3
XP-eXtreme Programming
Fall 2004 4
Kent: “Communication, simplicity,
feedback, courage”
Fall 2004 5
Fall 2004 6
The Overall XP Lifecycle
Fall 2004 7
User Stories
Fall 2004 8
User Stories
• Basis for:
• Requirements
• Test Cases
• Project Plan
• Estimate by User Story
• Velocity for overall tracking
• Workload distribution through “sign-up”
Fall 2004 9
Daily Standup Meeting
Fall 2004 10
Unit Tests
Fall 2004 11
SUnit
Fall 2004 12
Pair Programming
Fall 2004 13
Does Pair Programming work?
• From WikiWikiWeb:
• Pair up your people.
• When applicable, each pair should have a relatively
experienced and a relatively inexperienced person.
• For work being done at a computer, put the relatively
inexperienced person at the keyboard, so everything
the experienced person says has to flow through the
novice to the computer.
• The point is not for the guru to dictate to the
greenhorn; on the contrary, putting the novice at the
keyboard is meant to keep him or her more in the
loop.
Fall 2004 15
Integrate Constantly
Fall 2004 16
40 Hour Work Weeks
Fall 2004 17
Refactor Mercilessly
Fall 2004 18
Refactor Mercilessly (cont.)
Fall 2004 19
Avoid new functionality
• Keep the system uncluttered with extra stuff you guess will be used
later.
• Only 10% of that extra stuff will ever get used, so you are
wasting 90% of your time.
• We are all tempted to add functionality now rather than later
because we see exactly how to add it or because it would make the
system so much better.
• It seems like it would be faster to add it now.
• But we need to constantly remind ourselves that we are not
going to actually need it.
• Extra functionality will always slow us down and squander our
resources.
• Turn a blind eye towards future requirements and extra flexibility.
• Concentrate on what is scheduled for today only
Fall 2004 20
One of Four Hats
• Kent Beck:
• When you are coding you should be wearing only one of
four different hats.
• Refactoring code, but only changing the interface
• Interface = method names & parameters
• Refactoring code, but only changing the implementation
• Adding new functionality, but only changing the interface
• Adding new functionality, but only changing the implementation.
Fall 2004 21
Example of Refactoring
Fall 2004 22
Example (cont’d)
Now I notice that aRectangle cares a lot more about this message than I do:
area := self areaOf: aRectangle.
...
areaOf: aRectangle
^aRectangle area
Rectangle>>area
^self right - self left * (self bottom - self top)
Now, areaOf: isn't doing me much good:
...
area := aRectangle area.
...
Rectangle>>area
^self right - self left * (self bottom - self top)
Fall 2004 23
Key Idea
Fall 2004 24
XP is against “Big Design Up Front”
Fall 2004 25
Ward Cunningham On Comments
Fall 2004 26
Can this really work?
Fall 2004 27
The Overall XP Lifecycle
Fall 2004 28
XP Path
Fall 2004 29
XP Development
Fall 2004 30
XP Collective Code Ownership
Fall 2004 31
Lessons Learned
Fall 2004 32
XP in Perspective
Fall 2004 33