Concordion, like Fitnesse is another Specification By Example tool which I like because of its free form structure.
Concordion uses HTML as its syntax to write specifications. With the HTML, it uses the <span> tag to specify commands. Just like Fitnesse, fixtures are required to interpret the specification and execute the tests. Tests are written in Java using ether JUnit or TestNG. Other languages are supported, but I haven’t tried them.
The basic functions of Concordion are:
Assert Equals : To assert whether a value is equal and return true or false.
Set : Sets a variables value.
Execute : Execute an instruction with a result. The result can be void.
Execute On A Table : Executes the same behaviour across a row on a table. This is good for verifying multiple input tests.
Verify Rows : Allows you to verify the results when multiple values are returned. For example when returning the results form a database query.
When you run a test, Concordion returns HTML which has been marked up with the test results.
Advantages
The advantages of using Concordion over Word documents (and even in some cases fitnesse) are
- It uses HTML. Be careful though using WYSIWYG HTML editors. The HTML generated may be complex and it might be easier to just hand code the HTML yourself.
- Concordion is simple to understand and implement.
- Just like Fitnesse, it is easy to see when your document is up to date and that the examples are correct.
- Integrates well with Jenkins. I had no troubles incorporating within Jenkins and just used the HTML report plugin to incorporate the results.
Disadvantages
Again, like Fitnesse, there are a number of disadvantages of using Concordion over a Word Document.
- Requires coding compared to a word document, but then again, the purpose of Concordion is different.
- There is no version control built in, but saying that, you can tie the HTML with your source code and check in at the same location. That is what I have done.
- Again, just like HTML (Well, it is actually…) images and attachments need to be stored in separate files.
I like Concordion for its simplicity. I haven’t tried Concordion with message formats such as XML, but I’m assuming that the same caveat with Fitnesse where you need to decode the XML still applies.
Saying that, I do have some ideas about using the test data builder pattern to generate my XML message based on a table of inputs.
Maybe one day I’ll get around to doing it.
Let me know in the comments which you prefer, Concordion or Fitnesse and especially if you are using these in any SOA/Integration space.