Many developers test their code manually. A web developer makes changes, goes to the browser and verifies that the changes have been implemented. Manually testing works well but it has its limitations. If you work on an application that constantly adds complexity, you need to write automated tests and more specifically unit tests to test the logic of your application. Below we list 3 reasons for writing unity tests:
Bugs are found easily and faster
An application is a living product that is constantly changing. A codebase that has tests is more reliable than one that doesn't. And we all know that a developer's new development more than often introduces new bugs. These bugs can easily be caught with well-written tests. You save time and do not need to dive through a difficult code base to identify the problem that arises - you can quickly identify and solve the problem.
Unit tests save time and money
As you write unit tests for your product, you also discover bugs in the software. This saves the cost of fixing the bug later during the development cycle, which means your end-user also gets a "bug-free" product.
Unit tests provides documentation
Unit tests should test the logic of each module and the system as a whole. A great advantage of writing unit tests is that you get a live documentation of your product, which new developers can be referred to.