Originally posted by siu chung man: Why unit testing recommends and prefers to be used in the book and in Java program?
I'm not sure I understand your question.
Unit Testing is an important, but far from sufficient, part of testing in a software development project, wether done in Java or not. I don't understand J.B. to mean that you should *only* be unit testing your applications, it's just that he decided to write a book about JUnit; other authors (or perhaps even himself) have written about the other aspects of testing, and will continue to do so...
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
Joined: Jan 04, 2003
Um........ What are the advantages using unit testing that compares with other's testing method in Java program?
As the subtitle implies, JUnit Recipes is about programmer testing--tests that programmers write to give them confidence that the code does what they think the code does.
Effective programmer testing is like the brakes on a car: they allow to you go more quickly. Whenever you make a bad change to the system, a test fails and you know immediately.
Now JUnit Recipes does talk a little about integration tests and end-to-end tests, but its focus is isolated object testing: testing each object in isolation from the rest of them. The theory is--and it seems to work well for me--that if all objects work and collaborate well with one another's contracts, then the system will just work. And it does, at least the vast majority of the time.
Author of <a href="http://www.amazon.com/exec/obidos/ASIN/1932394230/ref=jranch-20" target="_blank" rel="nofollow">JUnit Recipes: Practical Methods for Programmer Testing</a>
I am happy with JUnit's feature set. That said, as Lasse points out, NUnit has some neat features unique to languages that offer attributes, like those in the .NET world. When Tiger becomes the norm, we will have to write JUnit 4.0 and learn to take advantage of the new, flexible features. I don't know how that will change the way I write tests, but I know it will have some effect.