liveBook · Manning

Chapter 11: Chapter 11. Strategies for implementing acceptance tests

What you will learn in chapter 11 of Test Driven: Practical TDD and Acceptance TDD for Java Developers

The introduction frames acceptance-test implementation as a choice between testing the whole system and testing at lower levels, considering cost versus value.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction frames acceptance-test implementation as a choice between testing the whole system and testing at lower levels, considering cost versus value.

Key terms: end to end, whole system, cost versus value

11.1 What should acceptance tests test?

This section explains how to focus automated acceptance tests on essential story requirements while combining automation with human testing.

Key terms: acceptance tests, user stories, end-to-end, manual, visual testing, automated regression tests, risks

11.1.1 Focus on what’s essential

This section explains how to focus acceptance tests on the behavior a story requires, using the UI when it is essential to that behavior.

Key terms: acceptance tests, domain logic, presentation, user story, actual UI, web interface, end-to-end scenario, session

11.1.2 Avoid turbulent interfaces

This section explains how to choose acceptance-test interfaces that limit maintenance from unrelated changes and keep tests focused on the story.

Key terms: turbulence, interface, system under test, cost of change, story, domain, user interface, navigation

11.1.3 Cross the fence where it is lowest

This section explains how technology constrains and favors acceptance-testing approaches, and how architecture can create additional testing options.

Key terms: hard limits, entry points, system under test, technology stack, white box, UI components, API-level access, testable, software architecture, service layer

11.2 Implementation approaches

This section introduces the acceptance-testing approaches discussed in the sections that follow.

11.2.1 Going end-to-end

This section explains end-to-end acceptance testing, its real-world coverage and stakeholder benefits, and the costs of UI dependence and slow feedback.

Key terms: end-to-end, real interface, black box, fixture classes, WebFixture, jWebUnit, customer’s language, brittle, UI, business logic

11.2.2 Crawling under the skin

This section explains how acceptance tests can operate beneath the concrete UI, with examples, benefits, and trade-offs.

Key terms: crawling under the skin, abstract UI, application and domain logic, internal service layer API, JNDI, JVM, abstract UI API, event queue, programming interface, impedance mismatch

11.2.3 Exercising the internals

This section explains when and why acceptance tests can exercise business logic directly, and how they differ from unit tests and broader acceptance tests.

Key terms: exercising the internals, business logic, validation rules, business rules, high-precision tests, specification, acceptance tests, unit tests, business domain, language of the implementation

11.2.4 Stubbing out the irrelevant

This section explains how to replace less relevant components in acceptance tests while retaining focused tests of real integrations.

Key terms: stubbing out the irrelevant, stubs, simulators, alternative implementations, supplementary strategy, integrations, stubbed system, modularize, risk-management, overall coverage

11.2.5 Testing backdoors

This section explains how testing backdoors give acceptance tests alternative access to a system and may eventually evolve into public functionality.

Key terms: testing backdoor, database, system’s API, side effects, public API, monitoring, fault-management

11.3 Technology-specific considerations

This section introduces why technology matters when choosing how to connect acceptance tests to a system.

Key terms: acceptance tests, system under test, technology, strategy

11.3.1 Programming libraries

This section explains how to choose interfaces, test formats, and stubs for acceptance testing programming libraries.

Key terms: public programming interface, under the skin, end-to-end, public API, user stories, acceptance tests, JUnit, Fit, level of abstraction, stubbing

11.3.2 Faceless, distributed systems

This section weighs internal-API and end-to-end acceptance-testing strategies for faceless distributed systems.

Key terms: under the skin, internal APIs, end-to-end tests, machine-to-machine interfaces, end-to-end acceptance-testing strategy, network interface, proprietary, closed interface, vendor’s client-side API, client-side application’s UI, crawling under the skin

11.3.3 Console applications

This section compares ways to implement acceptance tests for console applications, favoring end-to-end tests through their typically simple command-line interfaces.

Key terms: console applications, command-line interface, acceptance tests, put command, end-to-end strategy, console UI, semantic overhead, programming API, presentation, application logic

11.3.4 GUI applications

This section compares approaches to automating acceptance tests for desktop GUI applications and their practical tradeoffs.

Key terms: semantic complexity, event-driven, multithreaded, UI components, operating system-level events, coordinate-based test automation, Swing components, native API, native widgets, black box

11.3.5 Web applications

This section compares ways to implement acceptance tests for web applications, including testing beneath the UI, simulating browsers, and controlling real browsers.

Key terms: end-to-end, actual HTTP interface, crawling under the application’s skin, service layer, simulation libraries, HTTP traffic, HTML, JavaScript, jWebUnit, real web browser

11.4 Tips for common problems

This section identifies acceptance test complexity and slow execution as problems that can make test suites difficult to maintain and delay feedback.

Key terms: acceptance tests, design, refactor, performance, test execution, end-to-end acceptance tests

11.4.1 Accelerating test execution

This section presents ways to accelerate acceptance test suites by reducing setup and persistence work, distributing execution, and weighing the trade-offs of shared state and faster resets.

Key terms: setup, side effects, internal boundaries, cheating on persistence, disk I/O, in-memory mode, one-to-many, many-to-many, many-to-many-more, test client

11.4.2 Reducing complexity of test cases

This section explains how refactoring and reusable context objects can simplify acceptance tests, and how caching contexts can speed up repeated setup.

Key terms: acceptance tests, user story, common fixtures, context objects, common setups, test cases, inheritance hierarchy, caching context object, session state, snapshot

11.4.3 Managing test data

This section presents guidelines for keeping acceptance-test data manageable through a shared data set, generation, and usable version control.

Key terms: single data set, partition, test data, generating test data, persistence implementation, domain classes, ORM, version-control, data-set definition, diff

11.5 Summary

Concepts explained in this chapter

← Chapter 10: Chapter 10. Creating acceptance tests with Fit Chapter 12: Chapter 12. Adopting TDD →

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.