agile mëtteg series - session 5

52
Agile Mëtteg – 15 July 2010 Agile testing

Upload: agile-partner-sa

Post on 08-Jan-2017

3.267 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Agile Mëtteg series - Session 5

Agile Mëtteg – 15 July 2010Agile testing

Page 2: Agile Mëtteg series - Session 5

Agile Mëtteg in 2010

Complete Agile Mëtteg calendar onwww.agilepartner.net/agility_seminars.html

15 July 2010 Agile Mëtteg - Agile Testing 2

Page 3: Agile Mëtteg series - Session 5

OBJECTIVES & AGENDA

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.

AgendaIntroduction of Agile PartnerThe attendeesWhat is agile testing? And why? And how? Unit testing Behaviour Driven Development Test Driven Development Acceptance testing Q&A

15 July 2010 Agile Mëtteg - Agile Testing 3

Page 4: Agile Mëtteg series - Session 5

AGILE PARTNER SERVICES

Custom Software Development & Maintenance

Our core business to answer customer needs

IS servicesThanks to our expertise we can support IT team to reach their productivity & quality objectives (Assessment, Coaching, Support, Training, Resource delegation…)

IS SolutionsTake benefit from commercial or Open Source platform to answer as quick as possible to specific needs

IS users servicesWe can support Product & Services owners to work closely with the IT team (Assessment, Coaching, Support, Training, Resource delegation…)

15 July 2010 Agile Mëtteg - Agile testing 4

IS users Servic

es

Software Developme

nt & Software

Maintenance

ISSolutio

ns

IS Servic

es1 23

41

3

2

4

Page 5: Agile Mëtteg series - Session 5

Certifications Duration Date

Certified Scrum Product Owner

2 days 16 Nov. 2010

Certified Scrum Master 2 days 2011 (TBD)

NEXT TRAININGS & CERTIFICATIONS

Courses Duration

July August

Sept.

Agile methods 1 day 12 16 13

Scrum 2 days 13 17 14

Usine logicielle 3 days - 23 -

15 July 2010 Agile Mëtteg - Agile testing 5

Complete calendar on: http://www.agilepartner.net/training/training_calendar.html

-15%

Page 6: Agile Mëtteg series - Session 5

LET’S GET ACQUAINTED

July 15th, 2010 Agile Mëtteg – Agile Testing 6

Page 7: Agile Mëtteg series - Session 5

PRESENTATION OF THE ATTENDEES

Who are you ?What is your role ?What do you know about agility ?What are your expectations ?

July 15th, 2010 Agile Mëtteg – Agile Testing 7

Page 8: Agile Mëtteg series - Session 5

AGENDA

AgendaWhat is agile testing? And why? And how?Unit testingTest Driven DevelopmentAcceptance testingBehaviour Driven Development

15 July 2010 Agile Mëtteg - Agile testing 8

Page 9: Agile Mëtteg series - Session 5

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)

15 July 2010 Agile Mëtteg - Agile testing 9

Page 10: Agile Mëtteg series - Session 5

WHAT IS SOFTWARE TESTING?

Definition:

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

(Stephan Zimmer & Eric Ferrot)

15 July 2010 Agile Mëtteg - Agile testing 10

Page 11: Agile Mëtteg series - Session 5

MEASURING QUALITY

Measuring quality using tests:tests to find defectsfunctional / non-functional testinga LOT of kinds of tests

15 July 2010 Agile Mëtteg - Agile testing 11

Page 12: Agile Mëtteg series - Session 5

15 July 2010 Agile Mëtteg - Agile testing 12

SO WHAT IS AGILE TESTING ?

… AND WHY?

… AND HOW?

Page 13: Agile Mëtteg series - Session 5

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 13

Page 14: Agile Mëtteg series - Session 5

Agile approachTesting is part of the development process

WHAT IS AGILE TESTING?

15 July 2010 Agile Mëtteg - Agile testing 14

Iteration 1Requiremen

tsAnalysis

DesignDevelopme

ntTest

Release

Iteration 2Requiremen

tsAnalysis

DesignDevelopme

ntTest

Release

Iteration nRequiremen

tsAnalysis

DesignDevelopme

ntTest

Release

No specific order

Page 15: Agile Mëtteg series - Session 5

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

WHAT IS AGILE TESTING?

15 July 2010 Agile Mëtteg - Agile testing 15

Programmer

Domain Expert

Tester

Page 16: Agile Mëtteg series - Session 5

Agile approachTesting is part of the development processA whole team

WHAT IS AGILE TESTING?

15 July 2010 Agile Mëtteg - Agile testing 16

Programmer

Domain Expert

Tester

Programmer

Tester

Page 17: Agile Mëtteg series - Session 5

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?

15 July 2010 Agile Mëtteg - Agile testing 17

Page 18: Agile Mëtteg series - Session 5

WHY AGILE TESTING?

WHY should developers write tests?

Fear / ConfidenceDo you dare to change the code? Tests = safety netIt places developers as users Better usabilityIt makes the code testable Better design

15 July 2010 Agile Mëtteg - Agile testing 18

Page 19: Agile Mëtteg series - Session 5

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 )

15 July 2010 Agile Mëtteg - Agile testing 19

Page 20: Agile Mëtteg series - Session 5

AGILE TESTING… HOW?

Agile testing… HOW?

Unit testingTest Driven DevelopmentAcceptance testingBehaviour Driven Development

15 July 2010 Agile Mëtteg - Agile testing 20

Page 21: Agile Mëtteg series - Session 5

BUT FIRST…

15 July 2010 Agile Mëtteg - Agile testing 21

Page 22: Agile Mëtteg series - Session 5

LET US INTRODUCE YOU TO…

15 July 2010 Agile Mëtteg - Agile testing 22

TIME MASTER TIM!

Page 23: Agile Mëtteg series - Session 5

AGILE TESTING… HOW?

DINO LEGSA real projectA new feature:

„The Crystal Quest“

15 July 2010 Agile Mëtteg - Agile testing 23

http://dinolegs.blogspot.com/

Page 24: Agile Mëtteg series - Session 5

UNIT TESTING

15 July 2010 Agile Mëtteg - Agile testing 24

Page 25: Agile Mëtteg series - Session 5

UNIT TESTING

Definitions

Unit : Smallest testable part of an application

Unit test : A method to test a unit

15 July 2010 Agile Mëtteg - Agile testing 25

Page 26: Agile Mëtteg series - Session 5

UNIT TESTING

The „3A“ pattern

ArrangeAct

Assert

15 July 2010 Agile Mëtteg - Agile testing 28

Page 27: Agile Mëtteg series - Session 5

UNIT TESTING

F.I.R.S.T.

FastIndependentRepeatable

Self-ValidatingTimely

[Clean Code – Robert C. Martin]

15 July 2010 Agile Mëtteg - Agile testing 29

Page 28: Agile Mëtteg series - Session 5

UNIT TESTING

„The act of writing a unit test is more an act of design than of

verification“(Robert C. Martin)

15 July 2010 Agile Mëtteg - Agile testing 30

Page 29: Agile Mëtteg series - Session 5

TEST DRIVEN DEVELOPMENT (TDD)

15 July 2010 Agile Mëtteg - Agile testing 32

Page 30: Agile Mëtteg series - Session 5

TEST DRIVEN DEVELOPMENT (TDD)

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

15 July 2010 Agile Mëtteg - Agile testing 33

Unit TestCode

FIRST!

Page 31: Agile Mëtteg series - Session 5

TEST DRIVEN DEVELOPMENT (TDD)

Red – Green – Refactor

Make it failwrite the test firstMake it workwrite the simplest implementationMake it betterrefactor without changing the behavior

15 July 2010 Agile Mëtteg - Agile testing 35

Test

CodeRefactor

Page 32: Agile Mëtteg series - Session 5

TEST DRIVEN DESIGN (TDD)

TDD is not only about testingAlso called Test Driven Design

TDD is a methodology that helps creating a good design when

developing code.

15 July 2010 Agile Mëtteg - Agile testing 36

Page 33: Agile Mëtteg series - Session 5

TEST DRIVEN DESIGN (TDD)

TDD is not only about testingAlso called Test Driven Design

TDD consequencesYAGNIDRYLaw of DemeterSingle responsibility principleInterface segregation principleInversion of control

15 July 2010 Agile Mëtteg - Agile testing 37

GO

OD

DES

IGN

!

Page 34: Agile Mëtteg series - Session 5

TEST DRIVEN DEVELOPMENT (TDD)

DEMO

15 July 2010 Agile Mëtteg - Agile testing 38

Page 35: Agile Mëtteg series - Session 5

ACCEPTANCE TESTING

15 July 2010 Agile Mëtteg - Agile testing 39

Page 36: Agile Mëtteg series - Session 5

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 40

Page 37: Agile Mëtteg series - Session 5

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 41

Page 38: Agile Mëtteg series - Session 5

ACCEPTANCE TESTING

DEMO

15 July 2010 Agile Mëtteg - Agile testing 42

Page 39: Agile Mëtteg series - Session 5

BEHAVIOUR DRIVEN DEVELOPMENT (BDD)

15 July 2010 Agile Mëtteg - Agile testing 43

Page 40: Agile Mëtteg series - Session 5

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 44

Page 41: Agile Mëtteg series - Session 5

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 45

Page 42: Agile Mëtteg series - Session 5

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 46

Domain Expert

Programmer

Tester

Page 43: Agile Mëtteg series - Session 5

BEHAVIOUR DRIVEN DEVELOPMENT

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

Feature

15 July 2010 Agile Mëtteg - Agile testing 47

Feature: TitleAs a [role]I want [feature]so that [benefit] Feature: Crystal quest

As a playerI want to collect time crystalsso that I am able to complete the crystal quest

Page 44: Agile Mëtteg series - Session 5

BEHAVIOUR DRIVEN DEVELOPMENT

Scenario / Acceptance criteria

15 July 2010 Agile Mëtteg - Agile testing 48

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

Scenario 1: Tim loses a crystalGiven a Tim is on screenAnd a crystal is on screen,When Tim dies,Then the crystal disappearsAnd Tim‘s player score is decreased by 20

Scenario 2: Tim collects a crystalGiven Tim is on screenAnd a crystal is on screen,When Tim touches the crystal,Then the crystal disappearsAnd a nice music is playedAnd Tim‘s player score is increased by 100

Page 45: Agile Mëtteg series - Session 5

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 49

Page 46: Agile Mëtteg series - Session 5

BEHAVIOUR DRIVEN DEVELOPMENT

DEMO

15 July 2010 Agile Mëtteg - Agile testing 50

Page 47: Agile Mëtteg series - Session 5

SUMMARY

15 July 2010 Agile Mëtteg - Agile testing 51

Page 48: Agile Mëtteg series - Session 5

SUMMARY

Some things to remember about Agile Testing:Testing is part of the development processWhole-team approach: roles not that strictly separated as in traditional approachBuilding a testable architecture leads to a better design

... and don‘t forget!Setup a working environment

15 July 2010 Agile Mëtteg - Agile testing 52

Page 49: Agile Mëtteg series - Session 5

QUESTIONS

53Agile Mëtteg - Agile testing15 July 2010

Page 50: Agile Mëtteg series - Session 5

Certifications Duration Date

Certified Scrum Product Owner

2 days 16 Nov. 2010

Certified Scrum Master 2 days 2011 (TBD)

NEXT TRAININGS & CERTIFICATIONS

Courses Duration

May June July

Agile methods 1 day 17 1 12Scrum 2 days 18 2 13eXtreme Programming

2 days 6 - 8

Scrum Advanced 1 day 20 4 15Scrum Product Owner

2 days - - 1

15 July 2010 Agile Mëtteg - Agile testing 54

Complete calendar on: http://www.agilepartner.net/training/training_calendar.html

Page 51: Agile Mëtteg series - Session 5

RESOURCES

Agile Partner: www.agilepartner.net

Agile Interest Group Luxembourg: www.aiglu.org

Agile Alliance: www.agilealliance.org Scrum alliance: www.scrumalliance.org Scrum.org

15 July 2010 Agile Mëtteg - Agile testing 55

Page 52: Agile Mëtteg series - Session 5

CONTACTS

Thank You

15 July 2010 Agile Mëtteg - Agile testing 56

EricFERROT

Stephan ZIMMER

Senior Software Engineer

Software Engineer / CSM

[email protected] [email protected]