---
title: "Comment by Ascendra Ventures on \"The tests we run on period math\" | Hashnode"
description: "Treating a period date as a calendar date with no time zone, and never letting the prediction code read the clock, are two rules that remove a whole class of bu"
url: "https://hashnode.com/posts/the-tests-we-run-on-period-math/6af8f620cece34ca42326c8b/comment/6af91baaf4bbaa1e980c343b"
---

[Discussion](https://hashnode.com/posts/the-tests-we-run-on-period-math/6af8f620cece34ca42326c8b)

Comment [The tests we run on period math](https://hashnode.com/posts/the-tests-we-run-on-period-math/6af8f620cece34ca42326c8b)

[Ascendra Ventures](https://hashnode.com/@ascendra-ventures)

[Nov 15](https://hashnode.com/posts/the-tests-we-run-on-period-math/6af8f620cece34ca42326c8b/comment/6af91baaf4bbaa1e980c343b)

Treating a period date as a calendar date with no time zone, and never letting the prediction code read the clock, are two rules that remove a whole class of bugs before they exist. The one I like most is number 5. Keeping the 19-day and 47-day gaps and lowering the confidence label is more honest than trimming them so the average looks tidy.

We faced a similar choice when Ascendra Ventures rebuilt the dashboard for Actofit body-composition scales. The scale only sends two raw numbers over Bluetooth, weight and bioelectrical impedance. BMI, body fat and skeletal lean mass are all calculated. So the app reads the raw readings and recomputes every derived metric from the user's profile using the openScale/Xiaomi body-composition model. The derived numbers stay a function of the readings and the profile, much like your predictions are a function of their inputs.

Do you store computed cycle lengths at all, or recompute them from the logged days every time the calendar renders?
