Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Testing strategy

How Exponential is tested and how to test your own changes - the layers from syntax checks and static analysis to DB-less PHPUnit suites, database tests, live-installation tests, design and quality tests, benchmarks and…

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/help/software-engineers/testing-strategy.md

On this page

Testing strategy

This page is for engineers who plan the tests of a change, review whether a change is tested enough, or evaluate how well Exponential itself is tested. The standard, with counts and known gaps, is Testing and continuous integration.

Contents

  1. The layers
  2. What runs where
  3. Choosing the tests for a change
  4. What a good test here looks like
  5. Known gaps

The layers

LayerToolCatchesSpeed
Syntaxphp -l (PHP 8.3 and 8.0), node --checkparse errors, syntax newer than PHP 8.0seconds
File manifestbin/php/checkmanifest.phpa file whose checksum is missing or stale in share/filelist.md5seconds
Code stylebin/php/checkcodestyle.php, phpcs.xml.distnew style violations, type declarations, PHP 8.0 incompatibilitiesseconds
Static analysisPHPStan level 1 with a baselinenew findings in kernel/ and lib/a minute
Unit and component tests without a databasePHPUnit, most suiteslogic, parsing, rendering, security rulesminutes
Design and quality testsPHPUnit suites design and qualityinline CSS or scripts in admin templates, token rules, translations, the sniffs themselvesminutes
Database teststests/runtests.php --dsn ... --db-per-testSQL on MySQL 8.0 and PostgreSQL 15longer
Live-installation testssuites that need an installed site, or live servers named in environment variablesintegration with a real site, MongoDB, HTTPskipped without them
Boot smoke testtests/bin/bootsmoke.php on PHP 8.0a class that does not load, a missing compatibility functionseconds
Benchmarksbin/php/benchmark.php microperformance regressions (warning only)a minute

What runs where

WhereWhat
git commit (after make hooks)syntax, manifest, code style of staged files, commit message format
git push (after make hooks and make devtools)PHPStan against the baseline
CI, Qualitysyntax, manifest, commit messages, code style (warning), PHPStan, sniff tests, PHP 8.0 lint, install and boot
CI, PHPUnitthe DB-less run on PHP 8.1 to 8.5, and database tests on MySQL 8.0 and PostgreSQL 15
CI, Performancethe micro benchmark (warning)

Details: CI gates and Quality checks.

Choosing the tests for a change

  1. The tests that map to the changed files. tests/test-map.json maps source files to the test files that cover them; with the tests named after the changed classes it selects the tests of a change.
  2. A new test that fails without the change and passes with it. The contribution guide asks for exactly this.
  3. The suite of the area, for example php vendor/bin/phpunit --testsuite kernel-classes.
  4. The whole DB-less run before a larger push: php vendor/bin/phpunit.
  5. The database tests when SQL changed.
  6. A check on a running site for anything that renders: light and dark mode, the widths you support, no console errors.

What a good test here looks like

  • It needs no database unless it tests SQL, so it runs on every CI leg (DB-less tests and test suites).
  • It reads nothing from a developer's installation: no settings/override, no var/ caches, no installed site. CI has none of them.
  • It leaves no state behind: no static cache, INI value or file under var/ that the next test sees.
  • A test that needs a live server reads its location from environment variables and skips with the variable's name when it is not set; it carries no host name, account or password of its own.

Known gaps

From the standard: some test files are in no suite, the live-installation suites are skipped in CI, the database jobs cover MySQL and PostgreSQL only (not SQLite, MariaDB, Oracle or MongoDB servers), PHPUnit does not run on PHP 8.0, coverage is collected but not published or enforced, and the hooks are opt-in. Plan around them: if your change is specific to an engine without a CI job, test it on that engine yourself.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x