RISK-BASED QUALITY AND INSPECTION
Deciding on a lot from a sample
Understand what a sampling plan tells you, how it supports an acceptance decision and which risks remain.
A decision, not a guarantee
What is acceptance sampling?
Acceptance sampling is a statistical procedure for accepting or rejecting a lot on the basis of sample results. Its primary purpose is to support a decision specified in advance, rather than to estimate every aspect of lot quality or to control the production process.
100% inspection
Every unit is examined. This can be expensive or impractical, particularly when testing is destructive, slow or laboratory-based. Inspecting all units does not eliminate measurement or classification errors.
Sampling inspection
Only part of the lot is examined. This reduces time and cost but introduces uncertainty: two samples from the same lot can lead to different decisions. Decision risks must therefore be designed into the plan and communicated.
Key principle: accepting a lot does not establish that every unit conforms. It means that the observed results do not trigger rejection under the agreed sampling plan.
Two ways of observing quality
Sampling by attributes and by variables
Sampling by attributes
Each unit is assigned to a category, such as conforming/nonconforming, detected/not detected or intact/defective packaging.
- The result can be summarised as a count of nonconforming units.
- A single sampling plan is commonly described by n and c.
- It does not retain the magnitude of each deviation.
- It may require more units than an appropriate variables plan.
Sampling by variables
The numerical measurement is retained, for example net mass, concentration, moisture content or a physical dimension.
- Plans use information on location, variation and specification limits.
- They extract more information from each measured unit.
- They may achieve the desired protection with a smaller sample.
- Distributional assumptions and relevant measurement uncertainty must be considered.
The core of the plan
Producer’s and consumer’s risks
A plan is designed around specified quality levels and tolerable probabilities of making the wrong decision. Names differ across standards, so always check the definitions used by the selected scheme.
Producer’s risk (α)
The probability of rejecting a lot at the quality level designated as satisfactory. Such a rejection can cause unnecessary cost, delay or waste.
Consumer’s risk (β)
The probability of accepting a lot at the quality level designated as unsatisfactory. The consequences may affect the purchaser, trade or public health.
If p₁ is the satisfactory fraction nonconforming and p₂ the unsatisfactory fraction, the design aims for Pₐ(p₁) ≥ 1 − α and Pₐ(p₂) ≤ β. These are risks at specified quality levels, not universal error rates for every possible lot.
Single sampling by attributes
The probability of acceptance
Pₐ(p) = ∑d=0c C(n,d) pd (1 − p)n−d
Here, n is the sample size, c the acceptance number, d the observed number of nonconforming units and p the true fraction nonconforming. C(n,d) = n! / [d!(n−d)!]. Accept if d ≤ c; reject if d > c.
This binomial model assumes independent classifications with a common probability of nonconformity. It is an approximation for random sampling without replacement when the sample is small relative to the lot. For a substantial sampling fraction from a finite lot, the hypergeometric model may be needed. Clustering and heterogeneity also require attention.
Reading plan performance
The operating characteristic (OC) curve
An OC curve links actual lot quality to its probability of acceptance. It makes the plan’s ability to distinguish between quality levels visible.
| Element | Question | Interpretation |
|---|---|---|
| Horizontal axis | What fraction of the lot is nonconforming? | Larger values mean poorer quality. |
| Vertical axis | How likely is this lot to be accepted? | A high probability is not proof of conformity. |
| Transition | How well does the plan distinguish nearby quality levels? | Greater discrimination generally requires more information. |
| Risk points | What happens at the two designated quality levels? | Check producer’s and consumer’s risks before adoption. |
A theoretical error-free inspection of every unit, combined with a defined lot-quality cutoff, would give a sharp decision boundary. Sampling produces a gradual transition: lots of different quality may still have similar acceptance probabilities.
Decision sequences
Single, double, multiple and sequential plans
Single sampling
Take one sample of size n and apply the acceptance number c. The procedure is straightforward to administer and communicate.
Double sampling
The first sample may lead to acceptance, rejection or a second sample. If a second sample is required, apply the specified cumulative decision rules. Compared with a suitable single plan, this can reduce the average number inspected.
Multiple or sequential sampling
Evidence is gathered over several stages or, in sequential sampling, potentially one unit at a time. Efficiency gains must be balanced against operational complexity, record keeping and training.
A double plan is not a retest because the first result was unwelcome. Sample sizes and all acceptance, rejection and continuation rules must be defined before sampling starts.
Application in food operations
From the objective to the plan
The Codex General Guidelines on Sampling, revised in 2023, emphasise defining the objective, the lot, the characteristic to be checked and the required protection against decision errors.
- Define: specify the lot, characteristic, limit, intended decision and consequences.
- Select: choose attributes or variables and a suitable statistical model.
- Design: set quality levels, tolerable risks, sample sizes and acceptance rules.
- Verify: examine the OC curve, practical feasibility and physical sampling procedure.
Teaching example: packaging seal defects
A company needs to decide whether to accept lots of sealed packages. Each inspected unit is classified against a predefined seal-integrity criterion.
- Define what counts as a defect and how it will be assessed.
- Specify satisfactory quality and an unsatisfactory level that should have a low probability of acceptance.
- Choose α and β in light of commercial and food safety consequences.
- Select an n–c plan and examine its OC curve.
- Document random selection, traceability and lot disposition.
This is a procedure illustration, not a recommended plan for a specific food. Selecting n and c simply because they have always been used, or changing c after seeing the results, is not a defensible design method.
Microbiological sampling
The ICMSF approach
ICMSF links the stringency of microbiological sampling to the hazard and to what may happen to the food after sampling. The meaning of a result depends on the organism, food, analytical method and conditions of use.
Two-class plans
Sample units fall into acceptable or unacceptable categories relative to a microbiological criterion. Such plans commonly use n, c and m. For detection/non-detection criteria, specify the organism, analytical unit quantity and test method explicitly.
Three-class plans
Two limits, m and M, define satisfactory, marginal and unacceptable results. Under a common convention, results ≤ m are satisfactory, those > m and ≤ M are marginal, and those > M are unacceptable. Accept only if no result exceeds M and no more than c results are marginal. Follow the boundary convention of the applicable criterion.
In both cases: n is the number of sample units examined. The acceptance number c counts unacceptable units in a two-class plan, but marginal units in a three-class plan.
Finished-product testing does not replace good practices, HACCP, process control or environmental monitoring where appropriate. A satisfactory sample result does not prove the absence of contamination throughout the lot. Microbial distribution, analytical performance, test-portion size and sample representativeness matter.
Common pitfalls
What to avoid
- Equating lot acceptance with an absence of defects.
- Using convenience samples instead of an appropriate probability sampling procedure.
- Specifying a limit without considering decision risks.
- Ignoring spatial patterns or heterogeneity within the lot.
- Disregarding measurement uncertainty when it is relevant.
- Using incoming-lot inspection as a substitute for process control.
- Repeating tests until a favourable result is obtained.
- Applying a standards table without checking its scope and assumptions.
Sources and further reading
Technical references
- Codex Alimentarius — General Guidelines on Sampling, CXG 50-2004, revised in 2023.
- Codex — Information document for the General Guidelines on Sampling: background and worked applications.
- NIST/SEMATECH — Types of Lot Acceptance Sampling Plans.
- NIST/SEMATECH — Choosing a Sampling Plan with a Given OC Curve: binomial acceptance probabilities and risk points.
- ICMSF — Microorganisms in Foods: principles and applications.
- ICMSF — Microbiological Sampling Plans software: exploration of plan performance.
- Hong Kong Centre for Food Safety — Guidance Notes on Sampling Plan for Microbiological Analysis: definitions for two- and three-class plans.
Future development: sampling-plan simulator
A future tool will allow comparison of sample sizes, acceptance numbers and OC curves to explore changes in producer’s and consumer’s risks. The simulator is not yet available on this page.
Educational guidance adapted from the QualiFood Spanish guide. It is not an official translation of Codex or ICMSF publications and does not replace applicable requirements or a product-specific sampling plan.
