Meaningless Drivel is fun!*
The moose likes Testing and the fly likes Regarding TDD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Regarding TDD" Watch "Regarding TDD" New topic
Author

Regarding TDD

amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
I heard about Test Driven Development where we write out testcase first and then code .I don't know how we can write testcase to test a method if we yet don't implemented the class.I am using Junit for unit test case.Can anyone please tell me with example.
Rajah Nagur
Ranch Hand

Joined: Nov 06, 2002
Posts: 239
Follow this link....


You can't wake a person who is <b><i>pretending</i></b> to be asleep.<br />Like what <b>"it"</b> does not like - <i> Gurdjieff </i>
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
You write the test as if there already was a class with exactly the API you need to write the tests sensibly. That test, of course, won't compile to begin with, so the first step in making it run is writing just enough of the production code to make the test compile.

Does that help?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Dave Wilkins
Greenhorn

Joined: Sep 11, 2007
Posts: 6
You will also find an excellent introduction to TDD with Java and jUnit examples here:
http://www.ibm.com/developerworks/java/library/j-xp042203/index.html

Good luck


<a href="http://www.sqazone.net/" target="_blank" rel="nofollow">http://www.sqazone.net/</a>
amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
Thanks all for you for your kind reply.I got an idea how to proceed for following TDD approach.Now i want to know how we can follow TDD while developing web application .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding TDD