posted on Sunday, September 05, 2004 12:11 PM by davidboschmans

BENUG Workshop on Test-Driven Development

Next Thursday – September 9th – the Belgian .NET User Group (BENUG) is organizing a workshop about application testing using Test-Driven Development and Model-Based Testing principles. This hands-on workshop will be led by Jonathan de Halleux (wiki).
The goal of this workshop is to give the attendees some in-depth information on how unit testing, with or without a database, can be performed.

With this post I would like to provide some additional information and links to the tools and frameworks that will be used during the workshop. An overview.

After introducing unit testing and its principles Jonathan will show some of the most common testing frameworks and tools today available.

  • NUnit: NUnit is a unit-testing framework for all .NET languages. Initially ported from JUnit and currently in version 2.2.
  • MbUnit: MbUnit is a Unit Test Framework for .Net. It provides new fixtures as well as the framework to create new ones. MbUnit is based on QuickGraph, a directed graph library for C#. Currently in version 2.2.
  • csUnit: csUnit is  a unit testing tool for the Microsoft .NET Framework, supporting all.NET languages. Currently in version 1.9.4.
  • NUnitForms: NUnitForms is an NUnit extension for unit and acceptance testing of Windows Forms applications. Currently in version 1.3.
  • NUnitASP: NUnitAsp is a tool for automatically testing ASP.NET web pages. It's an extension to NUnit. Currently in version 1.5.
  • NUnitAddIn: NUnitAddIn is an add-in – developed by Jamie Cansdale - that enables point and test for Visual Studio.NET. Currently in version 0.9.
  • TestFu: TestFu is a framework that can help the tester to build a data generator, state machines, grammars, etc... Currently in version 0.2.
  • [Updated] Codesmith: Codesmith is a template-based code generator that can generate code for any ASCII-based language.

In the second part of the workshop Jonathan will cover database unit testing and how to use the frameworks and tools listed above in practice.

TestFu will be used to create “smart-data” for your test application. The purpose of this Database populator framework is to provide you with a smart and flexible set of random data generators to populate your database. This way you van provide the “food” for your unit tests. Furthermore TestFu can also be used as a production grammar.

"A production grammar is a collection of non-terminal rules to terminal rules that resembles a regular parsing grammar, but is used “in reverse”.” (Source)

Production grammars can do anything, ranging form generating data, piloting your application and generating test cases, ... During the workshop we’ll have a look at using production grammars for:

  • manipulate the Implementation Under Test (IUT),
  • generate test case that manipulate the IUT.
  • if you want to test IUT against input data,
  • generate a wide range of possible inputs.

[Updated]: Check out Jonathan's entry for more info on the use of Codesmith and the Database Populator Framework.

In the third part of the workshop Jonathan will briefly touch on model based testing. Model based testing is about using a model to describe the behaviour of a system. This is a proven technique that offers major advantages to test development teams. Models can be utilized in many ways throughout the product life-cycle, including:

  • improved quality of specifications,
  • code generation,
  • reliability analysis,
  • test generation.

This paper is a good read on model-based testing.

The Foundations of Software Engineering (FSE) group at Microsoft Research (MSR) have published Abstract State Machine Language(ASML), a tool that can be used for Model Based Testing.

"AsmL is the Abstract State Machine Language. It is an executable specification language based on the theory of Abstract State Machines. The current version, AsmL 2 (AsmL for Microsoft .NET), is embedded into Microsoft Word and Microsoft Visual Studio.NET. It uses XML and Word for literate specifications. It is fully interoperable with other .NET languages. AsmL generates .NET assemblies which can either be executed from the command line, linked with other .NET assemblies, or packaged as COM components." (Source)

During the workshop the attendees will be challenged to solve real-life problems in software testing. So don’t hesitate to bring your own software project and get it tested with the tools mentioned earlier! As a lot these tools are still “under development”, your feedback is greatly appreciated!

Workshop requirements:
Since this is a hands-on session, attendees are expected to bring their own portable, with the tools that will be used during the workshop pre-installed on it:

  • .NET Framework 1.1 & Visual Studio .NET 2003
  • Microsoft SQL Server 2000 or MSDE
  • NUnit
  • MbUnit
  • NUnitForms
  • NUnitASP
  • NUnitAddIn
  • TestFu

The workshop will start at 14h at the Compuware offices in Zaventem, Belgium. A road description can be found here.
See you all there!

Comments