Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using Cucumber as a language-agnostic spec

Using Cucumber as a language-agnostic spec

How we used BDD to set a contract for implementations of the same thing in different programming languages

Honza Javorek

October 08, 2019
Tweet

More Decks by Honza Javorek

Other Decks in Technology

Transcript

  1. Using Cucumber as
    a language-agnostic
    spec
    honzajavorek.cz @honzajavorek
    Honza Javorek

    View full-size slide

  2. U
    s
    i
    n
    g
    C
    u
    c
    u
    m
    b
    e
    r
    U
    s
    i
    n
    g
    C
    u
    c
    u
    m
    b
    s
    i
    n
    g
    C
    u
    c
    u
    m
    b
    e
    r
    U
    s
    i
    n
    g
    C
    u
    c
    u
    m
    b
    e
    i
    n
    g
    C
    u
    c
    u
    m
    b
    e
    r
    s
    i
    n
    g
    C
    u
    c
    u
    m
    b
    e
    r
    U
    s
    i
    n
    g
    C
    u
    c
    u
    m
    b
    s
    i
    n
    g
    C
    u
    c
    u
    m
    b
    e
    r
    U
    s
    i
    n
    g
    C
    u
    c
    u
    m
    b
    e
    r
    U
    s
    i
    n
    g
    C
    u
    c
    u
    m
    b
    e
    s
    i
    n
    g
    C
    u
    c
    u
    m
    b
    e
    r
    C
    u
    c
    u
    m
    b
    e
    r

    View full-size slide

  3. Using Cucumber as
    a language-agnostic
    spec
    honzajavorek.cz @honzajavorek
    Honza Javorek
    "

    View full-size slide


  4. OpenAPI,
    API Blueprint
    Dredd
    implementation
    ✅ ❌
    TESTED CONTRACT FOR HTTP APIs

    View full-size slide


  5. Gherkin
    feature files
    Cucumber
    implementation
    ✅ ❌
    TESTED CONTRACT FOR PRODUCT BEHAVIOR

    View full-size slide

  6. ...
    hooks
    interface

    View full-size slide

  7. ...
    TESTED
    CONTRACT
    language-agnostic
    open source friendly
    standard
    CI friendly

    View full-size slide

  8. ...
    TESTED
    CONTRACT
    language-agnostic
    open source friendly
    standard
    CI friendly
    able to describe
    a complex,
    custom behavior

    View full-size slide

  9. ...
    TESTED
    CONTRACT
    language-agnostic
    open source friendly
    standard
    CI friendly
    able to describe
    a complex,
    custom behavior

    View full-size slide


  10. Gherkin
    feature files
    Cucumber
    hooks handler
    implementation
    ✅ ❌

    View full-size slide


  11. Contract in
    Gherkin
    feature files
    ✅ ❌
    ...
    Cucumber
    tests

    View full-size slide


  12. Contract in
    Gherkin
    feature files
    with placeholders
    ...
    ✅ ❌
    Canned
    Cucumber
    tests
    Cross language test suite
    template package

    View full-size slide


  13. imagine we used
    YAML files with custom structure or
    JavaScript code to describe the test
    scenarios

    View full-size slide


  14. change propagation?

    View full-size slide

  15. TESTED
    CONTRACT
    language-agnostic
    open source friendly
    standard
    CI friendly
    able to describe a complex, custom behavior

    both human & machine -readable

    View full-size slide