aspose file tools*
The moose likes Testing and the fly likes TDD practioners, do you really start that simply? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "TDD practioners, do you really start that simply?" Watch "TDD practioners, do you really start that simply?" New topic
Author

TDD practioners, do you really start that simply?

Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

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

Joined: May 26, 2003
Posts: 30924
    
158

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: 1107

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

Joined: May 26, 2003
Posts: 30924
    
158

Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30924
    
158

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: TDD practioners, do you really start that simply?