O'Reilly logo

Learning Modular Java Programming by Tejaswini Mandar Jog

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introduction to unit testing

Unit testing is the process of testing a single functionality in the code at a time. In unit testing, the developer ensures that the functionality is working correctly according to business logic. We will use JUnit for unit testing.

Unit testing using JUnit

JUnit is an automation testing framework which provides numbers of TestRunners that can automate the execution of any Java class that extends from TestCase. It facilitates the testing of the expected behavior of a method as a unit. The developer can write test cases for all the functions in the code. Whenever a change occurs in the functionality, causing it to behave differently than expected, it can be easily identified and fixed as well. JUnit 4 supports annotation-based ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required