23
© Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com SELA DEVELOPER PRACTICE December 20-24, 2015 Arnon Axelrod Introduction to ATDD and SpecFlow

ATDD with SpecFlow

Embed Size (px)

Citation preview

Page 1: ATDD with SpecFlow

© Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com

SELA DEVELOPER PRACTICEDecember 20-24, 2015

Arnon Axelrod

Introduction to ATDD and SpecFlow

Page 2: ATDD with SpecFlow

Agenda

Problems with regular development processes

ATDD

SpecFlow

ATDD SpecFlow

Page 3: ATDD with SpecFlow

About myselfSenior Architect and Test Automation Team Lead at Sela Group

Professional Software Developer since 1995

Amateur programmer since ~1984 (age 11)

E-mail: [email protected] Blog: http://blogs.microsoft.co.il/ArnonAPhone: 052-5327296

Page 4: ATDD with SpecFlow

Problems with regular development processes

Page 5: ATDD with SpecFlow

Problems with Waterfall

Hard to think of all the details aheadLong specs may contain contradictions that are hard to seeCommunication problemsMost problems are revealed too lateResistant to change

Page 6: ATDD with SpecFlow

Problems with Agile

Requirements/Spec are often vagueNo document of the current expected stateChaotic designNot enough time to test

Page 7: ATDD with SpecFlow

Challenges with Automated Tests

Testability of the SUTReliabilityMaintainabilityHard to investigateSensitive to small application changesMedium bugs tend to be ignored

Page 8: ATDD with SpecFlow

Problems with Unit Tests

Does not test integrationCoupled to implementationTest technical details instead of user scenario

Page 9: ATDD with SpecFlow

ATDD

Page 10: ATDD with SpecFlow

What’s ATDD?

Acronym for “Acceptance Test Driven Development”

Other common names:BDD (Behavior Driven Design)SbE (Specification by Example)

Software Development methodology

Expands Agile

Page 11: ATDD with SpecFlow

The ATDD ProcessUser Story

• Clear Business Value• Small!

Define “Done”• Collaboratively• As user scenario

Write Failing Automated Test

• Identical to DoD• Business Language

Develop• Make the tests pass• Keep all tests pass• Refactor as needed

Done• Demo• Exploratory• Get Feedback

Page 12: ATDD with SpecFlow

Example

Page 13: ATDD with SpecFlow

Definition of Done

How will the user use the solution? (examples!)

How can we demonstrate it?

How will we test it?

Definition of Done!

Page 14: ATDD with SpecFlow

Benefits of ATDDFor the business / team:

Improves communication and collaboration

Fast customer feedback

Significantly Less bugs

Reliable automation

Accurate documentation

Changes are easy!

Happy Customers!

Page 15: ATDD with SpecFlow

Benefits of ATDDFor Developers:

No more unclear requirements

Clear focus: make the tests pass!

Easy to keep the code clean

Less messing with bugs

Less debugging

Page 16: ATDD with SpecFlow

Benefits of ATDDFor Testers:

Actual impact on quality!

No tedious test cycles

More time for exploratory

No more “it works on my machine”

Page 17: ATDD with SpecFlow

Benefits of ATDDFor Automation Developers:

Actual impact on quality!

Tests are always green

SUT is always testable

No need for workarounds

Page 18: ATDD with SpecFlow

Challenges of ATDD

Cultural change

Slicing the user stories

Defining the DoD

Page 19: ATDD with SpecFlow

SPECFLOW

Page 20: ATDD with SpecFlow

What is SpecFlow?

A tool for “Binding business requirements to .NET code”

Open Source project

Free

Visual Studio Plug-in

Cucumber for .Net

Page 21: ATDD with SpecFlow

Demo

SpecFlow

Page 22: ATDD with SpecFlow

SpecFlow allows us to use Business Requirements as Automatic Tests

These Requirements are constantly validated

This allows developers to refactor safely

Much less bugs!

Allows Continuous Delivery!

Page 23: ATDD with SpecFlow

Questions