Unit testing is verifying the individual units of code. Code coverage can be used to determine how much of the code is actually being tested by developers. The aim of unit testing is to execute each line of code, and so unit testing helps detect corner cases that wouldn’t otherwise be caught during functional tests. There are various methods of unit testing automation for every language; some examples are Gtest/Gmock, junit, Cunit. Unit testing support generally comes along with programming languages.
Why Unit Testing?
Unit testing, especially test driven development, is a design or implementation activity, not a testing activity.