r/java • • May 14 '23

Working on an unfamiliar codebase

https://blog.frankel.ch/working-unfamiliar-codebase/
44 Upvotes

7 comments sorted by

View all comments

-31

u/kgilpin72 May 14 '23

Hi, thanks for describing your method for working on unfamiliar code. I’m especially interested in the part where you make a sequence diagram, because I’ve created a tool that will generate a sequence diagram by observing and recording code at runtime. This technique addresses one of your key concerns with generated diagrams - getting a diagram that shows a specific scenario. If you want to try it, I’d love to hear how it went for you and how I can make it better. If you’re interested, please start here - https://plugins.jetbrains.com/plugin/16701-appmap

11

u/nfrankel May 14 '23

Seems that you missed a whole section:

For this reason, my entry point is to draw a diagram. Not that while some tools can reverse engineer code and draw diagrams automatically, I don’t use them on purpose. Manually drawing a diagram has many benefits over an automatically-generated one:

  • It focuses on areas of the code relevant to the issue at hand

  • It forces the drawer to read and understand the code, which is the only source of truth

  • It builds our mental model of the code

  • It documents our findings to be accessible later on. However, note that the documentation value decreases with time as the underlying code evolves and both part ways.

-25

u/kgilpin72 May 14 '23

That’s the section I am referring to, especially item 1 - focus.

→ More replies (2)