Unit testing is defined as “ Each module is tested alone in an attempt to discover any errors in its code ”. Its always a good practice to test each unit of your project independently as it saves time and effort while integrating the modules.
JUnit provides close relationship between testing and development. As developers write the code, they use the JUnit test runners to verify how much it deviates from the intended goal. Normally it is a standard practice that the code developers themselves write unit tests for their code.