I have recently been assigned a project to further develop an existing code base. The code doesn't contain any tests and not even one single line of comments. The whole "thing" is written in a really obfuscating manner so it takes a lot of time to figure out what happens.
How do you usually approach this kind of problem? Tips and trix on how to handle this situation?
One chunk at a time.
When you have to make modifications, write tests around what you are modifying. Then make your change safely. Over time, you end up with cleaner code, that's got tests.
Does it have source control? Look through the history of changes.
If not, PUT IT IN SOURCE CONTROL. You WILL, inevitably, make breaking changes. Lack of documentation of expected behavior guarantees this. If you are diligent in checking in your changes as you go, you will be able to roll back and redo.
Create documentation as you go. As you learn what the code does/is expected to do, document it.
Here's a list of code comprehension tools.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With