20 Facts about Xtend - writing executable Documentation with Jnario

03 Jul 2012

Here is a quick update about the current state of the Jnario development. I am currently preparing the first Jnario release. As Jnario relies heavily on Xtend, I have written a short introduction to Xtend titled "20 Facts about Xtend", which will become part of the Jnario documentation. Here is a short excerpt of it:

For those who don't know Jnario yet, Jnario is a new test framework for Java focusing on the design and documentation aspects of testing (for an introduction see my previous blog post).

You might have wondered about the title of this post "20 Facts about Xtend". In Jnario we write specifications by stating facts about our software. Here is a simple fact about Xtend (=> describes the expected behavior):

fact "'+' concatenates collections"{
  list(1, 2) + list(3, 4) => iterable(1, 2, 3, 4)

Now it should become clear why this post is titled "20 Facts about Xtend" - the Xtend introduction is generated from a spec consisting of 20 facts. Being able to generate HTML documentations from specs is one of my favorite Jnario features. The follwing screenshot shows the spec in the Eclipse editor. Note that you can run this spec as a normal JUnit test. This means code snippets in your documentation will always work, as otherwise the excution will fail. Executable documentation FTW!

Visit www.jnario.org for more information about Jnario. There is also a mailing list available for questions and discussions. Follow me on twitter if you want to stay up-to-date with Jnario.