II UNIT TESTING
The term “unit” needs explanation. There are several interpretations about exactly what constitutes a unit. In a procedural programming language, a unit can be
A single procedure
A function
A body of code that implements a single function
Source code that fits on one page
A body of code that represents work done in 4 to 40 hours (as in a work breakdown structure)
The smallest body of code that can be compiled and executed by itself
In an object-oriented programming language, there is general agreement that a class is a unit. However, methods of a class might be limited by any of the “definitions” of a unit for procedural code.
The bottom line is that “unit” is probably best defined by organizations implementing code. In my telephony ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access