Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
spl020438yLogically 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. -
@spl0 I think you're missing the part about the code always working. Tests stop other people adding breaking changes!
-
spl020438y@linux-colonel Yeah but if someone turns good code into bad code, by definition they are not good.
-
arminiae5668yIronic, 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? -
tahnik389898y@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
-
donuts238488yYou 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? -
donuts238488y@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... -
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.
Related Rants
"Tests are only for developers that can't write good codes"
-My senior, 2016
undefined
test
senior