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
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.
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
- I am the class being tested. Thou shalt not test any other class but me.
- Thou shalt write isolated tests
- Thou shalt not access files during unit tests
- Thou shalt not write two tests which depend upon each other
There are more of these to come... we are currently soliciting feedback.
- How do I use Ashcroft with Ant
- How do I use Ashcroft with Maven
- How do I use Ashcroft with IntelliJ IDEA
- How do I use Ashcroft with Eclipse
- What is Ashcroft's peformance impact
Java Security Manager
Only in Subversion for now: svn://beaver.codehaus.org/ashcroft/scm
You can also try the attached jar at the bottom of this page...