testdriven.com Wrangling quality out of chaos

Archive for June, 2004

Pragmatic Programmers Interview on O’Reilly Network

06.29.2004 · Posted in Links

In the five years since the release of The Pragmatic Programmer, it’s had ten printings in English, with translations in five languages. Since then, agile programming techniques have started to see mainstream acceptance, especially in areas such as test-driven development and refactoring. What’s the next step to improving software development?

Interviewees: Andy Hunt, Dave Thomas
Published: O’Reilly OnLamp, June 24, 2004


Delphi 8’s Free

06.29.2004 · Posted in Links

Julian Bucknall addresses the use of the Free command to deallocate memory, and brushes on its relevancy to test-first development: "If you follow TDD guidelines, you won’t use try..finally, Free. Why? Because, in the majority of situations, you’ll be writing code that’s not necessary and this runs against the mantra of TDD: write only the simplest code you need to pass the current test."


Java tool EMMA provides coverage as a side effect of unit testing

06.29.2004 · Posted in Java

Vladrim Roubtsov, of Trilogy, has released EMMA, a code coverage tool for Java.

"EMMA’s mission is to move code coverage from an infrequent release gate (possibly run on a dedicated ‘coverage’ machine because the license is too expensive for the entire team) to the domain of agile testing and development (‘check coverage while still writing testcases and before you check code in’). Coupled with a very liberal license, EMMA is a tool that provides code coverage stats as an easy side effect of unit testing itself."Based on bytecode instrumentation, EMMA uses a fast bytecode processor (~2ms/class), and can do instrumentation incrementally or "on-the-fly", without a special preparation phase.

"EMMA is free/open source and at the same time coded from a commercial software developer’s point of view: it works in any (not just the latest and greatest beta from Sun) Java 2 runtime and scales to very large projects (the largest single instrumentation run so far covered 20000+ classes). It has no external dependencies and is not tied to any particular testing framework."

Visit EMMA’s home page, SourceForge Project page.
Read Trilogy’s press release.

Right Game, Wrong Team

06.29.2004 · Posted in Links

Extreme Programming (XP) teams gain direction and confidence by being test-driven. Teams learn what needs to be built by writing tests and gain confidence in their work by running those tests. This has worked so well in practice for customers and programmers on XP projects that it provokes the question, "Can managers also benefit from being test-driven?"

Author: Joshua Kerievsky (Industrial Logic)
Published: Software Development Magazine, March 2003


Free Book Download from TheServerSide: Java Testing and Design

06.28.2004 · Posted in Books

TheServerSide.com and Prentice Hall have made available Frank Cohen’s book, Java Testing and Design, From Unit Testing to Automated Web Tests, as a PDF file.

The book teaches how to build production-worthy, scalable, and performant Web-enabled applications. It also presents techniques and tools to enable developers, QA technicians, and IT managers to work together in development and test automation.

View the back cover description.
Download the book (zipped PDF).

Java Testing and Design [PDF]

06.28.2004 · Posted in Links

Java Testing and Design [PDF]"This book shows how to understand what application you want to write, what strategies are likely to get you there, and then how to measure your level of success. This book offers practical, concrete advice about how to stay in tune with your project and ensure that your products are at least as good as your plans."
– Phil Goodwin, Staff Engineer at Sun Microsystems.

Produce scalable, reliable, high-performance Web-enabled applications in Java.

Web infrastructure is everywhere. And yet until this book there was no guide to show how your choices in design, coding, and testing impact the scalability, performance, and functionality of your Web-enabled applications.

Java Testing and Design: From Unit Testing to Automated Web Tests teaches you a fast and efficient method to build production-worthy, scalable, and well performing Web-enabled applications. The techniques, methodology, and tools presented in this book will enable developers, QA technicians, and IT managers to work together to achieve unprecedented productivity in development and test automation.

With Java Testing and Design, you will be prepared for a laundry list of new APIs, protocols, and tools being packed into the next generation of J2EE, .NET, and open-source systems. While these new software libraries, tools, and techniques are a big move forward for all of us, they push us to learn even more technology to turn out complex, highly functional, and interoperable software applications.

Author Frank Cohen shares proven best practices based on his extensive experience at leading enterprises (General Motors, BEA, AMP, 2Wire, Elsevier, U.S. Navy, Sun) and delivers an immediately useful set of open-source tools, techniques, and code that will automate the testing of your Web-enabled applications.

Coverage includes:

* Software development and test automation methodologies
* Exposes the scalability problems in SOAP-based Web Services
* Building, testing, and monitoring integrated multiple-protocol Web-enabled applications
* Performance kits for developers using BEA WebLogic, IBM WebSphere, and Sun Java System (formerly Sun ONE)
* Architecture, code, and test agents for J2EE, Web Services, P2P, and .NET
* Secure Internet services using current and next-generation technologies and much more!

Book made available online by TheServerSide.

Click here to order a hard copy of the book.


On the origins of TDD

06.28.2004 · Posted in Links

Steve Freeman writes: "At ADC2004 I was chatting with Ward Cunningham about the origins of Test Driven Development. He said that, for him, it came from working with a group that was working in parallel on the same code base. The domain was mathematical and so pretty straightforward to test, so he pushed the testing forward to make sure that they weren’t stepping on each other."


bwbUnit-2004.6.1 released

06.25.2004 · Posted in News

bwbUnit for Java is a set of components primarily geared towards assisting developers with unit testing. The components that make up bwbUnit are designed to be simple to use yet very powerful:

– the Private Proxy makes protected, package and private variables and methods accessible to developers to enhance their ability to create unit tests.

– the Pounder takes a method and reviews all of the possible combinations of input values and allows developers to invoke the method of interest using all of the predefined values for the parameter types.Changes in 2004.6.1:

– a String comparison that was being done incorrectly has been fixed.
– widening of method parameters is not supported. If an int is passed to a method that takes a long the call will now work correctly.
– invoking Methods defined in a parent class from a subclasses is now supported.
– it is now possible to pass a subclass to a method that is expecting the parent class and have the call work correctly.

Visit bwbUnit’s home page.

(from [url=http://www.javalobby.org/thread.jspa?forumID=17&threadID=13021]JavaLobby’s announcement[/url])

Test-Driven Development: a practical guide [Review]

06.25.2004 · Posted in Links

Test-driven development (TDD) has become very popular in recent months. Until now there was only one textbook on the subject – Kent Beck’s. [url=http://www.testdriven.com/modules/mylinks/singlelink.php?cid=10&lid=43]Test-Driven Development: A Practical Guide[/url] by David Astels, was published in July 2003 and complements Beck’s original TDD work. This book is part of The COAD Series, named after Peter Coad, Borland’s Senior Vice President and Chief Strategist. The book itself is a little over 550 pages long and offers up-to-the-minute advice on how TDD can change your development and testing philosophy.

Author: Craig Murphy

Tags: ,

Unit Testing chapter (Expresso Developer’s Guide online)

06.24.2004 · Posted in Links

Expresso contains the JUnit framework, a unit testing framework that allows the individual components of Expresso to be tested and verified as functioning correctly. Expresso applications can (and should) also include a number of unit tests. Unit tests [..] deal with individual components, making it easier to locate and correct a problem before components are assembled into a finished application.

Authors: Larry Hamel, Mike Nash, Mike Rimov, Mike Traum, Sandra Cann
Published: JCorporate Ltd., 1999-2004

POCMock for .Net releases version 3.0

06.24.2004 · Posted in Tools

Earlier this month, PrettyObjects released version 3.0 of its mocking tool, POCMock.

Rather than creating a subclass dynamically, POCMock creates a new module statically, i.e. it creates exactly the same module but with some or all the mocked classes.POCMock has three modes of generation:

– Normal mode: the class is not affected (it is copied as is in the mocked DLL);
– Mocked mode: the code is replaced by a validation in accordance with the test scenario (typical Mock technology);
– Verified mode: code is added before and after the normal code to allow for different uses (specified during test preparation).

And four types of uses: Normal, Mocked (validation of the call against the test scenario, returns simulated), Verified (validation of call against the test scenario, followed by normal execution), and Verified with results (validation of the call against the test scenario followed by normal execution and by validation of result calculated against the test scenario).

POCMock comes in Standard and Professional versions. The Standard version is freely available, but modules having 50 classes or more cannot be mocked.

Draft content from XUnit Patterns book available online

06.23.2004 · Posted in Books

I am compiling a catalog of all the patterns I see and use over and over when doing TDD in various flavours of XUnit (JUnit, VbUnit, RubyUnit, etc.) and I’d like your feedback!

The patterns and the narratives that introduce each topic area are available here. Each pattern has a DISCUSS button which takes you to a Wiki for entering feedback.

Validating objects in the middle tier with Spring

06.22.2004 · Posted in Links

Matt Raible writes: "Here’s a simple example of how to use Spring’s validation framework in your middle tier. This is by no means production code – I just want to show how it’s done and (hopefully) get some feedback on its viability. Should we be using validation frameworks to perform our business logic in the middle tier – or just hard code the logic in our methods?"

Exploratory testing at Agile Development Conference

06.22.2004 · Posted in Events

Elisabeth Hendrickson and Brian Marick will be giving a tutorial titled "Exploratory Testing for Agile Projects" at the Agile Development Conference, which will be held June 23-26 in Salt Lake City, USA.

During the tutorial, to be conducted June 24, they’ll share their ideas about how exploratory testing will mutate in the specific context of agile projects.

Brian Marick has made available the Game Design notes as a PDF.

Testing Wireless Java Applications

06.22.2004 · Posted in Links

Testing is even more important in the wireless world because working conditions vary a lot more than they do for most software. For example, wireless Java applications are developed on high-end desktop machines but deployed on handheld wireless devices with very different characteristics.

The aim of this article is to help you test your wireless applications. The article provides an overview of software testing, describes the challenges in testing wireless applications, presents a tutorial on testing wireless applications, furnishes testing checklists for user interface, networking, and other areas, and discusses certification programs for applications targeted at the Java 2 Platform, Micro Edition (J2ME applications).

Author: Qusay H. Mahmoud
Published: November 2002

(via Xyling Java blog)


Posts on Automating Unit Testing With a Base Class

06.22.2004 · Posted in Links

Steve Eichert writes: "I’ve recently written a series of posts on the process of automating the unit testing of CRUD operations on business objects. [..] In future posts I’ll dive into some of the details which I didn’t go into such as how to set the allowable values for a property, how to ignore a property when comparing objects, how to set a property value as unique, as well as how to manage relationships among objects. Look for a zip file containing a running example in the next couple of days."

(via Michael Swanson’s blog)


CGLIB mocking made easier

06.22.2004 · Posted in Links

Chris Nokleberg writes: "In Rickard’s recent entry he discusses a technique whereby abstract classes can implement an arbitrary set of interfaces, the missing implementations of which are ‘filled in’ by his AOP framework. I’ve done something very similar with CGLIB for my own Mock Object needs."


Parallel-JUnit runs JUnit tests in parallel

06.22.2004 · Posted in Links

This small library implements the org.kohsuke.junit.ParallelTestSuite class, which extends the junit.framework.TestSuite class. The ParallelTestSuite class enhances the base TestSuite class by running tests in parallel. Test objects registered to a ParallelTestSuite object run in parallel, allowing efficient test execution.

Author: Kohsuke Kawaguchi

Simplified Database Unit testing using Enterprise Services

06.20.2004 · Posted in Links

In this article I’ll show what problems we encounter today when we perform unit tests against database related component, and the various ways used to solve these problems. I’ll also show a new method to solve these problems, which is far easier and simpler than any of the others. At the end of this article you will have the tools necessary to do simple and easy unit tests against database related components without the need to write messy cleanup code after your tests.

Author: Roy Osherove
Published: June 19, 2004

Pass Context to Unit Tests with Artima SuiteRunner

06.18.2004 · Posted in Links

If your tests use certain parameters that change often, or that need to assume different values for different runs, you may feel the urge to make your tests configurable. Just like any other software, for certain parameters used by your tests, you may prefer to specify the values in a configuration file or on the command line instead of in the source code. [..] As of version 1.0beta7, Artima SuiteRunner allows you to specify configuration parameters called "settings" for individual runs. These settings, which may be specified on the command line or in a recipe file, can be accessed and used by your test classes. This article will show you how to supply settings to Artima SuiteRunner and access them from your test classes.

Author: Bill Venners
Published: Artima, June 14, 2004

NMock 1.1 released

06.18.2004 · Posted in Tools

NMock 1.1 is released and available for download from [url=https://sourceforge.net/project/showfiles.php?group_id=66591&package_id=64549]SourceForge[/url]

This release is produced using automated build 11 from CCNetLive.

The release contains numerous incremental bug fixes from the 1.0 release. If you are experiencing any problems with the download from sourceforge, it may be due to sourceforge’s mirroring process. If so, you can always retrieve the files from ccnetlive.

Java GUI testing framework: Abbot 0.12.3 released

06.18.2004 · Posted in Java

The Abbot framework is a Java library for GUI unit testing and functional testing. It provides methods to reproduce user actions and examine the state of GUI components. The framework may be invoked directly from Java code or accessed without programming through the use of scripts.

Mainly a bug fix release.Bug Fixes

– Fix apparent hang/freeze when recording/selecting components, especially with children of JTabbedPanes or other components which hide their children. Fix XSD; args attribute is not required on call steps.
– Fix strongly held reference when filtering components (nixnixnix).
– Fix NPE when recording null-valued selections in JTable/JList.
– Fix class cast exception when running scripts and reporting step status.
– Workaround disabled menus bug on OSX. Fix Robot verification w/1.4.2_04.
– Fix broken example scripts (fontchooser) (thanks to quikdraw).
– Fix editor tutorial script so that it runs outside of the editor.
– Fix several bugs selecting methods in the Assert step.
– Fix script context parsing error with w32 drive letters.
– Removed deprecated classes.
– Ensure most objects used in a test may be GC’d after a test run. Mostly affects the Abbot test suite.
– Fix test fixture timing issues that were causing lost key/mouse events.

Go to Abbot’s home, read the release notes, download Abbot, view the API.

ALLPAIRS Test Case Generation Tool

06.18.2004 · Posted in Links

Let’s say you must test something that involves a lot of different variables. Configuration testing is like that: different printers, different print options, different documents. Who knows what combination will fail? But you can’t try all combinations of all variables together, because that would be too many tests. So instead, you could create tests that pair each value of each of the variables with each value of each other variable at least once. Allpairs is a tool that will find a reasonably small set of test cases to satisfy that coverage standard. For instance, to try all combinations of 10 variables with ten values each would require 10,000,000,000 test cases. Allpairs only requires 177 cases.

Allpairs is a command-line executable based on a Perl script. Source is included.

Author: James Bach
See also: Pairwise testing for dummies

PicoContainer 1.0 released

06.17.2004 · Posted in Java

The PicoContainer team has announced the final release of PicoContainer 1.0.

PicoContainer helped popularize Dependency Injection (particularly Constructor Injection), a software pattern that helps developers keep their code simple and testable.PicoContainer is a lightweight container. It is not not a replacement for a J2EE container, as it doesn’t offer any infrastructure services out of the box, but its Dependency Injection feature provides a way of instantiating components and lacing them together with other dependent components.

Non-intrusive, PicoContainer doesn’t require implementing any funny APIs. They can be POJOs. With lifecycle support built-in and a very extensible design enabling virtually any form of extensions to the core, PicoContainer is embeddable inside other applications, and can help you write better code.

Read the press release.
Visit PicoContainer’s home page.
Visit Martin Fowler’s pages on Inversion of Control.