Silent Input Truncation: The Bug Pattern Hiding in Your Text Fields
A number field that quietly drops digits instead of validating them — and why this bug pattern is easy to miss by hand.
The Bug: 120 Becomes 12
We found this testing Europe Stay Tracker. One field accepts a number of days, valid from 1 to 90. A scripted journey typed "120" into the field — an out-of-range value that should be rejected or flagged. Instead, the app silently became "12": the third digit was dropped, and the app went on to calculate an answer for 12 days as though that's what had been entered.
This is a worse failure mode than an app that rejects the input outright. A rejected value tells the user something's wrong. A silently truncated value gives them a confident, specific, wrong answer with no indication anything was dropped.
The Same Bug Pattern, a Second Time
After that finding, the same type of bug turned up in a different field: typing "150" silently became "15". Tracing it back, both cases came from the same root cause — a take(2) call on the raw input, which keeps only the first two characters typed, regardless of whether the resulting number is valid for the field. It's an easy mistake to make: take(2) reads like a sensible length cap, but it caps character count, not numeric validity, so "1" + "2" + "0" becomes "12" rather than the input being rejected as out of range.
Both were fixed in the next build.
Why This Hides From Manual Testing
If you're testing by typing valid values — the numbers you expect people to enter — this bug never appears. It only shows up when you deliberately type something out of range, which isn't the first instinct when you're checking that a feature "works." That's exactly why it's worth scripting as its own test case rather than relying on it coming up naturally.
How to Script a Test That Catches This
- For every bounded numeric field, enter a value with more digits than the maximum valid value (a 3-digit number into a field capped at 90, for example)
- Check what the field actually contains after typing, not just what the app does with it
- Enter the minimum valid value minus one, and the maximum valid value plus one
- Check decimal input into integer-only fields, and vice versa
- Grep the codebase for truncation patterns like
take(n),substringorsliceapplied to form input, and confirm each one is paired with real validation, not used as a substitute for it
This kind of input-validation check is part of the scripted-journey pass in every report we produce — see the full pre-release testing checklist. If you'd like this run against your app, see our QA testing service.
Catch These Before Your Users Do
AI-tested, human-reviewed QA reports for Android apps — scripted journeys, exploratory testing, accessibility checks, across device configurations.