# Why Magento needs better tests in the AI era

Canonical page: https://magelens.dev/why-better-tests/
Research checked: 2026-11-01

AI makes code easier to produce. Your Magento store still has to calculate the right totals, take payments and create orders correctly.

Published expert perspectives, with our application to Magento. These are not testimonials or endorsements of MageLens.

## Commerce research

In Baymard’s 2026 breakdown of checkout abandonment reasons, 17% selected website errors or crashes. The breakdown excludes shoppers who were just browsing.

Source: [Baymard Institute · Checkout research](https://baymard.com/lists/cart-abandonment-rate)

## Expert perspectives

These notes paraphrase the sources; the website displays the short original quotations.

### Simon Willison: Give agents a test suite.

Willison argues that automated tests are essential when working with coding agents.

MageLens application to Magento: Run repeatable checkout, account and order scenarios before accepting an agent’s changes.

Source: [First run the tests](https://simonwillison.net/guides/agentic-engineering-patterns/first-run-the-tests/)

### Andrew Ng: Treat generated code as a proposal.

Ng explains that faster agentic development increases the need for automated verification because generated implementations can still fail.

MageLens application to Magento: Assert totals, order persistence and integration behavior when reviewing generated code.

Source: [The Batch · 17 September 2025](https://www.deeplearning.ai/the-batch/agentic-coding-and-agentic-software-testing-go-together/)

### Martin Fowler: Find the code your tests miss.

Fowler recommends using coverage to locate gaps and cautions against treating the percentage as a measure of test quality.

MageLens application to Magento: Inspect uncovered PHP, JavaScript and template paths. Use those gaps to choose the next meaningful test.

Source: [Test Coverage · 17 April 2012](https://martinfowler.com/bliki/TestCoverage.html)

### Edsger W. Dijkstra: Test beyond the happy path.

Dijkstra explains why successful test runs do not establish that a program is free from defects.

MageLens application to Magento: Include declined payments, unavailable stock and invalid addresses. Passing tests still need meaningful assertions and review.

Source: [Notes on Structured Programming · 1969](https://www.cs.utexas.edu/~EWD/transcriptions/EWD02xx/EWD249/EWD249.html)

### Jeff Bezos: Protect the customer promise.

Bezos describes customer trust as something businesses must continually earn by keeping their promises.

MageLens application to Magento: Treat checkout, pricing, payments and order creation as customer promises every release needs to keep.

Source: [U.S. House statement · 29 July 2020](https://www.aboutamazon.com/news/policy-news-views/statement-by-jeff-bezos-to-the-u-s-house-committee-on-the-judiciary)

## Apply the evidence

Use assertions to check business behavior. Use MageLens to see the PHP, JavaScript and template code your E2E suite executes.

[Explore the live report](https://magelens-coverage-demo.wintrywood128.chatgpt.site) · [Start with MageLens](https://github.com/MageLens/MageLens#quick-start)
