Re:Ask HN: What is the first thing you implement at a new co...
by organsnyder on Wednesday June 20, 2018 @09:08AM
(#17354978)
In my experience, it's extremely difficult to know which particular lines of code are obsolete. This becomes even more difficult as a codebase ages and is worked on by more contributors. Add on another exponent for every business stakeholder that has a hand in defining the business rules—especially if you have requirements coming from multiple sources that may not be aware of each other.
[ Parent
| on HN ]
Re:Ask HN: What is the first thing you implement at a new co...
by eastbayjake on Wednesday June 20, 2018 @09:28AM
(#17355125)
This is why we have the strangler pattern, right? You wrap the legacy functionality with a set of tests that define the functional requirements of the code, then your new refactored solution needs to keep those tests passing. (And then once you've done that, make sure that your "hacks and bugfixes" get test cases so you can make sure the next refactor accounts for them!)
Re:Ask HN: What is the first thing you implement at a new co...
by vorpalhex on Wednesday June 20, 2018 @09:29AM
(#17355126)
Which is why comprehensive testing is important. If we have test cases that accurately capture our requirements, then we can refactor and know when we've err'd from the path. If we don't have test cases, then we have to make best guesses (and we know how that one turns out).
Re:Ask HN: What is the first thing you implement at a new co...
by finaliteration on Wednesday June 20, 2018 @10:12AM
(#17355517)
Accuracy is key, here. I came into my current job with some pretty awful tests in place that “passed” and showed good coverage but did absolutely nothing for actually hitting the necessary cases...