My personal copy-paste summary of a similar topic on HN some time ago (<a href="https://news.ycombinator.com/item?id=9784008" rel="nofollow">https://news.ycombinator.com/item?id=9784008</a>):<p># Getting familiar with a new codebase<p>### Use the right tools<p>- grep, ack, ag, global search (Visual Assist)<p>- doxygen, javadocs<p>- sourcegraph, pfff (facebook), open-grok, SourceInsight<p>- Proper IDE, REPL<p>- chronon (dvr for java)<p>- SWAG (Software Architecture Group)<p>- Static code analysis<p>### Use the repository<p>- Find most relevant (frequently, recently edited) files<p>- Find dependancy graphs<p>- Get basic information like which languages are used for what<p>- Use good source control so that you don't have to worry about breaking things<p>- Look at commits, in general or for specific issues<p>- Browse the directory structure, packages, modules, namespaces etc.<p>- Use "blame" to see when things changed<p>### Ask questions<p>- Talk to the customer, find out the purpose of the application<p>- Pair up with another developer who is more familiar with the code<p>### Read the documentation<p>- Look at use cases, diagrams describing architecture, call graphs, user docs<p>- Understand the problem domain<p>- Add more documentation as your knowledge grows<p>- Comments and docs might be wrong!<p>### Browse the code<p>- Skim around to get a general idea and a feeling for where things are<p>- Look at public interfaces, header files first<p>- Find out which libraries are used<p>- Take some important public API or function in the UI and follow the code from there. Find implementations of functions, dive into related functions and data structures until you understand how the it's done. Then work your way back out.<p>- Use tools to quickly find declarations, definitions, references and calls of variables/functions/etc., usage patterns<p>- Find the entry point of the program<p>- Figure out the state machine of the program<p>- Focus on your particular issue<p>- Use a large, vertical screen with small font size with a pane to show file/class structure<p>### Take notes<p>- Use pencil and paper to write down summaries, relationships between classes, record definitions, core functions and methods<p>- Write a glossary: Function names, Datatypes, prefixes, filenames<p>- Document everything you understand and don't understand<p>- Use drawings to create a mental model<p>### Look at the data<p>- Find out how the data is stored in the database<p>### Build the project<p>- First make sure you can build it and run it<p>### Use the debugger, profiler and logging<p>- Set breakpoints, poke around the code, change variables, inspect local variables, stack traces, ...<p>- Watch the initialization process<p>- Start from main() and see where it goes<p>- Find hotspots with the profiler<p>- Set logging level to max/add logging and use the output to go through the code<p>### Edit the code<p>- Adopt the existing coding style<p>- Try to recreate and fix small bugs, make sure you understand the implications of the fix to the rest of the program first<p>- Tidy up the code according to the common standard after talking with the team<p>- Make the code clearer (best with tests)<p>- Add TODO comments<p>- Add comments describing what you think the code does<p>- Hack some feature into the code, then try to not break other stuff, build up a mental model over time, re-write the feature properly<p>### Use Tests<p>- Run the tests, make sure they are all passing<p>- Create new tests<p>- Browse the tests as an examples reference