What is an automated test and how to prevent a change from breaking your website?

Published on 2026-10-20 by frfrand

Automated testing explained: unit, integration, and end-to-end tests, examples with Python, coverage, and common mistakes.

What is an automated test and how to prevent a change from breaking your website?

Short answer: An automated test is a check that runs a program to verify whether a part of the software still behaves as expected. It is useful for discovering errors in a repeatable way, especially when the project changes frequently.

Imagine you have a website for booking appointments. Today a person can choose a date and time. Tomorrow you modify the discount system and, without realizing it, appointments start allowing duplicate bookings. A good set of tests can detect that problem before publishing.

Why isn't manual testing enough?

Manual testing is useful, especially for discovering user experience issues. But repeating twenty actions after every change is slow and easy to forget.

An automated test follows reproducible instructions. It can run every time you push code and report whether the check passed or failed.

The goal is not to eliminate human testing; it is to free up time from repetitive tasks and detect regressions before.

A small example in Python

Imagine a function that calculates the final amount of a purchase. You can write a test that checks the expected result:

def calcular_total(precio, cantidad):
    return precio * cantidad

def test_total_de_dos_productos():
    assert calcular_total(12, 2) == 24

Tools like pytest find these functions and allow running the checks. If someone introduces an error in the calculation, the test should fail.

Of course, a single test does not validate an entire store. It does not cover taxes, discounts, currencies, returns, or payment errors.

What types of tests exist?

Unit tests: they check small units of code, such as a calculation function or a validation.

Integration tests: they verify that several pieces work together. For example, that a backend can save and retrieve information from a test database.

End-to-end tests: they run flows similar to those performed by a person, such as entering the website, registering, and completing a reservation.

Each type has costs and advantages. A unit test is usually fast and precise; an end-to-end test can cover more components, but it also takes longer and can fail for external reasons.

What is a regression?

A regression occurs when something that previously worked stops working after a change. Tests are especially valuable for preventing this type of error.

If you fix a bug, a good practice is to add a test that reproduces the problematic case. That way, if the same error appears again in the future, automation can detect it.

What does code coverage mean?

Coverage attempts to measure which parts of the code are executed during tests. It can be useful for discovering completely ignored areas.

But 100 % coverage does not mean 100 % security or absence of errors. You can run all the lines of a function without verifying that the results are correct for unexpected data.

What matters more is the quality of the scenarios: normal cases, boundaries, predictable failures, and operations involving permissions or money.

Where are tests run?

They can run on your computer, in a CI environment like GitHub Actions, or on an integration server. It is advisable to isolate test databases and not use real customer information unless necessary.

A test that deletes records should not accidentally run against the production database. Always check the environment variables and credentials used.

Common mistakes

Testing only the perfect case. You also need to check what happens if an API fails, an incorrect value arrives, or two people act at the same time.

Making fragile tests. If a test fails because an irrelevant text changed, it can generate too much noise and end up being ignored.

Not maintaining them. When the product changes deliberately, tests must be updated to reflect their new requirements.

Believing that a green check replaces reviewing production. Tests reduce risks, but you need logs, alerts, and the ability to revert changes.

How does it fit into ArduMaker?

In ArduMaker, a repository linked to a VPS is deployed with every push to the chosen branch (if automatic deployment is enabled), so tests must run before the code reaches that branch: on your computer or in a CI like GitHub Actions, over the pull request.

For a staging environment, you can link the same repository, with another branch, on another VPS, and verify there that backend, frontend, and database behave together before affecting real users; WordPress sites also have an integrated staging copy. We explain this in How to manage environments: development, staging, and production.

In summary: an automated test allows repeating important verifications. The better it represents the real risks of the project, the more value it adds.

Frequently asked questions

How many tests does a project need?

There is no correct number. Start with what would cause the most damage if it broke: payments, permissions, calculations, and the main flow of the application. A good sign is that every error that reached production ends up converted into a test.

Can tests be run directly in production?

For read-only verifications, such as checking that the website responds after a deployment, yes. But tests that create, modify, or delete data must run against a test database, never against the database of real customers.

Sources: Official pytest guide · pytest best practices · GitHub Actions explained.

What is an automated test and how to prevent a change from breaking your website?
  • testing
  • pytest
  • calidad de software
  • despliegues

Keep reading

All articles · VPS plans