Problem solve Get help with specific problems with your technologies, process and projects.

How to approach JUnit for unit testing

JUnit is a useful tool for those conducting unit tests. Expert Mike Kelly explains how to begin using JUnit and recommends resources for those new to unit testing.

I like JUnit from what I hear. I do not know how to use it. Please kindly advise me how to use it.

In 2005 Dana Spears and I held a workshop on unit testing in Indianapolis. I published some of the findings of that workshop here. At the end of that article, I recommended a number of resources for getting started. That list included Kent Beck's Test-Driven Development: By Example (Addison-Wesley, 2002, ISBN 0321146530) and TestDriven.com.

Software testing resources:
Building beautiful software tests around JUnit

Unit testing critical for improving software quality

Find software bugs, defects using code coverage

Given that you asked specifically about JUnit, I would also recommend the JUnit documentation on SourceForge. A great example which walks you through specific tests (follow along in JUnit as you read it) is JUnit Test Infected: Programmers Love Writing Tests. Once you've read a bit about it, the best way to learn is to start doing it. Just start. The more you do it, the easier it gets.

Dig Deeper on Topics Archive

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.