| Author |
TDD practioners, do you really start that simply?
|
Wendy Gibbons
Bartender
Joined: Oct 21, 2008
Posts: 1098
|
|
I have seen the bowling TDD example, and I want to ask do you really start writing the 1st line of not test code with the getter just returning the result 2, then change it to store and return the passed in value. etc.
Or do you start with some remotely intelligent code, as you know that is where you have to go.
Even if you have never understood how to score bowling (myself a prime example), you can tell you are going to have to add up the scores passed in at some stage.
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26489
|
|
When doing true TDD< I do start with a simple base case. Like what happens when I pass in null or one value. When cheating, I don't .
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Wendy Gibbons
Bartender
Joined: Oct 21, 2008
Posts: 1098
|
|
|
here is a little example, your new task is to write a login window. what would your first test be?
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26489
|
|
|
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26489
|
|
Which would force me to write:
I'd probably write more validation cases. Then I'd write a happier case.
Then I'd finally get to the case where login works.
|
 |
 |
|
|
subject: TDD practioners, do you really start that simply?
|
|
|