Hi folks,
there seems to be some persistent confusion about what we mean when we talk about
unit testing, which Dave and I have addressed in some of the posts below, but I thought I should try to clarify the issue.
There are lots of different kinds of testing that can and should be
performed on a software project. Some of this testing requires
extensive involvement from the end users; other forms may require
teams of dedicated Quality Assurance personnel or other expensive
resources.
None of that is unit testing.
A unit test is a piece of code that exercises a very small, specific area of functionality of the code being tested. Unit tests are performed to prove that
a piece of code does what you think it should do. It may or may not be the RIGHT thing to do according to the customer or end-user: that's what acceptance testing is for. We're not really concerned with formal validation and verification or correctness just yet. We're really not even interested in performance testing at this point. All we want to do is prove that code does what we intended, and so we want to test very
small, very isolated pieces of functionality. By building up confidence that the individual pieces work as expected, we can then proceed to assemble and test working systems.
After all, if we aren't sure the code is doing what WE think it is, then any
other forms of testing are just be a waste of time.
Finally, as a courtesy to all you loyal
Java Ranch readers, here's a link to the online store that will give you a 20% discount on the Starter Kit books and PDFs:
http://pragmaticprogrammer.com/shopsite_sc/shopping_cart/order.cgi?storeid=*167d03fb829b81b917e3a91f00&rec=23&cpid=1077129594&function=add Or, just order using our normal shopping cart and enter the coupon code JR914XL when asked.
thanks, and enjoy!