Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TDD practioners, do you really start that simply?

 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is a little example, your new task is to write a login window. what would your first test be?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic