Professional Documents
Culture Documents
www.objectmentor.com
Robert C. Martin
www.junit.org fitnesse.org
Copyright 1998-2005 by Object Mentor, Inc All Rights Reserved
To do this, we need:
Data
5
6
Story Points 10 20 30 40 50 60 0
1/ 20 /2 00 3 1/ 27 /2 00 3 2/ 3/ 20 03
Velocity
2/ 10 /2 00 3 2/ 17 /2 00 3 2/ 24 /2 00 3 3/ 3/ 20 03 3/ 10 /2 00 3
7
Story Points 100 200 300 400 500 600 0
and this
1/ 20 /2 00 3 1/ 27 /2 00 3 2/ 3/ 20 03 2/ 10 /2 00 3 2/ 17 /2 00 3 2/ 24 /2 00 3 3/ 3/ 20 03 3/ 10 /2 00 3
Story Points Remaining
Story Points Remaining 600 Story Points 500 400 300 200 100 0
50 40 30 20 10 0
00
00
00
/2 00
00
/2 00
00
00
00
00
00
00
00
2/ 3/ 20 0
1/ 20 /2
1/ 27 /2
2/ 17 /2
2/ 24 /2
2/ 10 /2
3/ 3/ 20 0
0/ 2
7/ 2
7/ 2
4/ 2
0/ 2
0/ 2
Then managers could just look at them to see The status of the project.
8
3/ 10 /2
2/ 3
2/ 1
2/ 1
3/ 3
3/ 1
1/ 2
1/ 2
2/ 2
00
! !
10
! !
11
The Spec V1
The Spec V2
The Spec V3
The Spec V3
12
13
14
Royces Observation
15
Royces Conclusion
16
17
Jarzombek Study.
18
Over specification
Actual use of Waterfall Requested Features
Never 45%
Always 7%
Often 13%
Rarely 19%
Sometimes 16%
19
20
...the document-driven, specify-then-build approach... lies at the heart of so many... software problems.
Fred Brooks in his 1987 Report of the Defense Science Board Task Force on Military Software
21
Lets go to a meeting
1 May Analysis Design Implementation DFD ERD DD ST 1 Jul 1 Sep 1 Nov
22
Iterative Development
Exploration
UI Comms
Some UI, Comms, and Control for some behavior
Control
Slices cut across all sub-systems
23
. . . . . . . .
24
. . . . . . . .
25
! !
26
27
OR.
You guys are great. I have faith in you. I know you can do it! I sure hope you can
28
29
Story Points
1/ 2 0/ 2
10 20 30 40 50 60 0
00 3
1/ 2 7/ 2 00 3
2/ 3 /2 00 3 2/ 1 0/ 2
Velocity
00 3
2/ 1 7/ 2 00 3 4/ 2 00 3
2/ 2
Managers can.
3/ 3 /2 00 3 3/ 1 0/ 2 00 3
Story Points
1/ 20 /2 1/ 27 /2
100 0
200
300
400
500
600
00
3 00 2/ 3/ 20 0 2/ 10 /2 2/ 17 /2 2/ 24 /2
3 00
3 00
3 00 3/ 3/ 20 0 3/ 10 /2
3 00
manage
Staff
Scope
Quality
30
Collective Ownership
Acceptance Tests
Refactoring
Planning Game
Metaphor
31
User Stories
Stories
Name of a feature, or short description Brief specifications of customer requirements
Is a token for a conversation
Return Car
33
Story Estimation
Team assigns a estimate or price to each story Estimates are in dimensionless but proportional units
A 2 takes twice as much effort as a 1
Customer uses price to juggle priorities and acquire resources Unknowns can be eliminated through use of spikes, a research story
34
35
Agile Planning
User Stories Release Planning Iteration Planning
Even the best plans must be continually refined Requires continuous and meaningful feedback
37
In preparing for battle I have always found that plans are useless, but planning is indispensable.
Dwight David Eisenhower
38
Exploration
Attendees
Whole team
Input
Product Vision Initial Story List (verbal) Critical dates
39
Release Planning
Attendees
Whole team (as appropriate)
Inputs
Stack of estimated stories Team Velocity Critical dates or initial release functionality
Outputs
Release plan series of iterations, with significant dates
40
Release Planning
The 4-way Decision.
Important Expensive Important Cheap
Unimportant Expensive
Unimportant Cheap
41
Managing Scope
USER STORY USER STORY USER STORY
USER STORY USER STORY USER STORY USER STORY USER STORY USER
USER
USER
STORY STORY USER USER STORY USER STORY USER STORY STORY USER USER STORY USER STORY USER STORY STORY USER USER STORY USER STORY USER STORY STORY USER USER STORY USER STORY USER STORY STORY
Get
USER STORY
USER STORY
USER STORY
43
Release Plan
Release 1
44
Release 2
Iteration Planning
Monday Morning:
Confirm the stories for the iteration
Iteration velocity: number of story points completed Never extend the iteration date
46
47
48
49
1 May Analysis
1 Jul
1 Sep
1 Nov
52
53
56
Automated
written in a very high-level language executed frequently written by the stakeholders
57
Imagine you have a button to press that would tell you if the system worked
59
Test
61
Iteration
Acceptance Tests
Defines doneness.
62
Iteration
Acceptance Tests
Defines doneness.
63
66
Story Points
1/ 2 0/ 2
10 20 30 40 50 60 0
00 3
1/ 2 7/ 2 00 3
2/ 3 /2 00 3 2/ 1 0/ 2
Velocity
00 3
2/ 1 7/ 2 00 3 4/ 2 00 3
2/ 2
3/ 3 /2 00 3 3/ 1 0/ 2 00 3
Story Points
1/ 20 /2 1/ 27 /2
100 0
200
300
400
500
600
00
3 00 2/ 3/ 20 0 2/ 10 /2 2/ 17 /2 2/ 24 /2
3 00
3 00
3 00 3/ 3/ 20 0 3/ 10 /2
3 00
A Simple Example
The result
70
71
72
73
Story Points
1/ 2 0/ 2
10 20 30 40 50 60 0
00 3
1/ 2 7/ 2 00 3
2/ 3 /2 00 3 2/ 1 0/ 2
Velocity
00 3
2/ 1 7/ 2 00 3 4/ 2 00 3
2/ 2
and actionable
3/ 3 /2 00 3 3/ 1 0/ 2 00 3
Story Points
1/ 20 /2 1/ 27 /2
100 0
200
300
400
500
600
00
3 00 2/ 3/ 20 0 2/ 10 /2 2/ 17 /2 2/ 24 /2
3 00
3 00
3 00 3/ 3/ 20 0 3/ 10 /2
3 00
74
75
Evolution: XML-based
Still automated Scalable Visions of frameworks began XML introduces extra complexity Not customer friendly
76
GUI Testers
Mercury Robot Canoo WebRunner etc.
77
78
FitNesse
The solution we all agreed upon.
Requirements are written with example tables The tables are really tests Writing tests as a table is an interesting paradigm Some tests naturally fit into tables Some tests require thought to put them in the form of a table
80
The Mechanics
The first row of a FIT table is the title of the table This title is the name of something called a fixture Fixtures are simple programs written by the developers to connect the application to the data in the table.
81
The Mechanics
When you run a test the fixture gathers the data from the table and calls the appropriate functions in the application The fixture then gathers data from the application and compares them with entries in the table, turning them green or red
82
85
If it is thought of at all
86
Untestable Dependencies
Too often applications directly depend on external and third party resources
Networ k
READY
87
Dependency Management
Interfaces isolate the system from external dependencies
Networ k
READY
88
Testability!
89
100 90 80 70 60 50 40 30 20 10 0 1 3 5 7 9 11
91
92
Story Points
1/ 2 0/ 2
10 20 30 40 50 60 0
00 3
1/ 2 7/ 2 00 3
2/ 3 /2 00 3 2/ 1 0/ 2
Velocity
00 3
2/ 1 7/ 2 00 3 4/ 2 00 3
2/ 2
and actionable
3/ 3 /2 00 3 3/ 1 0/ 2 00 3
Story Points
1/ 20 /2 1/ 27 /2
100 0
200
300
400
500
600
00
3 00 2/ 3/ 20 0 2/ 10 /2 2/ 17 /2 2/ 24 /2
3 00
3 00
3 00 3/ 3/ 20 0 3/ 10 /2
3 00
Iteration Management
93
Collective Ownership
Acceptance Tests
Refactoring
Scrum
Metaphor
94
Copyright 2005 by Object Mentor, Inc All copies must retain this page unchanged.
Scoring Bowling.
The game consists of 10 frames as shown above. In each frame the player has two opportunities to knock down 10 pins. The score for the frame is the total number of pins knocked down, plus bonuses for strikes and spares. A spare is when the player knocks down all 10 pins in two tries. The bonus for that frame is the number of pins knocked down by the next roll. So in frame 3 above, the score is 10 (the total number knocked down) plus a bonus of 5 (the number of pins knocked down on the next roll.) A strike is when the player knocks down all 10 pins on his first try. The bonus for that frame is the value of the next two balls rolled. In the tenth frame a player who rolls a spare or strike is allowed to roll the extra balls to complete the frame. However, no more than three balls can be rolled in the tenth frame.
96
The Requirements.
Game + roll(pins : int) + score() : int
98
99
100
Tenth Frame
The tenth frame has two or three rolls. It is different from all the other frames.
101
The score function must iterate through all the frames, and calculate all their scores.
Tenth Frame
102
10
Tenth Frame
103
Begin
Create a project named BowlingGame Create a unit test named BowlingGameTest
104
Begin.
Create a project named BowlingGame Create a unit test named BowlingGameTest
Execute this program and verify that you get the following error:
No tests found in BowlingGameTest
105
106
107
108
109
110
111
112
113
114
public class Game { public void roll(int pins) { } public int score() { return 0; } }
115
public class Game { public void roll(int pins) { } public int score() { return 0; } }
116
117
118
119
120
121
122
123
124
tempted to use flag to remember previous roll. So design must be public void roll(int pins) { wrong.
score += pins; } public int score() { return score; }
125
126
- ugly
comment in test
127
128
129
- ugly
comment in test.
130
131
This isnt going to work because i might not refer to the first ball of the frame. Design is still wrong. Need to walk through array two balls (one frame) at a time.
132
133
public class Game { private int rolls[] = new int[21]; private int currentRoll = 0; public void roll(int pins) { rolls[currentRoll++] = pins; } public int score() { int score = 0; int i = 0; for (int frame = 0; frame < 10; frame++) score += rolls[i] + rolls[i+1]; i += 2; } return score; } }
134
135
136
-ugly comment in test. -ugly comment in conditional. -i is a bad name for this variable
public class Game { private int rolls[] = new int[21]; private int currentRoll = 0; public void roll(int pins) { rolls[currentRoll++] = pins; } public int score() { int score = 0; int i = 0; for (int frame = 0; frame < 10; frame++) { if (rolls[i] + rolls[i + 1] == 10) // spare { score += 10 + rolls[i + 2]; i += 2; } else { score += rolls[i] + rolls[i + 1]; i += 2; } } return score; }
137
138
139
140
141
public class Game { private int rolls[] = new int[21]; private int currentRoll = 0; public void roll(int pins) { rolls[currentRoll++] = pins; } public int score() { int score = 0; int frameIndex = 0; for (int frame = 0; frame < 10; frame++) { if (rolls[frameIndex] == 10) // strike { score += 10 + rolls[frameIndex+1] + rolls[frameIndex+2]; frameIndex++; } else if (isSpare(frameIndex)) { score += 10 + rolls[frameIndex + 2]; frameIndex += 2; } else { score += rolls[frameIndex] + rolls[frameIndex + 1]; frameIndex += 2; } } return score; } private boolean isSpare(int frameIndex) { return rolls[frameIndex] + rolls[frameIndex + 1] == 10; }
142
143
144
145
146
End
Contact Information
Robert C. Martin unclebob@objectmentor.com Website: www.objectmentor.com FitNesse: www.fitnesse.org
148