Re:Why Most Unit Testing Is Waste [pdf]
by fvdessen on Tuesday October 31, 2017 @06:49AM
(#15592206)
In my experience the usefulness of Unit Tests is very dependent on the quality of the team and its grasp on the business requirements. Some programmers can write high quality code that doesn't need unit/integration testing at all, some can't.
[ Parent
| on HN ]
Re:Why Most Unit Testing Is Waste [pdf]
by hacker_9 on Tuesday October 31, 2017 @07:08AM
(#15592309)
Legacy code = code without tests. You might write HQ code today, but without tests it'll become technical debt within a month or even a week down the line. Programmers come and go, unit tests are omnipresent.
Re:Why Most Unit Testing Is Waste [pdf]
by fvdessen on Tuesday October 31, 2017 @07:24AM
(#15592383)
Tests can become technical debt themselves, there's nothing special about test code that makes it immune to all the programming pitfalls.
Re:Why Most Unit Testing Is Waste [pdf]
by saas_co_de on Tuesday October 31, 2017 @09:36AM
(#15593097)
oh no! that consultant who I paid $100K to tell me that unit testing would solve all my problems didn't tell me that. maybe its because they have never written a line of code in their life let alone delivered a successful large scale software project, but who knows.
Re:Why Most Unit Testing Is Waste [pdf]
by bearjaws on Tuesday October 31, 2017 @07:13AM
(#15592336)
All code is legacy code as soon as you type the semi-colon. It is wishful thinking that a suite of unit tests will prevent a refactor or small change from producing technical debt.
In a sense you are right. That state where you have the complete program as a mental model goes away when you stop for that session. But if you pick it up the morning after that mental model could be reconstructed in < 1hr and you can finish the feature and deliver it as value to a user. If you created good tests (unit/integration/regression) that captures the gist of what the code should do, two-year-older-you or another developer have a good chance of getting a similar mental model in order to change the code with confidence. So i consider "legacy code" as a scale where you on one end go "The reqs have changed, better rewrite it all!" to "The reqs has changed, but I can confidently add this functionality and keep some of the unchanged behavior!"