testdriven.com Wrangling quality out of chaos

Archive for April, 2005

Improving the Testability of Legacy Code using TypeMock.NET

04.29.2005 · Posted in Links

While I churn out new code I want to be confident that it works as I expect. I’d like to document the intent I have with the newly written code, but don’t feel like writing documentation. I want to be sure that the classes my code depends on are free of any defects. At least in the way that I am using them.

And thus I design for testability and unit-test my code, but what about the dependencies between my code and the code written by others?

Let’s explain "Design for testability" by an example. We are assigned to a use-case where we need to look up a salary worker its authorizations. In this simple example we identify two system functionalities namely "Salary" and "Sending in files". The functionality salary is exposed by a set of web forms to fill in and submit the information. The functionality sending in files (where a file contains salary information in structured XML or in tabular form .xsl) is exposed through a file upload form.

Author: Paul Gielens
Published: April 16, 2005

SWExplorerAutomation: create programmable objects from Web page content

04.29.2005 · Posted in Links

The program creates an automation API for any Web application which uses HTML and DHTML and works with Microsoft Internet Explorer. The Web application becomes programmatically accessible from any .NET language.

SWExplorerAutomation API provides access to Web application controls and content. The API is generated using SWExplorerAutomation Visual Designer. SWExplorerAutomation Visual Designer helps create programmable objects from Web page content.

For Internet Explorer.

A guide to testing the Rails

04.29.2005 · Posted in Links

This article is for fellow Rubyists looking for more information on test writing and how that fits into Ruby On Rails. If you’re new to test writing or experienced with test writing, but not in Rails, hopefully you’ll gain some practical tips and insight on successful testing.

Author: Steve Kellock

AnyUnit 1.1 add-in for MSVS 2003 is released

04.25.2005 · Posted in News

AnyUnit version 1.1 is now released and ready for download at www.anyunit.com.

AnyUnit is an unit testing environment that allows developers to work with virtually any type of test frameworks, commercial and open source. It supports C/C++ unit testing, comes bundled with boost_test and CppUnit test layouts. Version 1.1 adds support for Managed C++/C#/Nunit, specialized test runners, custom test project mapping and various other enhancements; please visit website for details.

AnyUnit: test code generator for MSVS

04.25.2005 · Posted in Links

AnyUnit is an add-in for Microsoft Visual Studio. Its purpose is to create and execute test code for Visual C/C++ and C# projects.

AnyUnit speeds up creation and deployment of unit tests by creating test code stubs for every class and function defined in the original project and providing a one-button test executioner.

Commercial tool.

Testing Without Training

04.25.2005 · Posted in News

The last Methods & Tools’ poll question was: How many weeks of training on software testing have you completed in your professional life?


None 43%
Less than one week 19%
One week (5 days) 7%
One to two weeks 7%
Two weeks to one month 6%
More than one month 18%

Number of participants: 240As you can see, a large majority of the participants received none or few testing related training from their employers. I think that this situation is typical of the importance given to the testing phase in many software development projects. The time is often limited and there are few processes, tools and infrastructure available to optimise the efforts of the developers. The lack of training is just another factor that limits the efficiency of testing efforts.

At the other end of the spectrum, you see an important percentage with more than one month of training. This result should be connected with the activity of M&T readers. Around 20% of them are working in the software quality area and people working in this area should have more testing related training than the average developer.

Source: http://www.methodsandtools.com

Presentation by Damon Carr on TDD, Agile and Software Factories

04.25.2005 · Posted in News



Damon Carr, CEO of agilefactor, a leading innovator in Agile Process Improvement and Implementation, has been accepted as a speaker for the upcoming ‘Better Software Conference 2005’. His talk is on the following:

Agile Development Evolution to Software Factories – For the Advanced Agile Practitioner

Thursday, September 22
1:30 p.m.The concept of software factories is becoming a hot topic in software engineering circles. So, how can the factory model fit with Agile development practices? Damon Carr makes the case that Agile development is a stepping stone—not an alternative—to software factories. This is not the dreary vision of mindless workers in a factory. Instead, think of highly skilled individuals working with multi-million dollar machinery to develop systems. Even if you are not considering the factory model, Damon offers new practices that can reduce overall Agile development costs by as much as 40%. These include explicit refactoring to design patterns in your iterations, quantitative risk management, metrics for understanding the health of your project, and a new approach to team structure.

– How software factories capture the best technical and domain knowledge
– The pros and cons of Software Factories
– Some improvements to common Agile processes

For more information visit:


Improving Application Quality Using Test-Driven Development

04.25.2005 · Posted in Links

What is the one activity or phase that improves the quality of your application? The answer is an easy one: Testing, and plenty of it.

But when do we traditionally perform testing? If you are following a "waterfall" style approach to software development, it’s very likely that you have a testing phase somewhere towards the expected end of the project. This is peculiar, because we all know that at this stage in a software development project, the cost of any code or requirement changes is known to be much higher.

This article provides an introduction to Test-Driven Development with concrete examples using Nunit.

Author: Craig Murphy
Published: Methods & Tools, Spring 2005

TDD Tools Advisory, April 1-15, 2005

04.16.2005 · Posted in Advisories

The following tools were recently updated:

AntLion 0.5.0b1
aUnit 0.1
Clover.NET 1.2
CruiseControl.NET 0.9
DDTUnit 0.6.3
Fasper 0.9
Fit 1.1 for Java and .NET
Ivy 1.0RC1
Jetif 1.4.5
LuntBuild 1.1.1
MockPP 1.7.0
PortletUnit 0.2.3

Also: NTeam, NUnitProxyAntlion 0.5.0 beta 1
Antlion helps Apache Ant build files manage external libraries, and the paths and filesets that are associated with those libraries. This also includes inter-project relationships for multi-build file projects.

aUnit 0.1
Similar to how JUnit provides unit testing for Java, aUnit for AspectJ will provide mechanisms by which developers can test their aspects in isolation in support of Test Driven Development.

Clover.NET 1.2
Developers and Team leads use Clover.NET to quickly find untested code and to measure testing completeness. This feeds back into the testing process to improve tests. Clover.NET does not just produce a set of figures which are hard to relate to your code. Clover.NET reports, published in HTML format, provide an accessible, easily navigable view of your source. These reports are easily understood, yet comprehansive. They can be shared with the development team or project management.

CruiseControl.NET 0.9
CruiseControl.NET is an automated Continuous Integration server for the Microsoft .NET platform. It is a functional port of the Java-based CruiseControl to the .NET platform.

DDTUnit 0.6.3
The basic idea of DDTUnit is to provide an XML description (XML Schema based) of test data and combine it with the simplicity of JUnit. The XML is only used to define data structures. All program flow is coded in plain old Java.

Fasper 0.9
Fasper is a Java package which contains a framework for parser verification and an application to make test debugging easy.

Fit 1.1
Testing framework by Ward Cunningham and others and specifically applicable to acceptance tests like those prescribed by Extreme Programming. Our goal is to facilitate cooperation between customers, testers and developers who share the values of communication, simplicity, feedback and courage. The framework includes Java and .Net flavours.

Jayasoft Ivy 1.0RC1
Ivy is a simple but powerful dependency manager. Its key features are ease of use, extreme flexibility, easy extensibility, Ant integration, and transitive dependencies. It is ready to use with the Maven ibiblio repository. It eases continuous integration, and makes your software component a lot simpler to use.

Jetif 1.4.5
Jetif is a unit-testing framework for Java. It separates the testing data from the test code, records the test result to a text file or database, and logs some message to a simple text log file.

LuntBuild 1.1.1
A daily build tool based on Apache Ant. It performs build automation and management totally from a clean web interface.

MockPP 1.7.0
MockPP’s goal is to facilitate developing unit tests in the spirit of Mock Objects for Java, EasyMock and jMock. [url=http://www.testdriven.com/search.php?query=mock&action=results]Mock objects[/url] allow you to set up predictable behaviour to help you test your production code by emulating some functionality your code depends on. This might for example be a huge database which is too difficult and time-consuming to maintain just for testing purposes.

PortletUnit 0.2.3
PortletUnit is a jUnit Java Unit Testing Framework for testing JSR-168 portlets. It is built on ServletUnit and Pluto. It provides a mock portlet container as ServletUnit provides a mock servlet container.

Newly-registered projects:

NTeam will be an open source alternative to the upcoming Visual Studio Team System(r) and will utilize many existing open source applications such as NUnit, NAnt, and will link with various open source project, issue, and task management applications. NTeam will integrate with both proprietary and open source IDEs and will target small- and mid-sized businesses.

NUnitProxy aims to provide a framework to allow testing of unmanaged code from NUnit front end. As managed code becomes more common, it helps ease TDD acceptance if one front end (NUnit) can be used for all unit tests. Ideal for legacy code.

Legacy Refactoring Series (part 1)

04.14.2005 · Posted in Links

In its current state, the codebase is not as healthy as it could be. There are three classes in this system. The first class is the GUI, which is pretty simple and self contained. There might be some logic in it that could be refactored out into a Controller-type class, but I haven’t looked at it closely enough yet to know. In the same file as the GUI is the worker method for the thread where all the work happens. Not sure if I like this or not yet, but I’ll visit it at some point. There is a class called Assembly2UML which is the main worker class for this tool. This class is responsible for finding all the types and their relationships, and it has one real method in it, Serialize, and its 200 lines long. We’ll revisit this Serialize method shortly, as it is our original target for refactoring. Finally, there is another file called XMIServices, which houses both the interface IUMLFormatter and its derived type XMIFormatter. It is the responsibility of this XMIFormatter to be called occasionally from the Serializer to output the growing XMI model as it forms.

That’s the basic architecture. As it is, it would be very difficult to test, so I’d like to make few minor modifications to let us get it under some very simple tests.

Author: Brian Button
Published: March 30, 2005

A greener JUnit, XUnit automation patterns…

04.14.2005 · Posted in Blogosphere

Kent Beck is preparing [url=http://builderau.com.au/program/0,39024614,39183764-1,00.htm]a new release of JUnit[/url]: "Erich Gamma and I are working on a new JUnit release that will mark its first significant architectural changes since JUnit was very young." Just when we thought he was having a serious lapse

Gérard Meszaros has updated Patterns of XUnit Test Automation and seeks feedback.Bruce McLeod has a series of interesting posts on The Seven Tenets of Software Testing: 1. You can’t test everything so you have to focus on what is important 2. If you are going to run a test more than once, it should be automated 3. Test the product continuously as you build it 4. Base your decisions on data and metrics, not intuition and opinion 5. To build it, you have to break it 6. Except during TDD, developers should never test their own software 7. A test is successful when the software under test fails.

Brian Marick continues his series on Design-Driven Test-Driven Design with a blog entry in which he draws a parallel between Model-to_view and Mitotic Cell Division (you have just entered the Twilight Zone…).

Peter Provost shares a few good hints on When To Checkin When Doing TDD.

Sean McGrath discovers code as documentation on ITWorld and likes it as much as a laser sabre: Use the tests, Luke!

Brian Button explains how to go about Running the Enterprise Library Unit Tests.

James Shore explains [url=http://www.jamesshore.com/Blog/Fit%20and%20FitNesse.html]the difference between Fit and Fitnesse[/url].

Is pair programming making a remarked entry in educational settings? An article by the Computing Research Association states that "pair programming has been found to be very beneficial in educational settings. Students who pair in their introductory programming course are more confident, have greater course completion and pass rates in that course, and are more likely to persist in computer-related majors." See list of articles on Pair Programming Research at UCSC.

Roy Osherove asks How Do You Explain Pair Programming?

In Better Software Magazine, Rachel Davies explains: [url=http://www.stickyminds.com/BetterSoftware/magazine.asp?fn=cifea&id=65]It takes two to tango[/url].

Johanna Rothman wants to better explain Pair Programming to managers: "I attempted to explain why pair programming works to some skeptical project managers last week. I explained that in the best environments, a person can work 6 hours a day on technical work. And that person creates defects as well as creates work product. When pairing, the person can work for about 2 hours at a time, 2 or 3 times per day. But the created defect rate is much lower. The skeptics in my class pounced on the time spent working. I think I dealt with that question. But the real question that stumped them was how to do performance evaluations and give raises to pairs."

Of course, the obvious answer to Pair Programming woes is: the PairOn.

Here we go again: of all the things you need to do, practice religious test-first development for a month. (via [url=http://jamisbuck.org/jamis/blog.cgi/programming/Test-First%20Development_20050331230212.tx]Jamis Buck[/url])

Abhinay Mehta creates a mock UserDAO with jMock and EasyMock as a means to compare the two Java Mock libraries.

Paul (?) becomes an Agile Coach and tells what it’s been like.

Michael Gillespie responds to the question How do we get there from here? when adopting Agile processes.

Simon Brown is having success with project blogs.

Rob Harwood explains Language Oriented Programming: "Just as OOP introduced ‘everything is an object’, I propose for LOP that ‘everything is a language’."

For those of you building web applications, Brian McCallister posts Some guidelines.

Not TDD, but interesting: Choosing an enterprise language.

SpikeSource is providing a Test Upload Service for applications built on the SpikeSource stack. See also introductory article.

TheServerSide.NET asks: What Development Tools Do You Use?

Automated Tests and Continuous Integration in Game Projects

04.14.2005 · Posted in Links

We were first confronted with the notion of automated testing when, in the year 2000, customers of our back then still very young middleware company complained about stability issues and bugs in our 3D engine. Until that time, we had relied on manual tests performed by the developers after implementing a new feature, and on the reports of our internal demo writers who were using these features to create technology demos for marketing purposes. After thoroughly analyzing the situation, we came to the conclusion that our quality problems were mostly related to the way we were testing our software. [..]

As a result, we decided to adopt automated testing, starting with a new component of our SDK which we had just started to develop. The results were encouraging, so we finally expanded our practice of automated testing to all SDK components.

Author: Dag Frommhold and Fabian Röken
Published: Gamasutra, March 29, 2005


Selenium Assist: test code assistant for Selenium

04.14.2005 · Posted in Links

Selenium test scripts are very easy to write, because they are merely HTML tables. However, when much code has already been written this simple application automates some of this process by walking through the form fields and building the HTML table code automatically. It loads an application into a frame and lets you generate a script whenever you fill in a form. You can then tweak the test script to match your exact requirements.

Arbiter: document-based acceptance tester

04.14.2005 · Posted in Links

Arbiter is a requirements gathering and acceptance testing tool for project managers to help ease client interaction.

Similar to FIT in goal, Arbiter manages requirements documents in Word or RTF format that are created jointly by customer and developer. Requirements are parsed to extract a glossary and test suite.


Unit Testing the Data Access Layer

04.14.2005 · Posted in Links

Unit testing is becoming very popular among .NET projects, but unit testing the Data Access Layer (DAL) still remains a common obstacle. The problem stems from the very nature of databases: they are slow, common, persistent, external, and relational. This conflicts the nature of unit tests, which should be quick, independent, and repeatable. [..]

While mocking out the data layer can be useful when testing business objects, there is still tremendous value in having the real Data Access Layer thoroughly tested. For example, stored procedures can contain complicated search logic, or database functions can perform logic that must be done at the database level.

This article will show how to resolve these problems so that you can reliably unit test your Data Access Layer. First we need to establish two prerequisites:

1. Run both large and small SQL scripts, and
2. Ensure that a base-line schema is set up before running any of the tests.

Author: Tim Stall
Published: April 6, 2005

Tree Surgeon: .NET development tree generator

04.14.2005 · Posted in Links

Tree Surgeon is a .NET development tree generator. Just give it the name of your project, and it will set up a development tree for you in seconds. More than that, your new tree has years worth of accumulated build engineering experience built right in.

Writing Your First Unit Test: A primer on how to figure out where to start with unit testing

04.13.2005 · Posted in Links

This is a brief article on getting started with writing unit tests. Rather than getting into coding and the how to’s, of which there are numerous introductory tutorials, I want to discuss more the zen of unit testing. Hopefully you will find the information here to be of value–specifically, getting the most out of writing unit tests when you haven’t ever done it before. I’ve written a lot of articles on unit testing, but frankly, I don’t think they really provide enough guidance for the beginner.

Author: Marc Clifton
Published: The Code Project, April 12, 2005


Reduce runtime errors through unit testing

04.13.2005 · Posted in Links

The idea behind unit testing can be summed up by the old aphorism ‘a stitch in time saves nine’. We show you how to catch mistakes early in development

Microsoft’s submission of the C# language and the CLR (Common Language Runtime) as industry standards has led to many open source projects based on the .NET platform.

One such notable project is NUnit, a unit-testing framework for all .NET languages. I’ll demonstrate the simplicity of using NUnit to effectively unit test your code.

Author: Tony Patton
Published: April 11, 2005

Announcing TestNG 2.3

04.13.2005 · Posted in Java

The TestNG team is happy to announce the availability of TestNG 2.3.

The version is available here as well as the new documentation, which has been considerably improved (highlighted code snippets, detailed DTD, ant task and description of all the new features).What’s new:

* beforeSuite, afterSuite, beforeTest, afterTest
* Revamped ant task with haltonfailure and other helpful flags
* Better stack traces and improved level control for verbosity
* Better syntax for including and excluding methods in testng.xml
* Test classes can be invoked on the command line
* … and many bug fixes.

For Eclipse users, a new version (1.1.1) of the Eclipse plug-in that includes this new TestNG version is available on the remote update site or for direct download.

Also, TestNG has joined OpenSymphony (big thanks to Patrick and Hani for setting this up). As a consequence of this move, there is now a TestNG users forum as well as a Wiki and JIRA for issue tracking.

The users mailing-list has been moved to Google Groups and is connected to the forum, so you only need to subscribe to one.

Try it and let us know what you think!

Pycotine: Python Cocoa Test Interface Environment

04.12.2005 · Posted in Links

Pycotine (Python Cocoa Test Interface Environment) is a Cocoa GUI for Mac OS X to Steve Purcell’s PyUnit test framework. It allows you to execute a Python testsuite, possibly spread over many modules, comfortably from an application which shows statistical information about the ongoing tests with various counters and a progress bar. Errors and failures, usually reported on the commandline, are listed in a seperate part of the window.

Phing: Project Build System

04.12.2005 · Posted in Links

PHing Is Not GNU make; it’s a project build system based on Apache Ant. You can do anything with it that you could do with a traditional build system like GNU make, and its use of simple XML build files and extensible PHP "task" classes make it an easy-to-use and highly flexible build framework. Features include file transformations (e.g. token replacement, XSLT transformation, Smarty template transformations), file system operations, interactive build support, SQL execution, CVS operations, tools for creating PEAR packages, and much more.

If you find yourself writing custom scripts to handle the packaging, deploying, or testing of your applications, then we suggest looking at the Phing framework. Phing can comes with numerous out-of-the-box operation modules ("tasks"), and an easy-to-use OO model for adding your own custom tasks.

Participatory Testing: The SpikeSource Approach

04.12.2005 · Posted in Links

Testing different versions of components on different hardware for different types of functional usage brings up the challenge of combinatorial explosion. For example, a typical SpikeSource release integration involves optimizing 272 parameters distributed across 189 configuration files across 63 components yielding 7 preconfigured stacks for developing applications in Java, PHP, Python, Perl, C, and C++.

We need a new approach in testing to address these challenges. Our recommendation is to apply the very nature and strength of the "architecture of participation" to open source testing. To quote Tim O’Reilly, "we need a system that allows for a real free market of ideas, in which anyone can put forward a proposed solution to a problem; it becomes adopted, if at all, by acclamation and the organic spread of its usefulness."

Hence the requirement to build a Participatory Testing System that allows developers to participate by testing their applications as the payload.

Author: Murugan Pal
Published: O’Reilly Network, April 7, 2005


Spike PHPCoverage: coverage measurement and reports for PHP 5

04.12.2005 · Posted in Links

Spike PHPCoverage is an open-source tool for measuring and reporting code coverage provided by the test suite of a PHP application. Spike PHPCoverage can instrument and record the line coverage information for any PHP script at runtime.

Spike PHPCoverage also provides an extensible reporting mechanism with a standard HTML report implemented out of the box. The default report displays the summary information about the code coverage for an application and also shows the detailed information about a file including which lines were actually executed and with what frequency. It is possible to specify the directories and files that should be included and/or excluded from a coverage measurement.

Spike PHPCoverage works on PHP 5.0 and newer and uses Xdebug Extension for gathering the coverage data.