Introduction

A few years ago PatternTesting began as a framework to automatically check for Architecture/Design/Implementation decisions. This is now PatternTesting-Check.

Perhaps you don't want to have some of the checks (e.g. NullPointer-check for arguments) in the delivered jar file. But you want to keep the annotations for the check in your code. So you find now these annotations together with other stuff (e.g. profiling support) in PatternTesting-Runtime.

There are some aspects which improves your code, e.g. providing better error messages if an IOExceptons was thrown. These aspects are put also in the runtime part. So this part grows and grows and allows you to write better applications for free.

For the build process we use Maven2 and Continuum. Since Maven2 suggests to deliver only one artifact in a project we took the tools part into PatternTesting-Tools. This part contains Ant support and a Maven plugin.

You can use the PatternTesting framework also if you doesn't know anything about AspectJ. But you need a cookbook how to use it. And you need examples. This is where PatternTesting-Samples came in.

Why Not Checkstyle?

There are tools like Checkstyle, PMD or FindBugs, which can also find anti patterns in your code. Read, what Vincent Massol say in Pattern Testing with AOP at TheServerSide.com about this topic.

History

The Origin

from Vinent Massol:

Around 2001 I discovered AOP and AspectJ and I thought the idea neat. Since I wanted to test it I used it on the Apache Jakarta Cactus project to generate debug logs and to automate runtime checking of the Cactus configuration. In 2002 I was working as a software architect on a project and remembered my experimentations on Cactus and since I needed a way to enforce some best practices on this project I thought that I could use AspectJ for this. Either at build time or at runtime (think about a custom profiler providing business-related metrics). I coded a few aspects and it seemed to be working ok so I thought I should share it with others and created the PatternTesting open source project. A few years later I started working on other stuff and dropped the ball but the project was lucky to have Oliver step up and continue it :)

The Reincarnation

from Oli B.:

In 2005 I wrote a (German) book about AspectJ (Aspektorientierte Programmierung mit AspectJ 5), when I detect PatternTesting, which brought me some ideas for my book. The original NullTestAspect (now: NullPointerTrap) I presented during my lecture at the University of Applied Sciences in ULM. At the same time I began to use it in several projects.

In 2007 I wanted to get one of the authors, Vincent Massol and Matt Smith, for a talk at the AOP-Day 07. I offered them to help at the PatternTesting project to give some of the ideas back I had "borrowed" for some projects. They added me not only as developper but as administrator because both had no time any more for that project because both were busy with other projects.