To measure quality cost, you need to identify and categorize the sources of quality-related expenses in your supply chain. A common framework is the PAF model, which divides quality cost into four types: prevention, appraisal, internal failure, and external failure. Prevention costs are the costs of preventing defects or errors from occurring, such as training, planning, and quality audits. Appraisal costs are the costs of checking or testing the quality of products or services, such as inspection, sampling, and laboratory analysis. Internal failure costs are the costs of correcting defects or errors before they reach the customer, such as rework, scrap, and downtime. External failure costs are the costs of dealing with defects or errors after they reach the customer, such as warranty, returns, complaints, and lost sales.