Unit Testing
What is Unit Testing?
• UNIT TESTING is a type of software testing
where individual units or components of a
software are tested. The purpose is to validate
that each unit of the software code performs
as expected. Unit Testing is done during the
development (coding phase) of an application
by the developers.
Unit Testing Advantage
• Developers looking to learn what functionality is provided
by a unit and how to use it can look at the unit tests to
gain a basic understanding of the unit API.
• Unit testing allows the programmer to refactor code at a
later date, and make sure the module still works correctly
(i.e. Regression testing). The procedure is to write test
cases for all functions and methods so that whenever a
change causes a fault, it can be quickly identified and fixed.
• Due to the modular nature of the unit testing, we can test
parts of the project without waiting for others to be
completed.
Unit Testing Disadvantages
• Unit testing can't be expected to catch every
error in a program. It is not possible to
evaluate all execution paths even in the most
trivial programs
• Unit testing by its very nature focuses on a
unit of code. Hence it can't catch integration
errors or broad system level errors.