Engineer-to-Engineer: Building a Typing Test That Doesn't Lie to You
If you've ever shipped a "typing speed" feature into a developer tool, an educational dashboard, or a hiring pipeline, you've probably noticed that the simplest-looking metric in computing — words per minute — is also one of the easiest to game and the hardest to defend in a code review. The original article in this series pushes past the 80 WPM plateau. This one is for the people building the…
If you've ever shipped a typing speed feature into a developer tool, an educational dashboard, or a hiring pipeline, you'll know that words per minute (WPM) is a metric that can easily be manipulated and is difficult to defend in a code review. This article is for the people building the measurement itself: how to create a typing test that withstands scrutiny from accessibility leads, data engineers, and skeptical senior developers.
The two meanings of "word" you need to settle before anything else are:
1. The classic 5-character word, where total characters typed (including a trailing space) divided by 5.
2. The linguistically grounded word, counting whitespace-delimited tokens present in the source text.
These definitions produce noticeably different numbers for the same user, so you must pick one and document it or expose the formula in a tooltip for the user to see.
A naive implementation measures time from the first keypress to the last keypress and divides, but this approach has three issues that show up in real bug reports:
1. Idle gaps inflate the denominator unfairly.
2. Cold-start padding distorts short runs.
3. Backspace handling changes the meaning of the score.
To avoid these issues, stop the clock after a certain period of no input, run a warm-up prompt for short runs, and handle backspaces appropriately by computing raw CPM over all characters committed and accuracy as correct / total_attempted.
A reasonable internal model should have three numbers: Quantity (formula), Surface to user? (raw or net), and whether it's a primary or secondary metric. Never display gross WPM, as it rewards sloppy typing. Display the corrected (net) WPM instead.
When picking a corpus, consider dictionary vs. prose and domain-specific tokens. Also, think about keyboard layout and accessibility concerns for users on screen readers or alternative input devices. A per-bigram latency map can be a highly useful diagnostic feature once the headline metric works.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.