User Acceptance Stories

Jan Dahlke // Frontend Dev

jan.dahlke@pdfforge.org

mit Gherkin

Gherkin ist eine vereinfachende Sprache, die beim ATDD  (Accptance Test Driven Development) eingesetzt wird.

ATDD is closely related to test-driven development (TDD). It differs by the emphasis on developer-tester-business customer collaboration. ATDD encompasses acceptance testing, but highlights writing acceptance tests before developers begin coding.

Einführung

"Acceptance tests are from the user's point of view – the external view of the system. They examine externally visible effects, such as specifying the correct output of a system given a particular input." [1]

[1] - https://en.wikipedia.org/wiki/Acceptance_test-driven_development

[...]Gherkin is a line-oriented language that uses indentation to define structure. Line endings terminate statements (called steps) and either spaces or tabs may be used for indentation.

Syntaktische Merkmale

Gherkin ist so konzipiert, dass es sowohl menschen- als auch maschinenlesbar ist und hat nur wenige Keywords. Es ist eine Beschreibungssprache // turing-incomplete

features - sammeln scenarios, bilden Dateien *.feature

scenarios - core structure, enthalten einen oder mehr steps

backgrounds - zusätzlicher Kontext zu scenarios // vergleichbar mit einem beforeEach-hook im Testing

given - setzt das System in einen bekannten State, bevor die Interaction beginnt

steps - given, when, then - Dreischritt

whens - beschreibe die Key-Action die User ausführt

thens - beschreibe beobachtbares Ergebnis

Keywords

Beispiele

Feature: Serve coffee
  In order to earn money
  Customers should be able to
  buy coffee at all times

  Scenario: Buy last coffee
    Given there are 1 coffees left in the machine
    And I have deposited 1 dollar
    When I press the coffee button
    Then I should be served a coffee

Feature:  create new Deal in ppp dashboard

    Scenario:   create new Customer
      Given        I am logged in as Employee
      And           I clicked "create new Deal" button on ppp dashboard
      When        I fill out all needed Recipient Data
      And           press save User
      Then         the browser should redirect me to the URL of the Deal I created
      And           Fields for EDITOR & OWNER & RECIPIENT & STATUS are correctly filled

    Scenario:   add products to cart
      Given       I am logged in as Employee
      And          I created Recipient
      When       I press "add Product" button in deal View
      Then        a lightbox opens that allows to select products

Beispiel ppp dashboard

Wtf should one need this....?

...das Ergebniss des Denkens ist gleichzeitig Lastenheft und Dokumentation für das Projekt

...es sollten alle Anwendungsfälle der Applikation einmal durchdacht sein

...aus den User Stories heraus, kann man JiRA Tickets abbilden. Indem man im Confluence auf diese zeigt sind sie verknüpft.

...auch Änderungen der Anforderungen sind dokumentiert // Changerequests // checks and balances in der Diskussion

...TDD kann mit den Stories schnell umgesetzt werden

Made with Slides.com