Reading Code & Exploring Unfamiliar Codebases
15 minutesIn this hands-on exercise, you'll explore the Spring PetClinic application, a real-world codebase that may be in a language you've never used before. This is intentional! We'll practice the fundamental skill of reading and understanding unfamiliar code, a critical ability for every software engineer.
Repository
https://github.com/spring-projects/spring-petclinicClone the repository:
git clone https://github.com/spring-projects/spring-petclinic Important: No AI Tools for This Exercise
Please do not use AI assistants (ChatGPT, GitHub Copilot, etc.) for this exercise. We want to develop the fundamental skill of reading code and exploring unfamiliar codebases first. Once you've built this foundation, you'll be able to use AI to amplify this skill effectively.
Initial Orientation
- •Identify the tech stack: Without running the app, what technologies/frameworks can you identify from project files (pom.xml, package structure)?
- •Find the entry point: Locate the main application class. What annotations do you see?
- •Map the architecture: Based on folder structure alone, what architectural pattern does this app follow?
Code Navigation
- •Follow a user journey: Pick one entity (like "Owner" or "Pet") and trace it through the codebase - find its model, repository, service, and controller
- •Understand the data model: Without looking at documentation, can you sketch the database schema based on the entity classes?
- •Find the database configuration: Where and how is the database configured?
Pattern Recognition
- •Identify design patterns: Find examples of patterns being used (Repository, MVC, dependency injection)
- •Spot the conventions: What naming conventions do you notice for classes, methods, and packages?
- •Mystery endpoint: Given a URL like /owners/{ownerId}/pets/new, trace what happens when someone submits the form
Reflection
- •What made this codebase easier or harder to understand?
- •What strategies did you use to navigate the code?
- •How long did it take to understand the basic flow?
- •What could you apply to your own projects?
