testdriven.com Wrangling quality out of chaos

Archive for June, 2005

TDD content for the Summer 2005 issue of Methods & Tools

06.30.2005 · Posted in News

Summer 2005 issue’s content:

Agile Development with ICONIX Process by Doug Rosenberg, Matt Stephens and Mark Collins-Cope
This book’s excerpt provides an introduction to a process mixing the Use Case approach and Test-Driven Development.

Using Customer Tests to Drive Development by Lisa Crispin
This article reports a concrete experience of incorporating customer input in a Test-Driven Development approach

The Enterprise Implementation Framework (EIF): Beyond the IDEAL Model by Sinan Si Alhir
This article introduces the CMM’s IDEAL model and EIF, a broader framework for software process improvement wherein IDEAL model activities are balanced with the human perspective.

More than 30 pages of software development knowledge.

Methods & Tools is a free e-newsletter for software developers.
To download or read this issue go to the PDF area of methodsandtools.com.

Veering thoughts, /.Rails, Talk FIT

06.29.2005 · Posted in Blogosphere

In Testing, testing, one to three, testing Sean McGrath writes that "a testing focus has a way of veering your thoughts towards a dynamic model of software construction. A model in which adding running tests is a continuous activity, not an activity performed solely as part of a beta test programmer. In such a model, it is the most natural thing in the world to think of software itself as stuff that is as changeable as the tests are."

See what folks have to say about Agile Web Development with Rails over at SlashDot.

Jon Udell talks with Jeff Nielsen about agile software development and FIT (MP3 format, 1/2 hour).It looks like there’s underground work on an Eclipse plugin for SimpleTest. And did you know Drupal has a Simpletest plugin?

William C. Wake wraps up his series on Fit Code with Part 8 of 8 – RowFixture.

Ben Griffiths increases his life expectancy with Mock objects.

Roy Osherove covers a few of the reasons Mock Object testing can cause trouble and gives a few pointers (see also his follow-up). Roy will conduct two sessions on testing and agile development at TechEd Europe, July 7&8.

Blubber Plinth shares his [url=http://spaces.msn.com/members/blubberplinth/Blog/cns!1ph1IFVB92jPeGXHEH2mc2qw!149.entry]Mock objects experiences[/url].

Willem van den Ende is developing a course on agile software development (eXperience Agile) and a course on pair programming, and shares his progress (if you’re searching for Pair Programming Parties in Belgium, look no further).

Kim Polese, one of Time magazine’s Top 25 Most Influential People in America, speaks of making open source safe for the enterprise and mentions several Open Source unit testing tools in [url=http://searchenterpriselinux.techtarget.com/originalContent/0,289142,sid39_gci1101691,00.html]Making money with open source[/url].

Murugan Pal makes a list of What Developers Want: "Irrespective of the language programmers choose for expressing solutions, their wants and needs are similar. They need to be productive and efficient, with technologies that do not get in the way but rather help them produce high-quality software. In this article, we share our top ten list of programmers’ common wants and needs."

This has more to do with bug-tracking, but Jonathan Kohl tells a fascinating story on User Profiles and Exploratory Testing: "Sometimes we look to the code for sources of bugs and forget about the user. When one user out of many sees a problem, and that problem isn’t obvious in the source code, we dismiss it as user error. Sometimes my job as an Exploratory Tester is to track down the idiosyncracies of a particular user who has uncovered something the rest of us can’t repeat. Often, there is a kind of chaos-theory effect that happens at the User Interface, and this user has the right recipe to cause a unique failure. Repeating the failure accurately not only requires the right version of the source code and having the test system deployed in the same way, but knowing what a certain user does at a particular time is also something I’ve found to be equally important."

A cool definition of Reverse Waterfall:
* Start with a working system
* Test it thoroughly
* Write the code
* Design the implementation
* Describe the requirements

You may also be interested to know IBM is to offer tools tryouts.

Code Smells: Long Method

06.29.2005 · Posted in Links

Textbooks and courses try to teach good design, almost never show examples of bad design. The only examples I know of are the excellent books Refactoring by Martin Fowler, Refactoring to Patterns by Joshua Kerievsky and Working Effectively with Legacy Code by Michael Feathers. Code smells (names for various categories of bad design) has a chapter in "Refactoring" but could just as easily have a whole series of books.

This essay is an attempt to describe one code smell, and how to correct it. The code smell is known as "Long Method" (or Long Function in a non-object oriented language).

Author: Keith Ray
Published: June 27, 2005
link

Thycotic DatabaseScripter: database rollback tool

06.29.2005 · Posted in Links

Thycotic.DatabaseScripter is a simple utility that generates a stored procedure called "SETUP" which will remove all data from your database and then reinsert it in the correct order. It uses the system tables in the database to identify foreign key dependencies and make sure data is manipulated int he appropriate manner.
link

Refactoring with Visual Studio Macros

06.29.2005 · Posted in Links

We can use macros to perform specific refactoring operations on our applications, something Microsoft or third-party vendors are never going to do for us. By writing macros we can make performing these refactorings easier and quicker than if we did them manually, always a sure-fire way to ensure that more of them will be done.

In this article I am going to cover a couple of hypothetical refactoring situations. I will identify the problem, the refactoring to be used, and then we will walk through creating the macro to make it easier to complete that refactoring.

Author: James Avery
Published: OnDotNet, June 20, 2005
link

Testing Series Part 2: Testing Java Classes with JUnit

06.28.2005 · Posted in Links

By now you should know why testing is valuable. If you don’t, please see the first article in this five part series. The first article is a concept piece explaining why testing helps in an enterprise server-side software environment. Most software applications today are written in tiers: the presentation tier, the logic tier (where business logic is kept), and the data tier. The logic tier is the meat of the application and comprises all of the rules and actions of the application. The business logic usually resides in JAR files containing libraries of Java class files. People often think of testing as trying out a product. With a car, it’s easy: start the ignition and drive. With desktop software, it’s also easy: start up the application, then click around and type to test the functions that interest you. How do you test a JAR file filled with Java classes?

Author: Wellie Chao
Published: January 2004
See also: Testing Series Part I: Overview
link

ANN: Python Mock 0.1.0 released

06.23.2005 · Posted in Tools

I am pleased to announce the first release of Python Mock (version 0.1.0) on SourceForge:

http://sourceforge.net/projects/python-mock/

The Python Mock library enables the easy creation and use of mock objects for Python unit testing, inspired by the various Java mock object tools.Mock objects facilitate unit testing by acting as replacements for classes that the object being tested must interact with. The Mock object can accept any method call and return a canned value. The call is recorded by the Mock object and can be examined later by the test code.

The Mock objects can have expectations about how they are used, and will assert that they are being used correctly. The Mock objects can also can validate themselves against the class being mocked, checking that the methods called exist on the real object and have the right parameters. This ensures that the tests stay in sync with the classes being mocked.

The Mock class can also be used to as a mixin with a regular Python class to provide recording of method calls and setting expectations on non-Mocked methods. This enables the Mock class to be used for diagnostic purposes as well as for testing.

AnyUnit 1.3 add-in for MSVS 2003 is released

06.22.2005 · Posted in Tools

AnyUnit version 1.3 is now released and available for download at anyunit.com.

AnyUnit is an unit testing environment that allows developers to work with virtually any type of test frameworks, commercial and open source and supports C/C++/Managed C++/C# and VB.NET. This release adds test-from-code generation, JUnit-style XML output for integration with CruiseControl and performance improvements.

Rhino Mocks: New mocking framework for .Net

06.22.2005 · Posted in Tools

A discussion on mock objects and mock objects frameworks, including a new one, Rhino Mocks.

Article download (pdf): Mocking Frameworks

Rhino Mocks:

A dynamic mock object framework for the .Net platform. Its purpose is to ease testing by allowing the developer to create mock implementations of custom objects and verify the interactions using unit testing.

Rhino.Mocks is based on EasyMock.Net and released under the same BSD license. It’s free for use and modification for free and commercial software. Rhino.Mocks is an attempt to create easier way to build and use mock objects and allow better refactoring support from the current tools. It’s a hybrid approach between the pure Record/Replay of EasyMock.Net’s model and NMock’s expectation based model.

Rhino.Mocks allows easier injection of custom code into the validation code.
{Free/BSD} 😎 r

Rhino Mocks: .NET mocking framework

06.22.2005 · Posted in Links

A dynamic mock object framework for the .Net platform. Its purpose is to ease testing by allowing the developer to create mock implementations of custom objects and verify the interactions using unit testing.

Rhino.Mocks is an attempt to create easier way to build and use mock objects and allow better refactoring support from the current tools. It’s a hybrid approach between the pure Record/Replay of EasyMock.Net’s model and NMock’s expectation based model.
link

TDD Tools Advisory, June 1-15, 2005

06.16.2005 · Posted in Advisories

The following tools were recently updated:

Artima SuiteRunner 1.0b7
BEA JUnit plug-in 8.1.4
ConTest
Coverlipse 0.9.0
EMMA 2.0.5312
Exactor 1.1.0
Jayasoft Ivy 1.1
NCover 1.0RC2
Parabuild 2.0 build 491
PHPUnit 2.3.0b1 Artima SuiteRunner 1.0b7
Artima SuiteRunner is a free open source testing toolkit for Java released under the Open Software License. You can use this tool with JUnit to run existing JUnit test suites, or standalone to create unit and conformance tests for Java APIs. The three main advantages Artima SuiteRunner offers to JUnit users are reporters, runpaths, and recipe files. Existing JUnit users can use SuiteRunner to run their JUnit tests, which allows them to gain the benefits of reporters, runpaths, and recipe files while continuing to use their JUnit test cases.

BEA Workshop JUnit plug-in 8.1.4
BEA JUnit plug-in extends WebLogic Workshop (WLW) functionality to allow users to use JUnit directly inside it. It’s a plug-in the user can use to generate JUnit test cases from existing javacode or create them from scratch. These tests are run from within BEA Workshop using Ant.

ConTest
The main use of ConTest is to expose and eliminate concurrency-related bugs in parallel and distributed Java programs. ConTest systematically and transparently schedules the execution of program threads such that program scenarios that are likely to contain race conditions, deadlocks, and other intermittent bugs (collectively called synchronization problems) are forced to appear with high frequency. Because bugs are found earlier in the testing process, ConTest dramatically improves the quality of testing and reduces development expense.

Coverlipse 0.9.0
Coverlipse is an Eclipse plugin that visualizes the code coverage of JUnit Tests. It is unique for it integrates seamlessly in Eclipse. The coverage results are given directly after a JUnit run. This makes it the perfect tool for developers to recognize their tests fullfil their task.

EMMA 2.0.5312
EMMA is an open-source toolkit for measuring and reporting Java code coverage. EMMA distinguishes itself from other tools by going after a unique feature combination: support for large-scale enterprise software development while keeping individual developer’s work fast and iterative at the same time. EMMA is so lightweight developers can use it during the process of writing tests instead of waiting for a "test build". This gets code coverage where it belongs: helping with design and implementation before the code is checked in.

Exactor 1.1.0
Exactor is a framework for writing automated acceptance tests of the kind advocated by Extreme Programming. Customers or testers write acceptance tests using a simple plain text format. Programmers write the commands specified by the customer tests and connect them to the application being tested.

Jayasoft Ivy 1.1
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.

NCover (SourceForge) 1.0RC2
NCover tells how much of a program is covered by automated tests. It instruments source code prior to running unit tests to establish test coverage, features NAnt integration and can be used in continuous integration builds.

Parabuild 2.0 build 491
Parabuild is a powerful automated build management server developed by Viewtier Systems. It features an effortless installation process and easy overall use, remote multi-platform builds, automatic (integration) builds, stable scheduled builds, fast Web user interface, growing number of supported version control, and issue tracking systems. (Commercial tool)

Pear PHPUnit2 2.3.0b1
PHPUnit is a family of PEAR packages (PHPUnit, PHPUnit2, PHPUnit2_MockObjects, PHPUnit2_GtkUI, and PHPUnit2_WebUI) that supports the development of object-oriented PHP applications using the concepts and methods of Agile Programming, Extreme Programming, Test-Driven Development and Design-by-Contract Development. It provides an elegant and robust framework for the creation, execution and analysis of Unit Tests.

Agile Rails, Peeks into CVS for JUnit 4 & NMock2

06.14.2005 · Posted in Blogosphere

The Pragmatic Programmers will be publishing a new book this summer: [url=http://www.testdriven.com/modules/mylinks/singlelink.php?cid=17&lid=1019]Agile Web Development with Rails[/url].

Cédric Beust and Alexandru Popescu have been previewing Beck and Gamma’s latest JUnit 4.0 CVS builds, and comparing it with their own pet tool, TestNG.

Scott Ford thinks NMock2 is a welcome surprise (check it out from CVS).Jonathan Cogley reports on his MSDN Webcast on NUnitAsp.

Sebastian Bergmann compares his own PHPUnit2 and Marcus Baker’s SimpleTest.

Shane Duan posts a summary of his presentation Joy and Pain with Fitnesse: "What we have learned during our usage with Fitnesse, an acceptance test framework, and how we have benefited from it. This presentation is intended on purpose to avoid raising philosophical issues, software engineering methodology, or what the correct usage of the Fitnesse should be. Rather, it concentrates on the retrospective of our experience with Fitnesse."

Brian Button announces a 3-day public Test Driven Development course in St. Louis, MO, July 13-15: "Agile Solutions Group will be offering another in its series of public Test Driven Development classes, July 13-15 in St. Louis, MO. The class covers both refactoring and test first programming, which together make up TDD."

SpikeSource is holding the first TestFest on June 17, in Redwood City, CA, presenting the event as an opportunity to see how automated testing for open source projects like Jetspeed, posgreSQL, and SugarCRM are conducted.

Mike Bosch compares XP and RUP: "I think that both camps make good points and like any issue you have to see what works in your company and what doesn’t and then figure out which pieces to use. That’s not to say, don’t try and change what you think doesn’t work but also be realistic about what can be changed and what can’t. Unless you have a LOT of authority you will find it very exhausting to try and influence a culture change without buy-in from your management."

Brad Appleton thinks the next big thing for Customer-Oriented Requirements Architecture may be the next big thing, as an "evolution of expressive environments that allow the business analyst and customer to express their needs and requirements in terms closer to their own thoughts and vocabulary, and to be able to directly transform that into encapsulated entities from which tests can be automatically generated and executed".

Agile Web Development with Rails

06.14.2005 · Posted in Links

Agile Web Development with RailsRails is a full-stack, open-source web framework that enables you to create full-featured, sophisticated web-based applications, but with a twist… A full Rails application probably has less total code than the XML you’d need to configure the same application in other frameworks.

With this book, you’ll learn how to use ActiveRecord to connect business objects and database tables. No more painful object-relational mapping. Just create your business objects and let Rails do the rest. You’ll learn how to use the Action Pack framework to route incoming requests and render pages using easy-to-write templates and components. See how to exploit the Rails service frameworks to send emails, implement web services, and create dynamic, user-centric web-pages using built-in Javascript and Ajax support. There are extensive chapters on testing, deployment, and scaling.

You’ll see how easy it is to install Rails using your web server of choice (such as Apache or lighttpd) or using its own included web server. You’ll be writing applications that work with your favorite database (MySQL, Oracle, Postgres, and more) in no time at all.

You’ll create a complete online store application in the extended tutorial section, so you’ll see how a full Rails application is developed—iteratively and rapidly.

Rails strives to honor the Pragmatic Programmer’s DRY Principle by avoiding the extra work of configuration files and code annotations. You can develop in real-time: make a change, and watch it work immediately.

Forget XML. Everything in Rails, from templates to control flow to business logic, is written in Ruby, the language of choice for programmers who like to get the job done well (and leave work on time for a change).

Rails is the framework of choice for the new generation of Web 2.0 developers.

Authors: Dave Thomas and David Heinemeier Hansson with Leon Breedt, Mike Clark, Thomas Fuchs, and Andreas Schwarz
Expected date of publication: July 4, 2005
See also: PDF beta program from the Pragmatic Programmers

(Note: this description is for the first edition of the book. The second edition is here.)
link

Tags:

BEA Workshop JUnit plug-in

06.14.2005 · Posted in Links

BEA JUnit plug-in extends WebLogic Workshop (WLW) functionality to allow users to use JUnit directly inside it. It’s a plug-in the user can use to generate JUnit test cases from existing javacode or create them from scratch. These tests are run from within BEA Workshop using Ant.
link

Build, deBuild, deploy, and test EJB components iploy, and test EJB components in just a few seconds

06.14.2005 · Posted in Links

Wouldn’t life be easier if you could build, deploy, and test Enterprise JavaBeans (EJB) components in just a few seconds? This article shows you how to simplify the EJB development cycle. Author Nader Aeinechi shows how to easily create input data for your JUnit tests with XStream. He explains the benefits of running your tests with an embedded EJB container called OpenEJB and how those same tests can be run unmodified on your full-featured production EJB container.

Author: Nader Aeinehchi
Published: JavaWorld, June 13, 2005
link

ConTest: expose and eliminate Java concurrency-related bugs

06.14.2005 · Posted in Links

The main use of ConTest is to expose and eliminate concurrency-related bugs in parallel and distributed Java programs. ConTest systematically and transparently schedules the execution of program threads such that program scenarios that are likely to contain race conditions, deadlocks, and other intermittent bugs (collectively called synchronization problems) are forced to appear with high frequency. Because bugs are found earlier in the testing process, ConTest dramatically improves the quality of testing and reduces development expense.
link

Partial Adoption for Agile Approaches

06.06.2005 · Posted in News

In a recent poll, the Methods & Tools newsletter asked the following question: At what stage is the agile approach (XP, Scrum, FDD, …) adoption at your location?

Not aware – 26%
Not using – 16%
Investigating – 14%
Analysed and rejected – 3%
Pilot projects – 4%
Partial implementation (adoption of some agile practices) – 17%
Partial deployment (some projects are using this approach) – 12%
Deployed (all new projects are using this approach) – 8%

Participants: 232 There is a good balance between the three main situations of agile approaches’ adoption (no, maybe, yes):
– around 40% of the participants’ organisations are not using an agile approach or practice
– around 20% are investigating it or running pilot projects
– around 40% have adopted, fully or partially, an agile approach to software development.

The numbers on agile approach usage could be slightly biased. As Methods & Tools has published some articles on this topic in its recent issues, the proportion of agile practitioners in its readership and web sites visitors could be higher than in the "real world".

If you look at each question, you could be shocked that 26% of organisations are even not aware that something like an Agile movement have been active in the software development world these recent years. It is however a sad reality that some organisations are functioning in a "not invented here" mode. They think that their situation is "the best they can get" and they are not interested in what is happening "outside". It is also true that agility is people oriented and that most organisations have a tendency to be focused on process oriented activities. There is also a high number of respondents with partial implementation of agile practices. Even if some purists could argue that you cannot be 50% agile, this is another point showing that agility is reality oriented. You can rarely change completely and immediately a software development process.

Source: Methods & Tools

FIT reader, anonymous delegates, JIT accountability

06.06.2005 · Posted in Blogosphere

William C. Wake is currently posting a series of blog entries on FIT: "I’ve used it for a while, and looked at some of its code along the way, but hadn’t sat down and really studied it systematically. My plan is to spend an hour at a time, just digging in to what I find and sharing my notes." Read Part one, two, three, four.

Peter Provost tests events with anonymous delegates in .NET 2.0.

A reminder that Kent Beck will discuss eXtreme Programming and Developer Accountability tomorrow (June 7).Jonathan Cogley reports on the recent MSDN Webcast on NUnitAsp.

Guillaume Laforge uses Ant’s optional FTP task in Maven: "I had to customize my build to upload some files through FTP. But it wasn’t just a mere artifact to upload through FTP to the enterprise repository, so I couldn’t use Maven’s artifact plugin and its FTP method. So the solution was to use Ant’s optional FTP task."

Jérôme Lacoste uses his coffee break to detail how to manage CruiseControl with jManage.

Jason Ferguson uses Open Source .NET Tools for Sophisticated Builds.

The first international Agile Open conference took place last week. Outputs from the conference have been made available.

Brian Button has made a [url=http://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?EventID=1032273125&EventCategory=5&culture=en-US&CountryCode=US]webcast on Refactoring[/url] (MSDN webcast, needs registration).