What are the best pieces of advice to remember when you start debugging code?

1. Take Error Messages with a Grain of Salt

<aside> 💡

Check Assumptions Early: Not only should you be skeptical of error messages, but you should also make sure that you are looking into your general assumptions before you even start paying attention to the errors. Try to validate any assumptions (e.g., expected values of inputs, outputs, and intermediate steps) early. It’s easy to overlook basic mistakes like incorrectly formatted input data or incorrect initial configurations.

</aside>

2. Read the Error from the Bottom Up

<aside> 💡

3. Follow the Flow of Data from Input to Output

<aside> 💡

Testing code end-to-end: This advice is perfect for identifying where the issue occurs in larger systems. Testing from the start to the end of a process helps confirm that the issue isn’t just a localized bug but a systemic one that spans multiple parts of the application.

</aside>

4. When Debugging Pipelines, Start from the Pipeline and Dive into the Scripts

<aside> 💡