Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 33 Next »

When you are coding, how often do you run your unit test suite? Once a day? Once an hour? Once a minute? Could you even run the suite once a minute if you wanted to? Project Background

Also see Extreme XP Tools.

General Information

Introduction

Regardless of your political beliefs, as an agile and test-infected developer, we'd like you to consider the benefits of adhering to strict, some might say "dictatorial", limits on the way that you write your unit tests as well as the code being tested (SUT).

We should clarify, right up front, that these restrictions apply only to unit tests and not system tests or integration tests, which are also of great importance to the success of any project. However, your unit tests, at least one for each class in your codebase, should be clean, decoupled from one another, and run ultra-fast. We think you should be able to run thousands of unit tests and get your green bar in a few seconds. Achieving that kind of performance takes major discipline on the part of the developer, and Ashcroft helps you learn that discipline by failing tests which stray from best practices.

Remember, the most severe restrictions often lead to the most creative solutions.

Ten Commandments of Unit Tests

  1. I am the class being tested. Thou shalt not test any other class but me.
  2. Thou shalt write isolated tests
  3. Thou shalt not access files during unit tests
  4. Thou shalt not write two tests which depend upon each other

There are more of these to come... we are currently soliciting feedback.

How Does This Work

Ashcroft has an implementation of the Java seurity manager. Once registered (See FAQ), it will start monitoring the process. Ashcroft can be configured through additional VM parameter (See Ashcroft Configuration).

More Details

FAQ

Technical FAQ

Design FAQ

Java Security Manager

Download

Only in Subversion for now: svn://beaver.codehaus.org/ashcroft/scm

You can also try the attached jar at the bottom of this page...

Open issues and bugs

com.atlassian.confluence.macro.MacroExecutionException: JIRA project does not exist or you do not have permission to view it.

License

Copyright 2004-2005 (C) Obie Fernandez. All Rights Reserved.

Redistribution and use of this software and associated documentation
("Software"), with or without modification, are permitted provided
that the following conditions are met:

1. Redistributions of source code must retain copyright
statements and notices. Redistributions must also contain a
copy of this document.

2. Redistributions in binary form must reproduce the
above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.

3. The name "ashcroft" must not be used to endorse or promote
products derived from this Software without prior written
permission of Obie Fernandez. For written permission,
please contact obie@codehaus.org.

THIS SOFTWARE IS PROVIDED BY OBIE FERNANDEZ AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
OBIE FERNANDEZ OR HIS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.

  • No labels