News for hackers. Stuff that matters.
Re:I still love PHP and JavaScript by SicSemperUranus on Tuesday August 02, 2022 @08:45PM (#32326296)
> never found a legacy JS codebase that has a robust test suite, so any refactoring I do can be hard to test and verify.

Wouldn't you just... make a test suite?

Re:I still love PHP and JavaScript by phailhaus on Tuesday August 02, 2022 @08:56PM (#32326373)
If there is no pre-existing test suite, it is extremely difficult to know what is the right expected behavior that should be tested, and what is incidental to the implementation.
Re:I still love PHP and JavaScript by resonious on Wednesday August 03, 2022 @03:51AM (#32328812)
Hopefully there is a product team or actual internal users you can interface with to know the expected behavior. I'd expect to at least be able to write some integration-style tests that can ensure everything works from the user's perspective.

If you're so disconnected that you don't know the user's perspective or have no way to see the program in action, then ..best of luck!

Re:I still love PHP and JavaScript by madeofpalk on Wednesday August 03, 2022 @06:06AM (#32329732)
Defining big obvious functionality is usually easy to get from people. It's all the finer details that people might not know. You might have a feature that's been relatively untouched for a while, but people still use, so the devs have either left or forgotten from their past "drive-by development".
Re:I still love PHP and JavaScript by theonething on Tuesday August 02, 2022 @11:12PM (#32327218)
> just

Legacy code bases are more often that not huge monstrosities. Maybe you do start with some tests and increment, but there's no "just" involved.

Re:I still love PHP and JavaScript by jamesfinlayson on Wednesday August 03, 2022 @12:27AM (#32327661)
Where possible anyway.

I tried adding tests to a legacy AngularJS application (it was in the process of being phased out but was still business critical). I sunk days into trying to get a test to run, let alone pass, before giving up and deciding that eventual replacement was going to be quicker than finding good AngularJS documentation.

Re:I still love PHP and JavaScript by wiseowise on Wednesday August 03, 2022 @01:54AM (#32328118)
> just

Not sure if sarcasm or serious.