Noncritical paths – Testing Serverless Applications

Noncritical paths

The noncritical paths in your application will usually be background processes. These will not be time-sensitive and will be fully recoverable in the event of performance degradation or outages resulting from transient bugs or persistent errors, or following a code fix or rollback.

The operational quality of noncritical paths should be primarily supported through alerting and fault tolerance. You can afford to ship a higher percentage of bugs that disrupt these paths, within your error budgets (see Chapter 8 for more information about error budgets).

Is it a critical path?

Here are some questions you can pose about your microservices to understand whether they include critical paths:

  • Is someone or something relying on the request being served in a timely manner; either near-immediate (synchronous responses) or as-soon-as-possible (asynchronous responses)?
  • Can the request be idempotently retried at a later date?
  • Does handling the request involve storing or updating application or business-critical data?

Just Enough and Just-in-Time Testing

As you have seen so far in this chapter, with serverless your test coverage should be kept to a minimum and be focused on your critical user experiences. You should test just enough of your application to provide the confidence required to release a change into production—serverless testing is not about catching all possible bugs, it’s about catching the bugs that will wreak the most havoc on the user experience.

Per the serverless square of balance, testing cannot restrict your ability to deliver. If you have more than “just enough” tests and they take too long to execute (or even worse, are flaky and require multiple runs to pass), this will harm engineering productivity. In some cases, an inefficient test strategy can deter engineers from making frequent releases due to the burden and frustration associated with deploying changes.

Leave a Reply

Your email address will not be published. Required fields are marked *