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

Wed, 19 Feb 2003

Lots of tests up front

On the test-driven development group, I asked if people had experience switching from a process where programmers implemented all the unit tests after the code to one where they implemented all the unit tests before any of the code. That replaces Big Design Up Front with Big Test Up Front (sort of). I speculated it might be a reasonable intermediate step in organizational change.

C. Keith Ray writes the following:

Writing a whole lot of tests, and then writing the code to pass the tests has allowed my coworkers to create a whole lot of redundant code. In their case, they copy-paste-modified a bunch of tests, and then copy-paste-modify a bunch of code.

They didn't have a refactor step after getting each test to pass.

With a refactor step between each test, they could have noticed that the second piece of code to pass the test was almost identical to the previous piece of code, and thought about making a parameterized object instead of duplicating a method and changing one line.

Darach Ennis writes:

When I started out in the big bad world after university I joined an organization which followed a 'One Shot Deal' development lifecycle. SEI CMM with the V Model to be precise...

At the time I didn't know any better so I gave writing my test stories up front a shot when writing requirements etc..

Ultimately whenever I started coding, after a long train of documents and reviews, I quickly found the documented tests becoming less and less relevant as my assumptions were always incomplete, innacurate and sometimes irrelevant.

I spent more time re-writing documents than coding or contributing anything really useful. [...] My question would be whether the frustration and wasted work was better or worse with tests than it would have been with design documents. - bem

For me, test first implies one test or task at a time. Writing 10 or 20 tests without feedback from code is presumptuous and may prevent the minimal amount of code required to satisfy a stories acceptance criteria from emerging.[...]

[A company] might stand to gain a lot more if they can objectively gauge differences in methodologies rather than provide a 'migratory' testing approach for them to ease them into test-first. Sometimes its better just to roll up ones sleeves and give it a shot.

That's how I started out with TFD/TDD. One day I just decided to give it a shot. It took a few weeks before TFD/TDD clicked. It took another few months before I started to become proficient.

## Posted at 16:55 in category /testing [permalink] [top]

Fixtures as controllers - credit where it's due

Earlier, I speculated that FIT fixtures might be controllers, as in model-view-controllers. I learn that Rob Mee speculated the same speculation in exactly the talk I saw him give. I wish I could say that great minds think alike, but it's actually that my mind forgets where it learned something.

## Posted at 16:16 in category /testing [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.




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

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


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



Agile Alliance Logo