API Testing vs. Unit Testing

Many software engineers use the terms "API testing" and "unit testing" interchangeably. I’ll cut to the point of my paragraph and say that although the terms technically have quite different meanings, and the use of the terms has changed over time, in most cases the meaning of either term will be clear from the context in which it is used. Both loosely mean testing the individual building blocks which make up your program/system under test. The term "unit testing" is an old one and "officially" (by that I mean established by various standards organizations such as the IEEE many years ago) means testing the smallest compilable component of a system under test. There are several ways to interpret this but in a C++ environment it could mean testing individual functions. Now the term "API testing" (Application Programming Interface) is also old and "officially" means testing the subroutines (typically C++ functions) contained in a code library, including those exposed by an operating system.
So both "unit testing" and "API testing" are commonly used to mean testing the individual building blocks of a program or system. However, within the past few years several software development paradigms have adopted the term "unit testing" and given it a slightly different flavor. In particular Extreme Programming, Agile Programming, and Test-Driven Development consider unit testing a key part of their methodolgies — so much so that "unit testing" is closely associated with those (and other) development methodologies.
The bottom line is that testing the individual building blocks of a program/system under development is one of the most basic forms of testing and is an absolute requirement for any significant program/system. You can read about some of the details of the similarities and differences between classical API/unit testing and unit testing in a test-driven development environment in the August 2005 issue of MSDN Magazine at http://msdn.microsoft.com/msdnmag/issues/05/08/testrun/default.aspx .
This entry was posted in Software Test Automation. Bookmark the permalink.