← Back to Blog

Pest 5 Is Out: Test Impact Analysis, AI Agent Verification, and What It Means for Laravel Teams

Pest 5 ships test impact analysis, an AI agent plugin, evals, PHPStan, and Rector. Here's our agency take on what to adopt now and what to watch.

LaravelAugust 3, 20266 min readBy Joseph Rajewski
Pest 5 Is Out: Test Impact Analysis, AI Agent Verification, and What It Means for Laravel Teams

Nuno Maduro announced Pest 5 at Laracon US 2026 last week, and it's the most consequential Pest release since version 2 brought architecture testing into the default toolkit. The headline feature — test impact analysis — has real CI economics attached to it. But the AI angle is what's going to generate the most conversation on teams actively experimenting with agent-driven development.

What shipped in Pest 5

The release landed with five meaningful additions:

  • Test Impact Analysis (TIA) — Pest now tracks which source files each test actually exercises at runtime. On subsequent runs, it only re-executes tests whose covered files have changed. For a suite of 800+ tests, this can reduce a full CI run from several minutes to under 30 seconds when only a handful of files changed.
  • Agent Plugin — a new first-party plugin that lets AI coding agents interact with your test suite in a structured way. Agents can query which tests are failing, request targeted re-runs, and receive machine-readable output rather than ANSI-colored terminal noise.
  • Evals — borrowed from the AI/ML world, evals let you write probabilistic assertions against LLM output. If your Laravel app calls an external AI model and returns a generated response, evals give you a repeatable harness for asserting that the output meets quality criteria — not just that the HTTP call succeeded.
  • PHPStan integration — Pest now ships with built-in PHPStan support, so static analysis runs inside the same test command without a separate CI step.
  • Rector integration — automated code refactoring rules now run alongside tests, flagging deprecated patterns and suggesting fixes. Combined with PHPStan, this turns a Pest run into a three-in-one: test execution, static analysis, and refactor suggestions in one pass.

The upgrade path from Pest 4 is documented and the team notes it's non-breaking for most standard setups. If you're using custom plugins or deeply customized expectations, budget an hour or two for compatibility checks.

Our take

Test impact analysis is the feature that changes daily development habits. On our larger Laravel engagements — SaaS platforms with 600–1,000 tests — full suite runs have historically been a 3–5 minute wall that developers learn to avoid during active feature work. The result is a familiar anti-pattern: people run a narrow subset of tests locally, push, wait for CI, and fix things there. TIA breaks that loop. If the analysis overhead is low (and early reports suggest it is — a few hundred milliseconds of file-level diff tracking), developers will actually run the full suite continuously because it behaves like a narrow suite. That's a meaningful shift in feedback loop quality.

The honest trade-off: TIA is only as good as its coverage mapping. If you have tests that rely on runtime state, external service mocks, or dynamic file loading that Pest can't statically trace, you'll get false negatives — tests that should re-run but don't. The first week on any new project should include a "full suite + TIA suite" comparison run to catch gaps in the coverage map.

The Agent Plugin is early, but the direction is right. We've been experimenting with AI coding agents on Laravel projects for about six months now — using them for boilerplate generation, refactor suggestions, and first-pass test writing. The persistent friction has been that agents interact with test output poorly: they get confused by ANSI escape codes, retry logic, and non-deterministic ordering in failure messages. A structured, machine-readable output layer is exactly what's needed. We're not ready to say "let the agent manage your test suite autonomously," but a tighter feedback loop between an agent and a structured test runner is a meaningful step toward that.

Evals fill a real gap that most teams are ignoring. If your application calls an LLM — even indirectly, through a third-party service — your current test suite almost certainly just asserts that the call returned a 200 and the response body isn't empty. That's not a meaningful quality signal. Evals let you assert things like "the generated summary is under 100 words and mentions the client's product name" and run those assertions repeatedly against a sample set of inputs. It's not deterministic testing, but it's a structured way to surface regression in AI-integrated features. If we're building anything with AI output for a client in 2026, we're adding evals to the acceptance criteria.

PHPStan + Rector bundled in is a workflow improvement, not a revolution. Both tools were already part of our standard Laravel CI setup. Having them triggered in a single ./vendor/bin/pest invocation reduces the cognitive overhead of maintaining separate configuration, but it's additive rather than transformative. If you were already running PHPStan in CI, the migration is just removing a duplicate step.

What to do this week

Upgrade now if:

  • You're on Pest 3 or 4 with a standard test setup. The upgrade is low-risk and TIA alone justifies the hour it takes.
  • You're running CI suites longer than 2 minutes. TIA will pay for the upgrade time immediately.

Wait and watch if:

  • Your test suite relies heavily on custom Pest plugins not yet updated for v5. Check the plugin's GitHub issues before upgrading.
  • You have an upcoming client deadline in the next two weeks — don't introduce toolchain changes in crunch time.

Start experimenting with:

  • Evals, even informally. Any Laravel app making LLM calls should have at least a smoke-eval asserting output shape and basic quality thresholds before it hits production.

Originally referenced: Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals on Laravel News.

If your team is running Laravel in production and you want help setting up a modern testing pipeline — TIA, PHPStan, evals, or all three — get in touch.

Originally published by Laravel News. Read the full announcement here.

#laravel#pest#testing#ai#php

Need help with your project?

Let's discuss how Digital Pixel can help bring your vision to life.

Get in Touch