Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to approach huge code base of undocumented code? [closed]

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?

like image 634
picknick Avatar asked May 11 '10 16:05

picknick


3 Answers

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.

like image 56
CaffGeek Avatar answered Sep 20 '22 20:09

CaffGeek


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.

like image 24
Neil N Avatar answered Sep 21 '22 20:09

Neil N


Here's a list of code comprehension tools.

like image 26
Doug Currie Avatar answered Sep 22 '22 20:09

Doug Currie