testdriven.com Wrangling quality out of chaos

Archive for September, 2004

djUnit: JUnit testrunner with modified classloader

09.27.2004 · Posted in Links

djUnit plugin is a JUnit TestRunner and Eclipse plugin. Its classloader modifies classes before loading them to JVM, and runs tests using the modified ones to:

– generate a coverage report
– test using Virtual Mock Objects
– do a simple trace

djUnit can perform JUnit tests. Its usage is the same as that of JUnit.

link

Driving on CruiseControl, Part 1

09.27.2004 · Posted in Links

Continuous Integration is one of the buzzwords most people have probably heard of but surprisingly few are actually following this XP best practice.

Keeping this in mind, I’ll begin this tutorial by briefly describing what Continuous Integration actually means, why you should consider doing it, and finally, showing step by step how to do it using one of the most used Continuous Integration products, the open source CruiseControl developed by a bunch of ThoughtWorkers.

Author: Lasse Koskela
Published: JavaRanch, September 2004
link

JAM: JavaGen Ant Modules

09.27.2004 · Posted in Links

JAM, JavaGen Ant Modules, is a modular Ant toolkit for developing and testing Java/J2EE applications. JAM supports EJB and Servlet/JSP development using XDoclet, JUnit, Cactus, Maven, Castor and UML code generation on various servers including JBoss.
link

Driving projects with Examples: Chapter 2 available

09.23.2004 · Posted in Blogosphere

Brian Marick has made available Chapter 2 of his draft book, Driving Projects With Examples. He is also co-teaching courses on Test-Driven Design with Mike Clark and Exploratory testing with Elizabeth Hendrickson.

SD Best practices carries live reports from the 2004 conference. See them here and read about Kent Beck’s Oprah moment (registration needed).

Keith Ray posts 8 reasons to do TDD.

Agile Auckland has a website.

Mike Lorengo takes us through the moves of creating a Virtual Cellar. He’s already defined the architecture, set up Subversion, and has just shared his user stories.

JasperReports: Java reporting tool

09.23.2004 · Posted in Links

JasperReports is a powerful open source Java reporting tool that has the ability to deliver rich content onto the screen, to the printer or into PDF, HTML, XLS, CSV and XML files.

It is entirely written in Java and can be used in a variety of Java enabled applications, including J2EE or Web applications, to generate dynamic content.

Its main purpose is to help creating page-oriented, ready to print documents in a simple and flexible manner.
link

Exampler: Driving Software Projects with Examples

09.23.2004 · Posted in Links

"Given close and frequent contact between business experts and a development team, a surprising amount of product growth can be driven by a stream of well-chosen examples, implemented quickly. Those examples have traditionally been called tests, but that term misleads. It shifts the focus toward bugs and away from understanding the business and the possibilities that lie dormant in the product. So I’m dropping the word ‘test’ except when I’m referring specifically to after-the-fact product critique.

The main focus of this site is the draft of a book I’m writing, tentatively titled Driving Projects with Examples: a Handbook for Agile Teams."

— Brian Marick
link

Tags:

Continuous Integration: an unlikely hero

09.23.2004 · Posted in Links

Continuous Integration: an unlikely heroIf the road to hell is paved with good intentions, the road traveled by failed software projects is paved with broken builds. As a QA engineer, I used to find myself with wasted days, either stalled because there was no build to test or because the build I had just installed was seriously nonfunctional. After becoming a developer, I learned the masochistic joys of getting the latest code only to find that I could no longer build. From more experienced developers, I learned the survival technique of working with my own little sandbox of code that was days or weeks out of touch with the repository. This worked well enough until that moment we all dreaded: system integration.

I’m happy to report that my life is not like that any more. On my current team, everyone works with current code, the developers don’t suffer from merge hell, and the testers receive builds that are reliably functional. There are a lot of factors that go into reaching this happy state of affairs, but a lot of credit goes to an unlikely hero: an automated continuous integration (CI) system that has been tailored for our process.

Author: Jeffrey Fredrick
Published: Better Software Magazine, September 2004
link

Tags:

Unit Test Your Struts Application

09.22.2004 · Posted in Links

Unit testing is an important part of a good development process. Although there are many unit testing frameworks and technologies, such as JUnit, Cactus, EasyMock, HttpUnit, and so on, developers often find that it is difficult to unit test their Struts applications.

Author: Lu Jian
Published: OnJava.com, September 22, 2004
link

Simple web services nUnit helper class

09.22.2004 · Posted in Tools

I found that in developing a web services architecture which uses the Facade at the Distribution Boundary pattern, a lot of the unit tests have to validate the properties of simple objects against the same or equivalent objects with common property names.

The solution I came up with which is VERY simple uses reflection to iterate through the property names of an object and test equivalence of each one – note that if the types of properties are different even with the same name, unless it can be dynamically cast, will throw an exception. (Which is good – if this is the case the unit test should generally fail anyhow!)

TestHelper.vb

Usage of the class looks something like this:

Code:
Dim ignore() As String = {"ScheduleID"}
Assert.IsTrue(TestHelper.CompareProperties(sourceTO, resultTO, ignore))

where the ‘TO’ classes are Data Transfer Objects

From Joe Cincotta’s Blog

Jakarta HiveMind: services and configuration microkernel

09.22.2004 · Posted in Links

HiveMind is a services and configuration microkernel; an infrastructure for all types of Java applications. HiveMind encourages the use of best practices, as well as the aggressive refactoring seen in Test Driven Development.

HiveMind is responsible for thread-safe just-in-time instantiation of your services, and uses the dependency injection pattern to connect services together.
link

NMock to the rescue

09.22.2004 · Posted in Links

Ben Carey writes: "I was working with Drew today and preparing for our .Net Users Group presentation on leveraging open source development tools with .Net. For this presentation, we have consistently met at Panera because of the free wifi access. When we arrived this evening we were unable to connect to the wifi. At first, this seemed like a pretty big problem, but it ended up being a perfect scenario for how mock objects can provide a significant advantage…"
link

Tags:

Integration Testing

09.21.2004 · Posted in Links

Integration testing your T-SQL stored procedures saves debugging time and makes database programs more reliable and easier to reuse and maintain. In these respects, integration testing has many of the same benefits as unit testing individual procedures. The big difference between the two testing methodologies is that unit testing focuses on the internal logic of one procedure, and integration testing tries to identify problems that might happen when one procedure (the parent or "outer" procedure) calls another procedure (the child or "inner" procedure). Another important difference is that integration testing usually follows unit testing. After ridding two or more procedures of any internal defects, you can integration-test the procedures by checking for defects in the outer procedure’s call statements and in any data or error messages the inner procedure returns to the outer procedure.

Author: Dan Sawyer
Published: SQL Server Magazine, October 2004
Note: Requires subscription to SQL Server Magazine
link