Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What tools and techniques do you use for exploring and learning an unknown code base?

I am thinking of tools like grep, ctags, unit-tests, functional test, class-diagram generators, call graphs, code metrics like sloccount, and so on. I'd be interested in your experiences, the helpers you used or wrote yourself and the size of the code base with which you worked.

I realize that becoming acquainted with a code base is a process that happens over time, and familiarity can mean anything from "I'm able to summarize the code" to "I can refactor and shrink it to 30% of the size". But how to even begin?


locked by Thomas Owens Nov 11 '14 at 13:30

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

I would like to see how this gets answered as well; usually I end up just rewriting everything if code is too complex (or poorly written), and that's probably unacceptable/unwise for large projects. – Jeffrey Sweeney Mar 28 '12 at 18:16

31 Answers 31

My way to study large code project is as the following:

  1. make the project,and use it.
  2. use IDE to open the project.For example:Eclipse or Codelite.Then use IDE to index all source code of the project.
  3. Use IDE to generate class diagram if the language of the project support this function.
  4. Find the main method.Main method is an entry of program.And main method is also a good entry to explore the project.
  5. Find the core data-structs and functions of the program.Take a look at the implementation.
  6. Modify some code of the project.Make it and use it.Watch whether it correctly works! You will be encouraged by modify the program.
  7. After you have understood the main flow of the program and the implementation of the core system,you can explore the other modules of the program.

    Now you have understood the large code project!Please enjoy it!


protected by World Engineer Feb 15 '14 at 19:09

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.