This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Testing and the fly likes What is the purpose of unit testing? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Testing
Bookmark "What is the purpose of unit testing?" Watch "What is the purpose of unit testing?" New topic
Author

What is the purpose of unit testing?

Buddhika Mawella
Ranch Hand

Joined: Jan 06, 2011
Posts: 39

Hi,
I have seen many people are writing unit tests for their java programs. But what unit testing actually mean? What is the purpose of unit testing? What would be the result if we do not perform unit testing for our software?


BM
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1763
    
    7

I was goig to type up something, but the wikipedia entry on unit testing sums it up quite nicely. Also, you might want to have a look at the entry on test driven development.

The really, really short version is that unit tests are inteded to verify the correctness of individual units of a system. If you have a comprehensive test set you're essentially working with a safety net, because as soon as you make changes that break the contract guarded by a unit test, it will fail and you will know something's wrong right away.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What is the purpose of unit testing?