InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

My "Unit Test" Aint Your "Unit Test"

Posted by Mike Bria on Jun 25, 2008

Sections
Process & Practices,
Architecture & Design,
Development
Topics
Java ,
Unit Testing ,
.NET ,
Agile ,
Ruby ,
Software 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.
  • This article is part of a featured topic series on Agile

Related Sponsor

In today’s hyper-competitive world, later may be too late to adopt Agile development and this Roadmap for Success will help you get started. Download "Agile Development: A Manager's Roadmap for Success" now!

Where's the confusion? by Ole Friis Posted
Re: Where's the confusion? by Mr Magoo Posted
  1. Back to top

    Where's the confusion?

    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?

    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: www.discovercomputers.info/ComputerSecurity/glo...)



    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

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.