Displaying posts tagged with

“maven”

Nov
16
2009

Test anti-patterns project, contributors wanted!

I deliberately wrote a poor quality test, so that I could show how easy it is to re-factor it to a better one. I was driven by having seen lots of such poor tests and to be honest I don’t want to see another of its ilk again. I might write a test like this myself, but I would never leave it like this. Its part finished, littered with cut and paste, poorly named methods and hard coded values.

I show how to re-factor the test using several patterns for test fixtures. The setup stage is often the worst bit of a bad test. If you want to contribute some of your own bad tests and example improvements, read the blog, download the project and contribute!

Oct
27
2009

Refactoring to Google Collections – ImmutableList for simple code

Google collections are excellent in multi-threaded applications, so I thought I would re-factor some code to use them.