Flora Liu Hardware Engineer

05 Test2Fail Toolkit

Test2Fail Toolkit

Test-to-failure data in, a reliability report out.

Which life model fits, how sure is the fit, and when do the first units fail?

A test-to-failure run ends with a column of numbers. Turning it into an answer takes the same steps every time, so I put them in one tool.

github.com/floraliu-dev/Test2Fail-Toolkit ↗ · Python · Ships with synthetic sample data only.

What it does

  • Fits Weibull, Lognormal and Exponential by maximum likelihood and picks the best one.
  • Checks the fit with a Kolmogorov–Smirnov test.
  • Puts 95% bootstrap confidence intervals (1,000 resamples) on the Weibull β and η.
  • Predicts B10, B50, B95 and MTTF from 10,000 Monte Carlo samples.
  • Suggests a maintenance interval from a target reliability and cost.
  • Writes every plot and table into one PDF.
Survival curves for the same data under Weibull, Lognormal and Exponential fits. Their MTTFs sit within 1,000 cycles of each other, but the curves part early in life.
Fig 1 Three fits to one dataset. The mean lives are close; the early-life curves are not.

Why fit more than one model

Two models can agree on the mean life and still disagree on when the first 10% fail. Field returns come from that early tail, so the tool reports B10 and the fit test alongside MTTF.

I walk through one such dataset in How a product earns confidence.

Does the model match the data?

A best fit is only the best of three. The tool overlays the fitted CDF on the measured data and on a Monte Carlo sample drawn from the fit, then measures the largest gap between them.

Cumulative distribution of the measured lifetimes, a simulated sample and the fitted model, lying almost on top of each other. KS statistic 0.065, p-value 0.9507.
Fig 2 Measured, simulated and fitted CDFs. The largest gap is 0.065 (KS test, p = 0.95): no sign the model is wrong.

Try it