---
title: "Discussion on \"The tests we run on period math\" | Hashnode"
description: "Discussion on \"The tests we run on period math\". Most bugs in a period tracker are not visual bugs. They are one day off.\nSomeone logs a period at 11:40 pm on March 1. Stored as a timestamp and rendered somewhere else, that date can come back as Feb"
url: "https://hashnode.com/posts/the-tests-we-run-on-period-math/6af8f620cece34ca42326c8b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The tests we run on period math](https://alfredchaos.hashnode.dev/the-tests-we-run-on-period-math?utm_source=hashnode&utm_medium=feed)

Most bugs in a period tracker are not visual bugs. They are one day off. Someone logs a period at 11:40 pm on March 1. Stored as a timestamp and rendered somewhere else, that date can come back as Feb

Nov 15 · 3 min read · alfredchaos.hashnode.dev  
Read the article

-   [#android](https://hashnode.com/tag/android)
-   [#privacy](https://hashnode.com/tag/privacy)
-   [#testing](https://hashnode.com/tag/testing)

## Written by

[Alfred Chaos](https://hashnode.com/@alfredchaos)

@alfredchaos

  
[View profile](https://hashnode.com/@alfredchaos)

Indie dev building Mori, a privacy-first period tracker. No account, offline, one-time purchase.

## Responses 1

Markdown supported · ⌘↵ to post

[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?
