• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to implement unit testing

 
Anthony Karta
Ranch Hand
Posts: 342
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm not sure if someone already asked this question.

I'm new with Java and I have never implement unit testing.

I have read about JUnit or Cactus in general but how to apply them - are there online resources available with sample codes??

I'm working on Servlet, JSP, XML/XSL, JDBC.

many thanks
anthony
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would start by reading the official documentation and some articles from JUnit.org. Reading a good book on the subject wouldn't be a bad idea either.
 
Anthony Karta
Ranch Hand
Posts: 342
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks lassle!

actually, I am reading some articles in Junit.org now.

which book do you suggest? I'd like more to coding/practical approach than just talking.

thanks
tony
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tony Karta:
which book do you suggest? I'd like more to coding/practical approach than just talking.

Probably Unit Testing in Java by Johannes Link or Junit in Action by Vincent Massol. J.B. Rainsberger's JUnit Recipes should also be a terrific cookbook after you've mastered the basics.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lasse Koskela:

Probably Unit Testing in Java by Johannes Link or Junit in Action by Vincent Massol.


Seconded. "JUnit in Action" mostly concentrates on web applications in the later chapters, whereas "Unit Testing in Java" also contains a chapter on GUI testing and puts more weight on test driven development in general.
 
Adel Aneiba
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

There are two nice books explain how to use Junit and other realted topics. The books are:

Junit in action: ISBN:1-930110-99-5
Junit Recipes: ISBN:1932394230

Good Luck

Adel
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just assembled http://faq.javaranch.com/view?GoodBooksOnTesting - add anything you find missing!
 
Anthony Karta
Ranch Hand
Posts: 342
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks lassle!

actually, I am reading some articles in Junit.org now.

which book do you suggest? I'd like more to coding/practical approach than just talking.

thanks
tony
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See my previous reply...
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tony Karta:
thanks lassle!

actually, I am reading some articles in Junit.org now.

which book do you suggest? I'd like more to coding/practical approach than just talking.

thanks
tony


I'm having a d�j� vu...
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See my previous reply...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic