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
Productivity ,
Testing ,
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.
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.

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.