About

Exam Practice

Cheat sheet, flashcards and concept quiz covering Lectures 1–9 of Software Testing, from verification & validation to MC/DC, black box test design, test completion criteria, unit & integration testing and TDD.

Reference text: CSC312 lecture notes (KMUTT SIT); G. Myers, The Art of Software Testing; R. Patton, Software Testing; ISTQB Foundation syllabus

Showing 72 cards
1.1 Testing in the Age of AI & the SDLC

SRS

termtap to reveal ↺
Definition

Software Requirements Specification, the precise, technology-free description of what the system must do, produced by the analysis stage.

SRStap to flip back ↺
1.1 Testing in the Age of AI & the SDLC

Software artifact

termtap to reveal ↺
Definition

Anything that describes the system (requirements, SRS, design, code, test plans, user guides, data). Every artifact can be tested.

Software artifacttap to flip back ↺
1.1 Testing in the Age of AI & the SDLC

Exploratory testing

termtap to reveal ↺
Definition

Testing with no script or framework; a tester wanders through the software looking for trouble, guided by curiosity. An area where a human in the loop beats AI.

Exploratory testingtap to flip back ↺
1.2 Expected Results, Verification & Validation

Expected result

termtap to reveal ↺
Definition

The correct output, decided when the test case is written and before running it, usually derived from the SRS. A test case needs input AND expected result.

Expected resulttap to flip back ↺
1.2 Expected Results, Verification & Validation

Verification

termtap to reveal ↺
Definition

Checking a work product against its specification (CMMI). In everyday words, "did we build the thing right?"

Verificationtap to flip back ↺
1.2 Expected Results, Verification & Validation

Validation

termtap to reveal ↺
Definition

Checking that the delivered product fulfils its intended use in its real environment, i.e. the user's real needs (CMMI). In everyday words, "did we build the right thing?"

Validationtap to flip back ↺
1.3 The STLC, Defects & the Economics of Testing

STLC

termtap to reveal ↺
Definition

Software Testing Life Cycle: requirement analysis → planning → test design → environment set-up → execution → closure. It loops with every SDLC iteration.

STLCtap to flip back ↺
1.3 The STLC, Defects & the Economics of Testing

Economics of testing

termtap to reveal ↺
Definition

A bug costs about ten times more at each later stage (about 1 dollar at specification, 10 at design, 100 at coding, 1,000+ after release). Hence "test early".

Economics of testingtap to flip back ↺
1.3 The STLC, Defects & the Economics of Testing

Rework

termtap to reveal ↺
Definition

Redoing work because an earlier mistake was found late; about 44% of total development cost.

Reworktap to flip back ↺
1.4 Disasters & Functional vs. Non-Functional

Safety-critical software

termtap to reveal ↺
Definition

Software where a bug can kill or injure people (e.g. radiation therapy machines, aviation); it demands far more testing effort than ordinary software.

Safety-critical softwaretap to flip back ↺
1.4 Disasters & Functional vs. Non-Functional

Functional vs. non-functional requirement

termtap to reveal ↺
Definition

Functional = what the software does (save, calculate); easy to check against the spec. Non-functional = how well (performance, security, reliability, usability); needs metrics, tools and special environments.

Functional vs. non-functional requirementtap to flip back ↺
1.4 Disasters & Functional vs. Non-Functional

Load vs. stress testing

termtap to reveal ↺
Definition

Load testing gives the system a lot of work; stress testing restricts the resources available to do that work.

Load vs. stress testingtap to flip back ↺
1.5 The Seven Principles of Testing

Pesticide paradox

termtap to reveal ↺
Definition

Running the same tests repeatedly stops finding new bugs, because the bugs they can reach are already fixed. Keep writing new, different tests.

Pesticide paradoxtap to flip back ↺
1.5 The Seven Principles of Testing

Defect clustering

termtap to reveal ↺
Definition

Bugs gather in the same places (Murphy's Law; roughly 80% of bugs in 20% of the code). Where you find many, look harder.

Defect clusteringtap to flip back ↺
1.5 The Seven Principles of Testing

Absence-of-errors fallacy

termtap to reveal ↺
Definition

Professor's reading, not seeing bugs does not mean none exist. ISTQB reading, fixing found bugs is pointless if the system is unusable or misses the users' needs.

Absence-of-errors fallacytap to flip back ↺
1.6 The Five Definitions of a Bug

Patton's five bug definitions

termtap to reveal ↺
Definition

1 doesn't do what the spec says it should; 2 does what the spec says it shouldn't; 3 does what the spec doesn't mention; 4 doesn't do what the spec doesn't mention but should; 5 hard to use, slow, or users unhappy.

Patton's five bug definitionstap to flip back ↺
1.6 The Five Definitions of a Bug

Bug definition 4 and verification

termtap to reveal ↺
Definition

Verification cannot catch it, because the specification itself is incomplete and the software matches it. Only validation (back to the user's needs) can.

Bug definition 4 and verificationtap to flip back ↺
2.1 Exhaustive Testing

Exhaustive (brute force) testing

termtap to reveal ↺
Definition

Trying every possible input combination. Even a 32-digit calculator needs at least 2 × 10^64 tests for addition alone (4 × 10^64 if both numbers can be negative), so it is impossible.

Exhaustive (brute force) testingtap to flip back ↺
2.1 Exhaustive Testing

Test objective

termtap to reveal ↺
Definition

The goal of a group of tests (e.g. "test addition"); test cases are written under each objective.

Test objectivetap to flip back ↺
2.2 Risk & Testability

Impact (risk)

termtap to reveal ↺
Definition

How often a problem can happen combined with how much it costs (to fix, and if not fixed). Test high-impact areas first.

Impact (risk)tap to flip back ↺
2.2 Risk & Testability

Controllability / observability

termtap to reveal ↺
Definition

Controllability = you can control the input going in. Observability = you can see the result coming out. Together they make testability.

Controllability / observabilitytap to flip back ↺
2.2 Risk & Testability

Precision error, communication mismatch, protocol mismatch

termtap to reveal ↺
Definition

Three integration problems between units that work alone, namely small numeric errors that grow, messages one unit does not understand, and different rules for talking.

Precision error, communication mismatch, protocol mismatchtap to flip back ↺
2.3 The CalcEngine Walkthrough

Walkthrough (code)

termtap to reveal ↺
Definition

Playing the computer by running the code slowly on paper and writing each variable's value after every step; good for exposing logic errors.

Walkthrough (code)tap to flip back ↺
2.4 Testing vs. Debugging

Debugging

termtap to reveal ↺
Definition

Locating the cause of a bug (90–95% of the effort) and fixing it (5–10%). Done by developers, after testers show the bug exists.

Debuggingtap to flip back ↺
2.4 Testing vs. Debugging

Induction vs. deduction (debugging)

termtap to reveal ↺
Definition

Induction goes from specific clues to a general theory, then proves it. Deduction goes from a full list of possible causes, eliminating until one remains.

Induction vs. deduction (debugging)tap to flip back ↺
2.4 Testing vs. Debugging

Rules for fixing a bug

termtap to reveal ↺
Definition

Run regression tests after the fix; check whether the same mistake exists elsewhere; fix the real cause, not just the symptom.

Rules for fixing a bugtap to flip back ↺
2.5 Unattainable Perfection

The knee of the bug curve

termtap to reveal ↺
Definition

After roughly 50–70% of the bugs you will find, the curve flattens and each new bug costs much more effort, where the spiral of unattainable perfection begins.

The knee of the bug curvetap to flip back ↺
2.6 Artifacts & Reviews

Four kinds of review

termtap to reveal ↺
Definition

From casual to strict, walkthrough, ad hoc review, technical review, formal inspection. Formality, preparation and cost grow at each step.

Four kinds of reviewtap to flip back ↺
2.6 Artifacts & Reviews

Formal inspection roles

termtap to reveal ↺
Definition

Trained moderator, reader and recorder; a formal process with a checklist, measurement and a step to check that problems were fixed.

Formal inspection rolestap to flip back ↺
3.1 Static vs. Dynamic & Myers' Principles

Static vs. dynamic testing

termtap to reveal ↺
Definition

Static = checking without running (reviews, linters such as SonarQube). Dynamic = running the program and comparing actual with expected.

Static vs. dynamic testingtap to flip back ↺
3.1 Static vs. Dynamic & Myers' Principles

Myers' principle 2

termtap to reveal ↺
Definition

A programmer should avoid testing their own program, with the exceptions of unit testing and debugging.

Myers' principle 2tap to flip back ↺
3.2 Black Box vs. White Box

Black box testing

termtap to reveal ↺
Definition

Input-output (data-driven) testing through the interface only. Limited by exhaustive input testing. Done first, to avoid the developer's bias.

Black box testingtap to flip back ↺
3.2 Black Box vs. White Box

White box testing

termtap to reveal ↺
Definition

Logic-driven (transparent box) testing designed from the code and its paths. Limited by exhaustive path testing.

White box testingtap to flip back ↺
3.3 Paths, Decisions & Conditions

Decision vs. condition

termtap to reveal ↺
Definition

A decision is the overall true/false outcome of an if; a condition is one atomic true/false check inside it, joined by && or ||.

Decision vs. conditiontap to flip back ↺
3.4 The Coverage Ladder

Statement coverage

termtap to reveal ↺
Definition

Every statement runs at least once. The weakest criterion ("baby stuff"), because false branches may never run.

Statement coveragetap to flip back ↺
3.4 The Coverage Ladder

Decision (branch) coverage

termtap to reveal ↺
Definition

Every decision is true at least once and false at least once. A wrong condition inside a decision can still escape.

Decision (branch) coveragetap to flip back ↺
3.4 The Coverage Ladder

Condition coverage

termtap to reveal ↺
Definition

Every condition is true at least once and false at least once. Independent of decision coverage; a whole branch can be missed.

Condition coveragetap to flip back ↺
3.4 The Coverage Ladder

Short circuit / masking

termtap to reveal ↺
Definition

In A && B with A false (or A || B with A true), B is never evaluated. A masks B, so a bug in B can stay hidden.

Short circuit / maskingtap to flip back ↺
3.5 MC/DC & the Table Method

MC/DC

termtap to reveal ↺
Definition

Modified Condition/Decision Coverage. Each condition is shown to independently affect the outcome of the decision. Minimum n + 1 tests.

MC/DCtap to flip back ↺
3.5 MC/DC & the Table Method

Independence pair

termtap to reveal ↺
Definition

Two test cases that differ in exactly one condition and give different decision outcomes.

Independence pairtap to flip back ↺
3.5 MC/DC & the Table Method

Truth-table row order

termtap to reveal ↺
Definition

Every column starts with F; the last variable changes every row, the one before every 2 rows, and so on. Rows are numbered 1, 2, 3…

Truth-table row ordertap to flip back ↺
4.1–4.3 MC/DC Practice

Test set vs. minimum test set (MC/DC)

termtap to reveal ↺
Definition

A test set has at least one full pair in every extended column. A minimum test set is a test set with exactly n + 1 rows.

Test set vs. minimum test set (MC/DC)tap to flip back ↺
4.1–4.3 MC/DC Practice

Colour path

termtap to reveal ↺
Definition

Take a pair, stand on one of its rows, look across to the next extended column, take the pair named there, and repeat, reusing rows to reach n + 1.

Colour pathtap to flip back ↺
5.2 Equivalence Partitioning

Equivalence partitioning

termtap to reveal ↺
Definition

Split infinite inputs and outputs into partitions the program treats the same way, then test one sample from each. If it passes, the partition passes.

Equivalence partitioningtap to flip back ↺
5.2 Equivalence Partitioning

EP guidelines

termtap to reveal ↺
Definition

Range → 1 valid + 2 invalid; specific value → 1 valid + 2 invalid; member of a set → 1 valid + 1 invalid; Boolean → 1 valid + 1 invalid.

EP guidelinestap to flip back ↺
5.3 Boundary Value Analysis

Boundary value analysis

termtap to reveal ↺
Definition

For each boundary test the value on it, just below it and just above it (e.g. range 0–75, test −1, 0, 1 and 74, 75, 76).

Boundary value analysistap to flip back ↺
5.1 Testers, Developers & Independent Testing

Third-party testing

termtap to reveal ↺
Definition

Testing by an independent outside company, wanted for safety-critical software. Main shortcoming, cost.

Third-party testingtap to flip back ↺
6.1 The Triangle Problem

Hidden boundary

termtap to reveal ↺
Definition

A smaller border inside a partition found by thinking deeper, e.g. the position of the equal sides in an isosceles triangle.

Hidden boundarytap to flip back ↺
6.2 Decision Tables

Decision table

termtap to reveal ↺
Definition

Conditions on top, actions below, one rule per column (1, 0, X). A transposed truth table, so 2^K rules for K conditions before don't-cares.

Decision tabletap to flip back ↺
6.2 Decision Tables

Don't care (X)

termtap to reveal ↺
Definition

The condition does not affect this rule; one column with X replaces two columns (one with 1, one with 0).

Don't care (X)tap to flip back ↺
6.3–6.4 Cause-Effect Graphs

Cause-effect graph

termtap to reveal ↺
Definition

A graph linking causes (inputs) to effects (outputs) through AND, OR and NOT (plus intermediate nodes). Draw it first, then derive the decision table.

Cause-effect graphtap to flip back ↺
6.3–6.4 Cause-Effect Graphs

De Morgan's law

termtap to reveal ↺
Definition

NOT(A AND B) = NOT A OR NOT B; NOT(A OR B) = NOT A AND NOT B. "Break the line, change the sign."

De Morgan's lawtap to flip back ↺
6.3–6.4 Cause-Effect Graphs

Constraints E, O, I, R, M

termtap to reveal ↺
Definition

E = at most one cause is 1; O = exactly one; I = at least one; R = if A is 1 then B must be 1; M = effect E1 forces effect E2 to 0.

Constraints E, O, I, R, Mtap to flip back ↺
6.5 Decision Trees

Decision tree

termtap to reveal ↺
Definition

Conditions arranged hierarchically; each root-to-leaf path is one rule and one test case, with "not applicable" for conditions the path never evaluates.

Decision treetap to flip back ↺
7.1 The Three Completion Categories

Test completion criterion

termtap to reveal ↺
Definition

A rule decided in advance that says when testing can stop (also called a stopping criterion).

Test completion criteriontap to flip back ↺
7.1 The Three Completion Categories

Three completion categories

termtap to reveal ↺
Definition

1 principles & coverage (low-level tests); 2 statistics & past experience (needs prior data); 3 bug-finding trend (stop at the greatest drop in slope).

Three completion categoriestap to flip back ↺
7.2–7.3 Completion Calculations

CLD vs. design errors

termtap to reveal ↺
Definition

CLD = coding and logic design errors, about 40% (module tests catch most). Design errors, about 60%, are caught mainly by function and system tests.

CLD vs. design errorstap to flip back ↺
7.2–7.3 Completion Calculations

Bug-curve slope

termtap to reveal ↺
Definition

S = (n2 − n1)/(t2 − t1), the bugs found per time unit. Stop at the greatest drop between neighbouring slopes.

Bug-curve slopetap to flip back ↺
7.4 Drivers, the MUT & IV&V

IV&V

termtap to reveal ↺
Definition

Independent verification and validation by a separate company, required for safety-critical software. Strength, no bias; weakness, very expensive.

IV&Vtap to flip back ↺
7.4 Drivers, the MUT & IV&V

Synchronous communication

termtap to reveal ↺
Definition

The caller waits for the answer before continuing (like a phone call), which is how a driver usually calls the MUT.

Synchronous communicationtap to flip back ↺
8.1–8.2 Unit Testing, Stubs & Drivers

Failure vs. error (JUnit)

termtap to reveal ↺
Definition

Failure = the test ran but actual ≠ expected (a bug was found). Error = the test could not finish due to an unexpected problem not caused by the test case.

Failure vs. error (JUnit)tap to flip back ↺
8.1–8.2 Unit Testing, Stubs & Drivers

Side effect (unit testing)

termtap to reveal ↺
Definition

A change a test makes (e.g. to a shared variable) that another test might depend on. Tests must not depend on side effects.

Side effect (unit testing)tap to flip back ↺
8.1–8.2 Unit Testing, Stubs & Drivers

Stub vs. driver

termtap to reveal ↺
Definition

A stub is a fake module below the unit that the unit calls (minimum functionality). A driver is a fake caller above that runs the unit with test inputs.

Stub vs. drivertap to flip back ↺
8.1–8.2 Unit Testing, Stubs & Drivers

Harness (scaffolding)

termtap to reveal ↺
Definition

All the drivers, stubs and set-up around a unit that let you control its inputs and observe its outputs.

Harness (scaffolding)tap to flip back ↺
8.3 Integration Testing

Integration testing

termtap to reveal ↺
Definition

Combining tested units step by step and testing them as a group and through their interfaces; catches precision growth, interface errors and timing problems.

Integration testingtap to flip back ↺
8.3 Integration Testing

Top-down vs. bottom-up

termtap to reveal ↺
Definition

Top-down starts at the main module with stubs (early executable, poorer control/observation). Bottom-up starts at the lowest modules with drivers (better control/observation, executable very late).

Top-down vs. bottom-uptap to flip back ↺
8.4 XP & TDD

Red-green-refactor

termtap to reveal ↺
Definition

Write a failing test (red), write the simplest code to pass it (green), clean the code with all tests still passing (refactor), and repeat.

Red-green-refactortap to flip back ↺
8.4 XP & TDD

Fake it / obvious implementation / triangulation

termtap to reveal ↺
Definition

Three ways to green, namely return a hard-coded value, write the simple real code directly, or generalise only when two or more examples require it.

Fake it / obvious implementation / triangulationtap to flip back ↺
8.4 XP & TDD

Refactoring

termtap to reveal ↺
Definition

Cleaning code without changing what it does, in three steps (freeze the features, refactor, run a regression test).

Refactoringtap to flip back ↺
8.5–8.6 JUnit & Acceptance Testing

Fixture

termtap to reveal ↺
Definition

Set-up (e.g. in @Before) that creates the objects and initial values every test needs, so each test starts from the same known state.

Fixturetap to flip back ↺
8.5–8.6 JUnit & Acceptance Testing

JUnit 4 annotation order

termtap to reveal ↺
Definition

@BeforeClass once → for each test: @Before → @Test → @After → @AfterClass once. JUnit 5: @BeforeAll, @BeforeEach, @AfterEach, @AfterAll.

JUnit 4 annotation ordertap to flip back ↺
8.5–8.6 JUnit & Acceptance Testing

Test doubles

termtap to reveal ↺
Definition

Dummy fills a parameter; stub gives canned answers; spy is a stub that records calls; mock expects specific calls; fake is a simple working version (in-memory DB).

Test doublestap to flip back ↺