In order to understand someone else's code, you need to do RE (reverse engineering) ,i.e. disassemble or analyze in detail in order to discover concepts involved in manufacture.
Wikipedia:
"Reverse engineering is the process of discovering the technological principles of a device, object, or system through analysis of its structure, function, and operation. It often involves taking something (a mechanical device, electronic component, computer program, or biological, chemical, or organic matter) apart and analyzing its workings in detail to be used in maintenance, or to try to make a new device or program that does the same thing without using or simply duplicating (without understanding) the original.
Reverse engineering has its origins in the analysis of hardware for commercial or military advantage.The purpose is to deduce design decisions from end products with little or no additional knowledge about the procedures involved in the original production. The same techniques are subsequently being researched for application to legacy software systems, not for industrial or defence ends, but rather to replace incorrect, incomplete, or otherwise unavailable documentation"
In brief:
Through reverse engineering, a researcher can gather the technical data necessary for the documentation of the operation of a technology or component of a system. When reverse engineering software, researchers are able to examine the strength of systems and identify their weaknesses in terms of performance, security, and interoperability. The reverse engineering process allows researchers to understand both how a program works and also what aspects of the program contribute to its not working. The creation of better designs and the interoperability of existing products often begin with reverse engineering. It is desirable to do some of UML diagrams.
For example : a class diagram, sequence diagram and etc.
About UML, please see here:
http://en.wikipedia.org/wiki/Unified_Modeling_Language
Reverse engineering consists of the following steps:
* Observe and assess the mechanisms that make the device work.
* Dissect and study the inner workings of a mechanical device.
* Compare the actual device to your observations and suggest improvement.