Reputation: 3500
I have a general question about TDD.
As we all know, Test Driven Development requires a lot of testing. In best practice, you should test your code after everytime, you have coded something new, that you can test. Therefor it is very reasonable, to keep your tests as fast as possible. The question is now: How slow is the slowest possible. Do we start in the minutes area? Seconds? What is best? As Example, I have a test, which has a 3x3 Testmatrix. Executing this test takes a few seconds. Assuming, this will sum up, it could by one day take a few minutes, to test a package. This would mean, that a programmer would waste up to an hour each day, waiting.
So the Question is: What is the maximum time, a test may take?
Upvotes: 2
Views: 618
Reputation: 31464
There is no minimum or maximum time. Tests should be subjectively fast (the fast will vary from team to team and project to project).
Assuming, this will sum up, it could by one day take a few minutes, to test a package. This would mean, that a programmer would waste up to an hour each day, waiting.
Your entire test suite will eventually grow to few minutes. It is inevitable.
But, you mistakenly assume that you run entire suite with every save. You don't. You only run tests related to the feature you are developing, which in practice is usually tests for class/method you are currently writing.
You still of course run entire suite, but that would be few times a day at best, usually before merging changes or pushing to repository.
Upvotes: 3