Skip to content
All writing ‹ Part 10 of 11 · Mobile Debugging: When There Is No DevTools
Engineering · 4 min read

Experiment Mindset: Try to Disprove Your Own Guess First

Several guesses can fit the same facts, so a fit proves nothing. How to test a debugging guess on a phone by trying to disprove it with one change.

On the web, a test takes seconds, so a wrong guess dies fast. On a phone, each test is slow: you wait for the screen, you tap, and you read two recorders. So a guess that fits the facts tends to stay alive too long.

Start from first principles: a fit is not a proof

The same facts often fit several guesses. So a fit cannot tell you which guess is right. Only one thing makes a guess more believable: a test that can fail, and that the guess survives.

The test loop Facts lead to a guess, the guess leads to a prediction, and a test changes one thing. If the result differs from the prediction, the guess is refuted and the next guess starts. If it matches, the guess stays for now. Facts you observed Guess several guesses can fit Predict what one change will show Test change only that one thing differs matches Refuted try the next guess Guess stays for now
Only the test can end a guess. A match keeps it alive for now. A miss sends you back to the next guess.

An everyday example: your home Wi-Fi is slow. You guess that the router is too old, because it is five years old. The guess fits, but “the internet line is slow” fits too. To tell them apart, connect the computer straight to the modem with a cable, and change nothing else. If it is still slow, the router guess is refuted.

On a phone: one example

The example below is made up for teaching. It has the same shape as the real one. A WebView is a browser engine inside an app.

Two guesses, two tests The first guess blames target="_blank". Removing it changes nothing, so that guess is refuted. The second guess blames a click handler. A log shows defaultPrevented is true, so that guess survives. Facts a link does nothing on tap only it has target="_blank" Guess 1 target=_blank blocks the open test: remove target="_blank" only Still does nothing guess 1 refuted Guess 2 a click handler cancels the link test: log event.defaultPrevented defaultPrevented: true guess 2 survives, find the handler
The first guess fit both facts and still fell to one change. The second guess survived a test that was able to kill it.

target="_blank" and the failure appeared together, but the failure did not depend on it. Two things that appear together are not cause and effect.

The rules

  • Write each guess next to the test that can refute it, before you run anything.
  • Change one thing per test. Two changes in one test leave two possible causes.
  • A test result is a fact only about its own input. Check the conclusion with data from real users before it drives a decision (Changing Code on the Way Proves Only the Phone Side).
  • When a guess falls, update every document that states it.

A guess that fits is a start. A guess that survives is a finding.


Related: see why a proxy rewrite proves only the phone side, how to remove one layer per test, and the series takeaway: check one layer at a time with the right tool. Or go Back to the series overview.

↑↓ navigate ↵ open esc close