DEV Community

Cover image for How To Fix A Bug - Building SaaS #56
Matt Layman
Matt Layman

Posted on • Originally published at mattlayman.com

1

How To Fix A Bug - Building SaaS #56

In this episode, we picked an issue from GitHub and worked on it. I explained the flow of using test driven development to show how the bug existed in an automated test. We wrote the test, then fixed the code. After that, we did some test refactoring to clean things up.

We looked at what the issue was and how it is related to the handling of the Course model in a weekly view in the app.

I showed how the data model for the Course handles school days. Then I wrote the unit test that would show the failure for the issue.

Once we had a valid unit test in place, I switched to writing code for the Django view to make the test pass. Finally, we checked the behavior in the app to confirm that I fixed the issue.

With the issue fixed and the test passing, I refactored the test code to make the tests easier to understand and work with in the future.

This article first appeared on mattlayman.com.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay