DEV Community

Discussion on: How it's like to refactor code, written by other developer?

Collapse
 
derekjhopper profile image
Derek Hopper

Uncle Bob had a recent Twitter thread about this too: twitter.com/unclebobmartin/status/...

If you have no idea how the code works, poking and prodding seems like the best place to start. Once you start to reason about the flow and understand things enough, start adding tests. Basically, do whatever it takes to get the code under test.

You definitely want to be cautious and defensive in this process.

If you have time to read or study, the book Working Effectively with Legacy Code might give you some ideas on how to be defensive.

Collapse
 
ben profile image
Ben Halpern

Yeah, this is definitely territory where UncleBobeology shines.

Collapse
 
bosepchuk profile image
Blaine Osepchuk

+1 for Working Effectively with Legacy Code - excellent book!