Chapter 7. Testing Serverless Applications

You hear that Mr. Anderson? That is the sound of inevitability.

Agent Smith, The Matrix

In this chapter, you will explore the attributes and failure modes of serverless applications that influence a novel approach to testing. You will learn how to devise a test strategy for your team, and how to apply this strategy to your tests. The result will be a vastly simpler approach to testing that doesn’t fixate on test categorization or aim for maximum code coverage but instead meets the goals of rapid delivery, fault tolerance, and observability.

Efforts to promote software quality have traditionally been focused on identifying and eradicating bugs. The perceived quality of a piece of software was often measured by what went wrong with it. If bugs appeared in production, gaps in test suites were found and filled with more tests.

But software has evolved, and at the same time user demands have skyrocketed. Software must now be highly available, low-latency, and in a constant state of iteration. The way engineers build software has changed to meet these demands. Modern applications are cloud native, geographically and logically distributed, and a mixture of first-party, third-party, and open source code. To be able to build and operate software like this, while enforcing quality, engineering teams need to run tests that give maximum confidence in minimum time, deploy changes rapidly, understand application behavior instantly, and recover from ...

Get Serverless Development on AWS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.