Check: A unit testing framework for C

Check is a unit testing framework for C. It features a simple interface for defining unit tests, putting little in the way of the developer. Tests are run in a separate address space, so Check can catch both assertion failures and code errors that cause segmentation faults or other signals. The output from unit tests can be used within source code editors and IDEs..

Check was inspired by similar frameworks that currently exist for most programming languages; the most famous example being JUnit for Java (www.junit.org). There is a list of unit testing frameworks for multiple languages at www.xprogramming.com/software/. Unit testing has a long history as part of formal quality assurance methodologies, but has recently been associated with the lightweight methodology called Extreme Programming. In that methodology, the characteristic practice involves interspersing unit test writing with coding ("test a little, code a little"). While the incremental unit test/code approach is indispensable to Extreme Programming, it is also applicable, and perhaps indispensable, outside of that methodology.

The incremental test/code approach provides three main benefits to the developer:

  1. Because the unit tests use the interface to the unit being tested, they allow the developer to think about how the interface should be designed for usage early in the coding process.
  2. They help the developer think early about aberrant cases, and code accordingly.
  3. By providing a documented level of correctness, they allow the developer to refactor (see www.refactoring.com) aggressively.

That third reason is the one that turns people into unit testing addicts. There is nothing so satisfying as doing a wholesale replacement of an implementation, and having the unit tests reassure you at each step of that change that all is well. It is like the difference between exploring the wilderness with and without a good map and compass: without the proper gear, you are more likely to proceed cautiously and stick to the marked trails; with it, you can take the most direct path to where you want to go.

Information about Check

The Check project page is at http://sourceforge.net/projects/check/

The Check manual contains a good tutorial introduction.

This project has reached a point where it is fairly stable, and it does the job well for people that use it. Therefore it is not that actively maintained and long times may pass between checkins. It does not mean that Check is some abandoned piece of unworking junk laying around on SourceForge. We still aim for at least one release per year. There are packages in Fedora and Debian, and probably several other distributions.

News

Project NEWS, a summarized changelog.

Getting Check

Check can be dowloaded from here.

Contributing

The authors welcome any and all help with Check, whether through enhancement requests, bug reports, patches, or documentation.  Mailing lists are preferred to forums as they're easier to monitor.  Please visit the Check project page at http://sourceforge.net/projects/check/.

Patches to Check, unless trivial, should be against the latest SVN trunk, and should include a full set of unit tests testing the new behavior. No functionality goes into Check without unit tests, and submitting a patch without automated testing guarantees that it will go into the request queue, not the "to be applied soon" pool.

Projects Using Check

We know of the following projects using Check:

BitlBee: http://www.bitlbee.org/
checkmk: http://micah.cowan.name/projects/checkmk/
ctrlproxy: http://ctrlproxy.vernstok.nl/
Daimonin: http://sourceforge.net/projects/daimonin/
DBMail: http://www.dbmail.org/
Enlightenment (Eet and Eina libs): http://trac.enlightenment.org/e
EXIP: http://exip.sourceforge.net/
Expat: http://expat.sourceforge.net/
GNOME BuildBrigade: http://live.gnome.org/BuildBrigade/
GStreamer: http://gstreamer.freedesktop.org/
GNUpdf: http://www.gnupdf.org/
Iodine: http://code.kryo.se/iodine/
Lasso: http://lasso.entrouvert.org/
libspmt: https://svn.sable.mcgill.ca/sable/spmt/libspmt/
Loudmouth: http://developer.imendio.com/projects/loudmouth/
OpenSync (libopensync and libsyncml): http://www.opensync.org/
Pigment: https://code.fluendo.com/pigment/trac/wiki
RAPP: http://savannah.nongnu.org/projects/rapp
RedStore: http://code.google.com/p/redstore/
SCEW: http://www.nongnu.org/scew/
SSSD: https://fedorahosted.org/sssd/
Tinymail: http://tinymail.org/
XCB: http://xcb.freedesktop.org/

If you're using Check for an open source project and you're not listed here, please subscribe to check-users AT lists.sourceforge.net, send us an email, and we'll list you promptly.  Particularly if the first letter of your project is contained in the second half of the alphabet! Please note that although it's easy for us to add your project to our repository, the actual changes might not make it to the website until we release the next version.

Todo

Current bugs and feature requests.

SVN access

See the project's Subversion page for instructions.  You do want to append '/trunk' to that URL so that you don't end up checking out all tags and branches as well.  The CVS repository is now obsolete.
--
$Date: 2013-02-11 22:15:49 +0100 (Mon, 11 Feb 2013) $

SourceForge Logo