Ellen Lippe @ellen.lippe ellen.lippe@yahoo ellen.lippe@yahoo.com Ellen Lippe @ellen.lippe 8 Feature:

download Ellen Lippe @ellen.lippe ellen.lippe@yahoo ellen.lippe@yahoo.com Ellen Lippe @ellen.lippe 8 Feature:

of 18

  • date post

    02-Aug-2020
  • Category

    Documents

  • view

    2
  • download

    0

Embed Size (px)

Transcript of Ellen Lippe @ellen.lippe ellen.lippe@yahoo ellen.lippe@yahoo.com Ellen Lippe @ellen.lippe 8 Feature:

  • - and automated feature specifications

    Ellen Lippe @ellen.lippe ellen.lippe@yahoo.com

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 2

    Developer (me..)Tester (you?..)

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 3

     Better communcation and cooperation ◦ Among testers, developers, users, business analysts....

     Better software ◦ Predictable behaviour ◦ Bugfree ◦ Easy to change ◦ Easy to extend ◦ Fast to re-test

     My experience ◦ from various teams, products and programming languages ◦ gains and challenges

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 4

    TDD

    Gherkin

    Domain Driven Design

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 5

    BDD is a second-generation, outside– in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters.

    Dan North

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe

     The essense:

    ◦ A mindset

    ◦ A technique

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 7

     How to approach software engineering?

    ◦ What’s the starting point?

    ◦ How do we collaborate?

    .......The feature

    ....... We do! All the time..

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 8

    Feature: Basic Arithmetic As a scientist I need to be able to calculate numbers So that I can ......

    Scenario: Addition Given a calculator I just turned on When I add 3 and 4 Then the result is 7

    Scenario: Subtraction Given a calculator I just turned on When I subtract 5 from 9 Then the result is 4

    Scenario: Another addition

    Feature specification - gherkin syntax

    @given(”a calculator I just turned on”)

    public void given():

    calculator = new Calculator()

    calculator.turn_on()

    @when(”I add {number1} and {number2}”)

    public void when(int number1, int number2):

    result = calculator.add(number1,number2)

    @then(”the result is {expected_result}”)

    public void then (int expected_result):

    assert result==expected_result

    Step implementation - any language

    public class Calculator:

    public void turn_on()

    on = True

    public int add (int num1, int num2)

    if on:

    return num1 + num2

    public int subtract(int num1, int num2)

    if on:

    return num1 – num2

    Sofware source code

    IDE/Test run tools

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe

     Behave for Python

     Specflow for .Net

     Jbehave for Java

     Cucumber for Ruby (and Java, .Net ++)

    9

    http://pythonhosted.org/behave/ http://www.specflow.org/ http://jbehave.org/ https://github.com/cucumber/cucumber

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe

    10

    Feature: Basic Arithmetic As a scientist I need to be able to calculate numbers So that I can ......

    Scenario: Addition Given a calculator I just turned on When I add 3 and 4 Then the result is 7

    Scenario: Subtraction Given a calculator I just turned on When I subtract 5 from 9 Then the result is 4

    Scenario: Another addition

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 11

    Implementation

    Testing / feature verification

    Operation/Maintenance

    Feature wish user

    user BA

    Communication

    Feature specification

    user

    BA

    developer

    developer

    Feature: Basic Arithmetic As a scientist I need to be able to calculate numbers So that I can ......

    Scenario: Addition Given a calculator I just turned on When I add 3 and 4 Then the result is 7

    Scenario: Subtraction Given a calculator I just turned on When I subtract 5 from 9 Then the result is 4

    Scenario: Another addition

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 12

     How to make sure that we create what the user needs?

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 13

    !!

    user

    BA

    developer

    D o c s

     => Common understanding on right level

    IT

    Feature: Basic Arithmetic As a scientist I need to be able to calculate numbers So that I can ......

    Scenario: Addition Given a calculator I just turned on When I add 3 and 4 Then the result is 7

    Scenario: Subtraction Given a calculator I just turned on When I subtract 5 from 9 Then the result is 4

    Scenario: Another addition

     How to make sure that we create what the user needs?

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 14

     More robust code, that’s easy to change and extend, and with less bugs (none?)

     With automated feature tests I....:

    ◦ ...know exactly what to implement ◦ don’t spend money on creating a rolls royce if this is not in spec ◦ sufficient detail level

    ◦ ... can focus more ◦ use all my developer skills in how to code,

    not mixed with understanding/remembering what ◦ one feature at a time

    ◦ ...know that I don’t break any existing functionality ◦ risk free refactoring to enhance application capabilities ◦ don’t introduce bugs ◦ safetynet

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 15

     Testing and implementation merge

     Change the way we work

     Automated and manual tests complement each other => complete test suite

    Feature: Basic Arithmetic As a scientist I need to be able to calculate numbers So that I can ......

    Scenario: Addition Given a calculator I just turned on When I add 3 and 4 Then the result is 7

    Scenario: Subtraction Given a calculator I just turned on When I subtract 5 from 9 Then the result is 4

    Scenario: Another addition

    ◦ More involved in development process ◦ Overall flow/smoketests

    ◦ More involved in testing ◦ Communicates needed test effort

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 16

     Communication ◦ Later me, other developers, OM

     Documentation ◦ Top level

    ◦ Up to date

    ◦ Accurate with respect to what’s implemented

     Changed/new functionality ◦ Implement knowing that feature tests will tell you

    immediately if your change introduces a bug

     Regression testing ◦ Not necessary

  • ellen.lippe@yahoo.com

    Ellen Lippe

    @ellen.lippe 17

  • Ellen Lippe @ellen.lippe ellen.lippe@yahoo.com