DEV Community

Shweta Kadam
Shweta Kadam

Posted on

How do you debug/trace /gain knowledge of new codebase for backend web services

Hi just a question as to people switching companies or a person coming across a new huge backend codebase having multiple services or multiple services even dependent on other services or projects.
Exactly how is you process of gaining codebase knowledge and exploring the code itself?
Some examples of java projects or higher level overview would be really insightful!
Thanks

Oldest comments (1)

Collapse
 
recursivefaults profile image
Ryan Latta

This is a pretty tough question. I'll share my approach, but I can't be too specific since every bit of tech has different things you can do and can't do.

I think its helpful to have a really broad overview of all the parts. This server does X, which talkes to Service Y and finally Z kind of an overview. Get a sense of what the major responsibility is for each major piece.

From there I more or less accept I cannot know everything, so start with the job in front of me. I'll learn as I take on new and more work.

If there are good automated tests, run them by making tweaks to see how the code responds. Admittedly the chances of having tests like this is low.

Attach a debugger and step through functions to see where things wind up. This might get really hard if, for example, its a java project making heavy use of annotations.

Last, don't try to do this alone. Pair with someone more experienced. In large projects there are tons of things that people know only because they lived through it. So you can't hope to learn those things on your own.

I view it as, what is the approach I should take where I can be productive and safe in an environment I can't hope to understand.