Saturday, June 27, 2015

Pizza Chants


So my wife caught me giggling to myself in the kitchen. Why? I'd just seen a really corny pun on peace and peas. It wasn't the "classic" above but it was the same kind of thing. In fact, it wasn't the joke itself that had caused me to crack my face at all, but the thoughts spurred from the desire to make a better one from the same phonetic premise.

The first thing I come up with is:
Give Pisa chance
This slight variation on the well-known punchline is a plausible sentence but to make it work as a joke I need a context that can produce it. I'm working backwards from a result to look for some setup in which it is coherent:
Did you know that casinos are illegal in some parts of Italy? Apparently a bunch of gamblers held a candlelit protest overnight. 
They were singing "All we are saying is give Pisa chance."
This is also a testing pattern. When you're looking at responses from a system, a useful approach to finding potential issues can be:
  • I've got X. 
  • By changing X a little I can get Y. 
  • Y is plausible. 
  • Y would be bad. 
  • What context could give me Y?
The comedian Milton Jones has a beautiful gag which is a series of one-liners with the punch line "Your house stinks" spread out in his set:
 Anyone here own a cat?
 Any students in tonight?
So, you know what the punch line is going to be, what context might give a laugh here?  He goes for:
Is anyone in the audience an aromatherapist?
Which is not only funny, but also a (comedy) rule of three.

Meanwhile, back in the kitchen, I am busy applying another pattern - I think of it loosely as the Spooner - where you can look for the funny by permuting some aspect(s) of multiple elements. For example switching the initial sounds of peace and chance:
Give cheeser pants
Give cheetahs pants
Give cheaters pants
Give cheetah's pants
Small beer, perhaps. No obviously gut-busting laughs here, I'll grant you. But you could imagine contexts in which you could set these some of these up as jokes, although I will say that if you search for "cheetahs pants" as I did, looking for clues to such a context, you get a lot of photos of leopard skin leggings. Which - fashion naif that I am - violated both my expectations and my eyes.

But that's testing too: generate ideas and choosing to use them or not (at the moment). Sometimes rote generation  by some formula like this is productive and sometimes not so much. As it happens, I decide to try to stretch this line further (like some of those leggings) and end up with:
Give peaches pants
Which I found an amusing idea (this was the point my wife came to ask what had happened to her coffee) although probably a step too far in terms of plausibility... but I later found this picture:


To relate this back to testing with a specific example: imagine you have some functionality that accepts a couple of arguments. You might ask yourself questions like these:
  • what happens if the arguments are given in the wrong position?
  • does the structure, naming, usage etc of this functionality make it likely that users will mix up the arguments?
  • how would someone spot that they had made this kind of mistake?
I find an interesting overlap in techniques and skills I use for joking and testing and I use one to keep in trim for the other. I'll be talking about it at the Cambridge Tester Meetup and the UKTMF next month and then EuroSTAR in November.

1 comment:

  1. The last possibility: "how would someone spot that they had made this kind of mistake?" is academic and would not add quality in my opinion. But I am brute force kind of guy and hence I would use that in two ways, to randomize the input data ordering, or to systematically validate failure for all combinations except for the valid combinations. Interestingly enough swapping arguments around unpredictably is bound to open up cases where the parameter values may randomly have the same semantic value and hence once again automation may draw false positives out. Lets use an example in a language-agnostic or type-insensitive way:
    test1 = "hello", "conrad", 1 , FALSE
    test2 = "conrad", "hello", FALSE, 1
    Would both pass the case for the function prototype:
    Greeting ([string]anouncement , [string]recipient, [integer]repeatTimes, [bool]broadcastTweet)
    But would produce a passing result even though the parameters are randomly ill placed. I'm no fan of fuzzing, but I'm warming to it as a away of understanding ways of breaking APIs in a useful fashion by first feeding them data that "kinda" fits a mould. A bit like the rhyme:
    Give peas a chance = verb+noun+verb and/or optional conjunction ?

    ReplyDelete