31

My co-worker not only doesn't create unit tests, he comment out my own unit tests after he changes the code and the test breaks.

Comments
  • 5
    Stab him in the back, literally or not.
  • 5
    You might wanna let your boss know...
  • 6
    Not if he stabs him...
  • 1
    Getting angry just thinking about this.

    Are code quality metrics/tools part of your build process? I feel like the only way to train some people is to enforce that each version/release should have same or better code quality and test coverage...
  • 3
    Coworker deleting my code, thinking I broke the application. Later finds out it was broken by someone else's commit. Yeah, it happened. I was beyond pissed. :/
  • 1
    Print out the diff of the logic change and diff of commented unit test.

    Hang them on the fridge side by side.

    Deny knowing anything about them if he's even dumb enough to point out its his code and you made fun.
  • 1
    @deMark doesn't really work sadly if people don't learn to enjoy improving quality. I have seen lots of people go to extreme lengths to cheat the quality metric tools to stop flagging their changes.
  • 0
    @Henrik I was thinking about this the other day that people could write fake unit tests to cheat the metrics but that's almost as much effort as writing real ones...
  • 0
    @deMark sadly very easy to fake. If you are making a web api for example just write a test that calls one of the api methods then mock nothing in the test except the database, and no asserts in the test at all. And voila, free coverage without actually covering anything.
    I have seen so many of those over my years, and very little to no interest from the people that made them to fix them.
  • 1
    Hey bossman, do you know why Frank is commenting out my unit test?
  • 0
    It's no effort at all to fake.

    Assert.IsTrue(true)

    This is why code reviews are important.
Add Comment