• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding TDD

 
amit sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Follow this link....
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Dave Wilkins
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
amit sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic