Concordion Logo in Green


Presented by @nigel_charman
Project Lead @concordion

Using this slide deck

Press the space bar to navigate sequentially, or the left/right/up/down buttons to jump to specific sections.

Concordion is a test runner
for executable specifications
that creates beautiful living documentation

Open Source Logo
Apache 2.0 License
Contributors Contributors Contributors

Downloads

screenshot showing increase in download count

How it works

how it works image

Specification

how it works image

Specifications

describe in plain language the business requirements and show examples of desired behaviour

Collaborative specification



Image courtesy http://agilecoach.typepad.com/agile-coaching/2012/03/bdd-in-a-nutshell.html

Specifications

Are written in Markdown, HTML or Excel

(by anyone on the team, typically by a BA or tester)

Markdown

Markdown is a simple, natural format for creating rich text:


                    ## This is a H2

                    This is a paragraph

                    * This is a
                    * bullet point list

                    This is an [example](example.html "Title") link

                    | Table | Heading |
                    | ----- | ------- |
                    | Table | Row 1   |
                    | Table | Row 2   |
                

Markdown Editors

Markdown can be created/edited with all sorts of tools:

  • Github, Bitbucket, etc
  • Mindmapping tools - eg. MindMup
  • IDEs - eg. Eclipse, IDEA
  • Editors - eg. Notepad++, Sublime

Example specification


    # Splitting names

To help personalise our mailshots we want to have the first name and 
last name of the customer. Unfortunately the customer data that we are 
supplied only contains full names.

The system therefore attempts to break a supplied full name into its 
constituents by splitting around whitespace.

### Basic Example

The full name Jane Smith is broken
into first name Jane and last name Smith.
                

Instrumentation

how it works image

Instrumentation

In order to make the specification executable, it must be instrumented with commands.

Commands are added as Markdown links

(typically by a tester or developer)

Set [Jane Smith](- '#name')
Execute [broken](- '#result = split(#name)')
Assert Equals [Jane](- '?=#result.firstName')

Example instrumentation


    # Splitting names

To help personalise our mailshots we want to have the first name and 
last name of the customer. Unfortunately the customer data that we are 
supplied only contains full names.

The system therefore attempts to break a supplied full name into its 
constituents by splitting around whitespace.

### Basic Example

The full name [Jane Smith](- "#name") 
is [broken](- "#result = split(#name)") 
into first name [Jane](- "?=#result.firstName") 
and last name [Smith](- "?=#result.lastName").
                

when previewed...

preview showing concordion commands when you hover over markdown links

IntelliJ IDEA Plugin

animated gif showing intellij plugin support

IntelliJ IDEA

Concordion Support plugin

Surround with Concordion command Alt - Enter
Create method from usage Alt - Enter
Auto complete method and variable names Ctrl - space
Go to declaration Ctrl - left-click
Navigate spec <-> fixture Ctrl - Shift - s
Run tests (from spec or fixture) Ctrl - Shift - F10

HTML only

Find usages Ctrl - F7
Rename Shift - F6

Fixture

how it works image

Fixture

Runs as a JUnit test (or NUnit for .NET)

(typically written by a tester or developer)

Fixture


import org.concordion.integration.junit4.ConcordionRunner;
import org.junit.runner.RunWith;

@RunWith(ConcordionRunner.class)
public class SplittingNamesFixture {

    public Person split(String fullName) {
        return Person.newPerson(fullName);
    }
}
                

Output

System under Test

how it works image

System under Test

Executes Java code directly,

or other interfaces via "driver" classes

What are we testing?

Contributors Contributors
              Intention                                        Implementation

Other commands

Run another spec



    [Shipping](shipping.html "c:run")
                

or


    [Shipping](shipping.md "c:run")
                  

You can run HTML specs from Markdown and vice versa

Execute on a table



    | [split][][Full Name][full] | [First][first] | [Last][last]  |
    | -------------------------- | -------------- | ------------  |
    | John Smith                 | John           | Smith         |
    | Maria de los Santos        | Maria          | de los Santos |

    [split]: - "#result = split(#fullName)"
    [full]:  - "#fullName"
    [first]: - "?=#result.firstName"
    [last]:  - "?=#result.lastName"
        

Verify Rows



    |[_check GST_][][Sub Total][]|[GST][]|
    | -------------------------- | ----: |
    |                         100|     15|
    |                         500|     75|
    |                          20|      2|

    [_check GST_]: - "c:verifyRows=#detail:getInvoiceDetails()"
    [Sub Total]:   - "?=#detail.subTotal"
    [GST]:         - "?=#detail.gst"
        

Demo

Comparison


Concordion Cucumber
Grammar Plain English Gherkinglish
Input Format Markdown, HTML, Excel Text
Publishes doc with tests Completely flexible Limited
Embed screenshots, logs in output Extensible Limited
Instrumentation In specification Regexp in code
Languages Java, Groovy, C# * 13+ languages

* C# only supports HTML input currently

Extensions

storyboard image screenshot image logging tooltip image log viewer image

Excel, Parallel Runner,
Storyboard, Screenshot,
Logging Tooltip, Log Viewer
and more...

Learn more


http://concordion.org

http://github.com/concordion

@concordion


This presentation - http://tinyurl.com/concordion2

Fork me on GitHub