Skip to content
Tutorials Center
My learning

Topics

Lesson 59 of 60 ยท Practice and Interview Prep

Software Testing Cheat Sheet

A one-page software testing cheat sheet: principles, levels, types, design techniques, bug report template, severity vs priority, formulas and checklists.

This is the whole track on one page. Use it the way you would use a map: to find your place quickly, not to learn the country. Each block is a reminder with a link to the full lesson, so when a line is not clear, follow the link. Two small stand-ins at the end help you pick a technique for a situation and compute the numbers that testers report.

The map of testing

Fundamentals Principles, levels, types.
Design Techniques that choose the tests.
Defects Reports, severity, lifecycle.
Numbers Metrics and estimates.
1 / 2

Principles in one line each

Principle Reminder
Testing shows presence of defects It can reveal bugs, never prove there are none.
Exhaustive testing is impossible Choose tests by risk and technique.
Early testing saves time and money Review requirements before code exists.
Defects cluster A few modules hold most bugs; test them harder.
Pesticide paradox Repeated tests stop finding bugs; refresh them.
Testing is context dependent A game and a medical device are tested differently.
Absence-of-errors fallacy A bug-free product that misses user needs still fails.

Full lesson: The Seven Testing Principles.

Levels and types

Levels answer "where do I test?" and types answer "what do I test?".

Level Target Usually done by
Unit One function or class, in isolation Developers
Integration The connections between modules or services Developers and testers
System The whole product against requirements Testers
Acceptance Fitness for the business and users (UAT, alpha, beta) Users, business, testers
Type Question it answers
Functional Does it do what the requirement says?
Non-functional Is it fast, secure, usable, compatible, reliable?
Structural (white-box) Which parts of the code did the tests execute?
Change-related Is the fix fixed (confirmation) and is the rest still fine (regression)?

See Test Levels and Test Types. The test pyramid advice: many fast unit tests, fewer integration tests, few end-to-end tests.

Choosing a design technique

Situation Technique Core idea
A field with a range or limits Equivalence partitioning + boundary value analysis One value per group, plus the values on each edge (below, on, above)
Result depends on combinations of conditions Decision table n yes/no conditions give 2^n rules; collapse with "don't care"
Behaviour depends on history or status State transition States x events table; test valid moves and rejected ones
Many options to combine Pairwise Cover every pair of values at least once; far fewer tests than all combinations
A user goal across several steps Use case and scenario testing Main flow, alternate flows, exception flows
You have the code Coverage Statement, branch, condition, path; 100% is not proof
Little documentation or time Experience-based Error guessing, checklists, exploratory charters

Coverage formulas. Statement coverage = statements executed / total statements. Branch coverage = decision outcomes executed / total outcomes. Cyclomatic complexity = decisions + 1 (or edges - nodes + 2), and it gives the number of independent paths.

Static techniques find defects without running code: reviews and inspections, linters, and reviewing requirements for testability. Inspections are the most formal; walkthroughs are led by the author; informal reviews have no fixed process.

Test case and bug report templates

A good test case is atomic, clear and traceable:

TEXT
ID:            TC-CART-014
Title:         Order of exactly $100.00 gets the 10% discount
Requirement:   R2
Preconditions: Logged-in guest, empty cart
Data:          Items totalling $100.00
Steps:         1. Add items   2. Open the cart summary
Expected:      Discount line shows -$10.00; total $90.00

A good bug report lets a stranger reproduce the problem:

TEXT
Title:        <symptom> when <trigger>
Environment:  build, browser/device, OS, data
Steps:        1. ...  2. ...  3. ...
Expected:     what the requirement says
Actual:       what really happened
Evidence:     screenshot, log, video, test ID
Severity:     Critical / Major / Minor / Trivial
Priority:     High / Medium / Low
Frequency:    always, intermittent (say how often)

More in Writing Good Test Cases and Writing Excellent Bug Reports.

Severity vs priority

Severity Priority
Answers How bad is the failure? How soon do we fix it?
Set by Tester proposes Product owner or triage meeting decides

High severity with low priority: a crash in a tool that almost nobody uses. Low severity with high priority: a typo in the company name the day before a launch.

Execution and defect states

  • Test results: passed, failed, blocked (cannot run because of something else), not run, skipped.
  • Smoke: a quick check that a build is stable enough to test. Sanity: a narrow check of one change. Confirmation: rerun the failed test. Regression: rerun old tests to find side effects.
  • Defect states: New, Assigned, Fixed, Retested, Verified or Reopened, Closed. Side exits: Duplicate, Rejected, Deferred.
  • Entry criteria say when testing may start (build deployed, smoke passed). Exit criteria say when it may stop (no open Critical defects, agreed pass rate, all high-risk cases run).

Read more in Test Execution and Result Tracking and Defect Lifecycle and Quality Metrics.

Formulas

Measure Formula
Execution progress executed / planned
Pass rate passed / executed (or passed / planned; say which)
Defect density defects / size (per KLOC, per feature or per story point)
Detection effectiveness defects found before release / all defects found
Defect leakage defects found after release / all defects found = 1 - detection effectiveness
Reopen rate reopened defects / fixed defects
Requirements coverage requirements with at least one test / all requirements
Risk score likelihood x impact
PERT estimate (optimistic + 4 x likely + pessimistic) / 6

See Risk-Based Testing and Traceability and Test Estimation.

Checklists

Any input field: empty, one character, maximum length and one over, leading and trailing spaces, special characters and emoji, very long text, pasted text, wrong type, a script tag (should show as text), and a repeated submit.

Any new feature: read the requirement for ambiguity, list the rules and conditions, derive tests with the right technique, add negative tests, check error messages, think about permissions, think about what happens when the network or a service fails, and check that nothing nearby broke.

Release readiness: exit criteria met, no open blockers, regression pack run on the release build, known issues listed with owners, test summary reported with what was not tested, rollback plan known.

Exploratory session: a charter (mission), a time box (60 to 90 minutes), notes, bugs and questions recorded, and a short debrief. See Exploratory Testing in Practice.

Stand-in 1: a technique picker

The first stand-in turns the technique table into code. Give it the traits of a situation and it returns the techniques to consider. Real testers do this in their heads, but writing the rules out is a good way to learn them.

JS Pick techniques for a situation

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Notice that most real situations need two or three techniques together. The ticket price needs boundaries for the thresholds and a decision table for the combinations, as in Project: Test a Shopping Cart.

Stand-in 2: the metrics calculator

The second stand-in computes the numbers from the formula table for an invented release: 120 planned cases, 50 defects in total, 15,000 lines of code. It prints each formula so you can see which numbers go where, and it uses both common definitions of the pass rate.

JS Compute the usual test metrics

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The two pass rates (88.9% and 80.0%) differ by nine points for the same run, which is why every report must say which definition it uses. The 38 of 40 requirements covered leaves two requirements with no test at all, and finding those two is the real value of the number.

Differences cheat sheet: "X vs Y"

Interviews and exams love comparisons. Each row below gives the one-line difference. Follow the links for the full lesson.

Pair The difference in one line
Verification vs validation Verification: are we building it right (against the spec)? Validation: are we building the right thing (for the user)? (QA, QC and Testing)
QA vs QC QA prevents defects through process; QC finds defects in the product.
Error vs defect vs failure A person's mistake puts a defect in the work product; running it may cause a visible failure.
Static vs dynamic testing Static examines work products without running code; dynamic runs the software. (Static vs Dynamic)
Black box vs white box vs grey box Tests from behavior, from code structure, or from partial inside knowledge. (Black, White, Grey)
Functional vs non-functional What the system does vs how well it does it (speed, security, usability). (Test Types)
Smoke vs sanity Smoke: wide and shallow check of a new build. Sanity: narrow and deep check of a change. (Smoke, Sanity, Regression)
Retesting vs regression Retesting re-runs the failed test to confirm a fix; regression re-runs old passing tests to find side effects.
Alpha vs beta Alpha: internal, in a lab. Beta: external users in the real world. (Alpha, Beta, UAT)
UAT vs system testing System testing checks the whole product against requirements (by testers); UAT is the business deciding whether to accept it.
Load vs stress Load: expected traffic against targets. Stress: beyond capacity to find the breaking point and failure behaviour. (Performance)
Soak vs spike Soak: normal load for a long time. Spike: a sudden short surge.
Severity vs priority Severity: how bad the effect is. Priority: how soon to fix it. (Bug Reports)
Test scenario vs test case vs test script A one-line goal; the detailed steps and data; the executable version. (Scenarios vs Cases)
Test plan vs test strategy Plan: project-specific (what, when, who). Strategy: general approach, often organization-wide. (Test Strategy and Plan)
Test suite vs test plan A suite is a group of test cases; a plan is a document describing the testing effort.
Stub vs driver A stub replaces a called module (below); a driver replaces the caller (above). (Unit Testing Frameworks)
Top-down vs bottom-up integration Start from the top with stubs, or from the bottom with drivers.
Manual vs automation testing A person executes and judges vs a script runs repeatable checks; use both. (When to Automate)
Positive vs negative testing Valid input must work; invalid input must fail safely. (Positive and Negative)
Exploratory vs ad hoc Exploratory has a charter, time box and notes; ad hoc has no structure. (Ad Hoc, Monkey, Gorilla)
Monkey vs gorilla Random input across the app vs intense repeated testing of one module.
Equivalence partitioning vs boundary value analysis Partitions pick one value per class; boundaries test the edges of each class.
Decision table vs state transition Combinations of conditions vs sequences of events changing state.
TDD vs BDD Developer-written tests drive code design vs team-written behavior examples drive features. (TDD vs BDD)
Unit vs integration vs system vs acceptance Growing scope: one unit, connected units, the whole system, fitness for the business. (Test Levels)
Defect density vs defect leakage Defects per size vs the share of defects that escaped to production.
Test coverage vs code coverage Coverage of requirements or risks by tests vs the share of code executed.
BRS vs SRS The Business Requirements Specification states business goals in the customer's terms; the Software (System) Requirements Specification translates them into what the software must do.
Front-end vs back-end testing The user interface and browser behaviour vs the server, business logic, APIs and database.
Desktop vs web vs mobile testing Installed apps (OS, installation, hardware) vs browsers (cross-browser, network, URLs) vs phones (devices, gestures, battery, interruptions). (Mobile Testing Basics)
Client-server vs web testing Client-server uses installed clients talking to a server on a controlled network; web apps run in an unknown browser over the internet, so compatibility and security matter more.
Alpha release vs release candidate An early, unfinished build for internal use vs a build believed ready to ship if no major issue appears.
SAST vs DAST Code analysed without running it vs the running app attacked from outside. (Security Testing)
Penetration test vs vulnerability scan Skilled people exploit weaknesses to show impact vs a tool lists possible weaknesses.
Mock vs stub A stub returns canned answers; a mock also verifies how it was called.
Priority vs risk Priority orders work; risk (likelihood x impact) tells what could hurt. (Risk-Based Testing)
JS Self-test: name the difference

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A price depends on membership, order size and a coupon. Which technique fits best?

    When several conditions combine to decide the result, a decision table lists every combination so none is forgotten.
  2. 2. 100 defects were found: 90 before release and 10 after. What is the leakage?

    Leakage = defects found after release / all defects = 10 / 100 = 10%. Detection effectiveness is the other 90%.
  3. 3. Which pairing is a high-severity, low-priority example?

    The crash is technically severe, but very limited use can make it a low priority. The typo is the opposite case.
  4. 4. Optimistic 4 days, likely 6, pessimistic 14. What is the PERT estimate?

    PERT = (4 + 4 x 6 + 14) / 6 = 42 / 6 = 7 days.

Summary

  • Choose the technique from the shape of the rule: ranges, combinations, status, options, journeys.
  • Levels say where you test, types say what you test, and exit criteria say when you may stop.
  • Reports need a reproducible bug report, an honest pass-rate definition and a list of what was not tested.
  • Severity is damage, priority is urgency; both belong on the report but are decided by different people.
  • Keep this page for revision and return to the full lessons when a line is not clear.

You have reached the end of the track. Go back to What Is Software Testing? whenever you want to review from the start, or apply everything in a project.