40
EXECUTABLE REQUIREMENTS Godfrey Nolan RIIS LLC GANG 10 Year Celebration 10/1/11

NET executable requirements

Embed Size (px)

DESCRIPTION

Talk and Great Lakes .Net User Group 10 yr celebration 10/1/11

Citation preview

Page 1: NET executable requirements

EXECUTABLE REQUIREMENTSGodfrey Nolan

RIIS LLC

GANG 10 Year Celebration

10/1/11

Page 2: NET executable requirements

RIIS• IT Consultants and Developers since ‘98

• Based in Southfield, MI• Contact [email protected]

• Skills• Requirements, Development, Testing• iOS/Android, Java/C#, Oracle/SQL Server

• Clients• Fandango, Comerica, Cengage, Broadsoft, DTE, BondDesk,

Proctor Financial, Blue Cross, TK, Hanson

• Godfrey Nolan• [email protected]• 10 years ago – Unraveling the .Net executable

Page 3: NET executable requirements

Agenda

Page 4: NET executable requirements

What Makes a Good Requirement?• Unique – address one thing only• Complete – no missing information• Consistent – doesn’t contradict other req.• Traceable back to business need• Current – not obsolete• Feasible – can be implemented• Unambiguous – objective not subjective• Mandatory – not a nice to have• Verifiable – testable

Page 5: NET executable requirements

What makes a Bad Requirement?• Lengthy• Unfocused• Ambiguous• Verified Manually

Page 6: NET executable requirements

Attempts at Fixing the Problem• Company Wide Templates• Use Cases or User Stories• Requirement Reviews• Traceability Matrix• Requirements Metrics• Visualization/Simulation – iRise, Axure, Balsamiq• Agile Development – TDD, Scrum, Kanban• ALM, CLM

Page 7: NET executable requirements

Use Case

Scope: ATM

Level: User Goal

1. The card gets inserted.

2. The card information gets validated.

3. The transaction information gets collected and validated.

4. The cash is issued, card returned, cash removed, account debited, screen reset.

Page 8: NET executable requirements

User Story

1. User checks balance

2. User logs into the machine

3. User get "Fast Cash"

4. User makes a deposit

5. User withdraws from checking

6. User withdraws from savings

Page 9: NET executable requirements

Traceability Matrix

Page 10: NET executable requirements

Visualization

Page 11: NET executable requirements

But inevitably…

• Some or all the following happen• Scope change• Requirements confusion• Developer interprets the requirement• Business stakeholder doesn’t get what they’re expecting• Completely missed some crucial requirement• Requirements never kept up to date

Page 12: NET executable requirements

But What if?

Imagine a world where developers get detailed requirements in a format and mechanism that is readable by the business facing people...

...completely devoid of ambiguity in terms of what the correct behavior is...

...and can also be used as an automated test within your team's continuous integration processes. (Tim Wingfield)

Page 13: NET executable requirements

But What If? (TechTalk)

Page 14: NET executable requirements

But What If?

Page 15: NET executable requirements

TDD

Page 16: NET executable requirements

Executable Requirements

Page 17: NET executable requirements

Executable Requirements• These were the Droids you were looking for..

• BDD or Behavior Driven Design• Functional Tests• Integration Tests• Acceptance Tests• ATDD or Acceptance Test Driven Design• Specification by Example• Outside in Development• Executable Requirements

Page 18: NET executable requirements
Page 19: NET executable requirements

Outside In Development

Page 20: NET executable requirements

Manual Testing (Matt Stine)

Page 21: NET executable requirements

Testing Pyramid (Lisa Crispin)

Page 22: NET executable requirements

Continuous Integration

Page 23: NET executable requirements

Continuous Integration• Automated Build Process• Code gets checked in• Unit tests run• Executable tests run• Code gets deployed only if everything passes• Requirements are kept up to date!

Page 24: NET executable requirements

Writing Executable Requirements• Features file

• Written in DSL called Gherkin• Feature description• Scenario Outline

• Given/When/Then

• Examples (optional)• Sample test data

• Step Definitions• Setup• Tear down• Regular Expressions for each Given/When/Then

• Executable C# test code

Page 26: NET executable requirements

Given/When/Then

Page 27: NET executable requirements

What is SpecFlow• .Net tool to write Executable Requirement in Gherkin

format• Integrates with Visual Studio

• Use File->New templates for creating new feature files• Glue between Feature and Step Definition files

• Gives VS debugger support• Set breakpoints on Given/When/Then lines in your .feature files

• Integrates with your existing CI infrastructure• Also integrates with

• NUnit• Selenium• WatiN

Page 28: NET executable requirements

Good Executable Requirements• Understandable to developer• Understandable to business• Unambiguous• Automated• Run frequently

Page 29: NET executable requirements

Writing Executable Requirements

Page 30: NET executable requirements

Writing Executable Requirements• Features file

• Feature description• Scenario Outline

• Given/When/Then

• Examples• Sample test data

Page 31: NET executable requirements

Feature File

Page 32: NET executable requirements

Writing Executable Requirements• Step Definitions

• Setup• Tear down• Regular Expressions for each Given/When/Then

• Executable C# test code

Page 33: NET executable requirements
Page 34: NET executable requirements

SpecFlow Glue

Page 36: NET executable requirements

Sample Features files

Feature: Account Holder withdraws cash In order to have access to my money

As an Account Holder

I want to withdraw cash from an ATM

Scenario: Card has been disabled Given card is disabled

When the account holder requests money

Then the ATM should retain the card

And the ATM should say the card has been retained

Page 37: NET executable requirements

Sample Features files

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

When I press the coffee button

Then I should be served a coffee

Page 38: NET executable requirements

What Languages are supported• Languages

• C# - Specflow, Cuke4Nuke, StorEvil• Ruby – Cucumber• Java – Cuke4Duke• Also Phython, PHP etc.

• Tools• Cucumber• Selenium RC• Fitnesse

Page 39: NET executable requirements

Tear Down• BDD or Coding the right thing• Outside in Development• Works well in Scrum teams

• BA does feature file• Developer/tester does step definitions and C# test files

• Works well with VS10