Re: How to decipher a large program.
- From: Diomidis Spinellis <dds@xxxxxxx>
- Date: Tue, 27 Jun 2006 14:11:24 +0300
Chad wrote:
I recently downloaded a program that inserts captions in .jpeg files.
However, I'm sort of at a loss on where to start to see how it
works.The program has 3 c files and 4 header files. In the header
files, the
person comments on what function is supposed to do.
The question is, how do I figure out how each of these functions
interact with each other? Do I just get
a pen/paper and start jotting down notes? I was maybe thinking of
constructing some kind of flow
diagram to see how these functions interact. Any ideas?
Use tools: load the program in an IDE or an editor supporting tags, run grep to locate comments relevant to what you're looking for, trace the library or system calls the program makes, or use a profiler to create dynamic flow graphs. http://www.spinellis.gr/ismr/tools/index.htm
In most cases you're not interested in how the complete program works, so try to focus early on by searching the code for files, comments, strings, or identifiers that match the functionality that interests you.
Incidentally, the program you describe is small not large. Developers routinely maintain and fix multi-million large systems.
--
Diomidis Spinellis
Code Quality: The Open Source Perspective (Addison-Wesley 2006)
http://www.spinellis.gr/codequality
.
- References:
- How to decipher a large program.
- From: Chad
- How to decipher a large program.
- Prev by Date: Re: Groundless Schildt-Bashing (was "Re: coderwiki.com is starting and needs you!")
- Next by Date: socket programming
- Previous by thread: Re: How to decipher a large program.
- Next by thread: gdb and threads.
- Index(es):
Relevant Pages
|
|