Dev: "Ah, I finally fixed that code I was working on the other day and got it pushed to staging!"

Almond: "Ah, great! What was the issue in the end?"

Dev: "It was an odd one - it wasn't actually my code that was the issue, there was a bunch of other code getting in the way."

Almond: "How do you mean?"

Dev: "It kept complaining about something called a "unit test" failing - so after a while I found the right unit tests, deleted them, and now it works great!"

Almond: "..."

  • 26
    Sure sure, cuz ya know unit tests are waste of time and should always be removed ....
  • 3
  • 2
    Wait... What?
  • 3
    So what did you do next?
  • 8
    @echonox Remained calm and explained that wasn't a solution, then sat with him and worked out why the tests were failing. But that wasn't as dramatic, so I didn't include it ;)
  • 5
    @SauceBoss I'm equally amused and disgusted that a project like that exists...!
  • 1
  • 1
    CompilationError: Remove UnitTest in production environment.
  • 1
    Right.. there might be wrong code for unit test
  • 1
    I've seen it happen at a tech giant I worked at. Apparently a senior developer did this.
  • 0
    If you are doing refactoring or deeper changes in relationships between objects, without changing the logic, it's safe to mark the test as ignored. After all, it won't be the test that's failing but mocking dependencies. However this is a temporary solution and tests need to be working again before merging the code.
    For me, it happened multiple times that I temporarily commented the tests out - because they slowed me down. More relationships to track to even compile the project. Awesomeness of statically typed languages.
    But in the end, what's the guarantee that application works as it should, if not tests?
Add Comment