Envisioning Testing as a Three-Course Meal
September 26, 2022

Marcus Merrell
Sauce Labs

Share this

A Metaphorical Appetizer

Might we recommend a light and crisp prosecco?

In Italy, it is customary to treat wine as part of the meal. Wine isn't a beverage: wine is as integral to the meal as the food itself. The wine is the food. The food is the wine. They are inseparable, complementary.

Too often, testing is treated with the same reverence as the post-meal task of loading the dishwasher, when it should be treated like an elegant wine pairing: a test suite, properly written, gives you objective proof that your code is functioning properly, from the individual units to the full application. A passing suite of unit tests, executed after even a small change to someone else's code, gives you a dopamine hit almost as powerful as a sip of wine. If you treat testing like loading the dishwasher, you're probably overlooking details and missing steps. It's hard to care about details of any task you hate.

Like wine, tests can give you both pleasure and (given enough quantity) confidence.

To further stretch the metaphor: Testing can be off-loaded to a separate person or team — forgotten — just like loading the dishwasher. But everyone needs to eat, and everyone deserves the pleasure of a perfect pairing of wine with their dinner.


Photo from Mangia Michelle

The Main Course

Paired with a delightful Cabernet Sauvignon, or perhaps JUnit?

Unit Tests
Unit tests exist to ensure that a team's code works as correctly as it can. Few things are faster to execute than unit tests — we're talking about nanoseconds. You should have many of them, liberally sprinkled throughout the codebase. The bigger your team, the more you will thank yourself for requiring them. Unit tests apply equally to any kind of software project, including mobile apps.

Integration Tests
Integration tests ensure that one team's code interacts with other codebases as expected, and as it evolves and changes. They often talk to a microservice developed by another team. They don't execute as quickly as unit tests, but they are still blazingly fast — fractions of a second. Integration tests are critical to mobile testing in particular, because apps live and die by the function and efficiency of the APIs they use, and because so much of the mobile ecosystem beyond the API involves variables your team can't control.

Functional UI Tests
Functional UI tests are meant to string disparate parts of the system together, to ensure it works as a whole. These tests also tend to incorporate other kinds of software over which your team has zero control: web browsers, mobile devices, mobile operating systems, and background processes. As a result, these tests are exponentially slower than unit and integration tests.

As difficult as they are to develop and maintain, they are absolutely critical to the success of your app. Due to the complications of constant changes — to operating systems, libraries, and even mobile device hardware, the number of ways your code might be executed increases exponentially, and only testing can guarantee success.

Dessert

A Tawny Port will do the trick. Or some Selenium.

And thus we leave our culinary metaphor behind. While I expect to receive immediate gratification from my meal at a four star restaurant, succession planning requires a different motivation.

Automated testing is a form of succession planning. Unit, integration, Functional tests — these are created by people who understand the requirements that were used to create the software, and they evolve to changes made, staying relevant or being excised as requirements are altered.

Thus this is where our testing meal metaphor ends. While I expect to receive immediate gratification from my meal at a four star restaurant, succession planning requires a different motivation.

I don't write tests for myself, for today.

I write tests for myself, for a year from now, when I have to change my code and I can't remember what I was thinking.

I write tests for a new developer who inherits the code base later, after I'm gone.

My tests set my successors up for success. The seeds of good testing are planted today, to create the beautiful vintage, your team will savor for years.

Marcus Merrell is VP of Technology Strategy at Sauce Labs
Share this

The Latest

September 27, 2023

Navigating observability pricing models can be compared to solving a perplexing puzzle which includes financial variables and contractual intricacies. Predicting all potential costs in advance becomes an elusive endeavor, exemplified by a recent eye-popping $65 million observability bill ...

September 26, 2023

Generative AI may be a great tool for the enterprise to help drive further innovation and meaningful work, but it also runs the risk of generating massive amounts of spam that will counteract its intended benefits. From increased AI spam bots to data maintenance due to large volumes of outputs, enterprise AI applications can create a cascade of issues that end up detracting from productivity gains ...

September 25, 2023

A long-running study of DevOps practices ... suggests that any historical gains in MTTR reduction have now plateaued. For years now, the time it takes to restore services has stayed about the same: less than a day for high performers but up to a week for middle-tier teams and up to a month for laggards. The fact that progress is flat despite big investments in people, tools and automation is a cause for concern ...

September 21, 2023

Companies implementing observability benefit from increased operational efficiency, faster innovation, and better business outcomes overall, according to 2023 IT Trends Report: Lessons From Observability Leaders, a report from SolarWinds ...

September 20, 2023

IT leaders are driving an increasing number of automation initiatives as a way to stay competitive, reduce costs and scale as they navigate an unpredictable social and economic environment, according to the 2023 State of Automation in IT survey conducted by Jitterbit ...

September 19, 2023

Customer loyalty is changing as retailers get increasingly competitive. More than 75% of consumers say they would end business with a company after a single bad customer experience. This means that just one price discrepancy, inventory mishap or checkout issue in a physical or digital store, could have customers running out to the next store that can provide them with better service. Retailers must be able to predict business outages in advance, and act proactively before an incident occurs, impacting customer experience ...

September 18, 2023
Digital transformation is key to ensuring companies keep up with the competitive market landscape. Putting digital at the core of a business can significantly reduce operating expenses and inefficiencies. However, this process often means changing the way internal teams work with one another. To help with the transition, this blog offers chief experience officers (CXOs) advice on how to lead a successful digital transformation project ...
September 14, 2023

Earlier this year, New Relic conducted a study on observability ... The 2023 Observability Forecast reveals observability's impact on the lives of technical professionals and businesses' bottom lines. Here are 10 key takeaways from the forecast ...

September 13, 2023
On September 10, MGM Resorts experienced what it called a "cybersecurity issue" that had a major impact on the company's systems, showing how cyberattacks can bring down applications, ultimately causing problems for a company in many ways ...
September 12, 2023

Only 33% of executives are "very confident" in their ability to operate in a public cloud environment, according to the 2023 State of CloudOps report from NetApp. This represents an increase from 2022 when only 21% reported feeling very confident ...