1. Home
  2. Blog
  3. Software Testing

Software Testing

Software Testing Life Cycle (STLC): 6 Phases, Entry and Exit Criteria, Example

Testing is more than running test cases at the end of a project. Learn the six STLC phases, what each one needs and produces, how they apply to a real feature and how Agile teams adapt them.

9 min read
Software testing life cycle (STLC): six phases, entry and exit criteria, and an example

Key takeaways

  • The software testing life cycle is the sequence of activities used to plan, design, run and close testing.
  • The common model has six phases, from requirement analysis to test closure.
  • Entry and exit criteria define when a phase can start and when it is finished.
  • Agile teams keep the same activities but repeat them in small loops each sprint.

When a bug reaches production, the cause is often not that someone forgot to run a test. It is that a requirement was never questioned, the test data was wrong or nobody agreed what “done” meant. The software testing life cycle addresses those problems by giving testing a clear structure from the first requirement to the final report.

This guide explains each phase, then follows one illustrative feature through all of them: a login page that locks an account after five failed attempts. Sources do not fully agree on the number of phases. You will see models with seven or eight, but they mostly split the same work differently. We use the widely taught six-phase version.

What is the STLC?

The STLC is a defined series of testing activities carried out to confirm that software meets its requirements. Each phase has a goal, inputs and outputs, so that testing is planned and traceable rather than improvised at the end.

The benefits are practical. Testers get involved early, when defects are cheaper to fix. Effort goes to the highest risks. And when a manager asks “are we ready to release?”, the team can answer with evidence.

The six STLC phases at a glance

Phase Main goal Key output
1. Requirement analysis Understand what to test Questions, testable requirements, RTM
2. Test planning Decide how to test Test plan, estimates
3. Test case development Design the tests Test cases, scripts, test data
4. Environment setup Prepare where to test Ready environment, smoke test result
5. Test execution Run tests and log defects Results, bug reports
6. Test closure Evaluate and learn Closure report, lessons learned

Entry criteria are the conditions that must be true before a phase starts. Exit criteria are the conditions that must be true before it ends. They stop a team from, for example, running tests on a broken build and wasting a day.

Phase 1: Requirement analysis

Testers study requirements to find out what can be tested and what is unclear. This is often the cheapest place to prevent a bug, since a question costs far less than a production fix.

  • Entry: requirement documents or user stories are available.
  • Activities: identify functional and non-functional needs, ask questions, assess risk and decide what could be automated.
  • Exit: open questions are answered and the requirements traceability matrix (RTM) is started.
  • Deliverables: a list of testable requirements, and the RTM.

Login example. The story says “lock the account after five failed attempts”. A good tester asks: five in what period? How is it unlocked? Does a successful login reset the count? What message is shown? Each answer becomes something testable.

Phase 2: Test planning

The team decides the scope, approach, people, tools, schedule and risks. The test lead usually owns this phase.

  • Entry: analysed requirements and an initial risk assessment.
  • Activities: define scope, estimate effort, select tools, assign roles and set exit criteria for later phases.
  • Exit: the test plan is reviewed and approved.
  • Deliverables: the test plan and effort estimates.

Login example. In scope: lockout rules, reset and error messages on web and mobile. Out of scope: single sign-on, handled by another team. The biggest risk is locking out genuine users, so that gets the most attention. If you are unsure how a plan differs from a strategy, read test plan vs test strategy.

Phase 3: Test case development

This is where testers write the detailed test cases, automation scripts and test data.

  • Entry: an approved test plan and stable requirements.
  • Activities: write and review test cases, prepare data, script automated checks and update the RTM.
  • Exit: test cases and data are reviewed and ready.
  • Deliverables: test cases, scripts and test data.
ID Scenario Expected result
TC-01 4 failed attempts, then the correct password Login succeeds and the count resets
TC-02 5 failed attempts Account locks and a clear message appears
TC-03 Correct password on a locked account Login still refused
TC-04 Failed attempts on two browsers at once The count is shared and stays accurate
TC-05 Unlock with the reset link Login works and the count is cleared

Notice that TC-01 and TC-02 test either side of the limit, which comes straight from boundary value analysis. For more on writing these well, see how to write test cases.

Phase 4: Test environment setup

Tests need somewhere realistic to run: the right servers, data, accounts, browsers and network access. This phase often runs in parallel with phase 3, and it may be handled by developers or a DevOps team.

  • Entry: a test plan, an architecture overview and environment requirements.
  • Activities: set up hardware or containers, load data, configure access and install the build.
  • Exit: the environment is ready and a smoke test passes.
  • Deliverables: a working environment and a smoke test result.

Login example. Staging gets test accounts in known states, along with a shortened lockout timer so testers do not have to wait. A quick smoke test confirms that login loads at all before the full run starts. Containers help keep environments consistent, as shown in our Docker Compose tutorial.

Phase 5: Test execution

Testers run the planned tests, compare actual and expected results and report defects. Fixed bugs are retested, and related areas receive regression testing.

  • Entry: test cases are ready, the environment works and a build has been delivered.
  • Activities: run tests, record results, log defects, retest fixes and update the RTM.
  • Exit: planned tests are run, and defects are fixed or formally accepted.
  • Deliverables: test results and defect reports.

Login example. TC-04 fails: with two browsers, the counter only reaches four. The tester logs the bug with clear steps and evidence, as described in how to write a bug report. Once it is fixed, TC-04 is rerun, and related login checks go through the regression checklist.

Tip: Make exit criteria measurable, and agree on them in advance. “All critical tests pass and no high-severity bugs are open” is hard to argue with. “Testing looks good” is not a criterion.

Phase 6: Test closure

This phase is commonly skipped, which is a shame, since it is how a team improves. The team evaluates the cycle, archives its work and records what it learned.

  • Entry: execution is complete and the defect status is known.
  • Activities: check exit criteria, analyse defect trends, archive test assets and hold a retrospective.
  • Exit: the closure report is signed off.
  • Deliverables: the closure report and lessons learned.

Login example. The report shows that all five cases passed after one fix. The lesson is that concurrency was only tested late, so future features with counters get that scenario added during design.

STLC vs SDLC

The SDLC, or software development life cycle, covers building the whole product. The STLC is the part focused on testing, and runs alongside it.

Aspect SDLC STLC
Focus Building and delivering software Validating the software
Led by The whole product team Mainly QA and test engineers
Phases Requirements, design, build, test, deploy, maintain The six phases above
Output A working product Evidence of its quality

Requirement analysis in the SDLC feeds requirement analysis in the STLC, and development delivers builds into test execution. Testing does not have to wait until coding ends. Starting early is what people mean by “shift left”.

STLC in Agile and DevOps

The phases can sound like a long, one-way process, but they do not have to be. In Agile, the same activities shrink and repeat within each sprint, often in hours instead of weeks:

  • Requirement analysis happens in backlog refinement, through questions on the user story.
  • Planning happens in sprint planning, with lightweight notes in place of long documents.
  • Test design happens alongside coding, often as acceptance criteria and automated tests.
  • Environment setup is automated through containers and infrastructure as code.
  • Execution runs continuously in a CI/CD pipeline.
  • Closure becomes part of the sprint review and retrospective.

Keep what is useful and scale the paperwork to the risk. A small internal tool may need a short checklist, while a banking system may need formal sign-offs for regulatory reasons.

Common mistakes

  • Bringing testers in late. Bugs found in requirements are far cheaper than those found after release.
  • Vague exit criteria. Without them, deadlines make the decision for you.
  • Testing in a poor environment. Failures caused by bad data or configuration waste time and erode trust.
  • Skipping closure. The team then repeats the same mistakes in the next cycle.
  • Following it too rigidly. The STLC is a guide. Heavy documents do not automatically mean better quality.

Final thoughts

The software testing life cycle is simply a disciplined answer to six questions: what do we test, how, with which cases, where, what happened and what did we learn? Look at your next feature and check which of those questions your team usually skips. Fixing that one gap will likely give you the biggest gain.

Frequently asked questions

What are the 6 phases of the STLC?

They are requirement analysis, test planning, test case development, test environment setup, test execution and test closure. Some models split these into more steps.

What is the difference between STLC and SDLC?

The SDLC covers building the whole product, from requirements to maintenance. The STLC covers only testing activities, and runs alongside development.

What are entry and exit criteria?

Entry criteria are conditions required before a phase can start, such as a stable build. Exit criteria are conditions required to finish it, such as all critical tests passing.

What is an RTM in testing?

A requirements traceability matrix maps each requirement to its test cases. It shows whether every requirement is covered and helps you assess the impact of changes.

Is the STLC used in Agile?

Yes. Agile teams perform the same activities, but in shorter, repeated cycles within each sprint, with more automation and less formal documentation.

Keep learning

Work with Stack Quora

Need help with testing, WordPress or SEO?

We help teams ship better software and grow their sites. Tell us what you are working on and we will suggest a clear next step.

Keep reading

More guides on testing, AI & modern development

Enjoyed this article? Pick a topic and jump straight into our newest tutorials.

Artificial Intelligence

LLM Structured Output Explained: Getting Reliable JSON From AI Models

LLM structured output explained with validation we ran in Pydantic: JSON mode and schemas, constrained decoding, the ways model output…

Read article →
DevOps

SSH Keys Explained: How They Work, ssh-keygen, Ed25519 and Safe Habits

SSH keys explained with keys we generated: public vs private keys, ssh-keygen, Ed25519 vs RSA, fingerprints, passphrases, ssh-agent, authorized_keys, config…

Read article →
DevOps

HTTP Caching Explained: Cache-Control, ETag and 304 Responses, With a Live Test

HTTP caching explained with a small server we ran: Cache-Control directives, max-age, no-cache vs no-store, ETag revalidation and 304 responses,…

Read article →
Test Automation

API Contract Testing Explained: Catch Breaking Changes Before They Ship

API contract testing explained with a schema check we ran: what a contract is, consumer-driven contracts, Pact, OpenAPI, which changes…

Read article →
Software Testing

Risk-Based Testing Explained: Score Risks, Build a Matrix and Test What Matters

Risk-based testing explained step by step: identifying risks, scoring likelihood and impact, building a risk matrix, mapping risk to test…

Read article →
Databases & SQL

SQL Constraints Explained: NOT NULL, UNIQUE, CHECK and FOREIGN KEY, Tested

SQL constraints explained with tests we ran: NOT NULL, UNIQUE, CHECK, DEFAULT, PRIMARY and FOREIGN KEY, the NULL loopholes, SQLite's…

Read article →
Databases & SQL

SQL Date Functions Explained: Adding, Comparing and Grouping Dates Without Bugs

SQL date functions explained with queries we ran: adding intervals, month-end surprises, date differences, the BETWEEN trap, grouping by day,…

Read article →
Software Development

Python asyncio Explained: async, await, gather and TaskGroup With Real Timings

Python asyncio explained with code we timed: coroutines, await, gather, TaskGroup, error handling, timeouts, limiting concurrency and the blocking-call mistake…

Read article →
Software Development

Debounce vs Throttle in JavaScript: How They Work, When to Use Each, Tested

Debounce vs throttle in JavaScript explained with timings we measured in Node.js: how each works, simple implementations, leading and trailing…

Read article →
Software Development

Python Context Managers Explained: The with Statement, contextlib and Real Uses

Python context managers explained with code we ran: how with works, __enter__ and __exit__, contextlib.contextmanager, suppress, ExitStack, database transactions and…

Read article →
Artificial Intelligence

LLM Temperature and Top-p Explained: How AI Models Choose Their Next Word

LLM temperature and top-p explained with a simulation we ran: how probabilities are reshaped, what top-p keeps, recommended settings by…

Read article →
DevOps

YAML Explained: Syntax, the Norway Problem and Other Traps We Tested

YAML explained with a parser test: basic syntax, lists and maps, the Norway problem, versions turning into floats, octal zip…

Read article →
DevOps

Cron Jobs Explained: Syntax, Real Schedules and the Mistakes That Break Them

Cron jobs explained with schedules we verified: the five fields, operators, real examples, the day-of-month OR day-of-week trap, environment problems,…

Read article →
Software Testing

Bug Life Cycle in Software Testing: Every Status, Who Owns It and Common Mistakes

The bug life cycle explained: every defect status from New to Closed, who owns each step, rejected, deferred and reopened…

Read article →
Test Automation

Property-Based Testing in Python: Hypothesis Finds the Bugs Your Examples Miss

Property-based testing explained with Hypothesis tests we ran: properties vs examples, strategies, shrinking, the real bugs it found in our…

Read article →
Databases & SQL

SQL Pagination Explained: OFFSET vs Keyset, With a Million-Row Test

SQL pagination explained with a million-row test we ran: LIMIT and OFFSET, why deep pages get slow, keyset (cursor) pagination,…

Read article →
Databases & SQL

SQL EXISTS vs IN: Differences, the NOT IN NULL Trap and Performance

SQL EXISTS vs IN explained with queries we ran: how each works, why NOT IN returns no rows when a…

Read article →
Software Development

Python Logging Explained: Levels, Handlers, Formatters and Mistakes to Avoid

Python logging explained with code we ran: levels, basicConfig quirks, named loggers, handlers and formatters, logger.exception, lazy formatting, duplicate logs…

Read article →
Software Development

JavaScript Map vs Object: Key Differences, Pitfalls and a Benchmark

JavaScript Map vs Object explained with code we ran in Node.js: key types, ordering, the prototype trap, JSON, size, WeakMap…

Read article →
Software Development

Python Type Hints Explained: Annotations, mypy and the Errors It Catches

Python type hints explained with a real mypy run: basic annotations, Optional and unions, TypedDict, Literal, Protocol, generics, Callable, strict…

Read article →
Artificial Intelligence

LLM Tokens Explained: How AI Models Read Text, Count Costs and Fill Context Windows

LLM tokens explained with a tokenizer we ran: how text is split, why counts differ by language and tokenizer, context…

Read article →
DevOps

Semantic Versioning Explained: MAJOR.MINOR.PATCH, Ranges and Release Rules

Semantic versioning explained with code we ran: MAJOR.MINOR.PATCH rules, pre-releases, correct version sorting, caret and tilde ranges, 0.x versions, lockfiles…

Read article →
DevOps

Git Reset vs Revert: How to Undo Commits Safely, With a Tested Example

Git reset vs revert explained with a repository we built: soft, mixed and hard reset, revert commits, reverting merges, recovering…

Read article →
Software Testing

The Test Pyramid Explained: Layers, Ratios and When to Break the Shape

The test pyramid explained: unit, integration and end-to-end layers, sensible ratios, the ice cream cone anti-pattern, the testing trophy and…

Read article →
Test Automation

pytest Fixtures Explained: Scope, yield Teardown, conftest.py and Factories

pytest fixtures explained with a suite we ran: how fixtures work, scopes, yield teardown, conftest.py, factory fixtures, parametrized fixtures, built-ins…

Read article →
Databases & SQL

SQL Upsert Explained: INSERT ON CONFLICT, MERGE and the REPLACE Trap

SQL upsert explained with queries we ran: INSERT ON CONFLICT DO UPDATE and DO NOTHING, the excluded row, conditional updates,…

Read article →
Databases & SQL

SQL LIKE Operator Explained: Wildcards, Case Sensitivity and Performance

The SQL LIKE operator explained with queries we ran: % and _ wildcards, escaping, NOT LIKE and NULL, case sensitivity…

Read article →
Artificial Intelligence

AI Hallucinations Explained: Why Language Models Make Things Up and How to Reduce It

AI hallucinations explained: what they are, why language models produce them, common types, how to reduce them with grounding and…

Read article →
Test Automation

Mocking in Python: unittest.mock, patch and the Mistakes That Make Tests Lie

Mocking in Python with unittest.mock, tested: Mock and return_value, side_effect, patching where a name is used, spec and autospec, mocking…

Read article →
Software Testing

Code Coverage Explained: Line vs Branch Coverage and What 100% Really Means

Code coverage explained with a real coverage.py run: line, branch and condition coverage, reading a report, why 100% coverage can…

Read article →
Artificial Intelligence

What Are AI Agents? How They Work, With a Simple Agent Loop You Can Run

What are AI agents? A plain guide to the agent loop, tools, memory and guardrails, with a small Python loop…

Read article →
Test Automation

TDD vs BDD: Key Differences, One Feature Built Both Ways and When to Use Each

TDD vs BDD explained with one discount feature built both ways: red-green-refactor with code we ran, Given-When-Then scenarios, tools, trade-offs…

Read article →
Software Testing

User Acceptance Testing (UAT): Process, Checklist and Real Examples

User acceptance testing explained: who runs it, how it differs from QA, a seven-step process, a UAT test case template,…

Read article →
Artificial Intelligence

What Are Embeddings? Vectors and Cosine Similarity Explained Simply

What are embeddings? A plain-language guide to vectors, cosine similarity and semantic search, with a small example we ran, common…

Read article →
Test Automation

Flaky Tests: What Causes Them and How to Fix Them for Good

Flaky tests explained with demos we ran: the main causes, how to confirm and diagnose one, proper fixes for timing,…

Read article →
Software Testing

Load Testing vs Stress Testing: Differences, Metrics and k6 Examples

Load testing vs stress testing explained: what each proves, spike and soak tests, the metrics that matter, why averages mislead,…

Read article →