© John T. Taylor, Wayne T. Taylor 2021
J. T. Taylor, W. T. TaylorPatterns in the Machinehttps://doi.org/10.1007/978-1-4842-6440-9_6

6. Unit Testing

John T. Taylor1   and Wayne T. Taylor2
(1)
Covington, GA, USA
(2)
Golden, CO, USA
 

PIM defines a unit test as demonstrable evidence that an individual module works in isolation and that it meets all requirements and the design criteria. In this context, an “individual module” means a header file (.h) and its corresponding implementation file (.c or .cpp). If you’re programming in C++, this means that essentially every class will require a corresponding unit test. In C, most of your functions will require unit tests.

I know this can sound overwhelming. If you have to write a unit test for every class, it seems ...

Get Patterns in the Machine: A Software Engineering Guide to Embedded Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.