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.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay