Debugging Your Project as an Intern
Debugging can be difficult especially when you're just getting started with software engineering. This post outlines tips on debugging effectively.
Photo by James Harrison on Unsplash
In this blog, I reflect on the process of debugging my intern project and share my learnings from the process. During my internship, there have been times where I've been stuck on ends trying to debug my code where the error wasn't as trivial as fixing a semicolon. This post serves as both a reflection and an advice piece on how you can debug your code more systematically.
Reach out for directions not solutions
It's easy to feel stuck especially when you're working on a project that you have to take responsibility for. However, being responsible for your project doesn't mean that you can't reach out to other engineers on your team.
It is worth remembering that everyone starts somewhere. The engineers you're reaching out to now have also begun their careers somewhere where they didn't understand the codebase, felt stuck, or didn't know how to google effectively.
As an intern, you're not alone in solving technical issues. You work in a team and learning how to ask questions to your team is key to learning effectively.
When you reach out to your team members for help, make sure you have already done the following:
Document the error message you're receiving/write down the specific questions you have in mind.
Note down all the steps you've taken so far to debug the issue. This can be super helpful especially because it saves time for your team member to understand your approach.
Search for the relevant documentation in your company's internal documentation or wiki.
GOOGLE IS YOUR BEST FRIEND. Google any term you don't understand. If it's a concept then spend some time watching a relevant video on it.
Use ChatGPT / Bard / Bing Chat as your rubber ducky for running through basic exceptions and errors. But PLEASE don't feed any of your company's code or proprietary documentation into it. It can be a violation so please be mindful.
Reach out to someone outside your team if possible. A lot of people are willing to help out even if you think everyone's too busy. There's a great chance that at least one person can guide you in some direction.
Break the bug down into smaller steps
Last week, I had spent hours trying to figure out a FileNotFoundException in my code despite the files lying right there in the resources folder. Today I finally got my jar to locate the file resources within it after finally breaking the code down into a smaller subset and just executing that part of the script. The process of debugging helped me understand why it's important to run your code in chunks and then put it all together.
This means, for example, if you have multiple functions that you're trying to integrate with the code base for your project, try to decouple the functions and test one component (function/class/function call) at a time.
A lot of times interdependencies in your code can make it difficult to track down where your code is breaking. Sometimes using try-catch statements can be helpful in narrowing down where your code is breaking. You can take this as a starting point and reach out to other members of your team for guidance.
Discuss it in your 1:1 with your mentor when stuck
Many companies assign mentors for interns. Mentors can be your go-to for advice and direction before you reach out to your manager to raise your concerns about bugs or blockers to your progress in your concerns. Talk to your mentor and give them a detailed rundown of what you've done so far to solve your issue and what is working and what isn't. Tell them about the background learning that you've done to fix the bug and your current understanding of the codebase.
It's important to keep your mentor in the loop about the progress (or lack of) that you've made so far. They can help point you in the right direction or assess whether your current project matches the skill level they typically expect of interns. Ask them what resources you can use to understand the issue better. Being proactive in figuring out what you know and what you don't know can be pivotal in being a good software engineering intern.
Know when to communicate that you're totally blocked/stuck
It's important for your manager or mentor to know that you're blocked despite your best debugging efforts. This isn't necessarily a poor reflection of your engineering skills, it in fact is an indicator that you're willing to flag potential blockers early on.
A lot of times, interns are assigned proof of concept projects that may not be feasible given the business processes and timelines that certain orgs function in. It is important for your team to know what is feasible and what isn't. This gives them insight into what roadblocks/delays/bugs to expect when they are working on a similar feature after the end of your internship. Obviously, if you have perfectly elaborate specifications for your project and such a feature has been implemented before then it is unlikely that your project implementation is unfeasible. So use your discretion and provide relevant details to your mentor and/or manager.
Give yourself some kindness
It can be challenging to come to speed with different tools, programming languages, and legacy codebases that you've not previously worked with. Somedays you're going to feel exhausted finding bugs, stressed because your code won't compile, or worried that your tested code would burn in production.
While handling these situations, try to show some compassion towards yourself. It's hard to ramp up to a level of understanding in a short period of time especially while adjusting to a new company. Take your bugs and mistakes as learning instead of beating yourself up for them. You have a lifelong professional and academic career ahead. Struggling with bugs or issues is always going to be a part of the career. Your persistence in solving those issues grows from being patient with yourself and the issue. When you think you've tried everything that you could've possibly tried, take a deep breath and go spend some time listening to music or destressing by playing your favorite video game. Come back to it later with a more relaxed mind. You've done great so far and you will continue to do so. Just be a little patient with yourself.