Delete or comment out non-working JUnit tests?

Posted by Chris Knight on Stack Overflow See other posts from Stack Overflow or by Chris Knight
Published on 2010-03-23T16:05:09Z Indexed on 2010/03/23 16:13 UTC
Read the original article Hit count: 326

I'm currently building a CI build script for a legacy application. There are sporadic JUnit tests available and I will be integrating a JUnit execution of all tests into the CI build. However, I'm wondering what to do with the 100'ish failures I'm encountering in the non-maintained JUnit tests. Do I:

1) Comment them out as they appear to have reasonable, if unmaintained, business logic in them in the hopes that someone eventually uncomments them and fixes them

2) Delete them as its unlikely that anyone will fix them and the commented out code will only be ignored or be clutter for evermore

3) Track down those who have left this mess in my hands and whack them over the heads with the printouts of the code (which due to long-method smell will be sufficently suited to the task) while preaching the benefits of a well maintained and unit tested code base

© Stack Overflow or respective owner

Related posts about java

Related posts about junit