QA AND TEST AUTOMATION · PART 1 · MANUAL TESTING, PROPERLY · PRACTICE · 15 OF 112

Types of Software Testing: Smoke, Sanity, Regression

The testing vocabulary you hear every day, sorted so it makes sense: test levels (unit, integration, system, acceptance), functional and non-functional types, and testing after changes (smoke, sanity, confirmation, regression). With UAT, alpha and beta, black, white and grey box, and when a team runs each one on a ShopRung release.

  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 / 15

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

Key takeaways

  • Levels: unit to acceptance
  • functional and non-functional
  • smoke, sanity, confirmation, regression
  • black, white, grey box

Notes

The problem

Lists of fifty testing types confuse more than they teach, because the names answer different questions. Some describe the level: how big is the thing under test, from one function to the whole system. Some describe the type: which quality are we checking, like function, speed or security. Some describe the trigger: why are we testing right now, like a new build or a bug fix. Ask those three questions and the vocabulary falls into place.

Sort by three questions
  1. LEVEL: how big is the thing under test? unit → integration → system → acceptance
  2. TYPE: which quality? functional, performance, security, usability ...
  3. TRIGGER: why now? smoke, sanity, confirmation, regression

Test levels

Test levels go from small to big. A unit test checks one function alone, like the ShopRung discount function giving five hundred and five cents for a fifty dollar forty five cart. Integration testing checks that parts work together, like the API saving an order in the database. System testing checks the whole application end to end. Acceptance testing asks whether it meets the real business need. Developers own most unit tests. Testers live mostly at system level.

Levels in ShopRung
  • unit discount(5045) = 505 cents
  • integration API saves the order in the DB
  • system browse → cart → coupon → order
  • acceptance does checkout meet the business need? (UAT)

Integration styles

There are several ways to integrate. Big bang joins everything at once and then tests, which makes failures hard to locate. Top down starts at the user interface and replaces lower parts with stubs. Bottom up starts at the database and works upwards. In modern microservice systems, teams add contract tests, where each service checks the API it agreed with its neighbours. You will build one in Part four. Interviewers like to hear you know the trade offs.

Integration approaches
  • big bang: join everything, then test (hard to locate failures)
  • top-down: start at the UI, stub the lower parts
  • bottom-up: start at the database, drivers call up contract tests: each service checks the agreed API (Part 4)

Acceptance

Acceptance testing has a few flavours. User acceptance testing, or UAT, is business users checking the acceptance criteria on a near final build. Alpha testing is people inside the company using it before release. Beta testing gives it to a group of real customers early. Operational acceptance checks things like backups, monitoring and restore. And contract or regulatory acceptance checks what a contract or the law requires.

Acceptance testing
  • UAT: business users check the acceptance criteria
  • alpha: users test inside the company, before release
  • beta: a group of real customers try it early
  • operational acceptance: backups, monitoring, restore
  • contract / regulatory: rules the law requires

Functional types

Now the second question: which quality? Functional testing checks what the system does against its requirements. Does save ten work from fifty dollars? Do orders move through the right states? Is search case insensitive? All the design techniques you have learned so far, partitions, boundaries, decision tables and states, are mostly used for functional testing. It is the bulk of a tester's day.

Functional testing
  • checks WHAT the system does
  • against the requirements
  • ShopRung examples: SAVE10 from $50.00 (PRICE-3) order states (ORD-4) search not case-sensitive
  • techniques: partitions, boundaries, tables, states

Non-functional types

Non functional testing checks how well the system does its job. Performance: search returns in under a second, which is rule search five. Load and stress: many users at once. Security: Bob must not see Alice's order. Usability: messages say how to fix the problem. Accessibility: every field has a label. Compatibility: it works on the main browsers. Each has its own part later in this track, because each needs its own tools.

Non-functional testing
  • performance search < 1 s (SRCH-5)
  • load, stress many users
  • security ORD-7: no peeking
  • usability clear messages (NF-3)
  • accessibility labels (NF-2)
  • compatibility browsers (NF-1)
  • reliability, recovery

Smoke testing

The third question: why test right now? A smoke test runs on every new build and answers one thing: is this build stable enough to test at all? It is wide and shallow. For ShopRung: the app starts and the health check says up, products load, Alice can log in, add to cart and place an order. Fifteen minutes, usually automated. If smoke fails, the build goes back, and nobody wastes a day testing a broken build.

Smoke test
  • when: every new build
  • goal: is it worth testing?
  • breadth, not depth
  • ShopRung smoke set: app starts, /api/health UP products list loads alice can log in add to cart, place order
  • 15 minutes, mostly automated

Sanity testing

A sanity test is narrow. After a small fix or change, you quickly check that the changed area behaves sensibly before deeper testing. The coupon fix went in, so does save ten now work at fifty dollars, and do the totals look right? Smoke is wide and shallow across the whole app. Sanity is narrow, focused on one change. Honestly, many teams use the two words loosely, so in a new job, ask what your team means by them.

Smoke vs sanity
smoke                sanity
whole app            one area
wide, shallow        narrow
every new build      after a
                     small fix
"can we test?"       "is this
                     change sane?"

teams use the words loosely:
ask what they mean

Regression

After a bug fix, two kinds of testing follow. Confirmation testing, or re testing, runs the failed case again to confirm the bug is gone. Regression testing runs a wider set of tests to check the fix broke nothing else. A change to rounding could shift a total under the free shipping line, so shipping and order totals need checking too. Regression suites grow with every release, which is exactly why they are the first thing teams automate.

After a bug fix
  • confirmation (re-testing): run the failed case again → the bug is gone
  • regression testing: run the wider suite → nothing else broke
  • fix to rounding (PRICE-6) could break shipping (PRICE-9) or order totals

Box approaches

One more pair of terms. Black box testing designs tests from the requirements without looking at the code, which is what partitions and boundaries are. White box testing designs tests from the code, aiming for coverage of statements and branches. Grey box sits in between: you test the user interface but also look inside, at the API calls or the database. Most modern testers work grey box, which is why the next episodes teach SQL and DevTools.

Black, white, grey box
  • black box: test from the requirements, no code (partitions, boundaries)
  • white box: test from the code (statement, branch coverage)
  • grey box: some inside view, e.g. read the API or the DB while testing the UI

A release

Here is how they fit into one release week. Monday, the new build gets a smoke test, then functional testing and exploratory sessions on the new features. Tuesday, bug fixes get confirmation tests and a sanity check of their area. Wednesday, the full regression suite runs, mostly automated. Thursday, performance and security checks, and the business does user acceptance. Friday, the release, and a quick smoke test in production.

Release 1.4 in a week
  • Mon new build → smoke
  • Mon new features: functional + exploratory sessions
  • Tue bug fixes → confirmation + sanity on that area
  • Wed full regression suite (mostly automated)
  • Thu performance + security checks, UAT with business
  • Fri release, smoke in prod

Common mistakes

Mix ups interviewers listen for. Saying regression testing means re testing, when re testing confirms a fix and regression checks everything else. Using smoke and sanity as the same word without knowing the difference. Doing only functional testing and forgetting performance, security and accessibility. UAT done by testers alone, without business users. And regression suites that only grow, with nobody pruning or automating them.

Avoid these
  • "regression = re-testing" (they are different)
  • smoke and sanity as the same thing, without asking
  • only functional testing
  • UAT run by testers alone
  • regression suites nobody prunes or automates
  • calling every bug a "regression"

Say it like this

The classic pair of interview questions. Smoke versus sanity: smoke is a wide, shallow check that a new build is stable enough to test; sanity is a narrow check that one change behaves sensibly. Re testing versus regression: re testing confirms a fixed bug is really gone; regression testing checks the fix broke nothing else, which is why regression is the first suite a team automates.

In the interview
  • "Smoke is a wide, shallow
  • check that a new build is testable. Sanity is a narrow
  • check that one change makes
  • sense. Re-testing confirms
  • a fixed bug is gone;
  • regression checks the fix
  • broke nothing else, so it is the first suite we automate."

Interview questions

Q1What is the difference between smoke and sanity testing?

Smoke testing is a wide, shallow check that a new build is stable enough for further testing. Sanity testing is a narrow check that a specific change or fix behaves sensibly before deeper testing.

Q2What is the difference between re-testing and regression testing?

Re-testing (confirmation testing) runs the failed test again to confirm the bug is fixed. Regression testing runs a broader set to make sure the change did not break anything else.

Q3What are the test levels?

Unit (one function or class), integration (components working together), system (the whole application end to end) and acceptance (whether it meets the business need, e.g. UAT).

Q4What is the difference between functional and non-functional testing?

Functional testing checks what the system does against its requirements; non-functional testing checks how well it does it: performance, security, usability, accessibility, reliability, compatibility.

Q5What is UAT and who does it?

User acceptance testing: business users or customers check the system meets their needs and acceptance criteria, usually on a near-final build before release.

Q6What is the difference between alpha and beta testing?

Alpha testing is done by internal users before release; beta testing gives the product to a limited group of real external users to find issues in real conditions.

Q7What is grey-box testing?

Testing from the outside with partial knowledge of the inside, such as checking API responses or database rows while testing the UI.

Q8Why is regression testing usually automated first?

It runs on every change, grows with every release and checks known behaviour with stable expected results, so automation pays back quickly.