DEV Community


Discussion on: When do you write your tests?

eljayadobe profile image

My previous project, I was getting into the TDD swing of things. Doing it "by the book": writing the failing test first, then implementing, then passing the test, refactoring, still passing, check-in. Genuine honest-to-goodness unit tests (about 70% code coverage, and the entire unit test suite took under a second to run; the integration test suite took about 650 hours to run).

I'd like to say "it was heavenly"... and it was... but only because of the tools involved. It was a C# project, using Visual Studio, NUnit, and NCrunch. If not for NCrunch, I fear it would have been miserable. But NCrunch is so amazing, it made writing unit tests and doing TDD a joy.

(Disclaimer: I do not work for the NCrunch company, nor am I affiliated with them in any way.)

My current project is a C++ project. Build times are on the order of 10 minutes for changing a single C++ source file, and about an hour for a full build. I don't think TDD would work for this kind of environment. And there's no NCrunch equivalent for C++.