Skip to content

Glossary

Automated tests in Laravel: checks that run by themselves

Programs that check other programs, so that a fault shows up before it meets somebody in production.

A test is a small program that runs another program and checks whether what comes out is what should come out. On an invoice with a discount and a reduced tax rate, this one figure has to appear at the bottom. A test holds that fast and speaks up as soon as somebody changes it.

Laravel brings everything needed. An application can be started up completely, a call sent and the answer checked, with a database of its own that is empty again afterwards.

Where tests are worth having first

Not everywhere equally. They bring the most where business logic sits that has to be right: prices, deadlines, permissions, billing. Those places rarely change and hurt properly when they go wrong.

They bring the least on screens that are still moving. A test that breaks on every visual change gets switched off after a fortnight, and then stands around uselessly.

Tests deliver the most value together with CI/CD, because they then run by themselves on every change and nobody has to remember them.

FAQ

Häufige Fragen

How high should test coverage be?
The number is the wrong measure, because it can be driven up arbitrarily without a single business rule being checked. A more useful question is which faults would be really expensive. Cover those and you are better off than somebody with a high percentage and an unchecked price calculation.

Related

Terms that belong with this one

A project, or a question?

Write and tell us what it is about. You get an assessment from somebody who works with Laravel themselves, not from a sales desk.