When:
Wednesday, September 30, 2026 - 11:40 to 12:25 CEST
Room:
Penn Room I&II
Tags:
development & coding
Track:
SVG
m&b icon_new brand
development, ai & agentic architecture

Inside the Pyramid - A path to faster, clearer Drupal testing

Inside the Pyramid - A path to faster, clearer Drupal testing

Francesco Placella (Plach)

Your Drupal test suite is slow and it doesn't have to be. The test pyramid has been a cornerstone of software quality for decades, yet Drupal core has no formal guidelines instructing contributors how to write automated tests. This session will cover both the current state – discussing techniques to write faster tests – and how to change Drupal to make these improvements structural.

Prerequisite

Attendees will get the most out of this session if they:
- Have written at least one PHPUnit test in a Drupal context (any type)
- Are familiar with the distinction between `UnitTestCase`, `KernelTestBase`, and `BrowserTestBase`
- Have a basic sense of what mocking is (full familiarity with PHPUnit mocks not required)

Target Audience

Core and module contributors/owners, Developers

Outline

Drupal's automated test suite is a huge achievement – literally – but it is slow, and one of the reasons is structural: there are no official guidelines prescribing which test type to use for which scenario. People default to Kernel or Functional tests because the Drupal architecture and the test tooling have historically made those easiest to write, even when, in principle, a Unit test would have been faster, cheaper, and equally valid.
This session makes the case for adopting the test pyramid as an explicit, community-endorsed strategy for Drupal core, contrib, and custom code: this will require both coming up with precise guidelines and designing our code with better unit testability in mind. We have been working towards this goal since Drupal 8, we may finally be at a stage where we can reap the benefits of this monumental effort.
During the session we will review the current state and go over some concrete proposals to change our strategy, tooling, and documentation in order to improve the quality, consistency, and speed of our test suite(s) – and write cleaner code in the process.

Learning Objectives

By the end of this session, attendees will:
- Understand the test pyramid and how Drupal's four test types map onto it
- Recognize the structural and tooling reasons Drupal's test suite is weighted toward slower test types — and why that's a solvable problem, not a fixed constraint
- Know the current drupal.org issues and contrib tools already moving in this direction
- Be equipped to reason through which test type to write for common Drupal scenarios
- Leave with a clear picture of what a formal test pyramid initiative for Drupal core could look like, and how to contribute to it

Experience level
Intermediate