DEV Community

saif ali
saif ali

Posted on

Pain points In Legacy code refactoring?

People who worked or working on Legacy code base, mention what are the pain points you have faced while refactoring the code?

Top comments (7)

Collapse
 
szymach profile image
Piotr Szymaszek

1) No tests whatsoever,
2) things added without looking at the broader scope of things,
3) dead code,
4) methods or classes that do multiple things,
5) library or framework features used incorrectly.

Collapse
 
lexlohr profile image
Alex Lohr

1) Lack of readability, inconsistent code
2) Missing tests
3) Unit tests that are not testing the unit or worse, anything
4) Dependency on legacy libraries that are no longer maintained and become a liability
5) Model spread over the whole code base
6) No documentation whatsoever

Collapse
 
laurieontech profile image
Laurie

Hard to follow abstraction. There is lots of legacy code where it's not clear what else will be affected if you make a change. This is especially problematic when code lacks documentation and sufficient test cases.

Collapse
 
shaunchong profile image
shaunchong • Edited

Functions that are hundreds of lines long.

No coding style or standards followed.

Lack of documentation and not knowing what the dependencies are for the system, not knowing what other service or function might break due to your changes.

But most importantly, the lack of automated testing. It becomes increasingly harder to ship your refactored code when you don't have the confidence that it will not break something else.

Collapse
 
quii profile image
Chris James

Not a lot to add to existing replies, especially re tests but the main problem I find is no one actually knows how it works and most importantly what features are actually used anymore. It feels very frustrating to work with code you dont even know is useful.

Collapse
 
saifali40 profile image
saif ali

Oh boy! And it's very scared to touch those codes.

Collapse
 
saifali40 profile image
saif ali

1) So big Classes, methods
2) tightly coupled methods.
3) no proper indentations.