Testing of software that you develop is a very important part of the overall software development cycle. There are many types of testing, and each one has a specific purpose. Each one varies in the scope of testing. Some of the examples of testing are functional testing, integration testing, scenario testing, and unit testing.
Of all these types, unit tests are the narrowest in scope and are typically coded and executed by developers. Each unit test is meant to test a specific and small piece of functionality (typically, a method in a class) and is expected to execute without any external dependencies. Here are some of the reasons why you should write good unit tests: