Presentation on theme: "Concordion. You've been there... starting a project with great intentions but, 6 months down the line, you're sitting in front of another plate of spaghetti."— Presentation transcript:
You've been there... starting a project with great intentions but, 6 months down the line, you're sitting in front of another plate of spaghetti. How can we stop it?
Clean code expresses its logic clearly. It's well presented and makes good use of abstraction to hide irrelevant details. Or to put it simply...
So, focus relentlessly on readability. Not just in code, but in everything: Build scripts, class names, log files, story cards, acceptance tests, method names, s, unit tests, management reports, etc.
Don't tolerate acceptance tests written like this...
Use Concordion and write them like this instead...
Clear tests lead to clear fixture code
Notice you are not forced to use tables or a "Given... When... Then..." structure
"Given... When... Then..." is an excellent thinking tool, but it's not a natural way to explain things. Concordion lets you focus on readability.
Visibility to Management A huge benefit of having readable tests is that managers can actually read them and gauge their quality. This provides the team with an incentive for writing them well and not cutting corners.
Tables,,, Paragraphs Bold Headings You don't need to know much HTML to use Concordion...
A Worked Example of Concordion
Although this HTML might look a bit complicated, most of it is just a template. You only need to worry about the bits in the middle...
Now, highlight the key phrases in bold...
Once agreed, the developer can instrument it with hidden attributes that communicate with the fixture...
Here's our base fixture...
If we run it with JUnit, then currently it will fail...
The test output is written to a file in the temp directory*... * You can change this via a system variable, if you like.
Let's add the missing method and run it again...
It still fails, so let's get it to pass. Normally this would be a call to the system under test, but for this demo we'll just implement it in the fixture...
There are versions for... Java.NET Ruby Python
Coaching Although Concordion is very easy to use, the way of thinking - distilling and decomposing behaviours - can take some to get used to. I'm an independent consultant based in London, UK. Please contact me if you would like some help getting your team off on the right track with Concordion. David Peterson