I changed a field name by mistake and our offline inspection screen carried on showing ready. The fake SDK just returns true, so it never supplied that field in the first place. I'm helping maintain this while the cell is unavailable. What should I give the programmer so the next beginner mistake is caught instead of celebrated?
Start with the documented response for the installed interface version and the code that reads it. Your fake should supply that shape, including a documented unsuccessful response. Otherwise you're testing how the screen reacts to true, which you've now established rather thoroughly.
We have the version and response description. The programmer found that a missing value gets changed to ready by a default in our wrapper. So the fake and the wrapper were helping each other hide it.
Please include good reading then failed reading, because I've seen an old value sit there looking perfectly current after the request that should have replaced it failed
Our apprentice handover used to say run the tests, without showing a failure. Give the next person your misspelled field example and the expected failure message. Much easier to trust a test you've seen complain.
Jack's example is useful. Keep a malformed-response case separate from the documented unsuccessful response, though. One means the interface contract isn't being met; the other can be an ordinary reported outcome.
Thanks Jack, I'll keep my typo as the example. Felix Baker, those are separate now in the proposed tests. Felix Adams, the screen still needs the old-value case; I hadn't included a second read at all.
And don't hide that error in a log nobody in the lesson can see. I don't know your parser, but I do know a green box wins every argument with a buried warning