---
title: "CxxTest for C++ - easier unit testing?"
url: "https://osherove.com/blog/2005/2/21/cxxtest-for-c-easier-unit-testing.md"
canonical: "https://osherove.com/blog/2005/2/21/cxxtest-for-c-easier-unit-testing.html"
published: "2005-02-21T23:20:00"
updated: "2005-02-21T23:20:00"
tags: ["Agile Related"]
author: "Roy Osherove"
description: "CxxTest for C++ seems like a nice way to write unit tests in C++. It uses Perl to generate Cpp files from regular classes and then you compile those into unit tests and run them. this intermediate step saves you lots of…"
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# CxxTest for C++ - easier unit testing?

By Roy Osherove February 21, 2005 In [Agile Related](https://osherove.com/blog/category/agile-related)

**Historical article** · Originally published February 21, 2005; technical details may be outdated.

[CxxTest for C++](http://cxxtest.sourceforge.net/) seems like a nice way to write unit tests in C++. It uses Perl to generate Cpp files from regular classes and then you compile those into unit tests and run them. this intermediate step saves you lots of trouble in declaring your tests in C++ code "that hard way" and simply lets you write code that works.

I was alerted to this by someone who attended [one of my courses](http://www.teamagile.com/) the other day. Very interesting.

Some of the features:

- Doesn't require RTTI
- Doesn't require member template functions
- Doesn't require exception handling
- Doesn't require any external libraries (including memory management, file/console I/O, graphics libraries)
- Is distributed entirely as a set of header files

This makes it extremely portable and usable.

## More in Agile Related

[All posts in Agile Related](https://osherove.com/blog/category/agile-related)

- Feb 26, 2005

    ### [Test Driven Development proves useful at Microsoft](https://osherove.com/blog/2005/2/26/test-driven-development-proves-useful-at-microsoft.html)

- Feb 21, 2005

    ### [TDD and test generation in VS 2005 can be annoying and tricky if you don't watch out](https://osherove.com/blog/2005/2/21/tdd-and-test-generation-in-vs-2005-can-be-annoying-and-trick.html)

- Feb 21, 2005

    ### [Agile Israel news and updates](https://osherove.com/blog/2005/2/21/agile-israel-news-and-updates.html)

- Feb 21, 2005

    ### [Employing TDD and unit testing with Waterfall methodologies](https://osherove.com/blog/2005/2/21/employing-tdd-and-unit-testing-with-waterfall-methodologies.html)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
