Thursday, July 31, 2008

Understanding legacy code.

Most of the time in a software job is about understanding legacy code (any code which survived a few months is legacy :) ). Since this comes up everytime you move to a new team, I sat down to take notes. Surprising how often I forget to do few of the things that worked in the past. Hope you find these useful as well:
  1. Talk to the someone who already knows the codebase and walk through the main components on the board
  2. Play with the final product to get an idea of its features (becomes easy to correlate when you go through the code)
  3. Figure out how logging works in that product. Enable verbose logging (if available :)) and keep watching the tail of log as you play with the product
  4. Attach a debugger and step through the code while you use the product
  5. Run the unit tests under a debugger
  6. Go through the tests for a feature
  7. Go through the bug database by feature. This quickly gives a sense of what you are going to run into :) and a lot more.
  8. <>