Close

TDD

How Long Should Unit Tests Take to Run?

This post was written for the NCrunch blog. You can find the original here. When you first start writing unit tests, all is well and the few tests run in a matter of seconds. After having written hundreds or thousands of tests, running them might take…long. Too long. But when is long too long? How […]

Read More

The Importance Of Tests For Newcomers

I’ve sung the praise of TDD/automated testing many times before, but recently encountered an angle I hadn’t considered yet: the importance of automated tests for onboarding. Automated tests have several benefits: if you’re practicing TDD, it generally drives your design in a good directionit provides a safety net for refactoringit can catch bugsit speeds up […]

Read More

Why your test should fail first

I always try to convince other developers that writing your test first is not just about doing TDD the “correct” way (if there even is such a thing). That sounds a little fundamentalist. Rather, it’s about making sure your test is failing and failing for the right reason. Actually, this is only one reason, as […]

Read More

Reusing code in tests

When writing tests, you can often end up with tests that have (almost) the same setup. Certain input variables may change, but the structure of the setup code remains the same. When the setup is small, you can copy from one test to another. But when there is more ceremony involved, you will start to […]

Read More