Jesper Boeg on Priming Kanban
In this interview, Jesper Boeg, author of the new InfoQ book – Priming Kanban, discusses the keys to using Kanban effectively, and how to get started if you are currently using other approaches.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Rob Thornton on Oct 31, 2006
In the continuing search to find the balance between XML and annotations, TestNG has introduced the concept of annotation transformers. Conceived of by TestNG co-founder Alexandru Popescu (who is also InfoQ's Chief Architect), an annotation transformer is code that will override the behavior of annotations elsewhere in your project. This allows you to modify your annotation without using XML and without recompiling your source. You will have to recompile your annotation transformers if you change them.
Cedric Beust details the idea of annotation transformers and compares the pros and cons of XML vs annotations. His summary of XML vs annotations is:
...annotations allow you to put your configuration system close to the Java source it applies to, but changing it requires Java knowledge and a recompilation. On the other hand, XML files are usually easy to modify and they can be reread at runtime (sometimes even without relaunching your application), but they are very verbose and the edition can be error prone.
Beust refers to an idea he had back in 2004 of using XML to override annotations as something that is unlikely to take off, for good reason. Instead, TestNG 5.3 includes annotations transformers, which allow developers to programmatically override annotations, via the IAnnotationTransformer interface. An example of their use is to override the number of times a test is invoked. For example:
public class Mytest {
@Test(invocationCount = 10)
public void verify() {
// ...
}
}
This test annotation could be transformed to change the invocation count to a higher number:
public class MyTransformer implements IAnnotationTransformer {
public void transform(ITest annotation, Class testClass,
Constructor testConstructor, Method testMethod) {
if ("verify".equals(testMethod.getName())) {
annotation.setInvocationCount(15);
}
}
}
Agility at scale, become as agile as you can be
Five Key Practices to Agile ALM
Another example (extracted from the TestNG mailing list): set a default timeout value for all @Test methods, without having to modify this annotation argument in all existing @Test methods. And I am pretty sure there are other good example for which the code based annotation overridding is better than the XML way.
However, I am very interested to see more usage scenarios from our users. It took me and Cedric a while to figure out the details of this feature, so we are looking forward for possible ways to improve it.
./alex
--
.w( the_mindstorm )p.
TestNG co-founder
EclipseTestNG Creator
To give full credit, the current design is entirely Alexandru's idea.
On an unrelated note, it's kind of scary to be pointed back to a blog entry I posted more than two years ago and that I didn't even remember writing. I stand by what I said back then, though :-)
--
Cedric
Thank for pointing that out, Alex was too modest to tell us. :) We've modified the intro to mention this. It adds good context to post to point out the origins of stuff like this.
In this interview, Jesper Boeg, author of the new InfoQ book – Priming Kanban, discusses the keys to using Kanban effectively, and how to get started if you are currently using other approaches.
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.
Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.
Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).
Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.
Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
3 comments
Watch Thread Reply