Login | Register
My pages Projects Community openCollabNet

aut
Project home

If you were registered and logged in, you could join this project.

Summary Advanced Unit Testing
Category testing
License GNU General Public License
Owner(s) cliftonm

A project intending to extend and advance unit testing methodologies with the intention of moving unit testing into a more widely accepted discipline, possibly integrated with future development platforms.

Visit our sister project MbUnit, run by Jonathan de Halleux.  MbUnit allows the construction of complex fixtures at runtime and facilitates designing fixtures based on well known unit test patterns and Model Based Testing.

Roadmap

Project Overview
Development Tracks
Status
Tools & Technologies
Latest Releases
Coding Style Guidelines

Screenshots

The Application

Xml Output

Goals

Unit testing is an undeveloped, immature methodology.  The goal of this project is to move this methodology into a more stable and mature engineering discipline.  This means:

  1. providing useful tools to the developer for creating, managing, maintaining, and tracking tests and test results
  2. identifying specific unit test patterns that can be as a foundation stone for inexperienced test writers
  3. providing reverse and forward engineering tools to automate unit test generation for existing and new development efforts

The impetus for this project is the general lack of understanding of "how to write a good unit test" and the observation that the concept of unit testing is under-developed.  The final goal of the project is to explore avenues in which unit tests can be automatically generated through C#'s reflection mechanism and interactive wizards.  This includes reverse engineering (defining unit tests for existing code), and forward engineering (generating unit tests and stub application code).  The final application should also provide some automation regarding the generation of mock objects to facilitate simulating complex and/or undeveloped aspects of the application.  Unit testing is also more than just writing a unit test.  It is also a documentation tool.  Ancillary functionality of the application is to extract meaningful documentation that the programmer can use during application implementation.

Scope

Unit test applications already exist.  This project consists of several development efforts with the intention of attaining its goals.  These aspects are:

  • enrich the test suite available to the programmer
  • develop automation functions to assist in
    • reverse engineering
    • forward engineering
  • implement front-end wizards to guide the developer through unit test development
  • provide documentation identifying unit test patterns
  • interface with one or more defect tracking systems to automatically register defects detected by failed unit tests
  • interface with a web service to publish test runs, the goal being to provide a generic gateway which can be used to automate the injection of defects into existing defect tracking systems
  • auto-document unit test requirements, as much as is feasible, as a guide for the application developer
  • generate mock object stubs where designated by the unit test developer
  • extract mock object stubs from production code for the purposes of simplifying complex interfaces and test fixture setups
  • integration with Microsoft's VisualStudio (MSVS)
  • integrate with existing quality assurance processes

Development Environment

The initial development environment and platform will be C# and .NET.  Microsoft Visual Studio (MSVS) will be the primary development platform with the intent of supporting the development under Mono as well.  C# and .NET have been chosen for the following features:

  • reflection
  • modular assembly capability
  • XML services
  • web services

The VisualStudio platform is the primary development platform mainly because of its maturity and completeness.

Further Reading

The following articles have been written by Marc Clifton and discuss the fundamentals of unit testing, explore a case study, and develop an extended unit testing platform which is intended to be a vehicle for developing the goals discussed in this project.

Advanced Unit Testing, Part I - Overview
Advanced Unit Testing, Part II - Core Implementation
Advanced Unit Testing, Part III - Testing Processes
Advanced Unit Testing, Part IV - Fixture Setup/Teardown, Test Repetition, And Performance Tests
Advanced Unit Testing, Part V - Unit Test Patterns

Related resources

MbUnit

MbUnit is a Test Framework for the .Net platform that feels like other "Custom Attribute" based tools. It is an evolutionary and highly customizable test framework: fixtures are defined by connecting elementary pieces at runtime. For example, by chaining the SetUp, Test and TearDown handlers, you generate the SimpleTest fixture pattern.  In fact, MbUnit is not limited to Unit Testing, it also supports Model Based Testing, another deadly bug hunter. Like all projects, MbUnit has a lot of item on the to-do list and needs people contribution to evolve: testers, developers, documentation writers, etc...If you care to have a look, take a peak at http://mbunit.tigris.org

Unit Test Automation Applications:

CSUnit
NUnit
JUnit

Methodologies

Extreme Programming - one of the key aspects of XP is unit testing and is one of the Agile Methods
Agile Software Community

General Articles

The Benefits Of Automated Unit Testing, by Sami Vaaraniemi