Skip navigation.

So what is a software testing pattern?

patterns
[textile]Sorry to anyone reading this if I am telling you what you already know, but for the uninitiated, a **pattern**, put simply, is a common approach to solving a recurring problem or problem-type.

They have been around since the 70's (but I was only knee high to a grasshopper then - honest)... but considering how useful they are, I am surprised that it isn't talked about as much and certainly not as much in the UK (not in my experience in testing over the last decade)...

The patterns concept inspired the name behind this site... One of the key aspects of developing patterns is reflection. Reflecting on your experience, design (or refine) a pattern and then apply it before repeating the cycle and reflecting again. Seems obvious and simple - but I always preferred simple solutions to complex problems.

Some great introductory articles exist here:
"http://www.c2.com/cgi/wiki?WikiPagesAboutWhatArePatterns":http://www.c2.com/cgi/wiki?WikiPagesAboutWhatArePatterns

"Brian Marick's pages on Testing Patterns":http://www.testing.com/test-patterns/ explain the principles and link to some of the history (an interesting read). Brian frequently "discusses this concept on his blog":http://www.testing.com/cgi-bin/blog and is involved in the annual conferences for "Pattern Languages of Programming (PLoP) conferences":http://www.testing.com/cgi-bin/blog/2004/03/18#plop-2004 .

I will gather up more of my links and add them here as time goes on...

For now, this "Google Search for 'pattern software testing'":http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=pattern+software+testing&btnG=Search finds a good cross-section of resources relating to patterns in Software Testing, including:

"http://msdn.microsoft.com/architecture/patterns/testingpatterns/":http://msdn.microsoft.com/architecture/patterns/testingpatterns/

"http://www.rbsc.com/pages/TestPatternTemplate.htm":http://www.rbsc.com/pages/TestPatternTemplate.htm


and of course...
"http://www.testing.com/test-patterns/":http://www.testing.com/test-patterns/


[/textile]

Patterns observed in software testing?

[textile]Thanks for the comment James.

Is your concern only with the standard template for defining a "Pattern" and do you think that it is overkill and thus have you concluded that there is sufficient value in a "Lesson" (i.e. label+content)?

Perhaps patterns are more useful at a lower level than Lessons. I often see low level patterns in the tests that I apply and find it useful to communicate this to others in a succinct way. Perhaps all that is needed is the Lesson template in many cases.

Semantics aside ("Lesson" vs. "Pattern"), I find patterns in my testing useful. For example, perhaps a pattern of testing will identify a problem that requires a particular design pattern? Take the "Post Redirect Get Design Pattern":http://www.theserverside.com/patterns/thread.tss?thread_id=20936. This was applied on a project I am working on after a set of tests were performed evaluating managment of session state. I tend to apply a consistent pattern for tests that find problems in this space: reload, back, repeat (side-note: I suppose if I automated this, your blink oracle might be useful after a long sequence of navigation steps). The problems identified by these tests resulted in the "Post Redirect Get" pattern being implemented.

Of course, patterns shouldn't be preclude digression into creative exploration and thus don't preclude using heuristics to then explore beyond any failures or "rumblings":http://blackbox.cs.fit.edu/blog/james/archives/000142.html :-)

Interestingly, in your "rumble strip":http://blackbox.cs.fit.edu/blog/james/archives/000142.html heuristic, you explain an example of a test that most will probably always apply to text-input. Attempt to max out the field and all sorts of things can start to happen. I have also seen similar behaviour (although it was after the 4000th character on a HTML form field). Is this the beginnings of a simple test-pattern (e.g. "Increment to Max extent") or is it simply a common test? Is a collection of common tests for a text field just a collection of common tests or is that a testing pattern (e.g. "Null, Min & Max Boundaries")? Or as you imply, would documenting these as "Patterns" add too little value with too much structure and content?

Perhaps these patterns might serve no greater purpose than to help train people who are new to testing? Perhaps arming the junior tester with a starting point... perhaps getting them to the point where your Rumble Strip Heuristic might come into play? Perhaps the heuristic is the junior tester's cue to call in the experienced tester? If a "Lesson" is enough to do this - then I am all for it. Could there be some use in the headings for a pattern to help the junior tester understand why and when the pattern is relevant?

Questions, questions, questions! I don't have all the answers to these questions. :-)

Given time to study and apply the ideas more, I am sure the answers can be found. Perhaps you and Cem have already answered them? Perhaps a different perspective might highlight an alternative benefit? Until I do have enough answers, I look forward to exploring the concepts some more...

JMHO

What are your thoughts?

Antony

Lessons Learned in Software Testing

After attending a workshop on testing patterns, Cem Kaner and I left feeling that they had too much structure and too little content. That's why we wrote Lessons Learned in Software Testing, which is a plainer approach to patterns.

Our template was:

1. Label
2. Content

-- james

Comment viewing options

Select your preferred way to display the comments and click 'Save settings' to activate your changes.