Ivan Ermolaev
Ivan Ermolaev

Reputation: 1032

Common questions TDD with Mock

I don't know how use TDD in C++ projects, but I decided use "Google Mock Framework" for a start.

But I have one question:
When I finish testing, do I have to clean up my code from TDD's macros, class and etc?
In other words, should the release version of my project include Google Mock?

P.S. What do you advise for learning TDD on practice? (Articles, Books and etc.)

Upvotes: 0

Views: 84

Answers (2)

Damon
Damon

Reputation: 3012

In my opinion, there's no need to remove the testing code from the release version of the project. Test code should be developed in such a way that it is part of the final product i.e. it follows the same standards, is maintainable and follows good unit testing practises (see The Art of Unit Testing).

As part of TDD you should also be performing continuous integration builds that run after code is delivered. This build process should run through all (active) unit tests to make sure that nothing has been inadvertently broken (We use Anthill Pro). If you remove your test code prior to building, this process won't be possible.

There's a good article here by James Shore that might be worth read.

Upvotes: 0

Tony Han
Tony Han

Reputation: 2220

You can try this book: TDD By Example. It uses java, but I think it will help :)

Upvotes: 1

Related Questions