What is Cost of Quality (CoQ)?
Cost of quality is everything you spend because quality matters — split into the cost of conformance (prevention: training, good design; appraisal: testing, inspection) and the cost of nonconformance (internal failure: rework, scrap; external failure: warranty claims, recalls, lost customers).
The entire argument of modern quality management fits in one sentence: money spent on prevention is the cheapest money in the table, and external failure is the most expensive. The exam rewards prevention over inspection every single time.
Formula
CoQ = prevention + appraisal + internal failure + external failure
Worked example
A SaaS team debates paying $40K for automated regression testing. Last year, two production outages cost $180K in credits and churn. The $40K is appraisal-plus-prevention; the $180K was external failure. Framed as cost of quality, the "expensive" test suite is the bargain of the year.