Archives for Nick Pellow

Colour your Console (now in Java)

Most of us have seen how Rails uses colour in its server log, to highlight important lines or even words as the log scrolls by. In case you haven't, below is a screenshot: Java Devs, its now time for you too to keep your consoles pretty. Here is a very simple Color.java class that will wrap any text with the appropriate ANSI color codes. From the javadoc: This class uses the Builder Pattern, to allow combining formats. e.g. for a blue background and a bold, white foreground you would use: new Color("some

Continue reading »

Express Yourself with Clover EL

A little known - but very powerful feature of Clover is its built-in Expression Language. The Expression Language allows developers or managers to combine any of Clover's 30 report metrics using simple arithmetic expressions. For example, the CRAP metric which is defined as: CRAP(m) = comp(m)^2 * (1 -- cov(m)/100)^3 + comp(m) Where comp(m) is the cyclomatic complexity of method m, and cov(m) is the test code coverage provided by automated tests can be embedded into a Clover report or IDE by simply

Continue reading »

Don't you hate committing code and then waiting hours to find out you broke the build? Even worse is when other people commit code at a similar time to you, and you get dragged into the 'who broke the build' witch-hunt by pure circumstance. If your build times are blowing out because of long test runs (greater than ten minutes), then you are most likely suffering from CI (Continuous Integration) latency and the above problems are real problems for you and your team. Clover can help alleviate theses problems, by optimizing both unit and acceptance tests, drastically reducing the feedback time for each commit. What follows is a case study of how Clover's Test Optimization is run on the Confluence project.

Continue reading »