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

April 25, 2024

The use of hybrid multicloud models is forecasted to double over the next one to three years as IT decision makers are facing new pressures to modernize IT infrastructures because of drivers like AI, security, and sustainability, according to the Enterprise Cloud Index (ECI) report from Nutanix ...

April 24, 2024

Over the last 20 years Digital Employee Experience has become a necessity for companies committed to digital transformation and improving IT experiences. In fact, by 2025, more than 50% of IT organizations will use digital employee experience to prioritize and measure digital initiative success ...

April 23, 2024

While most companies are now deploying cloud-based technologies, the 2024 Secure Cloud Networking Field Report from Aviatrix found that there is a silent struggle to maximize value from those investments. Many of the challenges organizations have faced over the past several years have evolved, but continue today ...

April 22, 2024

In our latest research, Cisco's The App Attention Index 2023: Beware the Application Generation, 62% of consumers report their expectations for digital experiences are far higher than they were two years ago, and 64% state they are less forgiving of poor digital services than they were just 12 months ago ...

April 19, 2024

In MEAN TIME TO INSIGHT Episode 5, Shamus McGillicuddy, VP of Research, Network Infrastructure and Operations, at EMA discusses the network source of truth ...

April 18, 2024

A vast majority (89%) of organizations have rapidly expanded their technology in the past few years and three quarters (76%) say it's brought with it increased "chaos" that they have to manage, according to Situation Report 2024: Managing Technology Chaos from Software AG ...

April 17, 2024

In 2024 the number one challenge facing IT teams is a lack of skilled workers, and many are turning to automation as an answer, according to IT Trends: 2024 Industry Report ...

April 16, 2024

Organizations are continuing to embrace multicloud environments and cloud-native architectures to enable rapid transformation and deliver secure innovation. However, despite the speed, scale, and agility enabled by these modern cloud ecosystems, organizations are struggling to manage the explosion of data they create, according to The state of observability 2024: Overcoming complexity through AI-driven analytics and automation strategies, a report from Dynatrace ...

April 15, 2024

Organizations recognize the value of observability, but only 10% of them are actually practicing full observability of their applications and infrastructure. This is among the key findings from the recently completed Logz.io 2024 Observability Pulse Survey and Report ...

April 11, 2024

Businesses must adopt a comprehensive Internet Performance Monitoring (IPM) strategy, says Enterprise Management Associates (EMA), a leading IT analyst research firm. This strategy is crucial to bridge the significant observability gap within today's complex IT infrastructures. The recommendation is particularly timely, given that 99% of enterprises are expanding their use of the Internet as a primary connectivity conduit while facing challenges due to the inefficiency of multiple, disjointed monitoring tools, according to Modern Enterprises Must Boost Observability with Internet Performance Monitoring, a new report from EMA and Catchpoint ...