166
tahnik
7y

"Tests are only for developers that can't write good codes"

-My senior, 2016

Comments
  • 2
  • 2
    Totally agreed..
  • 6
    i guess... he's just an asshole
  • 11
    Logically he is correct though.

    1. bad code = bugs
    2. good code = !(bad code) = no bugs
    3. no bugs = no need to test as no bugs to find

    Of course, in practice, you cant prove any substantial code is good without testing it, so he's talking rubbish.
  • 4
    @spl0 I think you're missing the part about the code always working. Tests stop other people adding breaking changes!
  • 2
    @linux-colonel Yeah but if someone turns good code into bad code, by definition they are not good.
  • 3
    @spl0 but the good developer must write the tests to stop said bad developer
  • 2
  • 2
    Tests are not just to catch or prevent bugs!!
  • 2
    Ironic, as bad code is usually more difficult to write (unit) tests for than 'good' code..

    I wonder, does your senior consider their own code 'bad', thus requiring tests (which is actually a good point to start teaching from, since you can't prove the nonexistence of bugs)? Or do they really believe tests are unnecessary?
  • 0
  • 1
    I agree with you
  • 1
    Should write that as "senior" because this guy clearly is not.
  • 0
    @arminiae Their code doesn't have any tests. Most of the code he has written and maintaining right now are 10-15 old codes which doesn't have any unit tests
  • 1
    You write a core function that has particular requirements and edge cases then go on vacation.

    When you come back after 2wks, you need to make a possible breaking change, how do you make sure your new change doesn't break anything?... Without wanting to strangle urself?
  • 0
    @allanx2000 I wish I could make him understand that
  • 0
    @tahnik yea... It's a big problem. Most my team write tests just to check the box... They don't understand how taking 5mins to write a good test will save you from like 2hrs of debugging later on...

    Or they hope to find a new job before they have to debug their code and leave the mess to the next dev... Which unfortunately is usually me...
  • 1
    Then call it "legacy" code. Any code even relatively new that has no unit test should still be called legacy code, since you're not certain if it's written using TDD or BDD.
  • 0
    Give that developer a slap for his brilliance.
Add Comment