5 ms·
> 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
by SicSemperUranus 4y ago
> 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?
- phailhaus 4y agoIf 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.
- resonious 4y agoHopefully 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!
- madeofpalk 4y agoDefining 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".
- theonething 4y ago> 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.
- jamesfinlayson 4y agoWhere 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.
- wiseowise 4y ago> just Not sure if sarcasm or serious.