Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
3  
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
1  

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!

share|improve this answer

protected by World Engineer Feb 15 at 19:09

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

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.