Bug·Hunt Primer
DARK
SE401 · Software Testing and Quality · Chapter 04

Your code compiles.
That was never the hard part.

Testing exists because "it runs" and "it's correct" are two completely different claims. This chapter is the foundation for the entire course: why bugs are expensive (sometimes fatal), the exact vocabulary that separates an error from a defect from a failure, the seven principles every tester internalizes, and the process that turns "let's test it" into something repeatable.

5 real-world disasters
Error → Defect → Failure
7 test principles
7-step test process
📌 From the instructor's own margin notes
  • Midterm: listing-type questions are capped around 2 points — but you're expected to understand everything, not just list it.
  • No hand-drawn diagrams needed in exam answers.
  • Be ready to give a real example / case study on request (not just recite one).
  • The whole chapter is really answering four questions: Why are we doing testing? What happens if we didn't? What's a test plan? What's a test case?
HUMAN ERROR mistake DEFECT / BUG in the code FAILURE
§ 01 — WHY TESTING IS NECESSARY

Software is everywhere, and unfinished testing has a body count

Software now runs phones, smart homes, satellites, trucks, farm equipment, and aircraft. When it fails, the failure isn't abstract.

💥
Memory hook
"A bug you don't catch, a customer catches instead — and it costs 16× more by then."
Every disaster below is the same story: a defect that testing could have caught, discovered instead in production, in the worst possible place.
1985 — Therac-25 radiation therapy machine (Canada)

A software bug delivered lethal radiation doses

Malfunctioned due to a software bug, leaving 3 people dead and critically injuring 3 others.

Medical device software — a bug is not an inconvenience, it's a casualty.
April 26, 1994 — China Airlines Airbus A300

Crashed due to a software bug

Killed 264 innocent lives.

You may be asked to name or explain a case study like this on an exam — know at least one cold.
June 4, 1996 — Ariane 5 Flight 501 (maiden launch, 12:34pm)

Self-destructed 39 seconds after liftoff

Deep-dive case study below — this one gets its own section because the instructor spent real time on it.

Cost: €500 million.
April 1999 — $1.2 billion military satellite launch

Failed because of a software bug

Called out in the deck as the costliest accident in history.

US bank accounts

A software bug credited 823 customers $920 million

Not every failure kills someone — some just quietly move a billion dollars that was never supposed to move.

Deep dive — Ariane 5: what actually happened

the exam's favorite case study

European expendable launch system, built to carry double the payload of its predecessor Ariane 4 (which had 113 successful launches and 3 failures).

Timeline of the failure
T0 → T0+36s: normal flight.
Inside SRI 2 (inertial reference system): the value BH (Bias Horizontal) exceeds 2¹⁵. The routine convert_double_to_int(BH) fails — the value is too big to fit. An exception is thrown, crashing SRI 2, then SRI 1 too.
Result: the onboard computer (OBC) receives diagnostic data and misreads it as real flight data — the rocket becomes disoriented, swings past a 20° angle, hits huge aerodynamic stress, and the boosters start separating.
T0+39s: self-destruction. Cost: €500M.
Why it happened (root cause)
Not a programming error — the unprotected conversion was a design decision from ~1980.

Not a design error either — it was justified against Ariane 4's flight trajectory and real-time constraints.

A problem with integration testing — theoretically detectable, but the test space was huge versus limited resources, and the SRI software was actually useless at that stage of flight anyway.

Reuse of a component with a hidden constraint — precondition was abs(BH) < 32768.0, valid for Ariane 4's flight profile but no longer valid for the more powerful Ariane 5.
Lessons learned (verbatim from the deck): Test! Test! Test! — test even when the code is reused. When you reuse code, ensure the assumptions are still valid. When you write reusable code, document the assumptions. Write fail-safe code. Do not propagate errors.
The economic case

Per the Cost of Poor Software Quality in the US, 2020 report (CISQ — Consortium for Information & Software Quality): the total Cost of Poor Software Quality (CPSQ) in the US is $2.08 trillion$1.56 trillion from operational failures and $520 billion from legacy systems. We want software systems to be reliable; testing is how, in most cases, we find out if they are.

Cost of Quality (CoQ) formula
CoQ = Cost of Conformance (CoC) + Cost of Non-Conformance (CoNC)

CoC: Prevention (quality planning, tools, training) + Appraisal (testing, inspection).
CoNC: Internal failures (rework) + External failures (liability, loss of property, loss of lives).

Testing adds to CoC — but it must directly reduce CoNC, or it wasn't worth doing.
§ 01b — WHY PROGRAMS FAIL & THE COST TO REPAIR

A defect caught early is cheap. Caught late, it's 16× the price.

"Your code is complete. It compiles. It runs... your program fails. How can this be?" There's a defect in the code; when executed, it causes bad behavior that later becomes visible as a failure. Before a program can be debugged, it must be set up so it can be tested — executed with the intent to make it fail. The first step in debugging is to reproduce the problem: first to bring it under control so it can be observed, second to later verify the fix actually worked.

Requirement
Design
Code / Unit Test
Independent Test
16×
After Release
Why it compounds — the four typical scenarios: Business Analyst → System Architect → Programmer, each stage's work product is either correct or incorrect. If the requirement itself is wrong, every downstream stage (design, code) inherits that wrongness — an error made early silently poisons everything built on top of it, which is exactly why it gets exponentially more expensive to fix the later it's caught.
Role of testing across the SW lifecycle

Testing has an important role in all stages of a product's life cycle: Planning, Development, Maintenance, Operations.

Purpose: reduce the risk of problems occurring during operation; check the system meets legal requirements and industry-specific standards; and simply learn more about the system under test.
What testing gives you back
Measures quality in terms of defects found — functional aspects and non-functional aspects (reliability, usability, portability).

Creates confidence in the software's quality, if properly tested with a minimum of defects found.

Teaches lessons for future projects — understanding root causes lets you improve process and prevent recurrence.
§ 02 — WHAT IS TESTING?

A systematic, destructive search for defects

"Are we meeting the requirements?" is the plain-language version. The formal version is more precise — and more testable on an exam.

Definition

know this verbatim

Software testing is a systematic process used to identify the correctness, completeness, and quality of developed software. It includes a set of activities conducted with the intent of finding errors so they can be corrected before the product reaches end users. In simple words: testing is an activity that ensures the software system is defect free. It can be done either manually or with automated tools.

The formal (ISTQB-style) framing

The process of testing all SW life-cycle activities — both static and dynamic — concerned with planning, preparation, and evaluation of software products and related work products, to: determine they satisfy specified requirements, demonstrate they are fit for purpose, and detect defects.

Depending on objectives, testing can focus on

Confirming requirements are met · Causing as many failures as possible · Checking no defects were introduced during changes · Assessing quality (with no intention of finding defects) · Finding defects (reduces the probability of undiscovered ones) · Creating confidence in the level of quality · Providing information for decision-making · Preventing defects.

MYTHBUSTERS: SOFTWARE TESTING EDITION

Four myths, busted with the exact fact from the slide

🚫

Myth #1: BUSTED

"Testing shows there are no errors." Fact: the main objective is to discover defects. Testing is a destructive activity — you're trying to break the system, not prove it's fine.

🚫

Myth #2: BUSTED

"Testing ensures the software does what it's supposed to." Only partly true — testing must also ensure the software does not do what it's not supposed to do.

🚫

Myth #3: BUSTED

"Testing is easier than design/implementation." Fact: you must consider every possible scenario, implied and unstated requirements and threats, and be imaginative and creative.

Myth #4: CONFIRMED

"Testing is an extremely creative and intellectually challenging task." This one's actually true.

SELF-ASSESSMENT — TEST THE TRIANGLE PROGRAM

The exact exercise the deck uses to prove Myth #3 wrong

A program reads 3 integers representing triangle side lengths and prints whether it's Equilateral (all 3 equal), Isosceles (exactly 2 equal), or Scalene (all different). Write test cases that would adequately test it. How many are actually needed?

CategorySample InputExpected Result
Enter no / 1 / 2 valuesnil · 12 · 12, 13Error — 3 integers required
Happy path5,5,5 / 3,3,4 / 2,3,4Equilateral / Isosceles / Scalene
Wrong format / non-integers / spaces / other chars2.5, 7.5, 8.7 · a, %, ZError — 3 integers required
Boundary — at least one is 00, 0, 0Error — all values must be > 0
Boundary — at least one is > max27, 27, 27Error — all values must be ≤ max
Invalid triangle (fails triangle inequality)2, 2, 5 · 2, 3, 25Error — not a triangle
The real lesson (why Myth #3 is busted): even a program this small needs no-input cases, format errors, boundary cases at 0 and at max, negative values, and triangle-inequality violations layered on top of just the three "happy path" answers — that's creative, systematic thinking, not something "easier than coding."
📌 Margin note — "How will you do it?"
  • Smoke test ("Hello World!"): test major functions first — if there are bugs, it's an early indication that everything else has bugs too.
  • Check handling of inputs: illegal inputs (text instead of integers), impossible inputs (floating vs. integer), outrageous values (infinities, max/min), out-of-domain values (negatives, outside spec), input errors (mis-spellings).
  • Stress test: multiple inputs without restart, or run the program for long periods of time.
§ 03 — SOFTWARE TESTING TERMINOLOGY

Error, defect, failure — three words that are NOT synonyms

This is the single most exam-tested distinction in the whole chapter.

🔗
Memory hook
"Humans Err, Code gets a Defect, Systems Fail."
Error (human mistake) → Defect/fault/bug (the flaw it leaves in the code) → Failure (what happens if that flaw actually executes and misbehaves).
Error (= mistake)

A human action

Human actions that result in a fault or defect in the system. Concerned with the underlying cause of the defect. Can occur in design, coding, requirements — even testing itself.

Defect (= fault, bug)

A flaw sitting in the system

Flaws in a system that can cause the system to fail to perform its required function — e.g. an incorrect condition or statement. Concerned with specific parts/components of the system. Can occur in requirements, design, or program code.

Failure

Observed bad behavior

Deviation of the observed behavior of a system from its specification (its expected behavior). Can only be determined with respect to the specification. If a defect in code is executed, a failure may occur — but not all defects cause failures all the time.

📌 Margin note — real question the instructor said she'd ask
  • "Is bug the same as defect? — Yes. But failure is different."
  • "Bugs and faults ≠ failures... but a bug/fault might cause a failure."
Worked example — square(int x)
int square(int x) {   return x*2; // should be x*x }
The defect: the line return x*2; itself — it sits there whether or not you ever call the function.
Same defect, two different outcomes
square(3) → returns 6, expected 9. A failure — the defect executed and produced observably wrong behavior.

square(2) → returns 4, which is also what 2×2 equals. Not a failure — correct result by coincidence, even though the exact same defect is still sitting in the code, unexecuted-in-a-way-that-shows.
Causes of defects: Human error — split into internal causes (fatigue, lack of training, lack of understanding, lack of interest) and external pressures (time pressure, complex code, many system interactions, changed technologies) — plus non-controllable events like environmental conditions (radiation, magnetism, pollution).
Historical trivia (also fair game): the very first recorded software "bug" was a literal moth, found trapped between points at Relay #70, Panel F of the Mark II Aiken Relay Calculator, Harvard University, September 9, 1945. It's on display in the Smithsonian.
§ 04 — TESTING: CONCEPTS

The vocabulary you need before you can write a real test suite

Eight terms, chunked by what role they play — write it, run it, or judge it.

🧰
Chunking aid — group by role, not alphabet
"What you WRITE, what you BUILD to run it, and how you JUDGE it's enough."
Test Case + Oracle = what you write. Scaffolding + Fixture + Driver = what you build so it can run. Suite + Script = how it's organized. Adequacy = how you know when to stop.
GroupTermWhat it actually is
✍️ What you writeTest CaseAn execution of the software with a given test input — includes input values, sometimes execution steps, and expected outputs. Consists of inputs, steps/actions, and a pass/fail criterion.
Test OracleThe expected outputs of software for a given input — a part of every test case. Generating oracles automatically is considered the hardest problem in auto-testing.
🔧 What you build to run itTest ScaffoldingAdditional code needed to execute a unit or subsystem in isolation — replacements for parts of the program you're omitting from the test. Not useful in production code; needs to be removed.
Test FixtureA fixed state of the software under test used as a baseline for running tests (aka the "test context") — e.g. loading a database with a known dataset, or preparing input data and mock/fake objects.
Test DriverA software framework that loads a collection of test cases or a test suite; can also handle configuration and comparison between expected and actual outputs.
📦 How it's organizedTest SuiteA collection of test cases, usually sharing similar prerequisites and configuration, usually run together in sequence. Different suites exist for different purposes (certain platforms, certain features, performance...).
Test ScriptA script that runs a sequence of test cases or a whole test suite automatically.
🛑 When to stopTest AdequacyWe can't use every possible input — so which do we use, and when do we stop? An adequacy criterion is a rule that lets us judge the sufficiency of a set of test data. Example: test coverage (statement coverage, branch coverage...) — a measurement of what % of the code was exercised, e.g. via the Cobertura tool.
Test case verdicts — the three possible outcomes of running one:
Pass: execution completed, and the function performed as expected.
Fail: execution completed, but the function did not perform as expected.
Error: execution was not completed at all, due to an unexpected event, exception, or improper setup of the test case.
// Example JUnit test case for testing sum(int a, int b) int actual_output = sum(1, 2); assertTrue(actual_output == 3);

Here, 3 is the test oracle (the expected output) baked directly into the assertion.

§ 05 — GRANULARITY OF TESTING & TESTING VS. QA

Four zoom levels, and testing's place inside quality assurance

Acceptance Testing — validate against user requirements, by customers, without formal test cases
System Testing — test the system as a whole, by developers
Integration Testing — test the interaction between modules
Unit Testing — test of each single module
TESTING PURPOSE

Two things testing is explicitly NOT

The purpose of testing is to find defects — to discover every conceivable weakness in a software product. The deck highlights this in a bright yellow callout box, verbatim:

1. Software testing ≠ Debugging.
2. Software testing ≠ Quality assurance.
Testing vs. Quality Assurance (QA)

Software testing is a planned process used to identify the correctness, completeness, security, and quality of software. Quality Assurance (QA) is a planned and systematic way to evaluate the quality of the process used to produce a quality product. QA's goal is to assure a product meets the customer's quality expectations.

Testing is necessary but not sufficient for QA — testing contributes to quality by identifying problems. QA sets the standards for the whole team/organization to build better software.
The Venn picture from the deck
QA TESTING improvement of dev. process prevention of bugs appearing finding bugs uncovering bugs before users find them
§ 06 — THE SEVEN TEST PRINCIPLES

P1 through P7 — starred by the instructor as "memorize? understand all"

This is the one slide the instructor personally flagged with a star. Given the midterm note up top ("listing capped, but understand everything"), these seven are the highest-yield thing in the whole chapter.

🐘
Memory hook — first letters, in order
"Pretty Eager Elephants Cannot Paint Cute Art"
Pretty=Presence(P1) · Eager=Exhaustive-impossible(P2) · Elephants=Early(P3) · Cannot=Clustering(P4) · Paint=Pesticide paradox(P5) · Cute=Context-dependent(P6) · Art=Absence-of-errors fallacy(P7).
🔍

P1 — Presence of defects

Testing can show defects are present, but cannot prove there are none. It reduces the probability of undiscovered defects — but even zero found is not proof of correctness.

♾️

P2 — Exhaustive testing is impossible

Testing every combination of input and precondition isn't feasible except in specific cases. We use risks and priorities to focus test effort.

⏱️

P3 — Early testing

Testing activities should start as early as possible in the development life cycle, and should be focused on defined objectives.

🎯

P4 — Defect clustering

A small number of modules contain most of the defects discovered during pre-release testing.

🐜

P5 — Pesticide paradox

If the same set of tests is repeated over and over, it will stop finding new bugs — the defects it can catch are already gone, just like pests develop resistance.

🏗️

P6 — Context dependent

Testing is done differently in different contexts — safety-critical software is tested very differently from an e-commerce site.

🙅

P7 — Absence-of-errors fallacy

Finding and fixing defects doesn't help if the software system is unusable or doesn't meet the user's expectations.

P5 in practice: to overcome the pesticide paradox, test cases need to be regularly reviewed and revised, and new, different tests need to be written to investigate different parts of the software.
§ 07 — FUNDAMENTAL TEST PROCESS

Seven steps from "who/what/why/when/where" to a closed test cycle

Test case vs. Test suite vs. Test plan
Test case: inputs, steps/actions, and expected results — i.e., a pass-fail criterion.

Test suite: a group of test cases, usually organized around some principle (e.g. a smoke test suite).

Test plan: a document that specifies how a system will be tested, including criteria for success — the exit criteria.

Testing process: developing test plans, designing test cases, running the test cases, and evaluating the results.
The 7 fundamental test process steps
1. Test planning 2. Monitoring & control 3. Test analysis 4. Test design 5. Implementation 6. Execution 7. Completion

1–2. Planning, monitoring & control

who / what / why / when / where

A plan encompasses what, how, when, and by whom: scope, objectives, and risk analyses; the test levels and types to be applied; documentation to be produced; resources assigned to each test activity; and the schedule for implementation, execution, and evaluation. Control and adjust the plan to reflect new information and new project challenges.

3–4. Analysis & design

objectives → conditions → cases

First, review the test basis: requirements, product architecture, product design, interfaces, and the risk analysis report.

Analysis

General test objectives are transformed into concrete test conditions.

Design

Produces test cases, test environments, test data, and creates traceability back to requirements.

5–6. Implementation & execution

build it, then run it
Implement

Group tests into scripts, prioritize the scripts, prepare test oracles, write automated test scenarios.

Execute

Run the tests and compare results with oracles, report incidents, repeat test activities for each corrected discrepancy, and log the outcome of test execution.

7. Test completion

close the loop
Evaluate

Assess test execution against the defined objectives. Check if more tests are needed, or if exit criteria should change.

Report & close

Report: write or extract a test summary report for stakeholders. Test closure activities: the activities that make test assets available for later reuse.

§ 08 — THE PSYCHOLOGY OF TESTING

Testers need a different mindset than developers

A good tester needs
Curiosity Professional pessimism Attention to details Good communication skills Experience at error guessing
To communicate defects and failures constructively: keep reports and reviews of findings fact-focused — not accusatory.
Tips & tricks: be clear and objective. Confirm that (1) you understood the requirements, and (2) the person who has to fix the bug has understood the problem.
Independence in testing

A certain degree of independence is often more effective at finding defects and failures. However, a developer can also very efficiently find bugs in their own code. The right level of independence depends on the objective of testing.

Level 1 — Lowest independence

Tests designed by the same person who wrote the code

Level 2

Designed by another person, same team, same organization

Level 3

Designed by a person from a separate testing team, same organization

Level 4 — Highest independence

Designed by a person from an outside organization / company (outsourced)

§ 09 — LIMITATIONS OF SOFTWARE TESTING

What testing can never promise you

Testing vs. Verification vs. Debugging

three different jobs

Both testing and verification attempt to exhibit new failures. Debugging is a separate, systematic process that finds and eliminates the defect that led to an observed failure. Programs without any known failures may still contain defects — either because they haven't been verified yet, or because they have been verified but the failure in question simply isn't covered by the specification.

Exhaustive testing is impossible — the math

Consider a simple program with a loop bounded at 20 iterations and a handful of branches: it has 10¹⁴ possible paths. At one test per millisecond, testing every path would take 3,170 years. Exhaustive testing is impossible — full stop.

Absence of defects ≠ correctness
"Program testing can be used to show the presence of bugs, but never their absence." — Dijkstra, 1969

Testing reduces the probability of undiscovered defects remaining in the software, but even if no defects are found, it is not proof of the absence of defects.
So how much testing is enough?

It depends on the level of risk (technical risks, business risks) and on project constraints (time, budget). It's impossible to test everything — testing should provide sufficient information for stakeholders to make informed decisions about releasing the software or planning next development steps.

When do you stop?

One of the hardest problems in testing is not knowing when to stop. You can use metrics as a guess — keep track of the defect rate, and when it trends toward zero, treat that as an indicator. But even if you do find the very last bug, you'll never actually know it was the last one.

Myth, busted here too: "Principles are just for reference, I won't use them in practice." Fact: this is untrue — the seven principles help you build an effective test strategy and draft error-catching test cases. Experienced testers internalize them to the point of applying them without even thinking about it.
§ 10 — COMMON MISTAKES

The wrong answers this chapter's exam questions are designed to catch

Every one of these is a distinction the deck explicitly draws — which means it's fair game to mix up under exam pressure.

1. "A defect is the same thing as a failure"

✗ WRONGIf the code has a defect, that IS a failure.
✓ RIGHTA defect is a flaw sitting in the code. It only becomes a failure if it's executed and produces observably wrong behavior — square(2) proves the same defect can run without failing.

2. "Testing and debugging are basically the same activity"

✗ WRONGTesting finds AND fixes bugs.
✓ RIGHTSoftware testing ≠ Debugging (stated explicitly, in a highlighted box). Testing discovers/exhibits failures; debugging is the separate systematic process of finding and eliminating the defect that caused one.

3. "Testing and Quality Assurance are the same thing"

✗ WRONGIf you test enough, you have QA covered.
✓ RIGHTSoftware testing ≠ Quality assurance. Testing is necessary but NOT sufficient for QA — testing finds problems in the product; QA improves the process that produces the product.

4. "If testing finds zero defects, the software is bug-free"

✗ WRONGNo bugs found = correctness proven.
✓ RIGHTP1 + Dijkstra's quote: testing can show defects ARE present, never that they're absent. Zero-found only reduces the probability of undiscovered defects — it's not proof.

5. Mixing up test verdicts: Pass, Fail, and Error

✗ WRONGAny test that doesn't pass is a "Fail."
✓ RIGHTFail means execution completed but the result was wrong. Error means execution never even completed (crash, exception, bad setup) — you don't yet know if the function itself is right or wrong.

6. "A great regression suite keeps finding new bugs forever"

✗ WRONGThe same test suite, run repeatedly, will keep proving quality.
✓ RIGHTP5, the Pesticide Paradox: run the same tests over and over and they stop finding new bugs. You must regularly review, revise, and add new tests to probe different parts of the software.

7. Confusing P1 (Presence of Defects) with P7 (Absence-of-Errors Fallacy)

✗ WRONGThese are the same principle stated twice.
✓ RIGHTP1 is about what testing can prove (presence, not absence, of bugs). P7 is a different trap entirely: even a system with zero known defects is worthless if it doesn't meet the user's actual needs.

8. "Test scaffolding should ship with the production code"

✗ WRONGScaffolding is just extra helper code — keep it around, it can't hurt.
✓ RIGHTTest scaffolding is explicitly "not useful in production code" and "needs to be removed" — it exists only to let you exercise a unit in isolation during testing.
§ 11 — POP QUIZ

Click a question to reveal the answer

Separate from the Practice Lab below — these are quick recall checks, not full exam-style questions.

Q1Where and when was the very first recorded software "bug" found, and what was it, literally?
Answer: A moth trapped between points at Relay #70, Panel F of the Mark II Aiken Relay Calculator, at Harvard University, on September 9, 1945. It's now on display at the Smithsonian.
Q2What kind of software issue caused the Ariane 5 Flight 501 self-destruction, and was it a programming error?
Answer: No — not a programming error, and not a design error either. It was an unprotected data-type conversion (convert_double_to_int) throwing an exception because a reused Ariane 4 component's precondition (abs(BH) < 32768.0) no longer held for the more powerful Ariane 5. Root cause: reuse of a component with a hidden constraint, combined with an integration-testing gap.
Q3Short answer: describe the Error → Defect → Failure chain in one sentence each.
Answer: A human makes an error (mistake) during design, coding, requirements, or even testing. That error can leave a defect (fault/bug) in the requirements, design, or code. If that defect is executed, a failure — a deviation from expected behavior — may occur, though not every execution of a defect causes one.
Q4MC: A test case's execution crashes with an unhandled exception before it can compare actual vs. expected output. Is that a Pass, Fail, or Error?
Answer: Error. Fail requires the test execution to have completed, just with the wrong result. Here execution never completed, so it's classified as Error, not Fail.
Q5True or False: "Software testing = Quality Assurance."
Answer: False. Testing is necessary but not sufficient for QA. Testing evaluates the product (finds defects); QA evaluates and improves the process used to build the product.
Q6Which of the 7 test principles explains why re-running the exact same regression suite stops catching new bugs?
Answer: P5, the Pesticide Paradox. Fix: regularly review and revise test cases, and write new, different tests to investigate different parts of the software.
Q7Short answer: list the four independence levels for who designs a test case, from least to most independent.
Answer: (1) Same person who wrote the code → (2) another person, same team/organization → (3) a separate testing team, same organization → (4) an outside organization/company (outsourced testing).
Q8Per the "cost to repair" chart, roughly how many times more expensive is fixing a defect found after release compared to during the requirements stage?
Answer: 16× more expensive (1× at Requirements → 2× Design → 4× Code/Unit Test → 8× Independent Test → 16× After Release).
§ 12 — CHEAT SHEET

The whole chapter, one scannable table

ConceptOne-line definition
Error (mistake)A human action that leads to a defect.
Defect (fault, bug)A flaw in the system that CAN cause it to fail — a static property of the code.
FailureObserved deviation from the specification — only occurs if a defect is executed.
Test caseInputs + steps/actions + expected results (pass/fail criterion).
Test oracleThe expected output for a given input.
Test scaffoldingTemporary code that lets you run a unit in isolation; removed before production.
Test fixtureA known baseline state for the software under test (data, mocks, DB setup).
Test suite / script / driverA grouped collection of test cases / a script that runs them automatically / the framework that loads and evaluates them.
Test adequacyA rule for judging when a set of test data is "enough" (e.g. code coverage %).
Unit → Integration → System → AcceptanceSingle module → interactions between modules → whole system by developers → validated by customers against requirements.
Testing vs. QA vs. DebuggingTesting finds defects in the product · QA improves the process that builds the product · Debugging fixes the defect that caused an observed failure.
P1–P7Presence-not-absence · Exhaustive-impossible · Early · Clustering · Pesticide paradox · Context-dependent · Absence-of-errors fallacy.
7-step test processPlanning → Monitoring & control → Analysis → Design → Implementation → Execution → Completion.
VerdictsPass (completed, correct) · Fail (completed, incorrect) · Error (didn't complete).
§ 13 — PRACTICE LAB

Apply the vocabulary to concrete scenarios

Same shape of reasoning the instructor's own examples (square(), Ariane 5, the triangle program) use — worth drilling until automatic.

1. Given int square(int x) { return x*2; } (should be x*x): is the incorrect line itself a defect, a failure, both, or neither? What about calling square(3)?
→ The line is a defect. Calling square(3) (which returns 6 instead of 9) is a failure.
Why: a defect is a static flaw in the code, present whether or not it's ever executed. It only becomes a failure once execution produces an observable deviation from the specification.
2. Same buggy square() function — is calling square(2) (which returns 4) a failure?
→ No. Not a failure.
Why: 2*2 also equals 4, so the wrong formula happens to produce the correct result for this specific input. The defect is still there — it's just not "showing" this time. This is exactly why P1 says testing shows presence, not absence, of defects: you can run many inputs and see no failures while a defect still lurks.
3. A tester runs the same regression suite before every release for two years. Lately it hasn't found a single new bug, even though users keep reporting issues. Which principle explains this, and what should the team do?
→ P5: the Pesticide Paradox.
Why: repeating identical tests only ever catches the same category of bugs. The fix is to regularly review and revise the test cases and add new, different tests that probe different parts of the software.
4. Classify the Ariane 5 root cause using the deck's own framing: was it a programming error, a design error, an integration-testing gap, or a reuse-without- revalidation problem — or some combination?
→ An integration-testing gap AND a reuse-without-revalidation problem — explicitly NOT a programming error or a design error.
Why: the unprotected conversion was a deliberate ~1980 design decision, valid and justified for Ariane 4's flight profile. The failure was that this precondition (abs(BH) < 32768.0) was never re-verified against Ariane 5's more powerful, different trajectory — theoretically catchable in integration testing, but the test space was huge versus the resources available.
5. A test case for the triangle-classifier program is run with input 0, 0, 0, and the program correctly prints "Error: all values must be > 0." What test-design idea does this input specifically target?
→ A boundary case — testing right at the edge of the valid domain (0 is just outside "must be > 0").
Why: boundary values (like the minimum valid value, or one below it) are classic high-yield test inputs — bugs cluster at edges of valid ranges far more than in the middle of them.
6. A test executes to completion. The output matches the oracle exactly. What's the verdict — Pass, Fail, or Error?
→ Pass.
Why: the execution completed AND the function performed as expected — both conditions required for a Pass verdict.