What Is Software Testing? Definition, Types, Levels and Process
What is software testing? A clear definition, the four testing levels, the main test types, manual vs automated testing, and real test code examples.
- Written by
- Yuvan Sundrani
- Read time
- 8 min read
- Published

Software testing is the process of evaluating a software application, and the requirements and designs behind it, to find defects and confirm that it behaves as specified and serves its users' needs. In practice, that means running code against defined expectations and reporting every gap between intended and actual behaviour.
Most teams first meet testing as a gate at the end of a sprint: code goes in, a pass or fail comes out. That view explains why so many defects reach production, because a gate checks only what someone thought to check, at the moment they checked it. Effective software testing works more like a feedback loop that runs from the first requirements review to monitoring in production.
This guide covers why testing carries real economic weight, the four testing levels, the main test types, how manual and automated testing divide the work, and what a working test looks like in code.
Key Takeaways
- A 2002 NIST study put the annual cost of gaps in software testing infrastructure to the US economy at $59.5 billion.
- The four classic testing levels are unit, integration, system and acceptance testing, each owned by a different role.
- Test types describe what quality a test checks, from functional correctness to performance, security and usability.
- Automate checks you run often with stable expected results, and keep human testers on exploratory and usability work.
- Frameworks such as pytest and Playwright Test turn repeatable checks into code that runs on every commit.
Why Software Testing Matters
The cost argument for testing has a well documented anchor. In June 2002, the US National Institute of Standards and Technology published The Economic Impacts of Inadequate Infrastructure for Software Testing. The report put the annual cost of gaps in testing infrastructure to the US economy at $59.5 billion, and estimated that feasible improvements could deliver an annual benefit of $22.2 billion.
The same report noted that over half of software bugs were found "downstream" in development, and that finding and correcting defects represented approximately 80 percent of development costs. A defect caught in a requirements review costs a conversation. The same defect caught by a customer costs a support ticket, a hotfix, a release and some measure of trust.
Beyond cost, testing gives a team three things:
- Lower risk in high-impact areas such as payments, sign-in and data storage.
- Evidence for release decisions, so a product owner ships on facts rather than hope.
- Confidence to change code, because a reliable regression suite surfaces a broken behaviour within minutes.
Errors, Defects and Failures
Precise vocabulary leads to clearer bug reports. Three related terms describe how a problem travels from a person's head to a user's screen:
| Term | Meaning | Example |
|---|---|---|
| Error | A human mistake that introduces a defect | A developer reads "10 percent discount" as 1 percent |
| Defect (bug) | A flaw in code or a requirement | The function multiplies by 0.01 where it should use 0.10 |
| Failure | Visible wrong behaviour at runtime | A customer sees $198 at checkout where $180 was expected |
A defect can sit quietly in code for months until a specific input triggers a failure. Testing exposes failures, and debugging traces each one back to its defect.
The Four Levels of Software Testing
A testing level is a group of test activities aimed at software at one stage of development. Most teams work with four:
| Level | What it checks | Typical owner | Example tools |
|---|---|---|---|
| Unit testing | One function, class or module in isolation | Developers | pytest, JUnit, Jest |
| Integration testing | How components and services work together | Developers, QA engineers | Test frameworks plus API tests |
| System testing | The complete application against its requirements | QA engineers | Playwright, Selenium, Appium |
| Acceptance testing | Fitness for real users and the business | Product owners, users | UAT sessions, BDD scenarios |
Unit tests run in milliseconds and point at the exact function at fault, so teams write the most of them. Integration testingthen checks the seams between parts. System tests exercise full user journeys end to end, which makes them slower and more fragile, and acceptance testing is the final gate before release. The testing pyramid explains how to balance all four.
Types of Software Testing
Levels describe where a test operates. Types describe what quality it evaluates, and most types apply at every level.
| Test type | Question it answers | Example |
|---|---|---|
| Functional | Does each feature produce the correct output? | Login succeeds with valid credentials |
| Performance | Does it stay fast under load? | Checkout responds in 300 ms with 5,000 users |
| Security | Does it resist attacks and protect data? | Session tokens expire after sign-out |
| Usability | Can real users reach their goals easily? | New users finish onboarding in 2 minutes |
| Compatibility | Does it work across browsers and devices? | Checkout passes on Chrome, Safari, Android and iOS |
| Regression | Did a change break something that used to work? | The full order suite passes after a redesign |
Two techniques shape how testers design cases for any of these types. Black-box testing works from the specification alone, using methods such as boundary value analysis. White-box testing works from the code structure and measures statement and branch coverage.
Manual vs Automated Testing
Every test starts as an idea a person writes down. The question is whether a person or a script runs it afterwards.
| Dimension | Manual testing | Automated testing |
|---|---|---|
| Best for | Exploratory, usability and one-off checks | Regression, smoke and data-driven checks |
| Speed per run | Minutes to hours | Seconds to minutes |
| Upfront cost | Low | Higher, since scripts take time to write |
| Cost per repeat run | Constant, each run needs a person | Close to zero once stable |
| Judgement | Strong, a tester spots anything odd | Limited to the assertions in the script |
A useful rule: automate a test when you will run it many times and its expected result is stable. Keep it manual when it depends on human judgement, such as whether an onboarding flow feels clear.
What a Software Test Looks Like in Code
Automated tests are ordinary code that calls the system and asserts on the result. Here are the two ends of the pyramid.
A unit test with pytest
The pytest documentation shows that a plain Python assert is enough to check an expectation, and that pytest automatically collects files named test_*.py.
# test_pricing.pypython
import pytest
from pricing import apply_discount
def test_ten_percent_discount():
assert apply_discount(200.0, percent=10) == 180.0
def test_discount_above_100_percent_raises_error():
with pytest.raises(ValueError):
apply_discount(200.0, percent=120)
If the 1 percent misreading from the earlier example ever shipped, the first test would fail at once and name the exact function at fault.
An end-to-end test with Playwright
Playwright Test is an end-to-end framework that runs on Chromium, WebKit and Firefox.
// tests/cart.spec.tstypescript
import { test, expect } from '@playwright/test';
test('shopper can add a product to the cart', async ({ page }) => {
await page.goto('https://shop.example.com/products/blue-mug');
await page.getByRole('button', { name: 'Add to cart' }).click();
await expect(page.getByTestId('cart-count')).toHaveText('1');
});
Before each click, Playwright auto-waits until the element is visible, stable, able to receive events and enabled. This one test still touches the web server, the product page, the cart service and the browser together, which is why end-to-end suites need more upkeep than unit suites. Teams that ship on mobile and web often want one flow across every surface, which is what our platform is built for.
The Software Testing Process
Testing follows a repeatable cycle, whether a team works in sprints or long phases:
- Plan the scope, risks, environments and exit criteria.
- Analyse requirements and user stories to decide what to test.
- Design concrete test cases with inputs and expected results.
- Prepare test data, environments and automated scripts.
- Execute the tests and log every difference as a defect.
- Close the cycle with a results summary and lessons learned.
Our article on the six phases of the STLC maps each phase to its entry and exit criteria.
Conclusion
Software testing is a feedback loop that runs across the whole lifecycle, from requirement reviews to production. The NIST figures show why it matters: defects found late cost far more than defects found early.
A practical starting point looks like this. Write fast unit tests for your business logic, add integration tests at service boundaries, and automate a small set of end-to-end tests for the journeys that earn you money. Keep skilled testers on exploration and usability, where human judgement wins. Then review the suite every release, retiring tests that have stopped earning their place and adding tests where defects cluster.
Teams that master these fundamentals get far more value from every tool they adopt, whether that is pytest, Playwright or an AI testing agent.
FAQs
What is software testing in simple words?
Checking that software does what it should, by comparing its actual behaviour with the expected behaviour.
What are the main types of software testing?
Functional, performance, security, usability, compatibility and regression testing, each checking a different quality of the software.
What are the four levels of software testing?
Unit, integration, system and acceptance testing, moving from single functions up to the complete product.
What is the difference between manual and automated testing?
A person runs manual tests and judges results, while scripts run automated tests and check coded assertions.
Is QA the same as software testing?
QA improves the process that builds software, while testing evaluates the product itself for defects.
Which tools are used for software testing?
Common choices include pytest and JUnit for unit tests, Playwright and Selenium for web, and Appium for mobile.
.png)