That depends on the code and on how "deep" you need to know it... I propose the following order:
- read the documentation (user manual, requirements, architecture, design)
- try to understand the related module-testcases
- read the comments inside the code
- read the code itself
- execute the code with debug-output, possibly alter the code and determine why which module-testcase fails
If the documentation is sparse, you might use re-engineering-tools like
doxygen,
or
this resource for regular expressions.
Good luck (especially if you don't have documentation nor comments ;-)
Rata