145
votes

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. See the help center for guidance on writing a good question.

Read more about locked posts here.

31 Answers 31

0
votes

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.