By failing to prepare you’re preparing to fail
The repetition problem Some time ago I had a chance to witness the truth of this universally applicable sentence on a set of integration tests. Our integration tests were taking definitely longer than we expected them to and it was hard to pin to down the exact few cases, which were driving the performance of the whole test set down. After looking at the tests, I noticed some suspicious lines of code in the test setup (we were using SpecFlow): If you’re familiar with SpecFlow, maybe you've already noticed the issue. There’s a common rule taught to all young programmers: if your program is going to use a calculated value multiple times, be sure to calculate it just once. If we translate the previous example from SpecFlow to nUnit Framework, it would look similar to that: This code does the all the initialization before every test being run, multiplying the work by the number of tests. However, being hidden behind a neat attribute, it’s easy to be overseen. Know yo...