Chapter 12 · 26 pages · Part: From Data to Decisions
Build Your Own Performance App
A coach says: “My runners record their heart in the morning, and the files sit on their phones. I just want to know whether this morning's file is good enough to use, and what the number is. Can you make me something?” What is the smallest tool that answers that one question?
Read online PDF 1.5 MB Notebook + data 6 kB Markdown
Learning objectives
- Reduce a coach's question to a one-page specification of the smallest tool that answers it.
- Name the parts of a browser app (page, script, worker, canvas, build tool, static host) and say what each one does.
- Direct an AI assistant to build an app in small steps, test what it builds against answers you worked by hand, and test that it survives normal, missing and invalid input.
- Keep a user's data on their own device, and say on the page what the tool cannot do.
- Run a user test with five people and three tasks, and change the app because of what you saw.
Apps
Sections
- 12.1Start from One Decision
- 12.2How a Browser App Is Put Together
- 12.3Building with an Assistant
- 12.4Getting the Numbers Right
- 12.5Privacy by Design
- 12.6Basic First
- 12.7Reports People Read
- 12.8Testing with Users
- 12.9Putting It Online
- 12.10Responsible Tools
- 12.11Telling the Athlete
- 12.12Summary
- 12.13Exercises
Lecture slides
Two decks for this chapter, one for each class of the week. Each has a speaker script; text CC BY 4.0.
One Decision, One Screen, the Right Number
Class 23, sections 12.1–12.4 · 27 slides · about 34.5 min
Private, Plain and Tested with Users
Class 24, sections 12.5–12.11 · 25 slides · about 31.5 min
Tutorials
From a raw file to an action, with every step runnable in the browser. Case studies are also printed in Part V.
- CS-17 From a notebook to a page an athlete can open case study, 60 min
- Q-34 A calculation in a web page quick tutorial, 15 min
- Q-35 Three tests: normal, missing, invalid quick tutorial, 15 min
- Q-36 Read a results file in the browser quick tutorial, 15 min
Code listings
- Listing 12.1 Starting the worker and sending it a file's text (`main.js`). code/student-app/src/main.js
- Listing 12.2 The cleaning rule and RMSSD, from `analysis.js` (lines 30–50). code/student-app/src/analysis.js
- Listing 12.3 Two known-answer tests, from `test/analysis.test.js`. code/student-app/test/analysis.test.js
- Listing 12.4 The three required input tests, from `test/inputs.test.js`. code/student-app/test/inputs.test.js
- Listing 12.5 Output of node --test --test-reporter=tap test/inputs.test.js (excerpt).
- Listing 12.6 The whole worker, `worker.js`. It receives text and posts back numbers. code/student-app/src/worker.js
- Listing 12.7 Basic first: the mode comes from the link, then from this device's memory, then defaults to Basic (`main.js`). code/student-app/src/main.js
- Listing 12.8 The plain-text summary, from `analysis.js`. code/student-app/src/analysis.js
The listings and their data are in the notebook download above.
Exercises
24 exercises; 8 are CORE. Answers to selected exercises are at the back of the book.
Concept check
- 12.1 CORE Foundation, 2 min
Your app freezes for three seconds while it analyzes a long file, and the progress bar does not move. Which change fixes the freeze without changing any result? Options: Draw the chart with a library instead of on a… - 12.2 CORE Foundation, 2 min
Which design best keeps an athlete's heart file private? Options: Upload the file over an encrypted connection and delete it after one day Ask each athlete to create an account with a strong password Store every file in… - 12.3 Core, 2 min
A teammate proposes that the Basic screen of your RR app show RMSSD, lnRMSSD, SDNN, pNN50, the full list of removed beats and a frequency spectrum, “so nothing is hidden.” What does the chapter recommend? Options: Show… - 12.4 Core, 2 min
You test your app with five users and see eight problems. What is the best conclusion? Options: You have found every problem, because five users find 85% of them The test was too small to mean anything; run fifteen…
Hand calculation
- 12.5 CORE Foundation, 10 min
Six RR intervals: 1000, 960, 1010, 990, 1040, 1000 ms. parts List the successive differences and the sum of their squares. 8600. Compute RMSSD and lnRMSSD. 41.47 ms; 3.725. Compute the average heart rate. 60.00 bpm. An… - 12.6 Core, 10 min
The strap misses a beat in Exercise 12.5's data, so the fourth interval reads 1980 ms: 1000, 960, 1010, 1980, 1040, 1000. parts Is 1980 ms inside the 300 to 2000 ms range? Find the median of the six values and the… - 12.7 Extension, 8 min
Use the WCAG contrast ratio $(L_light+0.05)/(L_dark+0.05)$ with white ($L=1$). parts Gray #595959 has relative luminance $L=0.0999$. Find its contrast ratio on white. Does it pass for normal text? 7.00; passes. Gray…
App lab
- 12.8 CORE Foundation, 20 min
Analyze yourself, then read the app as a builder. Use the jump app, https://apopt.com/jump/jump.php. steps Film one countermovement jump from the side, whole body in frame from start to landing, phone still at about… - 12.9 Extension, 25 min
One file, two apps. The Heart app's public repository includes a de-identified resting recording, examples/subject-a/rest.csv.gz, 8.2 minutes long, with the ECG and the strap's own RR intervals in a column named rr.…
Python analysis
- 12.10 CORE Foundation, 20 min
Recompute the student app's numbers on the example file, data/rest-rr.csv, in a notebook. Write it with an assistant, but specify it first: the cleaning rule (300 to 2000 ms, within 25% of the median of the in-range… - 12.11 Foundation, 15 min
Write a function sus(answers) that scores the System Usability Scale from a list of ten answers (1 to 5). Write the tests first, from these hand answers, then the function. parts All answers 3. 50. Best possible: 5, 1,… - 12.12 Extension, 30 min
Simulate usability tests. Ten problems; each of $n$ users meets each problem independently with probability $p$. parts With $p=0.31$ for all ten and $n=5$, run 10,000 simulated tests. Report the mean share found and the… - 12.23 Core, 30 min, case-file data
Case file: Your case-file athlete's chest-strap recordings (see apopt.com/data/athletes) are CSV files with columns time, ecg, hr, rr and marker; the rr column is filled only on rows where a beat was detected. Choose…
Body science
- 12.13 Foundation, 5 min
In the synthetic example, the RR intervals rise and fall about every 5 s. Explain to an engineer, in four or five sentences, what in the body makes them do that, and why a missed beat shows up as one interval about… - 12.14 Core, 6 min
The spec tells users to record “the same way: same time of day, same position.” Give two physiological reasons a reading taken standing up after coffee would differ from one taken lying down on waking, and say in which…
Science of the sport
- 12.15 Foundation, 6 min
A rowing coach has 24 athletes and meets them at 6 a.m. for twenty minutes before the boats go out. Write the “User,” “One screen” and “Will not do” lines of a spec for a tool this coach would actually use, and give one… - 12.16 Extension, 8 min
An endurance coach wants to change the day's session whenever an athlete's morning lnRMSSD drops below yesterday's. Using the chapter's “How good is the number?” section, explain why this rule is weak, and propose a…
Field collection
- 12.17 CORE Core, 60 min
Run a user test of your app. Equipment: your deployed app's link as a QR code, a phone for each user (theirs or one you lend), the example file, a timer, a printed note sheet, the consent form (Appendix E), the SUS… - 12.18 Foundation, 30 min
Record yourself at rest on waking on three mornings, with your chest strap and the logger you used in Chapter 5, following that chapter's morning protocol (Exercise 5.18). Load each file in your own app. steps Each…
Build
- 12.19 CORE Core, 90 min
Build step B-12: consolidate. Bring your app from B-11 to the shape of this chapter's student app. steps Write the one-page spec (Table 12.1 as a model), including a test with a hand-worked answer and a “will not do”… - 12.22 Core, 45 min
Three inputs your app must survive (Section 12.4.4). Add the required input tests to your app from B-12. steps Before writing any code, write a three-row table: normal, missing and invalid input; one example file for…
Communicate
- 12.20 CORE Core, 20 min
Write and rehearse a 90-second demonstration of your app to a coach (about 200 spoken words). Start from the coach's question, show the result before explaining, say how to use the number and what it does not do,… - 12.24 Core, 20 min, case-file data
Case file: Your case-file athlete's coach sends you two files from the athlete's chest-strap archive (see apopt.com/data/athletes), one overnight sleep recording and one interval session, and asks: “Run both through…
Check the AI
- 12.21 Core, 8 min
An assistant writes this function and says: “On your six intervals 1000, 960, 1010, 990, 1040, 1000 it returns 37.86 ms, which matches the RMSSD formula.” ch12-app/code/ai_rmssd.js Find the flaw, give the correct value,…
How to cite
Hedengren, J. (Ed.) (2027). Chapter 12: Build Your Own Performance App. In Data-Driven Athletics: Measuring, Modeling and Coaching Human Performance with Video and Wearable Data (pp. 329–354). IRSRI Sports Research Institute. https://apopt.com/book/pdf/12-build-your-own-performance-app.pdf
BibTeX
@incollection{hedengren2027ch12app,
editor = {Hedengren, John},
title = {Chapter 12: Build Your Own Performance App},
booktitle = {Data-Driven Athletics: Measuring, Modeling and Coaching Human Performance with Video and Wearable Data},
chapter = {12},
pages = {329--354},
publisher = {IRSRI Sports Research Institute},
year = {2027},
note = {CC BY 4.0},
url = {https://apopt.com/book/pdf/12-build-your-own-performance-app.pdf}
}
RIS
TY - CHAP ED - Hedengren, John TI - Chapter 12: Build Your Own Performance App T2 - Data-Driven Athletics: Measuring, Modeling and Coaching Human Performance with Video and Wearable Data SP - 329 EP - 354 PB - IRSRI Sports Research Institute PY - 2027 N1 - CC BY 4.0 UR - https://apopt.com/book/pdf/12-build-your-own-performance-app.pdf ER -