Test Automation
- In Turkish
- Test Otomasyonu
In short
Test automation is using code to run tests and check their results, so the same checks repeat quickly and consistently on every change instead of by hand.
What is test automation?
An automated test sets up a situation, performs actions and asserts the outcome, then reports pass or fail. Unit tests call functions directly, integration tests check pieces working together, and end-to-end tests drive a real browser or app. Frameworks such as JUnit, pytest, Jest, Playwright, Cypress and Selenium provide the runners, assertions and reports.
The real payoff comes from running them constantly. A CI pipeline runs the suite on every push and pull request, so a change that breaks something is caught within minutes, while the author still remembers the code. That safety net is what makes refactoring, frequent releases and continuous deployment possible.
A healthy suite follows the test pyramid: many fast unit tests, fewer integration tests and a small number of end-to-end tests for the most important user journeys. Tests must be reliable to be trusted, so flaky tests that fail randomly should be fixed or removed quickly, and test code deserves the same care as production code.
A common misconception is that everything should be automated. Automation is best for checks that are repeated often and have clear expected results. Exploring a new feature, judging usability and testing something that changes every day are often better done by people, and an automated test that is never maintained becomes a burden rather than a safety net.
Key takeaways
- Test automation runs tests and checks results with code.
- Unit, integration and end-to-end tests can all be automated.
- Running the suite in CI catches regressions within minutes.
- The test pyramid favors many fast tests and few slow ones.
- Automate repeatable checks; explore and judge usability by hand.
Example
# .github/workflows/test.yml
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm test # unit and integration tests
- run: npx playwright install --with-deps chromium
- run: npx playwright test # end-to-end tests in a real browserReaders ask
What should be automated first?
Tests for the most important and most frequently changed parts of the system, and checks that are run often, such as regression tests for core features. Fast unit tests usually give the best return.
Does test automation replace manual testing?
No. It handles repetitive checks with known expected results. Exploratory testing, usability judgments and investigating unexpected behavior still need people.
What is an SDET?
A software development engineer in test: an engineer who writes automated tests, test frameworks and tooling, combining development and testing skills.
See also
- Unit TestTesting & Quality, p. 35A unit test is a small, automated check that verifies one function, method, or class behaves correctly in isolation from the rest of the program.
- End-to-End TestTesting & Quality, p. 8An end-to-end test is an automated test that runs a complete user journey through the whole application, from the user interface to the database and back.
- CI/CDDevOps & Cloud, p. 9CI/CD is a set of automated practices that build, test, and release code changes frequently, so software can be delivered to users quickly and safely.
- Test PyramidTesting & Quality, p. 32The test pyramid is a model for balancing automated tests: many fast unit tests, fewer integration tests, and only a few slow end-to-end tests at the top.
- Flaky TestTesting & Quality, p. 10A flaky test is an automated test that sometimes passes and sometimes fails without any change to the code, which makes its results hard to trust.
- Regression TestingTesting & Quality, p. 22Regression testing is the practice of re-running existing tests after a code change to make sure that features which used to work have not broken.
Spotted a mistake or something missing on this page?Suggest an edit