UNIT TESTING is a level of software testing where individual units/ components of a software are tested. The purpose is to validate that each unit of the software performs as designed. A unit is the smallest testable part of any software. It usually has one or a few inputs and usually a single output. In procedural programming, a unit may be an individual program, function, procedure, etc. In object-oriented programming, the smallest unit is a method, which may belong to a base/ super class, abstract class or derived/ child class. (Some treat a module of an application as a unit. This is to be discouraged as there will probably be many individual units within that module.) Unit testing frameworks, drivers, stubs, and mock/ fake objects are used to assist in unit testing.
A function, loop, method, or statement in the program is working very well. This type of testing is executed by the Developer. In unit testing, Individual procedures or functions are tested to guarantee that they are operating in the approved manner and all components are tested individually.
Defined by Mohsin Ghani on 21-3-2020