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

December 01, 2022

You could argue that, until the pandemic, and the resulting shift to hybrid working, delivering flawless customer experiences and improving employee productivity were mutually exclusive activities. Evidence from Catchpoint's recently published Site Reliability Engineering (SRE) industry report suggests this is changing ...

November 30, 2022

There are many issues that can contribute to developer dissatisfaction on the job — inadequate pay and work-life imbalance, for example. But increasingly there's also a troubling and growing sense of lacking ownership and feeling out of control ... One key way to increase job satisfaction is to ameliorate this sense of ownership and control whenever possible, and approaches to observability offer several ways to do this ...

November 29, 2022

The need for real-time, reliable data is increasing, and that data is a necessity to remain competitive in today's business landscape. At the same time, observability has become even more critical with the complexity of a hybrid multi-cloud environment. To add to the challenges and complexity, the term "observability" has not been clearly defined ...

November 28, 2022

Many have assumed that the mainframe is a dying entity, but instead, a mainframe renaissance is underway. Despite this notion, we are ushering in a future of more strategic investments, increased capacity, and leading innovations ...

November 22, 2022

Most (85%) consumers shop online or via a mobile app, with 59% using these digital channels as their primary holiday shopping channel, according to the Black Friday Consumer Report from Perforce Software. As brands head into a highly profitable time of year, starting with Black Friday and Cyber Monday, it's imperative development teams prepare for peak traffic, optimal channel performance, and seamless user experiences to retain and attract shoppers ...

November 21, 2022

From staffing issues to ineffective cloud strategies, NetOps teams are looking at how to streamline processes, consolidate tools, and improve network monitoring. What are some best practices that can help achieve this? Let's dive into five ...

November 18, 2022

On November 1, Taylor Swift announced the Eras Tour ... the whole world is now standing in the same virtual queue, and even the most durable cloud architecture can't handle this level of deluge ...

November 17, 2022

OpenTelemetry, a collaborative open source observability project, has introduced a new network protocol that addresses the infrastructure management headache, coupled with collector configuration options to filter and reduce data volume ...

November 16, 2022

A unified view of digital infrastructure is essential for IT teams that must improve the digital user experience while boosting overall organizational productivity, according to a survey of IT managers in the United Arab Emirates (UAE), from Riverbed and market research firm IDC ...

November 15, 2022

Building the visibility infrastructure to make cloud networks observable is a complex technical challenge. But with careful planning and a few strategic decisions, it's possible to appropriately design, set up and manage visibility solutions for the cloud ...