Sunteți pe pagina 1din 5

Test & Analyze

Testing
Without
a Map
You don’t
always need
SOMETIMES WHEN FACED WITH AN UNFAMILIAR APPLI-
to wait for cation and a directive to test it, it can feel as if you’ve
complete been asked to chart a course through unknown waters.
You’re not sure what you’ll find on the voyage, but
specifications you’ve got experience, some notions of what to look
to start your for, and an idea of where you’d like to go. If you see
something surprising or unexpected, you’ll take note of
testing effort. it. Those are exploratory skills, and sometimes they’re
BY MICHAEL BOLTON all you need to begin.
Some testing advocates suggest that you should never
test without a “complete written specification.” That’s
unrealistic advice. First, there are plenty of contexts in
which you may be asked to test without a formal speci-
fication: when you’re evaluating a piece of commercial
software to see if it suits your company’s needs; when
your organization’s production code is so old and so
heavily patched that the original specification would be
meaningless—even if it could be found; or when work-

www.stickyminds.com JANUARY 2005 BETTER SOFTWARE 25


Test & Analyze

ing on Agile projects. Second, “complete- History: The feature’s or function’s cur- The Product itself: The behavior of a giv-
ness” is entirely dependent upon perspec- rent behavior should be consistent with en function should be consistent with the
tive and context. Even so-called “com- its past behavior, assuming that there is behavior of comparable functions or
plete” specifications contain much that is no good reason for it to change. This functional patterns within the same
implicit. In fact, the more explicit the heuristic is especially useful when testing product unless there is a specific reason
document, the longer and more ponder- a new version of an existing program. for it not to be consistent.
ous it is—and the less likely that some-
one will read it in its entirety. Finally, cer- Image: The product’s look and behavior Purpose: The behavior of a feature, func-
tain kinds of specifications might be should be consistent with an image that tion, or product should be consistent
supplied to you through some means the development organization wants to with its apparent purpose.
other than a formal document—conver- project to its customers or to its internal
sation, email, or your own inferences. A users. A product that looks shoddy often Statutes: The product should behave in
quick meeting with the boss, combined is shoddy. compliance with legal or regulatory re-
with your skills at identifying value, quirements.
risks, and problems, might give you all Comparable products: We may be able
the charter you need to begin supplying to use other products as a rough, de facto Remember: Heuristics are guidelines, not
useful information to management. standard against which our own can be edicts; they’re fallible. They aren’t univer-
An effective tester can always obtain compared. sal—there are plenty of other ways by
valuable information by exploration, which we can decide whether a product
even if the sole purpose of exploring is to Claims: The product should behave the is acceptable or unacceptable. There is
gather information for a more detailed way some document, artifact, or person some conceptual overlap between some
test strategy. says it should. The claim might be made of the points—but to an explorer, fea-
in a specification, a Help file, an adver- tures of the new territory overlap, too.
tisement, an email message, or a hall-
Prepare for way conversation, and the person or
theJourney agency making the claim has to carry
some degree of authority to make the
Explore and
When the explorers of old set sail for
claim stick. Discover
uncharted waters, they did not set out Users’ expectations: A feature or func- Armed with these tools, let’s imagine that
unequipped. They knew the sun and the tion should behave in a way that is con- I’m working for a small start-up, and that
stars, and they carried tools such as sistent with our understanding of what my company is going to be releasing its
compasses, sextants, and clocks, not users want, as well as with their reason- software on CDs. The company doesn’t
only for navigation but also for map- able expectations. have a lot of money, and every dollar
making. More importantly, they ven-
tured out with extensive background
knowledge and skills, which included
deduced reckoning, celestial navigation,
and horse sense. For exploratory testers,
knowledge is often represented in two
terms that you’ll use as a testing expert:
oracles and heuristics. An oracle is a
principle or mechanism by which we
can tell if the software is working ac-
cording to someone’s criteria; an oracle
provides a right answer—according to
somebody. A heuristic is a provisional
and fallible guide by which we investi-
gate or solve a problem; it’s also a
method by which learning takes place as
a result of discoveries informed by ex-
ploration.
James Bach has given us a helpful set
of oracle heuristics, to which I’ve added
one, in the form of this mnemonic: HIC-
CUPPS. The idea is that a product should
be consistent with: Figure 1: The main screen of Nero Cover Designer, shown immediately after startup.

26 BETTER SOFTWARE JANUARY 2005 www.stickyminds.com


Test & Analyze

counts, so my boss has asked me to evalu- about what the program can do. So let’s Hmmm . . . there’s nothing here that
ate the program that comes with the CD press the F1 key. looks like a reference to text. In fact,
burner: the popular Nero CD recording Why F1? Windows users have a there’s nothing here that seems to refer to
software. Printing CD covers is a require- heuristic that F1 should trigger the Help anything in the Cover Designer. Let’s go to
ment, so she asks me to have a look at file, courtesy of the Windows User Inter- the Index and look for the words “Cover
Nero’s Cover Designer, a subset of the face Guidelines. (See this issue’s Sticky- Designer.” All I see is Help for the Nero
CD recording package, to see whether the Notes for more information.) Cover De- CD-ROM burning software. That means
company should use it. Instead of writing signer is a Windows program, and a that either there is no Help for Cover De-
up an elaborate test plan, I’ll just plunge program’s behavior should be consistent signer, or if there is a Help file, it’s not
in, quit when I have more information, with programs like it. If there is a coming up from inside Cover Designer.
and then (and only then) make some deci- compelling reason for your program to That’s a problem based on the consistency
sions about how to proceed. Figure 1 behave differently, then it might be with user expectations heuristic—a user
shows what I see on the main screen just worthwhile to depart from de facto UI could reasonably expect that a Help file
after I start the program. standards. Otherwise, consistency with summoned from within an application
Yogi Berra was right: you can observe other products is a favor to the user, sav- should be that application’s Help file.
a lot just by looking. One of the first ing her the time and trouble of learning a Well, it seems as though I’ll have to
things I note is that there appears to be a different way of doing things. give up on Help, and that’s noteworthy.
default setting for the font: Arial for the When we press F1, a tooltip appears Let’s return to the first presumed bug and
face and 16 for the point size. My boss at the hot spot on the mouse pointer: do some more investigation. I don’t
doesn’t need to tell me to test fonts; I have know exactly what my company is going
the consistency with purpose heuristic in to put on the CD cover, but the specifics
my head to tell me that, if the task is to don’t matter, so I’ll put in some text that
print CD covers, graphics and text—and The tooltip says, “Lets
therefore fonts—are likely to be part of you modify the con-
that task. Do I care about the accuracy of tents of the text”.
the point sizes and color depth of the Shouldn’t that say,
graphics? Maybe, but I can ask about “Lets you modify the
those things later, after I’ve run some oth- contents of the text
er tests. I make a note to ask questions box”? That might be a
about accuracy and move on. quibble, but in some
I’m going to need to put something on contexts I’d be willing
my CD cover, so I choose to insert a new to call it a second bug.
object. I click Object, Insert, Text Box. If this were my pro-
Then I double-click the new object that gram, I might find the
appears, and the dialog shown in Figure imprecise English a
2 pops up. little embarrassing,
Something already feels funny. In the which would violate
new font properties area, the name of the the consistency with Figure 2: In the textbox properties box, the font name is
font has disappeared and the point size image heuristic: A pro- missing. Could this be a bug?
now appears to be 8. In accordance with gram should be con-
the consistency within the product heuris- sistent with the image that a
tic, one would think that the font proper- company wishes to present. And
ties should be the same on both the main another thing: shouldn’t F1 dis-
screen and the new dialog. Do we have play the Help dialog instead of a
our first bug? I’d say yes, but perhaps we tooltip? By Windows conven-
should do some checking. I’ll note it. tions, a tooltip should appear
when you hover over an item
with the mouse. I’ll write a cou-

Investigate ple more notes about these Help


issues; they might represent an-
NewFindings other bug or two.
I want to open the Help file.
We don’t have a specification, but Win- There’s another way to do
dows programs typically come with a that—I can click the Help but-
Help file. A program should be consis- ton to open it, click the Find tab,
tent with claims it makes about itself, and find all the references to
and the Help file is usually full of claims “text box.” (See Figure 3.) Figure 3: The Help dialog isn’t helpful.

www.stickyminds.com JANUARY 2005 BETTER SOFTWARE 27


Test & Analyze

reflects the way that I might use the pro- tations heuristic suggests that typing some tic: A program should behave in a man-
gram. (See Figure 4.) text should not change the selected font ner consistent with its own history or pre-
When I type “Beatles Compilation”— unless I’ve asked to do so. Even though vious versions of the product.
in fact, immediately after striking the B this rectifies the problem I noted as the The bugs in this program have been
key—the font size of 8 turns to 16, and first bug, it does so in a way that gives me pretty easy to find, and this last one is so
the formerly blank drop-down for the pause, and this is arguably yet another troublesome that I have some grave
typeface is suddenly set to Arial. The con- bug; I’ll write that down. I’ll highlight the doubts about the rest of the program. Af-
sistency with the user’s reasonable expec- text that I’ve entered and choose a differ- ter five minutes of testing, I’ll be able to
ent typeface and size; tell the boss that she should not rely on
again, specifics don’t this product to produce the company’s
matter. I’ll select Comic CD covers—and thank goodness I didn’t
Sans MS and 26 points. waste time preparing an elaborate test
(See Figure 5.) plan based on some incomplete specifica-
Then, I’ll press OK tion that some programmer apparently
to close the dialog. didn’t read.
Now, I’ll immediately
click the text box to
open the dialog again.
(See Figure 6.)
The Journey
Presto! The type-
face is back to Arial,
Ends
and the size is 16. This This was a particularly egregious exam-
violates the consistency ple, but if you’re still adamant that you
Figure 4: After typing in the text box, the font name with purpose heuristic. need a written specification before you
appears. Surely the purpose of can begin testing, consider what you’ve
pressing OK (rather just read in the context of two questions.
than Cancel) on an ob- First, did we need a written specification
ject is to retain the to provide important, credible, timely in-
properties that I’ve se- formation to management? Second,
lected until I explicitly would the cost of researching and
change them: A feature preparing a specification—and waiting
or function should be for it to be prepared—add significantly
consistent with its ap- to the value of our report?
parent purpose. An- As you can see, in many contexts it’s
other bug to note. not only perfectly OK but also entirely de-
Note that in this di- sirable to test without using a specifica-
alog there are tabs for tion. My background knowledge of GUIs
pen, brush, and image on Windows helped me recognize several
as well as text. I try problems, and my ability to put myself in
this out, and I find that a user’s shoes helped too. A few minutes
Figure 5: The text is highlighted, and the typeface and size
every time I try to re- of exploration, wandering through one
are changed.
open the text box to feature of the program and looking
modify one of these at- through the spyglass of those exploratory
tributes, the font infor- testing heuristics, has helped me not only
mation disappears—an to find bugs but also to identify credibly
inconvenience and an why I think they’re bugs, even though I
annoyance and, even had nothing like a complete, formal, writ-
without a specifica- ten specification. Although I didn’t have a
tion, manifestly a bug. map, I was certainly able to explore and
I’m disappointed be- compile one along the way. {end}
cause I seem to re-
member this feature Michael Bolton lives in Toronto and
working in a previous teaches heuristics and exploratory testing
version of Nero Cover in Canada, the United States, and other
Designer. That’s a vio- countries as part of James Bach’s Rapid
lation of the consisten- Software Testing course. Contact Michael
Figure 6: The typeface and size did not save with the text. cy with history heuris- at mb@developmentsense.com.

28 BETTER SOFTWARE JANUARY 2005 www.stickyminds.com

S-ar putea să vă placă și