agile mëtteg #5: agile testing

Post on 07-Aug-2015

76 Views

Category:

Presentations & Public Speaking

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

25 June 2015

Agile Mëtteg : Agile Testing

ObjectivesThis session will focus on a Agile Testing and provide you with practical examples and techniques to help your team understand what is behind this approach.

AgendaLet’s get acquaintedWhat is agile testing?Unit testing Test Driven Development Acceptance testing Behavior Driven Development Q&A

28 Feb. 2013 3

OBJECTIVES & AGENDA

Introduction to agile methods

4

LET’S GET ACQUAINTED

28 Feb. 2013 Introduction to agile methods

Introduction to agile methods 528 Feb. 2013

Eric FERROT

Senior Software Developer

ME

6.

AGILE PARTNER

28 Feb. 2013 Introduction to agile methods 6

Software Development

Knowledge Transfer Innovation Support

Consulting

Introduction to agile methods 7

YOU

What about you?

What do you know about agility?What are your expectations?

28 Feb. 2013

8

WHAT IS AGILE TESTING?

28 Feb. 2013 Introduction to agile methods

9

WHAT IS TESTING?

28 Feb. 2013 Introduction to agile methods

WHAT IS SOFTWARE TESTING?

Definition:

Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test.

(Wikipedia)

WHAT IS SOFTWARE TESTING?

Definition:

Software testing is a way to measure the quality of the product using tests.

(me)

MEASURING QUALITY

Measuring quality using tests:tests to find defectsfunctional / non-functional testingManual / automated testsa LOT of kinds of tests

15 July 2010 12

SO WHAT IS AGILE TESTING ?

… AND WHY?

… AND HOW?

Traditional / Waterfall approachTesting is done after the development

Requirements Analysis Design Developmen

t Test Release

WHAT IS AGILE TESTING?

15 July 2010 Agile Mëtteg - Agile testing 14

Agile approachTesting is part of the development process

WHAT IS AGILE TESTING?

15 July 2010 Agile Mëtteg - Agile testing 15

Iteration 1

Requirements

Analysis

Design

Development

Test

Release

Iteration 2

Requirements

Analysis

Design

Development

Test

Release

Iteration n

Requirements

Analysis

Design

Development

Test

Release

No specific order

Traditional / Waterfall approachTesting is done after the developmentClear separation of roles

WHAT IS AGILE TESTING?

15 July 2010 Agile Mëtteg - Agile testing 16

Programmer

Domain Expert

Tester

Agile approachTesting is part of the development processA whole team

WHAT IS AGILE TESTING?

15 July 2010 Agile Mëtteg - Agile testing 17

Programmer

Domain Expert

Tester

Programmer

Tester

Agile testing places an increased portion of the testing in the hands of the developers

Wait… WHAT?!?!I’m a programmer not a testerIt’s trivial I don’t need a testI don’t have time for testingMy code is very difficult to test

WHAT IS AGILE TESTING?

WHY AGILE TESTING?

WHY should developers write tests?

Fear / ConfidenceDo you dare to change the code? Tests = safety net

It places developers as users Better usability

It makes the code testable Better design

15 July 2010 Agile Mëtteg - Agile testing 19

WHY AGILE TESTING?

A better design

“How good the design is doesn't matter near as much as whether the design is getting better or

worse. If it is getting better, day by day, I can live with it

forever. If it is getting worse, I will die.”

(Kent Beck )

AGILE TESTING… HOW?

Agile testing… HOW?

Unit testingTest Driven DevelopmentAcceptance testingBehaviour Driven Development

BUT FIRST…

15 July 2010 22

A PAGE OF ADVERTISMENT!

15 July 2010 23

http://www.dinoeggsrebirth.com/

COMING THIS SUMMER

UNIT TESTING

UNIT TESTING

Definitions

Unit : Smallest testable part of an application

Unit test : A method to test a unit

UNIT TESTING

The „3A“ pattern

ArrangeAct

Assert

UNIT TESTING

F.I.R.S.T.

FastIndependentRepeatable

Self-ValidatingTimely

[Clean Code – Robert C. Martin]

UNIT TESTING

DEMO

COLLISION DETECTION

COLLISION DETECTION

COLLISION DETECTION

COLLISION DETECTION

COLLISION DETECTION

COLLISION DETECTION

COLLISION DETECTION

TEST DRIVEN DEVELOPMENT (TDD)

TEST DRIVEN DEVELOPMENT (TDD)

What is TDD? Difference to unit testing Write the unit test

Unit TestCode

FIRST!

TEST DRIVEN DEVELOPMENT (TDD)

Red – Green – Refactor

Make it failwrite the test first

Make it workwrite the simplest implementation

Make it betterrefactor without changing the behavior

15 July 2010 Agile Mëtteg - Agile testing 44

Test

CodeRefactor

TEST DRIVEN DEVELOPMENT (TDD)

TDD is not only about testingAlso called Test Driven Design

TDD is a methodology that helps creating a good design when

developing code.

TEST DRIVEN DEVELOPMENT (TDD)

TDD is not only about testingAlso called Test Driven Design

TDD consequencesYAGNIDRYLaw of DemeterSingle responsibility principleInterface segregation principleInversion of control

GO

OD

DE

SIG

N !

TEST DRIVEN DEVELOPMENT (TDD)

DEMO

TEST DRIVEN DEVELOPMENT (TDD)

TEST DRIVEN DEVELOPMENT (TDD)

TEST DRIVEN DEVELOPMENT (TDD)

TEST DRIVEN DEVELOPMENT (TDD)

ACCEPTANCE TESTING

ACCEPTANCE TESTING

Unit testing tells us that the code is meeting the programmer‘s expectationsUnit testing is essential but not sufficient

Acceptance tests are specifications for the

desired behaviour and functionality of a system.

Customer orientedAbout the what and not the howUsually black box system testsIntegration tests character15 July 2010 Agile Mëtteg - Agile testing 53

ACCEPTANCE TESTING

Implementing acceptance tests means automation

Examples of automation tools:Framework for Integrated Test (Fit) is an open-source tool for automated acceptance testFitnesse is a webserver, a wiki and an automated testing tool based on Fit

15 July 2010 Agile Mëtteg - Agile testing 54

ACCEPTANCE TESTING

DEMO

BEHAVIOUR DRIVEN DEVELOPMENT (BDD)

15 July 2010 Agile Mëtteg - Agile testing 56

BEHAVIOUR DRIVEN DEVELOPMENT

Behaviour Driven Development (BDD)

Evolution of TDD introduced by Dan NorthUsing terminology focused on the behavioural aspects of the system rather than testing

Unit ≠ behaviour Focus on why the code should be created Business value > Code Specification > Test

15 July 2010 Agile Mëtteg - Agile testing 57

BEHAVIOUR DRIVEN DEVELOPMENT

Outside-in methodology from the known to the unknown

Helps the developer to think YAGNI Leads to better design BDD = Behaviour Driven Design

Don‘t forget about the roots (TDD) Red – Green – Refactor

15 July 2010 Agile Mëtteg - Agile testing 58

BEHAVIOUR DRIVEN DEVELOPMENT

Ubiquitous language based on the business domain

Common vocabulary between participantsMinimizes translationAvoids miscommunicationMakes it easier to validate early

15 July 2010 Agile Mëtteg - Agile testing 59

Domain Expert

Programmer

Tester

BEHAVIOUR DRIVEN DEVELOPMENT

Story frameworkEach feature is captured in a „story“, which defines the scope of the feature along with its acceptance criteria

Feature

Feature: TitleAs a [role]I want [feature]So that [benefit] Feature: End of Agile Mëtteg session

As a speakerI want to end the session in a beautiful waySo that the audience is very impressed

BEHAVIOUR DRIVEN DEVELOPMENT

Scenario / Acceptance criteria

Scenario: TitleGiven some initial context,And some additional context,When an event occurs,Then ensure some outcomes

Scenario 1: Tim saves some dino eggsGiven Tim is on screenAnd Tim is holding 3 eggs,When Tim warps out,Then the eggs disappearAnd player‘s score is increased by 6 points

Scenario 2: Tim collects a red lockGiven Tim is on screenAnd a red lock is on screen,When Tim touches the red lock,Then the red lock disappearsAnd a nice message is shownAnd a wonderful music is played

BEHAVIOUR DRIVEN DEVELOPMENT

Several existing tools for automationJBehave, NBehave, JSpec, NSpec, CppSpec, PHPSpec, SpecFlow, RSpec, Cucumber, …

Executable specification Quick feedback and regression testing Requirements are tests Tests are documentation

15 July 2010 Agile Mëtteg - Agile testing 62

BEHAVIOUR DRIVEN DEVELOPMENT

DEMO

15 July 2010 Agile Mëtteg - Agile testing 63

SUMMARY

15 July 2010 Agile Mëtteg - Agile testing 64

SUMMARY

Some things to remember about Agile Testing:Testing is part of the development processWhole-team approach: roles are not strictly separated like in a traditional approachBuilding a testable architecture leads to a better designUnit tests and acceptance tests are complementaryUse agile practices: TDD, BDD, Continuous Integration

QUESTIONS & ANSWERS

28 Feb. 2013 Introduction to agile methods 66

67

YOUR FEEDBACK

28 Feb. 2013 Introduction to agile methods

Introduction to agile methods 68

R.O.T.I for this SESSION

28 Feb. 2013

Source: www.qualitystreet.fr

THANK YOU

28 Feb. 2013 72Introduction to agile methods

Retrouvez nous sur :

Agile Partner: www.agilepartner.net & http://blog.agilepartner.net

top related