What is an automated test and how to prevent a change from breaking your website?
Published on 2026-10-20 by frfrand
Pruebas automatizadas explicadas: tests unitarios, integración y end-to-end, ejemplos con Python, cobertura y errores comunes.

An automated test is a check that runs a program to verify if a part of the software continues behaving as expected. It serves to discover errors in a repeatable way, especially when the project changes frequently.
Imagine you have a website to book appointments. Today a person can choose date and time. Tomorrow you modify the discount system and, without realizing it, appointments start allowing duplicate reservations. 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 problems. But repeating twenty actions after each change is slow and easy to forget.
An automated test follows reproducible instructions. It can run every time you push code and communicate 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 verify 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 accessing 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 execute all lines of a function without verifying that the results are correct for unexpected data.
Quality of scenarios matters more: normal cases, boundaries, predictable failures, and operations involving permissions or money.
Where are tests executed?
They can run on your computer, in a CI environment such as 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 it fits into ArduMaker?
In projects deployed on VPSs managed with ArduMaker, it is advisable to run tests before each major deployment. You can also use staging environments to verify that backend, frontend, and database behave together before affecting real users.
In summary: an automated test allows repeating important verifications. The better it represents the real risks of the project, the more value it adds.
Sources: Official pytest guide · pytest best practices · GitHub Actions explained.
