Ok, to be honest, they are not all unit tests, some are integration tests.
But hey, you can’t have it all, after all, you’ve almost got a 1000 tests in place, great!
The only downside: when time went by, only two thirds of the test nowadays pass, the rest doesn’t.
The consequence is that nobody runs the tests, and on the build server they don’t run either.
Developers are discouraged to create new tests because they will never be run again.
What to do now?
Basically there are three options:
- fix the failing tests;
- ignore the failing tests;
- delete the failing tests;
The first option is not a real option: who can and wants to fix 300 failing tests?
The second option is tempting: all the code is kept so the remaining unit tests still run and no code is thrown away. And maybe, later, when we have spare time, they all get fixed.
As tempting as the second option is, I choose for the third option: delete all the failing tests. I think all the ignored tests just creates noise in your code, and the spare time to fix them… that will be the day!
And the longer you work on your production code, the more out of sync the testcode will be. So you maybe have to comment out some code in your ignored tests (yikes) in the future to prevent from compile errors.
Yes I understand, removing so much code from your project feels like throwing away money, but I think it will save you money in the future, and you can start right now with a clean base of unit tests.