QA AND TEST AUTOMATION · PART 0 · INTRODUCTION AND CAREERS · PROCESS · 5 OF 112

Software Testing Life Cycle (STLC): Phases Explained

The six phases of the software testing life cycle, each with its entry criteria, work and deliverables: requirement analysis, test planning, test design with a traceability matrix, environment setup, execution with the defect loop, and closure. Walked through on a real ShopRung coupon rule, with the ISTQB names and how it all shrinks to fit an Agile sprint.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 67
  63. 68
  64. 69
  65. 70
  66. 71
  67. 72
  68. 73
  69. 74
  70. 75
  71. 76
  72. 77
  73. 78
  74. 79
  75. 80
  76. 81
  77. 82
  78. 83
  79. 84
  80. 85
  81. 86
  82. 87
  83. 88
  84. 89
  85. 90
  86. 91
  87. 92
  88. 93
  89. 94
  90. 95
  91. 96
  92. 97
  93. 98
  94. 99
  95. 100
  96. 101
  97. 102
  98. 103
  99. 104
  100. 105
  101. 106
  102. 107
  103. 108
  104. 109
  105. 110
  106. 111
  107. 112
1 / 18

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Analyse
  • plan by risk
  • design with traceability
  • set up and smoke
  • execute, retest, regress
  • close and learn

Notes

The idea

The software testing life cycle, or STLC, is the ordered set of phases that testing work moves through. Requirement analysis, test planning, test design, environment setup, test execution, and test closure, with defects looping back along the way. Each phase has entry criteria, which say when you are ready to start, activities, deliverables, and exit criteria, which say when it is done enough. The SDLC builds the product. The STLC runs alongside it and tests it.

STLC, in one line
  • the ordered phases of testing
  • work, each with: entry criteria: ready to start? activities: the work itself deliverables: what it produces exit criteria: done enough?
  • the SDLC builds the product;
  • the STLC tests it, alongside

Two vocabularies

You will meet two vocabularies. Many job ads and interviews use the six phases in this episode. The ISTQB syllabus, the common language of testing certificates, uses slightly different names: test analysis, test design, test implementation, test execution and test completion, plus planning, and monitoring and control running the whole time. The work is the same. Use whichever words your team uses, and know how they map, because interviewers mix them.

Same work, two sets of names
common STLC        ISTQB v4.0
requirement        test analysis
  analysis
test planning      test planning
test design        test design
environment setup  test implementation
test execution     test execution
test closure       test completion

ISTQB adds monitoring and
control, running all the way

Requirement analysis

Phase one, requirement analysis. You read the requirements and decide what can be tested. Take ShopRung rule price three: SAVE10 gives ten percent off when the subtotal is fifty dollars or more. It is testable, because the number is clear. You still ask questions. Does exactly fifty count? Yes, or more. Is free shipping judged before or after the discount? Rule price nine says after. The outputs are answered questions, a list of testable rules, and ideas about what to automate.

Reading PRICE-3 and PRICE-9
  • rule: SAVE10 = 10% off when subtotal is $50.00 or more testable? yes: clear number
  • questions: exactly $50.00 counts? yes free shipping before or after discount? after
  • out: questions, testable rules, what to automate

Test planning

Phase two, test planning. The test plan answers practical questions. What is in scope, and what is deliberately left out? Which test levels and techniques will we use, and what is manual versus automated? Which environments and data do we need? Who does what, and by when? What could go wrong? And when do we start and stop? In an Agile team this is often a page or two. The thinking matters far more than the template.

A test plan covers
  • scope: in and out approach: levels, techniques, manual vs automated
  • environments and test data
  • roles and schedule
  • risks and how to handle them
  • entry and exit criteria
  • a page or two is often enough

Plan by risk

You never have time to test everything equally, so plan by risk. Risk is roughly how likely something is to break, times how bad it would be. In ShopRung, coupons and totals touch money, so they get deep testing. Rule order seven, a customer must never see another customer's order, is a privacy risk, so it is high too. Search wording matters less. Money and privacy go first and deepest. This one habit makes a plan far better.

Risk = likelihood × impact
area               risk    depth
coupons, totals     high   deep
  (PRICE-1..10)
order privacy       high   deep
  (ORD-7)
cart quantity       med    normal
search wording      low    light

money and privacy first

Test design

Phase three, test design. Each rule becomes test conditions, then concrete test cases with data, steps and expected results. Here is one for rule price three. Log in with an empty cart. Add two Green Build Mugs at fifteen dollars and one Ship It T-shirt at twenty. Apply the coupon in lower case. Expect a subtotal of fifty, a discount of five, shipping of four ninety nine, because forty five is below seventy five, and a total of forty nine ninety nine.

TC-PRICE3-01
req:   PRICE-3
pre:   logged in, cart empty
steps: 1 add 2 x Green Build Mug
       2 add 1 x Ship It T-Shirt
       3 apply coupon "save10"
expect: subtotal $50.00
        discount $5.00
        shipping $4.99
        total    $49.99

Traceability

Design also produces a requirements traceability matrix, or RTM. It is a simple table that links each requirement to the test cases that check it, and their status. It answers two questions a manager will ask. Which rules have no tests at all? Here, search speed, rule search five, is a gap. And which rules are at risk right now? Price three has a failing test. A spreadsheet or a test management tool both work.

Requirements traceability
req      test cases       status
PRICE-3  TC-PRICE3-01..04  3 pass
                           1 fail
PRICE-9  TC-PRICE9-01..03  pass
ORD-7    TC-ORD7-01        pass
SRCH-5   none yet          GAP

gaps show what is untested;
fails show what is at risk

Environment setup

Phase four, environment setup. You need the right build, running, with known data. In ShopRung you start the app, call the reset endpoint so products and coupons are back to a known state, and check the health endpoint reports up, with the version you expect. Then a quick smoke test: log in, add to the cart, place one order. If the smoke test fails, stop. Testing a broken build wastes everyone's time.

ShopRung test environment
start the build under test
POST /api/test/reset
  -> known products, coupons
GET /api/health
  -> {"status": "UP",
      "version": "1.0.0"}
smoke: log in, add to cart,
  place one order

smoke fails = stop, do not test

Test execution

Phase five, test execution. Run each case, compare the expected result with the actual one, and record the result with evidence. Turn on ShopRung's coupon boundary bug and run our test. Expected, a five dollar discount. Actual, a four hundred error saying the coupon needs a subtotal of at least fifty dollars. That is a fail, so you raise a defect. Each case ends as passed, failed, blocked by something else, or not run.

Run with coupon-boundary on
TC-PRICE3-01
expected: discount $5.00
actual:   400 "This coupon needs
          a subtotal of at least
          $50.00"
result:   FAIL -> defect raised

results: pass, fail, blocked,
  not run

The defect loop

Execution and defects form a loop. You report the defect, the developer fixes it, and a new build arrives. Then two different things happen. Confirmation testing, also called retesting, runs the failed case again to prove the fix works. Regression testing re-runs related cases, such as the other coupon and shipping rules, to check the fix did not break something nearby. Only then is the defect closed. Interviewers often ask for exactly this difference.

After a fix
  • confirmation testing (retest): run the failed case again on the new build
  • regression testing: re-run the related cases, PRICE-4, PRICE-9, totals, to check nothing else broke
  • then close the defect

Entry and exit criteria

Entry and exit criteria stop arguments before they start. Entry criteria for execution might be: the build is deployed, the smoke test passes, the cases are reviewed and the data is reset. Exit criteria might be: every high risk case has run, there are no open critical defects, and the product owner has accepted any known issues. Notice that exit criteria are not, every test passed. They say when the remaining risk is understood and accepted.

Examples
  • entry to execution: build deployed, smoke passes test cases reviewed test data reset
  • exit from execution: all high-risk cases run no open critical defects known issues accepted by the product owner

Test closure

Phase six, test closure, which ISTQB calls test completion. You write a short report: what was tested and what was not, the results, the open defects and their risk, where you changed the plan, and a clear recommendation. You keep the useful testware, such as cases, data and scripts, so the next release starts ahead. And you note lessons learned. A closure report a manager can read in two minutes is worth more than a long one.

Test completion report
  • what was tested, and not results: run, pass, fail, blocked
  • open defects and their risk
  • deviations from the plan
  • lessons learned
  • testware kept: cases, data, scripts, environment notes
  • recommendation: ship or not

STLC in a sprint

Does the STLC only fit Waterfall? No. In an Agile team the same phases happen for every story, just in hours instead of weeks. Story refinement is requirement analysis. Sprint planning covers test planning. Acceptance criteria and test ideas are written before coding, which is design. The pipeline and test environment handle setup. You execute as the story lands, and the sprint review and retrospective act as closure. Same thinking, smaller and faster.

Per story, per sprint
  • refinement → analysis
  • sprint planning → planning
  • before coding → design, acceptance criteria
  • CI and test env → setup
  • as the story lands → execute
  • review and retro → closure
  • same phases, smaller, faster

Rules of thumb

A few rules of thumb. Start analysis as soon as a requirement is written, not when the code arrives. Plan by risk, not by how many pages the plan has. Make every test trace back to a rule, so gaps are visible. Reset test data before each run, so results can be trusted. Always smoke test a new build before deeper testing. And define done as risk understood and accepted, not as one hundred percent passed.

Rules of thumb
  • start analysis when the requirement is written, not when the code is
  • plan by risk, not by page
  • every test traces to a rule
  • reset data before each run
  • smoke test before testing
  • exit = risk understood, not "100% passed"

Common mistakes

Common mistakes. Waiting for the build before doing any testing work, which throws away the cheapest phase. Writing a long plan that nobody reads. Having no traceability, so nobody can say what is untested. Testing on dirty, shared data, so failures cannot be reproduced. Retesting the fix but skipping regression, which lets a fix break its neighbours. And skipping closure, so the same lessons are learned again and again.

Common mistakes
  • starting to test only once the build arrives
  • a long plan nobody reads
  • no traceability: cannot say what is untested
  • testing on dirty, shared data
  • retesting the fix but skipping regression
  • no closure: lessons lost

Say it like this

Interviewers ask, explain the STLC. Try this. It has six phases. I analyse the requirements and ask questions early. I plan by risk. I design test cases and link them to requirements in a traceability matrix. I set up a known environment and smoke test it. I execute, raise defects, and after each fix I retest and run regression. Then I close with a short report and lessons. In Agile, the same cycle repeats for every story.

In the interview
  • "Six phases: analyse the requirements, plan by risk, design cases with an RTM, set up a known environment and smoke test, execute with a defect loop of retest and regression, then close with a report. In Agile it repeats per story."

Interview questions

Q1What is the STLC and what are its phases?

The software testing life cycle is the ordered set of testing activities: requirement analysis, test planning, test design, environment setup, test execution and test closure. Each phase has entry criteria, activities, deliverables and exit criteria.

Q2What is the difference between the SDLC and the STLC?

The SDLC covers building the whole product, from requirements to operation. The STLC covers only the testing work, and runs alongside the SDLC, starting as soon as requirements exist rather than after coding.

Q3What are entry and exit criteria? Give an example.

Agreed conditions for starting and finishing a phase. Entry to execution: build deployed, smoke test passed, test data reset. Exit: all high-risk cases run, no open critical defects, and known issues accepted by the product owner.

Q4What is a requirements traceability matrix and why use one?

A table linking each requirement to the test cases that cover it and their results. It shows untested requirements (gaps), which requirements are currently failing, and what to re-run when a requirement changes.

Q5What goes into a test plan?

Scope in and out, the test approach (levels, techniques, manual versus automated), environments and data, roles and schedule, risks and mitigations, and entry and exit criteria. In Agile teams it is usually short and lives with the team.

Q6What is the difference between retesting and regression testing?

Retesting (confirmation testing) re-runs the failed test on the fixed build to prove the defect is gone. Regression testing re-runs related tests to check the change did not break anything that used to work.

Q7The build arrives and the smoke test fails. What do you do?

Stop deeper testing, report the smoke failure with evidence straight away, and reject or roll back the build. Testing a build that fails basic checks wastes time and produces results nobody can trust.

Q8How does the STLC work in an Agile team?

The same phases happen for each story in a much shorter cycle: analysis in refinement, planning in sprint planning, design as acceptance criteria before coding, setup through CI and test environments, execution as the story lands, and closure in the review and retrospective.