How to catch bugs early on? How to prevent them from returning in a future build?
Not long ago, I've
asked you on Twitter to provide me questions for this newsletter. If you have any, please reply to the thread above!
This week, I'm answering the question:
How to catch bugs early on?
It's something we all like to do, catch bugs as early as possible. Ideally, we wouldn't even have bugs.
The answer might be obvious, but it starts for me with writing tests. I often find myself writing tests, expecting them to succeed at first, realizing I've made a mistake. That's the first bug solved I would've had without tests!
Secondly, system design. I like to use
draw.io to write out the feature I'm building. It's so often giving me insights into edge cases I didn't think about beforehand.
Lastly, I always try to write tests reproducing a bug before I fix them. This way, I'm making sure that we don't run into the same bug when changed a certain piece of code. A great gift to your future self!
Enjoy this week's SwiftLee Weekly!