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?

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!


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