testdriven.com Wrangling quality out of chaos

Archive for December, 2003

jWebUnit: Unit-testing framework for Java Web

12.31.2003 · Posted in Links

jWebUnit is a Java framework that facilitates creation of acceptance tests for web applications. It evolved from a project where we were using HttpUnit and JUnit to create acceptance tests. As the tests were being written, they were continuously refactored to remove duplication and other bad smells in the test code. jWebUnit is the result of these refactorings.
link

Testing Series Part I: Overview

12.31.2003 · Posted in Links

You may have heard of a new term circulating amongst developers, magazines, and online developer haunts: test-driven development. What is it? Test-driven development is a methodology that emphasizes creating tests as an integral part of the development process. If you care about the quality of the applications you write, you test before deploying. Just about everybody tests in one way or another, so you might ask: isn’t testing already a part of the development process? Test-driven development makes testing an integral part of the development process.

Author: Wellie Chao
Published: December 2003
link

Tags:

AntFit: A Fit task for Ant

12.29.2003 · Posted in Java

This tool, requested on the FIT wiki MakingRunners page, provides an external task for Ant that will invoke the FIT engine on the test input file.
To be used in a development effort consisting largely of Java where the chosen tool for the project’s build is Apache Ant, this tool allows the acceptance tests to be run as part of the overall build.
In projects where a build and deploy is complex and requires integration with application servers or other complexities, having the power of Ant to handle the steps and run the tests together is an important benefit.

http://www.cmdev.com/antfit/docs/
antfit@cmdev.com

Unit Testing Java Programs

12.28.2003 · Posted in Links

Testing programs can be very boring. Especially testing other people’s programs. And especially if you’re a programmer. But programmers love to write programs, so why not let the programmers write some programs that’ll do the testing for them? This is the idea behind automated testing, and this is what this article is about.

Automated unit testing (a unit typically being a Java class) is not a new thing. Some of us did it years ago on the mainframes, and it’s as useful as ever.

Author: Keld H. Hansen
link

StrutsTestCase: The tool for Struts unit testing (2)

12.28.2003 · Posted in Links

StrutsTestCase (STC) is a framework for testing Struts Action classes. It uses JUnit and in my first article about StrutsTestCase (STC) we looked at how STC could use a "mock object approach", where the servlet and Struts environments are simulated. STC also offers another testing possibility based on the Cactus framework, where the test is carried out in a real web server environment.

The main topic of the current article is about the Cactus option.

Author: Keld H. Hansen
link

StrutsTestCase: The tool for Struts tnit testing (1)

12.28.2003 · Posted in Links

Part of every IT-project includes testing, and Struts projects are no different. If we look at testing "from the bottom up", we start by unit testing the classes and methods we’re developing. Extreme programmers actually write their unit test cases before the code they’re supposed to test! As the project progresses, we step up through the application architecture to module, integration and system testing. You may use different words for your test phases, but the idea is to start at the very detailed level and finish by letting the end users test the functionality of the system, in order to see that what they get is what was promised to be delivered!

This article is about unit testing a part of your Struts application, specifically how you test the Action class.

Author: Keld H. Hansen
link

GroboUtils: adding test functionality to JUnit

12.28.2003 · Posted in Links

GroboUtils aims to expand the testing possibilities of Java. It contains many sub-projects which experiment with one aspect of testing through Java. Some projects are present to add shared functionality between the testing sub-projects, while others are remnants from the old purpose of GroboUtils (a collection of useful libraries).
link

Multithreaded Tests with JUnit

12.28.2003 · Posted in Links

JUnit is the glue that holds many open source projects together. But JUnit has problems performing multithreaded unit tests. This creates considerable difficulty for middleware developers in the open source J2EE market. This article introduces GroboUtils, a JUnit extension library designed to address this problem and enable multithreaded unit testing in JUnit. A basic understanding of JUnit and threads is recommended but not necessary for readers of this article.

Author: N. Alex Rupp
Date: 08/06/2003
link

Using Mock Objects in Java

12.28.2003 · Posted in Links

In a framework like StrutsTestCase, mock objects are used to simulate the Struts servlet environment, making it possible to test a servlet application without having a web server running. Another example is to mock the jdbc classes, making testing without a database possible.

In this article I’ll give some simple examples of how to code and use mock objects, and then demonstrate the MockObjects and MockMaker tools, which help you produce the code for the mock objects.

Author: Keld H. Hansen
Date: December 28, 2003
link

MakingStubs

12.23.2003 · Posted in Links

Martin Fowler writes:

"A common problem with test-enhanced designs is how to create Service Stubs in test mode while letting the real thing be there for production (and for some tests). A couple of my colleagues have shared their ideas.
Jeremy Stell-Smith showed me an approach based on an Abstract Factory. All stubbable services are pulled from a single factory. This example shows such a Persistance class."
link

DBUnit: JUnit extension for db-driven projects

12.22.2003 · Posted in Links

DbUnit is a JUnit extension (also usable from Ant) targeted for database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent way to avoid the myriad of problems that can occur when one test case corrupts the database and causes subsequent tests to fail or exacerbate the damage.

DbUnit has the ability to export and import your database (or specified tables) content to and from XML datasets. This is targeted for functional testing, so this is not the perfect tool to backup a huge production database.

DbUnit also provides assert facility to verify that your database content match some expected values.
link

jMock: Java code-testing library using mock objects

12.22.2003 · Posted in Links

Mock objects help you design and test the interactions between the objects in your programs.

The jMock package:

* makes it quick and easy to define mock objects, so you don’t break the rhythm of programming.
* lets you define flexible constraints over object interactions, reducing the brittleness of your tests.
* is easy to extend for application specific scenarios.
link

SysUnit: JUnit framework for distributed unit testing

12.22.2003 · Posted in Links

SysUnit is a JUnit framework for distributed unit testing. SysUnit is particularly well suited to system testing and integration testing or the unit testing of any highly distributed system using web applications, web services or JMS / MOM systems.

The idea behind SysUnit is that a single unit test is made up of a number of TBean objects. A TBean is to SysUnit what an MBean is to JMX. A TBean is a single JavaBean used for testing which is usually remote. A SysUnit test will create a number of TBeans, run them and then perform some validation to ensure that the test worked.
link

JS Console

12.22.2003 · Posted in Links

JS Console is a Mozilla/Firebird add-on for JavaScript developers. Any JavaScript code or file can be run from JS Console to test it.
It includes a powerful unit testing engine driven by assertions included in the JavaScript code.
link

Test-driven development sessions at OT 2004

12.22.2003 · Posted in Events

Among other XP-related sessions at the conference, the following two will deal specifically with TDD:

Tutorial: Using mock objects to drive top-down development
Speakers: Joe Walnes, Tim Mackinnon

Test Driven Development — An introductory tutorial in Test Driven Development
Speaker: Ivan Moore

Location: St. Neots, UK
Dates: March 28th-31st, 2004
Information and registration: OT 2004Tutorial: Using mock objects to drive top-down development
Speakers: Joe Walnes, Tim Mackinnon
Mock objects are usually regarded as a programming technique that merely supports existing methods of unit testing. But this does not exploit the full potential of mock objects. Fundamentally, mock objects enable an iterative, top-down development process that drives the creation of well designed object-oriented software.
This tutorial will demonstrate the mock object development process in action. We will show how using mock objects to guide your design results in a more effective form of test driven development and more flexible code; how mock objects allow you to concentrate more on end-user requirements than on infrastructure; and how the objects in the resultant code are small and loosely coupled, with well-defined responsibilities.

Test Driven Development — An introductory tutorial in Test Driven Development
Speaker: Ivan Moore
Test Driven Development (TDD) is a way of writing code that produces clean, concise and well tested code. It is different than the way most people are taught to develop code, and takes some getting used to. This tutorial gives participants a hands-on introduction to TDD in which they can get a flavour of how it works. XUnit/Mock and sample code will be provided for the exercises in two languages: Java and Python. Participants can use whatever language they want but no sample code or infrastructure support can be given for other languages.

Using JUnit in Eclipse [PDF]

12.20.2003 · Posted in Links

In Java, the standard unit testing framework is known as JUnit. It was created by Erich Gamma and Kent Beck, two authors best known for design patterns and eXtreme Programming, respectively. Eclipse builds come with both JUnit and a plug-in for creating and working with JUnit tests. As a demonstration, we will use these tools to test a simple class for representing fractions.

Author: Christopher Batty
Revised: October, 2003

link

Tags:

Build a Java Web App Using HttpUnit and the Test-driven Methodology

12.19.2003 · Posted in Links

JUnit performs automated testing for standalone Java applications that either run on the command line or serve as components. If you develop large-scale or distributed applications, however, you are most likely going to work with Java Web applications. Because Web applications communicate via HTTP rather than Java method calls, JUnit is poorly equipped to test Web applications. HttpUnit comes to the rescue. This freely available tool provides Web testing functionality that complements JUnit.

Author: Wellie Chao
Date: November 25, 2003

link

Test-Driven Development in Microsoft .Net

12.17.2003 · Posted in Books

A book on TDD in .NET is due out in February, 2004, entitled Test-Driven Development in Microsoft .Net — Learn How to Leverage Test-Driven Development in the .Net Platform, by James Newkirk and Alexei Vorontsov.

Description of the book:

"Learn how to apply the concepts and techniques of Test-Driven Development (TDD) to writing software for Microsoft .NET. Two experts in agile software development teach—using a wealth of pragmatic examples in C# and other .NET development tools—how to use automated tests to drive lean, efficient coding and better design. You’ll focus on .NET-specific issues for TDD, including the best time to employ the inherent features of .NET class libraries and how to use NUnit, a leading unit-testing framework for .NET. And you’ll see real-world examples of TDD-for .NET projects, including a Microsoft ADO.NET relational database, a user interface created with Microsoft ASP.NET and Microsoft Windows® Forms, Web services, and other useful applications."

Click here for more information on this book.

CTA++: C++ Test Aider

12.15.2003 · Posted in Links

CTA++ is a tool for unit testing C++ classes, libraries and subsystems. CTA++ is simple to use and provides very powerful features helping the tester to build the testing environments and running the tests on C++ code. The testing process becomes efficient, visible and organized – as required in a professional testing environment.
link

Agile Development Conference — Call for Proposals

12.15.2003 · Posted in News

The Agile Development Conference is an integrated, 4-day conversation about techniques and technologies, attitudes and policies, research and experience, the management and development sides of agile software development. The agile approach focuses on delivering business value early in the project lifetime and being able to incorporate late breaking requirements changes by accentuating the use of rich, informal communication channels and frequent delivery of running, tested systems, and attending to the human component of software development.

The Agile Development Conference gives attendees access to the latest thinking in this domain and bridges communities that rarely get a proper chance to exchange ideas and thoughts, bringing together researchers from labs and academia with executives, managers, and developers in the trenches of software development. The Agile Development Conference is not about a single methodology or approach, but rather provides a forum for the exchange of information regarding all agile development technologies.

We invite you to share your knowledge and experience via the submission of papers. The Agile Development Conference will be held in Salt Lake City, Utah, June 23-26, 2004.We are soliciting contributions in four areas:

Experience reports relate the author’s experiences in a real situation, using a particular technique, tool, or approach.
Experience Reports proposals due February 15

Peer to peer gives participants the chance to learn from each other.
Peer to Peer proposals due January 12

Research papers relate the outcome of a study on the selected topic, and possible extrapolations from those studies.
Research Papers Proposals due January 31

Tutorials are an independent instruction on a self-contained topic of relevance to conference attendees.
Tutorials Proposals due January 5