December 2, 2014

Why test it? Because it's there

The mountaineer George Mallory, when asked in 1923 why he felt compelled to climb Mount Everest, is famously claimed to have responded: "Because it's there". I'm drawn to testing by a similar outlook - why would you not want to test something, especially the crisp, untouched surface of something which has never been tested before? - but I sometimes find it difficult to explain this to other people.

And then EuroSTAR happened.

Before and after keynote sessions in the main auditorium, the main viewscreen displayed a rotating cycle of recent EuroSTAR-themed tweets from the previous few minutes. After Shmuel Gershon's keynote, the screen showed one of the quotes from his presentation which I'd tweeted:

I'd used linebreaks to emphasise the pause between the statements, but when the tweet appeared on the auditorium screen, it created a malformed display - I didn't manage to grab a photo in time, but the final sentence had dropped below the intended display area.

This gave me pause to utter one of the most famous words of the curious tester: "Huh."

With some time before the next auditorium session, I began wondering: How many other opportunities for display errors might there be? I decided to do some "testing in production" by using TweetDeck to schedule some tweets for the next time that we were in the auditorium, so that I could be poised with camera in-hand to capture any bugs that I observed.

I settled on four tweets, each of which I believed could reveal different pieces of information, and scheduled them for 10 minutes before we entered the auditorium, as the montage always began with tweets from about 10 minutes beforehand.

Message 1: Linebreaks

This was an attempt to replicate the behaviour that I had observed in the previous session. This time, I added multiple linebreaks which I thought might exacerbate the problem, whereas it might have made more sense to replicate the exact structure of my original message.

Nevertheless, it had the intended effect, breaking the rendering:

Message 2: Unprintable characters

This might not look too impressive, but that's because it involved tweeting a variety of unprintable characters (utilising the allchars mode in PerlClip). I didn't catch a photo of this on the big screen, but it did similarly screw with the layout - as I recall, the "How did that go?" message was rendered on top of my avatar/name.

Message 3: Wrapping and special characters

With time and tweets limited (and with PerlClip's allchars still in my clipboard buffer), I opted to attack on two fronts simultaneously. Not only did I post a selection of extended characters, but I also did so in a single string, to see whether the renderer managed to wrap the content.

We're getting a bit blurry now, as I was chuckling a little too heartily, but you can see a few things in this screenshot: It's encoded < and > into &lt; and &gt; (so it should be XSS-safe!), several characters near the end are displaying an "X" glyph indicating that they can't be rendered, and the string failed to automatically wrap.

Message 4: More special characters

To finish, some more extended characters, including a lot of common accented characters (thanks again, Perlclip). This time I interspersed spaces to take wrapping out of the equation, but which would also force the tweet to consume more lines than were available on the display.

This went pretty much as expected (and hoped) - it helped to identify several more unprintable characters, and demonstrated that it was possible to obscure the final line of the display (eliminating the author name/avatar):

And with that, my short, cheeky experiment was completed. Except it wasn't quite! Several people had caught on to what I was planning when I posted the tweets 10 minutes earlier, and had decided to re-tweet or repeat the messages. This meant they were looping under other people's names for the whole intermission!

The whole experiment gave me such a sense of innate joy and fulfilment - from first noticing the possibility of a problem, to generating test data which would help to discover more problems, to the dénouement where the fruits of my labours were revealed. When people ask me why I test: It's because I get to do this sort of experiment, dozens of times a day, to stop similar (but more serious) problems from emerging in the real-world.

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket
Comments powered by Disqus