liveBook · Manning

Chapter 19: Technical note patterns for quick error recovery

What you will learn in chapter 19 of Effective Behavior-Driven Development

The introduction explains why failing BDD scenarios need early, context-rich error reporting to make failures in a CI/CD pipeline quicker to diagnose.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction explains why failing BDD scenarios need early, context-rich error reporting to make failures in a CI/CD pipeline quicker to diagnose.

Key terms: regression tests, CI/CD pipeline, BDD scenario, root cause, regression problem, early error detection, runtime information

19.1 Descriptive Assertion pattern: including context information in the error message

This section shows how to make assertion failures easier to diagnose by putting relevant context in their error messages and checking those messages during development.

Key terms: Descriptive Assertion pattern, assertion error message, context information, Red-Green-Refactor loop, failing scenario, assertion, assertion library, fluent API, AwesomeAssertions, Cucumber Messages

19.2 Supplementary Attachment pattern: attaching execution context information to the test result

This section explains when to attach execution context to a scenario result and how to preserve it for diagnosing failures.

Key terms: Supplementary Attachment pattern, execution context, error message, application log, after-scenario hook, scenario execution status, test result attachment, AddAttachment

19.3 Test Log pattern: recording scenario execution details

The section explains how the Test Log pattern records scenario execution details across automation layers so failures are easier to diagnose without cluttering scenarios.

Key terms: Test Log pattern, BRIEF principle, scenario execution errors, test layer, automation layer, Test Action pattern, TestAction base class, input and output parameters, LogDebug, debug

19.4 Embedded Application Log pattern: including the application log with the test log

This section explains how embedding application logs in the test log creates one diagnostic record, and how to control its verbosity so that record remains useful.

Key terms: Embedded Application Log pattern, test log, application log, hierarchical log messages, test logger, application’s logging output, in-process, background job, default verbosity level, log category

19.5 Corroboration Check pattern: monitoring the application’s health indicators

This section explains how the Corroboration Check pattern catches unexpected application health issues that ordinary scenario assertions can miss.

Key terms: Corroboration Check pattern, health indicators, functional checks, SUT, Test Action, Attempt Action, after-scenario hook, application log, false negatives, negative scenarios

19.6 Fail-fast Check pattern: ensure that the preconditions have been met

This section explains how fail-fast checks verify scenario preconditions immediately so setup errors are easier to diagnose.

Key terms: Fail-fast Check pattern, context, precondition, Given, background job, When step, timeout, generic fail-fast check, custom fail-fast check, RestApiContext

19.7 Summary

Concepts explained in this chapter

← Chapter 18: Dress rehearsal patterns for building confidence Chapter 20: Staging patterns for adapting test execution →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.