DEV Community

Why doesn't my code work?

Milecia on July 10, 2018

After you've been writing code for a while you start to notice things. Maybe you have a picture that's a little too far left or the price you're ge...
Collapse
 
stealthmusic profile image
Jan Wedel • Edited

There are some useful tips in there, but the most important step is missing. Write an automated test to reproduce the bug before fixing it. This should replace step 1). Then, step 8) would be TDD, rerun the test and change your code until it works.
This is really important to make sure you won’t have any regressions. A good test suite is especially important when trying to find a bug. You usually try a lot of stuff, changing code here and there. From time to time, you forget to revert something and there it is, your regression.