When a Breakfast Burrito Exposes the Need for Rigorous Software Testing
Tags: programming, webdev, testing, productivity
Published: 2023-09-02 13:37:11

## The Craving that Sparked a Journey

After a week of non-stop work and home-cooked meals, all I wanted was a simple pleasure: a McDonald’s breakfast burrito and a cup of coffee. A desire so straightforward should have required minimal effort to fulfill, **but my 5:58 AM visit to McDonald’s website served up something unexpected — a lesson in the critical need for accurate software testing**. McDonald’s, which boasts a staggering 57.3 million monthly desktop website visits according to SEMrush data, has a level of digital responsibility that cannot be overstated.

![McDonalds Monthly Website Desktop Traffic | SemRush](https://miro.medium.com/v2/resize:fit:700/1*3bSU60vj_grdbQl_9DPGJQ.png)

## Navigating the Web Maze for a Fast Food Breakfast

In an effort to satisfy my hunger, I turned to a Google search and clicked on a McDonald’s location page. It read, “Sorry, we’re closed — we will be open at 5:00 AM.”

![McDonalds is Closed at 5:58 AM but opens at 5:00 AM](https://miro.medium.com/v2/resize:fit:700/1*tZEoIZiX6wxaYzpIsFER-w.png)

I checked my phone. It was 5:58 AM CST. Then, right at 6:00 AM, the message changed to “We are open.”

![McDonalds Opened at 06:00 AM - Opens at 05:00 AM](https://miro.medium.com/v2/resize:fit:412/1*FmwgX7MWHYUE8VkaLfsTGg.png)

This wasn’t just a hiccup; it was symptomatic of something more complex. A simple timing error could extend into a range of issues that jeopardize user trust and overall experience.

## Digging Deeper into the Backend Behavior

My curiosity was piqued, and I delved into Chrome’s Developer Tools.

![Chrome Dev Tools - Where This Label Is Coming From](https://miro.medium.com/v2/resize:fit:700/1*dd6z7DtvAJdwVK5Prp_2Cg.png)

Chrome Developer Tools — Debugging  [mcdonalds.com](https://www.mcdonalds.com/), understanding where label is coming from

It was clear that the HTML, complete with the misleading time information, was compiled on the server side. There was no client-side JavaScript to blame here.

![McDonalds returns rendered HTML Back that has the label - no JS Client Code that sets it](https://miro.medium.com/v2/resize:fit:700/1*80GQfZVrgWzrON7R0_gIwg.png)

Backend returns HTML Back that contains the label “Open / Close”

Since I had navigated from a Google search, metrics are undoubtedly gathered for analytics. This tracking data offers a plethora of localization options that could be far more accurate than whatever method was currently failing at McDonald’s.

## The Price of Inaccuracy in a World Obsessed with Precision

My experience brings to mind the words of Glenford J. Myers, Corey Sandler, and Tom Badgett:

> One of the primary causes of poor application testing is the fact that most programmers begin with a false definition of the term. They might say:
> 
> “Testing is the process of demonstrating that errors are not present.”  
> “The purpose of testing is to show that a program performs its intended functions correctly.”  
> “Testing is the process of establishing confidence that a program does what it is supposed to do”  
>   
> Thus, a more appropriate definition is this:  
> **“Testing is the process of executing a program with the intent of finding errors**.  
> [The Art of Software Testing, 3rd ed., Wiley, 2011]

Now, imagine the magnitude of this issue when scaled to 58 million monthly users. What might appear to be a trivial timing error to a developer could translate into widespread confusion or even distrust among customers.

## Concrete Steps to Enhance Accuracy and User Experience

## Removing the Label if Reliability is in Question

The first and most straightforward solution is to simply remove the feature if it cannot be trusted for accuracy. A feature that cannot reliably serve its function has the potential to do more harm than good. Inaccuracy not only sows seeds of doubt but also tarnishes the brand image.

## Tests That Seek and Destroy Errors

The fact that such an error went live suggests inadequate testing.

![McDonalds Production Server](https://miro.medium.com/v2/resize:fit:424/1*gJLr3q1x_1EAxgY25vq-vw.png)

It’s not enough to check if the software does what it’s supposed to do; you must also ensure it doesn’t do what it’s not supposed to. Test cases should be designed to capture a wide variety of scenarios, including time zones, devices, and browsers, to rigorously vet the system for errors.

## Using Client-side Solutions for Maximum Accuracy

JavaScript offers client-side features like  `Intl.DateTimeFormat`  that can fetch time zone data right from the user’s device. It’s a reliable, efficient method to eliminate the types of errors that complicated my search for a breakfast burrito.

As we come to the end of this tale, from a seemingly simple desire for a breakfast burrito to an intricate analysis of software testing,  **I’d like to express my gratitude for your time and engagement.** It’s an honor to share this journey with you. Being in a circle focused on high-caliber coding techniques can significantly minimize bugs and inefficiencies. It can, in a lighthearted way, speed up our ‘TTB - Time to Breakfast.’ Small glitches can reveal big vulnerabilities, but collectively, we have the potential to fashion a world where both our breakfast burritos and user experiences are unmatched.

Wishing you all a splendid weekend!

![The Art of Software Testing, 3rd Edition By Glenford J. Myers, Corey Sandler, Tom Badgett](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/am6cdl5rd1oz9syoy8gx.png)

**References**
Myers, G. J., Sandler, C., & Badgett, T. (2011). The Art of Software Testing (3rd ed.). Wiley.