C Language Tutorial:

C Language Testing frameworks


Many developers use unit tests to check that their software works as expected. Unit tests check small units of larger pieces of software, and ensure that the outputs match expectations. Testing frameworks make unit testing easier by providing set-up/tear-down services and coordinating the tests.

There are many unit testing frameworks available for C. For example, Unity is a pure C framework. People quite often use C++ testing frameworks to test C code; there are many C++ test frameworks too.


Test Harness:

TDD - Test Driven Development:

Test double mechanisms in C:

  1. Link-time substitution
  2. Function pointer substitution
  3. Preprocessor substitution
  4. Combined link-time and function pointer substitution

Note on C++ testing frameworks used in C: Using C++ frameworks for testing a C program is quite a common practice as explained here.

C Language Testing frameworks Examples:

Related C Language Tutorial Topics:

Other Tutorial Topics:

This modified content is an extract of the original Stack Overflow Documentation released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow. This topic was created and modified by the Stack Ovedrflow Contributor.