Archive for the 'aa-ftt' Category

An alternative to business-facing TDD

The value of programmer TDD is well established. It’s natural to extrapolate that practice to business-facing tests, hoping to obtain similar value. We’ve been banging away at that for years, and the results disappoint me. Perhaps it would be better to invest heavily in unprecedented amounts of built-in support for manual exploratory testing.

In 1998, I wrote a paper, “When should a test be automated?“, that sketched some economics behind automation. Crucially, I took the value of a test to be the bugs it found, rather than (as was common at the time) how many times it could be run in the time needed to step through it manually.

My conclusions looked roughly like the following:

test tradeoffs in general

Scripted tests, be they automated or manual, are expensive to create (first column). Manual scripts are cheaper, but they still require someone to write steps down carefully, and they likely require polishing before they can truly be followed by someone else. (Note: height of bars not based on actual data.)

In the second column, I assume that a particular set of steps has roughly the same chance of finding a bug whether executed manually or by a computer, and whether the steps were planned or chosen on the fly. (I say “roughly” because computers don’t get bored and miss bugs, but they also don’t notice bugs they weren’t instructed to find.)

Therefore, if the immediate value of a test is all that matters, exploratory manual testing is the right choice. What about long-term value?

Assume that exploratory tests are never intentionally repeated. Both their long-term cost and value are zero. Both kinds of scripted tests have quite substantial maintenance costs (especially in that era, when testing was typically done through an unmodified GUI). So, to pull ahead of exploratory tests in the long term, scripted tests must have substantial bug-finding power. Many people at that time observed that, in fact, most tests either found a bug the first time they were run or never found a bug at all. You were more likely to fix a test because of an intentional GUI change than to fix the code because the test found a bug.

So the answer to “when should a test be automated?” was “not very often”.

Programmer TDD changes the balance in two ways:

Test tradeoffs for TDD

  1. New sources of value are added. Extremely rapid feedback reduces the cost of debugging. (Most bugs strike while what you did to create them is fresh in your mind.) Many people find the steady pace of TDD allows them to go faster, and that the incremental growth of the code-under-test makes for easier design. And, most importantly as it turns out, the need to make tests run fast and reduce maintenance cost leads to designs with good properties like low coupling and high cohesion. (That is, properties that previously were considered good in the long term—but were routinely violated for short-term gain—now had powerful short-term benefits.)

  2. Good design and better programmer tools dramatically lowered the long-term cost of tests.

So, much to my surprise, the balance tipped in favor of automation—for programmer tests. It’s not surprising that many people, including me, hoped the balance could also tip for business-facing tests. Here are some of the hoped-for benefits:

  • Tests might clarify communication and avoid some cases where the business asks for something, the team thinks they’ve delivered it, and the business says “that’s not what I wanted.”

  • They might sharpen design thinking. The discipline of putting generalizations into concrete examples often does.

  • Programmers have learned that TDD supports iterative design of interfaces and behavior. Since whole products are also made of interfaces and behavior, they might also benefit from designers who react to partially-finished products rather than having to get it right up front.

  • Because businesses have learned to mistrust teams who show no visible progress for eight months (at which point, they ask for a slip), they might like to see evidence of continuous progress in the form of passing tests.

  • People often need documentation. Documentation is often improved by examples. Executable tests are examples. Tests as executable documentation might get two benefits for less than their separate costs.

  • And, oh yeah, tests could find regression bugs.

So a number of people launched off to explore this approach, most notably with Fit. But Fit hasn’t lived up to our hopes, I think. The things that particularly bother me about it are:

  • It works well for business logic that’s naturally tabular. But tables have proven awkward for other kinds of tests.

  • In part, the awkwardness is because there are no decent HTML table editors. That inhibits experimentation: if you don’t get a table format right the first time, you’re tempted to just leave it.

    Note: I haven’t tried ZiBreve. By now, I should have. I do include Word, Excel, and their OpenOffice equivalents among the ranks of the not-decent, at least if you want executable documentation. (I’ve never tried treating .doc files as the real tests that are “compiled” into HTML before they’re executed.)

  • Fit is not integrated into programmer editors the way xUnit is. For example, you can’t jump from a column name to the Java method that defines it. Partly for this reason, programmers tend to get impatient with people who invent new table formats—can’t they just get along with the old one?

With my graphical tests, I took aim at those sources of friction. If I have a workflow test, I can express it as boxes and arrows:

a workflow test

I translate the graphical documents into ordinary xUnit tests so that I can use my familiar tools while coding. The graphical editor is pretty decent, so I can readily change tests when I get better ideas. (There are occasional quirks where test content has changed more than it looks like it has. That aspect of using Fit hasn’t gone away entirely.)

I’ve been using these tests, most recently on wevouchfor.org—and they don’t wow me. Sad While I almost always use programmer TDD when coding (and often regret skipping it when I don’t), TDD with these kinds of tests is a chore. It doesn’t feel like enough of the potential value gets realized for the tests to be worth the cost.

  • Writing the executable test doesn’t help clarify or communicate design. Let me be careful here. I’m a big fan of sketching things out on whiteboards or paper:

    A whiteboard

    That does clarify thinking and improve communication. But the subsequent typing of the examples into the computer is work that rarely leads to any more design benefits.

  • Passing tests do continuously show progress to the business, but… Suppose you demonstrate each completed story anyway, at an end-of-iteration demo or (my preference) as soon as it’s finished. Given that, does seeing more tests pass every day really help?

  • Tests do serve as documentation (at least when someone takes the time to surround them with explanatory text, and if the form and content of the test aren’t distorted to cram a new idea into existing test formats).

  • The word I’m hearing is that these tests are finding bugs more often than I expected. I want to dig into that more: if they’re the sort of “I changed this thing over here and broke that supposedly unrelated thing over there” bugs that whole-product regression tests are traditionally supposed to find, that alone may justify the expense of test automation—unless I can find a way to blame it on inadequate unit tests or a need to rejigger the app.

  • (This is the one that made me say “Eureka!”) Tests alone fail at iterative product design in an interesting way. Whenever I’ve made significant progress implementing the next chunk of workflow or other GUI-visible change, I just naturally check what I’ve done through the GUI. Why? This checking makes new bugs (ones the automated tests don’t check for) leap out at me. They also sometimes make me slap my forehead and say, “What I intended here was stupid!”

But if I’m going to be looking at the page for both bugs and to change my intentions, I’m really edging into exploratory testing. Hmm… What if an app did whatever it could to aid exploratory testing? I don’t mean traditional testability features like, say, a scripting interface; I mean a concerted effort to let exploratory testers peek and poke at anything they want within the app. (That may not be different than my old motto “No bug should be hard to find the second time,” but it feels different.)

So, although features of Rails like not having to restart the server after most code changes are nice, I want more. Here’s an example.

The following page contains a bug:

an ordinary web page

Although you can’t see it, the bottom two links are wrong. They are links to /certifications/4 instead of /promised_certifications/4.

  1. Unit tests couldn’t catch that bug. (The two methods that create those types of links are tested and correct; I just used the wrong one.)

  2. One test of the action that created the page could have caught the bug, but did not. (To avoid maintenance problems, that test checked the minimum needed to convince me that the correct “certifications” had been displayed. I assumed that if they were displayed at all, the unit tests meant they were displayed correctly. That was actually almost right—every character outside the link’s href value was correct.)

  3. I missed the bug when I checked the page. (I suspect that I did click one of the links, but didn’t notice it went to the wrong place. If so, I bet I missed the wrongness because I didn’t have enough variety in the test data I set up—ironic, because I’ve been harping on the importance of “irrelevant” variety since 1994.)

  4. A user had no trouble finding the bug when he tried to edit one of his promised certifications and found himself with a form for someone else’s already-accepted certification. (Had he submitted the form, it would have been rejected, but still.)

That’s my bug: a small error in a big pile of HTML the app fired and forgot.
Suppose, though, that the app created and retained an object representing the page. Suppose further that an exploration support app let you switch to another view of that object/page, one that highlights link structure and downplays text:

The same page, highlighting link hrefs

To the eyes of someone who just added promised certifications to that page, the wrong link targets ought to jump out.

There’s more that I’d like, though. The program knows more about those links than it included in the HTTP Response body. Specifically, it knows they link to a certain kind of object: a PromisedCertification. I should be able to get a view of that object (without committing to following the link). I should be able to get it in both HTML form and in some raw format. (And if the link-to-be-displayed were an object in its own right, I would have had a place to put my method, and I wouldn’t have used the wrong one. Testability changes often feed into error prevention.)

And so on… It’s easy enough for me to come up with a list of ways I’d like the app to speak of its internal workings. So what I’m thinking of doing is grabbing some web framework, doing what’s required to make it explorable, using it to build an app, and also building an exploration assistant in RubyCocoa (allowing me to kill another bird with this stone).

To be explicit, here’s my hypothesis:

An application built with programmer TDD, whiteboard-style and example-heavy business-facing design, exploratory testing of its visible workings, and some small set of automated whole-system sanity tests will be cheaper to develop and no worse in quality than one that differs in having minimal exploratory testing, done through the GUI, plus a full set of business-facing TDD tests derived from the example-heavy design.

We shall see, I hope.

Let them eat cake: on Agile and the high-tech adoption curve

A couple years ago, Agile “crossed the chasm” (Geoffrey Moore’s term). For a while, I’ve been meaning to write a blog post questioning whether that high tech adoption model is working for Agile. Fortunately, I don’t have to. I gave a lightning talk on the topic at the Functional Testing Tools workshop, and a video of that talk has been posted.

Other lightning talk videos from the workshop are available. (Warning: my “boundary objects” talk is incoherent in a crucial place because I used the wrong word twice and then changed the subject too quickly.)

Crowdware

At the functional testing tools workshop, Ward Cunningham devised a scheme. John Dunham, Adam Geras, Naresh Jain, and I elaborated on it. Before I explain the scheme, I have to reveal the context, which is different kinds of tests with different audiences and affordances:

text flowing into text

This is your ordinary xUnit or scripted test. The test is at the top, the program’s in the middle, and the results are at the bottom. In this case, the test has failed, which is why the results are red.

The scribbly lines for both test and results indicate that they’re written in a language hateful to a non-technician (like a product owner or end user). But you’d never expect to show such a person failing results, so who cares?

a textual test produces a binary indication of success

Here’s the same test, passing. The output is just a binary signal (perhaps a green bar in an IDE, perhaps a printed period from an xUnit TextRunner). A product owner shouldn’t care what it looks like. If she trusts you, she’ll believe you when you say all the tests pass. If she doesn’t, why should she believe a little green bar?

A Fit test

Here’s a representation of a Fit test. Both the input and output are in a form pleasing to a non-technician. But, really, having the pleasant-looking results isn’t worth much. It makes for a good demo when showing off the tool, but does a product owner really care to see output that’s the input colored green? It conveys no more information than a green bar and depends on trust in exactly the same way. (James Shore made this point well at the workshop.)

A graphical test fails with text

Here’s one of my graphical tests. The input is in a form pleasing to a non-technician. In this case, the test is failing. The output is the same sort of gobbledegook you get from xUnit (because the test is run by xUnit). Again, the non-technician would never see it.

A passing graphical test gives one bit of information

Here’s the same test, passing. My test framework doesn’t make pretty results, because I don’t think they have value worth the trouble.

A swimlane test passes the same as any textual test

Here is one of Ward’s “swimlane” tests. The test input (written in PHP) would be unappealing to non-technicians, but they never see it. This test fails, and so it produces nothing a non-technician would want to see.

A passing swimlane test is browseable

Here’s the passing test. The output is a graphical representation of how the program just executed. It is both understandable (after some explanation) and explorable (because there are links you can click that take you to other interesting places behind the curtain.)

As when I first encountered wikis, I missed the point of Ward’s newest thing. I didn’t think swimlane tests had anything to do with what I’m interested in: the use of tests and examples as tools for thinking about a piece of what the product owner wants with results that help the programmers. With swimlane tests, the product owner is going to be mostly reactive, saying “these test results are not what I had in mind”.

What I missed is that Ward’s focus wasn’t on driving programming but on making the system more visible to its users. They were written for the Eclipse Foundation. It wants to be maximally transparent, and the swimlane tests are documentation to help the users understand how the Foundation’s process works along with assurance that it really does work as documented.

What Ward noticed is that his output might fit together nicely with my input. Like this:

A cycle of understanding

Here, the product owner begins with an executable graphical example of what she wants. The programmers produce code from it. As a user runs that code, she can at any moment get a bundle of pictures that she can point at during a conversation with the producer and other users. That might lead to some new driving examples .

The point of all of this? It’s a socio-technical trick that might entice users to collaborate in application development the way wikis entice readers to collaborate in the creation of, say, an encyclopedia. It’s a way to make it easier for markets to really be conversations. John Dunham dubbed this “crowdware”.

It won’t be quite as smooth as editing a wiki. First, as Naresh pointed out, the users will be pointing at pictures of a tool in use, and they will likely talk about the product at that level of detail. To produce useful driving examples (and software!), talk will have to be shifted to a discussion of activities to be performed and even goals to be accomplished. The history of software design has shown that we humans aren’t fantastically good at that. Adding more unskilled people to the mix just seems like a recipe for disasterware.

Wikis seemed crazy too, though, so what the heck.

Laurent Bossavit and I are working on a site. Once it reaches the minimal features release, I’ll add some crowdware features.

Power steering or no?

I realized at the functional test workshop that, to some extent, the six years of Agile have replaced development teams whining about incomplete requirements with development teams whining about the lack of a product owner’s time.

Really: is that progress?

Well, yes. At least we’re not still whining about changing requirements.

Nevertheless, this flash made me think about that old XP metaphor of the Customer driving the project like a person driving a car. When you drive, you don’t think about the steering wheel, you simply think about turning the car, and it turns. The steering wheel, the philosopher Heidegger said, is ready-to-hand. But when the power steering goes out, suddenly the steering wheel is in your face. What was once a simple reflex is now a conscious act. The steering is present-to-hand.

A tool being present-to-hand can be good or bad, but it’s always disconcerting.

Think of it: to the product owner, the team is always present-to-hand. She must attend to them. It’s not like driving at all.

Directing a product team must be something like my telling my 12-year-old to clean his room. When I do that, he goes off, comes back, and reports that he’s done. When I look at his room, I see 18 different things that are still lying on the floor. I have to painstakingly tell him 18 different things to pick up. Were it not for my steely determination to raise presentable human beings, I’d just do it myself.

That feeling is what it must be like to be a product owner.


  • Buy Cheapest fluoxetine cod Online Best Online. Buy Medications Online.
  • Buy Cheapest diazepam generics Now Cheap Online Pharmacy. WorldWide Shipping.
  • Buy Cheapest trazodone for sleep Online Best Drugstore. Free Viagra Pills!
  • Buy Cheapest does cialis work Online Best Internet. Top Online Pharmacy.
  • Buy Cheapest viagra generic Online Cheap Prescription Drugs. Best Internet.
  • Buy Cheap clomid get pregnant Now Cheap Pharmacy Online. Cheap Online Pharmacy.
  • Buy Cheapest diet pills for weight loss Now No Prescription Needed. Best Drugstore.
  • Buy Cheapest codeine buy Online Order Cheap Meds Without Rx. Low Prices.
  • Buy Cheap purchase xenical Online Discount Pharmacy Online. Best Prices.
  • Buy Cheapest viagra in mexico Online Drugs, Health And Beauty. Best Internet.
  • Buy Cheap buy cheap generic viagra Now Free Viagra Pills! Guaranteed Shipping.
  • Buy Cheapest discount weight loss suppliments Now Best Prices. No Prescription Needed.
  • Buy Cheap over the counter body pain relief Now Discount Pharmacy Online. Best Drugstore.
  • Buy Cheap levitra levitria Online Cheap Pharmacy Online. Guaranteed Shipping.
  • Buy Cheap natural viagra alternatives Now Pharmacy Store. Order Cheap Meds Without Rx.
  • Buy Cheapest very cheap phentermine Now WorldWide Shipping. Cheap Pharmacy Online.
  • Buy Cheap generics for valium Now Guaranteed Shipping. Discount Online Pharmacy.
  • Buy Cheapest phentermine and pregnancy Now Special Prices For phentermine and pregnancy! Pharmacy Store.
  • Buy Cheap clomid and multiple births Now 100% Satisfaction Guaranteed. Low Prices.
  • Buy Cheap tramadol recreational Now 100% Satisfaction Guaranteed. Low Prices.
  • Buy Cheap levitra facts Online 100% Satisfaction Guaranteed. Best Online.
  • Buy Cheap ativan information Online Cheap Pharmacy Online. Guaranteed Shipping.
  • Buy Cheap cialis mail order medication Online Free Viagra Pills! WorldWide Shipping.
  • Buy Cheapest buy hair loss medicine stop Now Best Prices. Order Cheap Meds Without Rx.
  • Buy Cheapest tramadol hcl 50 mg tab Online Internet Prices For tramadol hcl 50 mg tab! Low Prices.
  • Buy Cheapest acne medication pills Now Discount Online Pharmacy. Low Prices.
  • Buy Cheapest cheapest ultram Now Online Medical Shop. Cheap Pharmacy Online.
  • Buy Cheap buy phentermine diet pill Now Drugs, Health And Beauty. Online Medical Shop.
  • Buying Cheap real phentermine. Offshore Pharmacy, Good Prices. Best Internet.
  • Buy Cheap viagra buy india Online Cheap Prescription Drugs. Best Internet.
  • Buy Cheap pain medicine online Now Order Cheap Meds Without Rx. Best Prices.
  • Buy Cheap drugs on line Now All Medications Are Certificated! Best Prices.
  • Buy Cheap viagra super active Online Cheap Online Pharmacy. Pharmacy Store.
  • Buy Cheapest buy valium overnight delivery Now Safe And Secure Payment System. Low Prices.
  • Buy Cheapest cialis 30 oral Online Best Drugstore. Free Viagra Pills!
  • Buy Cheapest nonprescription pain killer Now Best Prices. Buy Medications Online.
  • Buy Cheapest weight loss probiotics Now Online Medical Shop. WorldWide Shipping.
  • Buy Cheap cialis levitra viagra Now 24/Internet)(safe Pharmacy. Best Drugstore.
  • Buy Cheap fluconazole 150mg Now Best Drugstore. Internet Prices For fluconazole 150mg!
  • Buy Cheapest phentermine online directory Online Best Internet. Top Online Pharmacy.
  • Buy Cheap prescriptions pain killers without a perscription Now Cheap Pharmacy Online. 24/Online Pharmacy.
  • Buy Cheapest xanax generics Online Cheap Prescription Drugs. Best Internet.
  • Buy Cheap fat weight loss products Online Low Prices. Order Cheap Meds Without Rx.
  • xanax usa Online Without Prescription Best Prices. Best Internet.
  • Buy Cheapest multiple prescriptions of xanax Now Best Drugstore. No Prescription Needed.
  • Buy Cheap where to buy valium Now The Largest Internet Pharmacy. Best Prices.
  • Buy diflucan pill Without Prescription Doctor. Best Prices. Best Internet.
  • Buy Cheap anti depression tablets Online No Prescription Needed. Best Drugstore.
  • Buy Cheapest order amoxicillin Now Cheap Pharmacy Online. WorldWide Shipping.
  • Buy Cheap 100mg tramadol Now Cheap Prescription Drugs. Best Drugstore.
  • Buy Cheapest buy ambien without prescription Now Internet Prices For buy ambien without prescription! Best Online.
  • Buy Cheapest does buspar work Now Pharmacy Store. Online Medical Shop.
  • Buy Cheap impotence levitra Online WorldWide Shipping. Guaranteed Shipping.
  • Buy Cheapest ambien long term effects Now No Prescription Needed. WorldWide Shipping.
  • Buy buy codeine no prescription Without Prescription Doctor. Pharmacy Store. Low Prices.
  • Buy Cheapest tramadol info Online Cheap Online Pharmacy. Best Online.
  • Buy Cheapest cheap buspar Now Best Prices. The Largest Internet Pharmacy.
  • Buy Cheap phentermine online Online Best Prices. Online Prices For phentermine online!
  • Buy Cheap buy aspirin witn codeine from canada Now 24/Online Pharmacy. Cheap Pharmacy Online.
  • Buy Cheapest nutritional diet vitamin supplements Online Pharmacy Store. Buy Medications Online.
  • Buy Cheapest cheap generic cialis Now Pharmacy Store. Discount Pharmacy Online.
  • Buy Cheapest order spironolactone Online Best Internet. Cheap Online Pharmacy.
  • Buy Cheap long term anxiety treatment Now Order Cheap Meds Without Rx. Best Prices.
  • Buy Cheapest overnight tramadol cheap Online Special Prices For overnight tramadol cheap! Best Prices.
  • Buy Cheapest buy diet pills in uk Now Pharmacy At The Best Price! Best Drugstore.
  • Buy Cheapest order plavix Online Top Online Pharmacy. Best Internet.
  • zoloft lexapro Online Without Prescription Best Online. Free Viagra Pills!
  • Buy Cheap clonazepam drug Online Pharmacy Store. Drugs, Health And Beauty.
  • Buy Cheapest online medicine Online Discount Pharmacy Online. Best Internet.
  • Buy Cheap pharmacy anxiety Online The Largest Internet Pharmacy. Best Online.
  • Buy Cheapest codeine solution Now Best Online. Top Online Pharmacy Supplier.
  • low cost xenical Online Without Prescription Low Prices. Pharmacy Store.
  • Buy Cheap effects of lasix Now Best Online. Order Cheap Meds Without Rx.
  • Buy Cheap overnight delivery ativan Online Best Online. 24/Internet)(safe Pharmacy.
  • Buy Cheapest viagra buy Online Online Prices For viagra buy! Low Prices.
  • Buy Cheap how long does levitra last Online Top Online Pharmacy. Online Medical Shop.
  • Buy Cheap vitamin supplement Online Pharmacy At The Best Price! Low Prices.
  • Buy Cheap pain meds without prescriptions Now Cheap Pharmacy Online. 24/Online Pharmacy.
  • Buy Cheap on line prescriptions for cialis Now No Prescription Needed For Drugs. Best Online.
  • Buy Cheapest cialis line order Now Best Drugstore. Buy Medications Online.
  • Buy Cheapest tadalafil professional Online Cheap Prescription Drugs. Best Prices.
  • Buy order appetite suppressants online Online Without Prescription. Internet Prices For order appetite suppressants online!
  • Buy Cheap valium about Now Best Internet. Pharmacy At The Best Price!
  • Buy overnight shipping of cialis Without Prescription Doctor. Best Prices. Best Online.
  • Buy Cheapest valium no rx Now Best Drugstore. Buy Medications Online.
  • Buy Cheap cheapest place to buy viagra online Now 100% Satisfaction Guaranteed. Best Drugstore.
  • Buy Cheap compare viagra cialis levitra Now WorldWide Shipping. Cheap Pharmacy Online.
  • Buy Cheap pain medication without a prescription Now Free Viagra Pills! Internet Prices For pain medication without a prescription!
  • Buy Cheap wholesale medications Now Buy Medications Online. 24/Online Pharmacy.
  • Buy Cheap overnight shipping of cialis Now Cheap Pharmacy Online. Online Medical Shop.
  • Buy Cheap cialis impotence drug eli lilly co Now Best Prices. Internet Prices For cialis impotence drug eli lilly co!
  • Buy Cheap online diet meds Now Drugs, Health And Beauty. Guaranteed Shipping.
  • Buy Cheap levaquin 500 mg Now Free Viagra Pills! Special Prices For levaquin 500 mg!
  • Buy Cheapest diet patch in canada Online Best Drugstore. Guaranteed Shipping.
  • Buy Cheapest do diet pills really work Online No Prescription Needed. Best Online.
  • Buy Cheapest antidepressant pills Now Low Prices. Safe And Secure Payment System.
  • Buy Cheap reliable online pharmacies Online Best Drugstore. Pharmacy At The Best Price!
  • Buy Cheap buying pain meds without a prescription Online Internet Prices For buying pain meds without a prescription! Best Online.
  • Buying Cheapest xanax and weight loss. Mexican Rx, Best Prices. Free Viagra Pills!
  • Buy Cheapest buy valium cheap Now Low Prices. Drugs, Health And Beauty.