InfoQ

News

My "Unit Test" Aint Your "Unit Test"

Posted by Mike Bria on Jun 25, 2008 09:06 AM

Community
Java,
Agile,
.NET,
Ruby
Topics
Software Testing,
Unit Testing
Tags
Testing,
Productivity,
TDD
Mike Hill, well-known XP contributor, came forth to make a few interesting assertions about the misunderstanding often surrounding how a TDD "unit test" differs from the "unit test" of traditional lore. In particularly, Mike describes how he and the others at Industrial Logic have been able to avoid much of the confusion when teaching by using the term microtest to describe TDD's unit tests.
We call XP's unit tests "microtests", at least in part to sidestep the tedious and error-prone business of constantly explaining how XP's unit tests are quite unlike the testing world's unit tests.
The thread was initiated by Ben Hall's question asking why it appears that the testers (non-programmer ones that is) in his view seem not to have quite the prolific community as other disciplines:
...in the community, where are all of the testers? Developers are easy to find, they have massive conferences (PDC, TechEd) down to small user groups (NxtGenUG), I have been a member of NxtGenUG for almost 2 years since they first started in Coventry and I attended TechEd Europe but where are the testers at these types of events? Or am I just missing something?

I know recruiters have been asking this question for a while, but from a community point of view - where are all the testers? Where are the conversations happening? There must be a conversation happening about how we can improve software testing, how testers fit into the project structure and take advantage of new development technologies.
Interestingly enough, initial response to Ben's question summarized in part as "the communities are there, but separate, in large part due simply to avoid miscommunication through term overlap". Thus prompting the great discussion about the possible benefits of a fresh term such as "microtesting" to capture the TDD way of programmer "unit testing".

Hill led this discussion, primarily asserting the positive outcomes he has had with using "microtesting" to help new XP teams understand how a unit test is focused on a significantly smaller "unit" than that often thought of by non-XPer's. Mike highlights not only this difference, but goes on to note how in fact the actual purpose of TDD and microtesting differs from that of traditional testing:
We take the position that the real benefit of extensive microtest-driven development isn't higher quality at all. Higher quality is a side effect of TDD. Rather, the benefit and real purpose of TDD as we teach it is sheer productivity: more function faster.
Many responses show support for the idea's brought forth by Mike. Among them, XP big name Ron Jeffries:
I very much agree that this is the real benefit, and I admire [your assertiveness] in coming right out and saying it.
Additionally interesting and useful about the thread are the various viewpoints and stances presented regarding the pro's and cons of introducing a new term like 'microtesting', as well as a highly informative list of what a microtest really is.

Take a few moments to check out the thread for yourself here, and let readers know what your take on the subject may be.

For more on 'microtesting', check out Industrial Logic's "Greatest Hit" eLearning albums for web-based training on this subject and many others.

Related Sponsor

VersionOne is recognized by Agile practitioners as the leader in Agile project management tools. Companies such as Adobe, BBC, CNN, Dow, HP, IBM, Sony and 3M have turned to VersionOne to help deliver greater value to their customers.

2 comments

Reply

Where's the confusion? by Ole Friis Posted Jun 25, 2008 2:17 PM
Re: Where's the confusion? by Mr Magoo Posted Jun 26, 2008 4:46 PM
  1. Back to top

    Where's the confusion?

    Jun 25, 2008 2:17 PM by Ole Friis

    I've never been aware that a confusion exists. What is described in this article as microtests is exactly what I understand as unit tests. Perhaps someone will be kind and tell me what other people understand unit tests as being?

  2. Back to top

    Re: Where's the confusion?

    Jun 26, 2008 4:46 PM by Mr Magoo

    I guess that is a good example of the confusion then!

    Definition:
    "To write test cases for every non-trivial function or method in the module so that each test case is separate from the others if possible."
    (ref: http://www.discovercomputers.info/ComputerSecurity/glossary.html)

    The fact that "developer unit tests" are generically called "unit tests" as the default definition (from a devs point of view of course) does not change the actual meaning.
    Devs tend to get frustrated with people "confusing the issue" by calling other things unit tests when, in fact, they are part of the confusion.

Exclusive Content

A Formal Performance Tuning Methodology: Wait-Based Tuning

Steven Haines talks about tackling web application performance tuning by proposing a method called wait-based tuning.

Shaw and Fowler About Forging a New Alliance

Shaw and Fowler talk about the need for a new relationship between the business department and the IT department. Studies have shown that projects mostly fail due to miscommunication between the two.

How to GET a Cup of Coffee

In this article, Jim Webber, Savas Parastatidis and Ian Robinson show how to drive an application's flow through the use of hypermedia in a RESTful application.

Archaeopteryx: A Ruby MIDI Generator

Eccentric artist turned overnight anti-celebrity, Giles Bowkett captures the heart and soul of RubyFringe as he demonstrates his revolutionary Archaeopteryx MIDI drum pattern generator.

Alexandru Popescu Discusses the InfoQ.com Site Architecture

InfoQ Chief Architect Alexandru Popescu discusses the InfoQ architecture, WebWork and DWR, Hibernate and JCR, Hibernate scalability, the new InfoQ video streaming system, and future plans for InfoQ.

LHC Grid: Data storage and analysis for the largest scientific instrument on the planet

higgs-event

The Worldwide Large Hadron Collider (LHC) Computing Grid provides data storage and analysis for the entire high energy physics community that will use the LHC.

Fostering Software Craftsmanship in a Corporate Setting

Scott talks about software craftsmanship represented by people responsible for their work, continuously learning, taking pride in their work, sharing knowledge and respecting professional standards.

Eric Nelson on Windows as a Web Platform

Eric Nelson explores Windows as a web platform using IIS 7.0 providing an architecture deep dive and striving to reduce the lines of code in web applications.