How do you familiarize yourself with a codebase?
Here is how I do it:
- Find a some small scope that is relevant to my work. A recent example is SSO workflow in an open source project we use at work. I make sure to always pick a "leaf" for this task and not a trunk like index.php with a vary deep and wide dependency tree.
- Figure out the intended behavior and write a unit test for it (very rare for me to see code that is well covered). Sometimes I have to refactor the code to make it actually testable.
- When tests pass, I feel comfortable making changes. I begin with removing redundancy - removing unused imports. Consolidating a wall of if statements to a match/switch.
- Make a PR. Carefully go through any code review/feedback I get from the maintainers.
- Rinse and repeat until I get a good grasp on the project.
Thoughts? I haven't worked in big teams before so I don't know if my approach is common or not. I personally don't know how to understand something without actively interacting with it.