Exploration Through Example

Example-driven development, Agile testing, context-driven testing, Agile programming, Ruby, and other things of interest to Brian Marick
191.8 167.2 186.2 183.6 184.0 183.2 184.6

Mon, 05 Apr 2004

Big visible charts

A blog about Big Visible Charts (via Jason Yip).

## Posted at 17:14 in category /agile [permalink] [top]

Poke-inviting code

Michael Feathers:

You think your design is good? Pick a class, any class, and try to instantiate it in a test harness. I used to think that my earlier designs were good until I started to apply that test. We can talk about coupling and encapsulation and all those nice pretty things, but put your money where your mouth is. Can you make this class work outside the application? Can you get it to the point where you can tinker with it, in real time, build it alone in less than a second, and add tests to find out what it really does in certain situations. Not what you think might happen, not what you hope might happen, but what it really does?

That made me think: wouldn't it be nice to be able to point at a class (or some similar unit) and tell it, "You! Make me an object that I can poke at." It would create representative objects (or mocks) that it depended on, then sit there waiting for you to send messages to it via the interpreter.

Somehow, this seems different to me than running the unit tests under a debugger, hitting a breakpoint sometime after the setup method, then poking away. It puts the responsibility for comprehensibility exactly in the code, not one step removed. (Something like the difference between explaining code with a comment and making the code intention-revealing.)

Of course, you'd want the interpreter to be able to generate a unit test from your poking. Any such test would need some cleaning up. But, perhaps a generator that tried to filter out unneeded commands (assuming cooperation from the programmer about side-effects) could make that effort reasonable. Anyone want a Masters' project?

Even if this idea is dumb, maybe there's something to the notion of code that goes out of its way to be explored. Is that different from simply being decoupled? simply being well tested?

## Posted at 09:19 in category /coding [permalink] [top]

About Brian Marick
I consult mainly on Agile software development, with a special focus on how testing fits in.

Contact me here: marick@exampler.com.

 

Syndication

 

Agile Testing Directions
Introduction
Tests and examples
Technology-facing programmer support
Business-facing team support
Business-facing product critiques
Technology-facing product critiques
Testers on agile projects
Postscript

Permalink to this list

 

Working your way out of the automated GUI testing tarpit
  1. Three ways of writing the same test
  2. A test should deduce its setup path
  3. Convert the suite one failure at a time
  4. You should be able to get to any page in one step
  5. Extract fast tests about single pages
  6. Link checking without clicking on links
  7. Workflow tests remain GUI tests
Permalink to this list

 

Design-Driven Test-Driven Design
Creating a test
Making it (barely) run
Views and presenters appear
Hooking up the real GUI

 

Popular Articles
A roadmap for testing on an agile project: When consulting on testing in Agile projects, I like to call this plan "what I'm biased toward."

Tacit knowledge: Experts often have no theory of their work. They simply perform skillfully.

Process and personality: Every article on methodology implicitly begins "Let's talk about me."

 

Related Weblogs

Wayne Allen
James Bach
Laurent Bossavit
William Caputo
Mike Clark
Rachel Davies
Esther Derby
Michael Feathers
Developer Testing
Chad Fowler
Martin Fowler
Alan Francis
Elisabeth Hendrickson
Grig Gheorghiu
Andy Hunt
Ben Hyde
Ron Jeffries
Jonathan Kohl
Dave Liebreich
Jeff Patton
Bret Pettichord
Hiring Johanna Rothman
Managing Johanna Rothman
Kevin Rutherford
Christian Sepulveda
James Shore
Jeff Sutherland
Pragmatic Dave Thomas
Glenn Vanderburg
Greg Vaughn
Eugene Wallingford
Jim Weirich

 

Where to Find Me


Software Practice Advancement

 

Archives
All of 2006
All of 2005
All of 2004
All of 2003

 

Join!

Agile Alliance Logo