This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
I agree. I think some of us introduce confusion because junit can be used for other things. We use junit to test JDBC - integration tests. I guess another thing is that unit testing is not the same as junit.
I guess another thing is that unit testing is not the same as junit.
Of course, JUnit is a testing tool to do the unit testing... So I'm not sure about the reason why you are comparing the type of the testing and the tool that can be used to do that testing... Correct me, if I got confused with meaning of your words...
Originally posted by Ko Ko Naing: Of course, JUnit is a testing tool to do the unit testing... So I'm not sure about the reason why you are comparing the type of the testing and the tool that can be used to do that testing...
He's not. He apparently referred to the quite common association Java developers new to unit testing have that "unit testing" equals "JUnit tests".