SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
SpecFlow ❤ Xamarin
(and Xamarin ❤ SpecFlow too!)
MonkeyFest 2017 –
Global Xamarin Summit
23/09/2017
Gáspár Nagy
coach • trainer • bdd addict • creator of specflow
@gasparnagy • gaspar@specsolutions.eu
Copyright © Gaspar NagyCopyright © Gaspar Nagy
bdd addict
given.when.then
CAUTION!
on the stage
Gáspár Nagy
coach, trainer and bdd addict
creator of SpecFlow
gaspar@specsolutions.eu
https://specsolutions.eu
@gasparnagy
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Check out our new book!
• A BDD book for everyone (PO, BA, dev,
tester)
• Practical guide
• Demonstrates good collaboration
techniques, illustrated by concrete
examples
Find it on Leanpub through
http://bddbooks.com!
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Agenda
• Software Quality
• Test Automation
• Behavior Driven Development (BDD) with SpecFlow
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Why quality is so important
for mobile development?
Copyright © Gaspar NagyCopyright © Gaspar Nagy
TestMissionQuadrant
testabilityeasier hard
qualityimportantcritical
Financial
Frameworks
Trivial
mobile apps
Microservices
SPA
Mobile
apps
Enterprise
AppsConference
Session Demos
Desktop
Apps
Dev Tools
Copyright © Gaspar NagyCopyright © Gaspar Nagy
But what is quality?
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Source: http://istqbexamcertification.com/what-is-software-quality/
What is software quality – ISTQB
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Defining software quality is not easy…
…we still try to measure it though
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Measuring software quality
• Number of bugs – contradicting measure: either good product or bad QA
• Number of tests – hard to determine the right amount of tests; can lead to test
gold-plating
• Test coverage (% of lines) – loosely correlates to quality; devs like gaming
• Code metrics – important factor, but not enough for quality
• Production issues – good, but too late
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Quality is about confidence
My best way to measure quality is to regularly ask the team
how they feel…
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Testing is a tool for gaining confidence about
software quality
Copyright © Gaspar NagyCopyright © Gaspar Nagy
What kind of tests do we need?
Copyright © Gaspar NagyCopyright © Gaspar Nagy
TestAutomation
Pyramid
Test Automation Pyramid: Mike Cohn – Succeeding with Agile
Pic: http://gasparnagy.com/2017/02/balancing-scenarios-and-unit-tests-case-study-with-specflow/
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Defining quality based on the Maslow’s
pyramid (Gojko Adzic)
Source: https://gojko.net/2012/05/08/redefining-software-quality/
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Defining quality based on the Maslow’s
pyramid (Gojko Adzic)
Source: https://gojko.net/2012/05/08/redefining-software-quality/
Copyright © Gaspar NagyCopyright © Gaspar Nagy
A classification of quality aspects
Functional
• Works as
expected
• Expectations
are good
• Expectations
are
documented
Usability
• Secure
• Fast
• Convenient
• Pretty
• Consistent
• Predictable
Strategic
• Architecture
• Code quality
• Easy to
integrate
• Flexible
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Happy
path
Automatedtestsfora
specificscenario
Test Automation Pyramid: Mike Cohn – Succeeding with Agile
Pic: http://gasparnagy.com/2017/02/balancing-scenarios-and-unit-tests-case-study-with-specflow/
Specific
ScenarioTesting gap
Functional
Usability
Strategic
Specific
Scenario
Service-UI
connection
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Happy
path
Differentkindoftestson
thetestingpyramid
Test Automation Pyramid: Mike Cohn – Succeeding with Agile
Pic: http://gasparnagy.com/2017/02/balancing-scenarios-and-unit-tests-case-study-with-specflow/
Specific
Scenario
Service-UI
connection
Functional
Usability
Strategic
Smoke
test
Edge
case
Timeout
handling
Argument
check
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Unit test is a tool, not the goal
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Functional quality tests:
How do I ensure the expected behavior?
Copyright © Gaspar NagyCopyright © Gaspar Nagy
[HttpPost]
public ActionResult Answer(int answer)
{
TriviaEntities db = new TriviaEntities();
var question = db.FindQuestion(CurrentQuestion);
if (question.Type == QuestionType.Easy)
{
db.AddScore(question, user, 10);
}
else
{
db.AddScore(question, user, 50);
}
var model = new GameModel
{ Score = db.GetScore(question, user) };
return View(model);
}
implement
feedback
Agile mini-waterfall
Copyright © Gaspar NagyCopyright © Gaspar Nagy
How BDD can help?
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Scenario: Correct easy answer scores 10
Given I register a team
When I submit a correct easy answer
Then my score should be 10
Discovery
Automation with
Cucumber/SpecFlow
Examples link requirements to software
Formulation
Copyright © Gaspar NagyCopyright © Gaspar Nagy
So, what is BDD?
Discovery
Shared understanding is established through
collaboration and structured conversations
Formulation
Examples of system behaviour are documented
as scenarios
Automation
Scenarios are automated to be able to verify the
system’s behaviour
Copyright © Gaspar NagyCopyright © Gaspar Nagy
This is an example!
Scenario: Correct easy answer scores 10
Given I register a team
When I submit a correct easy answer
Then my score should be 10
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Let’sturnthetesting
pyramid
Test Automation Pyramid: Mike Cohn – Succeeding with Agile
Pic: http://gasparnagy.com/2017/02/balancing-scenarios-and-unit-tests-case-study-with-specflow/
Functional
Usability
Strategic
Happy
path
Specific
Scenario
Service-UI
connection
Smoke
test
Edge
case
Timeout
handling
Argument
check
Copyright © Gaspar NagyCopyright © Gaspar Nagy
TestingIceberg!
Test Automation Pyramid: Mike Cohn – Succeeding with Agile
Pic: http://gasparnagy.com/2017/02/balancing-scenarios-and-unit-tests-case-study-with-specflow/
Functional
Usability
Strategic
Happy
path
Specific
Scenario
Service-UI
connection
Smoke
test
Edge
case
Argument
check
Timeout
handling
Copyright © Gaspar NagyCopyright © Gaspar Nagy
SpecFlow Basics
Testing the view model
Testing the UI
SpecFlow ❤ Xamarin
https://github.com/gasparnagy/Sample_Xamarin_GeekPizza
Copyright © Gaspar NagyCopyright © Gaspar Nagy
SpecFlow ❤ Xamarin
• SpecFlow is a tool to support Behavior Driven Development
• It can be used for Xamarin apps both for “UI” and “Service” tests
• The shared code for the different platforms also reduces testing efforts!
https://github.com/gasparnagy/Sample_Xamarin_GeekPizza
Copyright © Gaspar NagyCopyright © Gaspar Nagy
What we just learned
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Define your own testing strategy!
• Define your own quality criteria
• Find the right tools for testing the particular aspects
• BDD/SpecFlow can help to make “business-interesting” tests
Copyright © Gaspar NagyCopyright © Gaspar Nagy
Happy Testing!
Gáspár Nagy
coach • trainer • bdd addict • creator of specflow
@gasparnagy • gaspar@specsolutions.eu
Thank you!
http://bddbooks.com
Copyright © Gaspar NagyCopyright © Gaspar Nagy

Mais conteúdo relacionado

Mais de Gáspár Nagy

Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Gáspár Nagy
 

Mais de Gáspár Nagy (12)

Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
Testing is Difficult (Agile in the City Bristol 2017, Lightening talk)
 
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
Scaffolding a legacy app with BDD scenario (Agile in the City Bristol 2017)
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (Qualit...
 
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
A tesztelés szerepe folyamatos kihelyezést használó projektekben (Microsoft, ...
 
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
Behavior Driven Web UI Automation with Selenium and Cucumber/SpecFlow (BDDx L...
 
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
Property Based BDD Examples (ETSI UCAAT 2016, Budapest)
 
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (HUSTEF 2...
 
Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...
Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...
Given/When/Then-ready sprint planning with Example Mapping (Agilia Budapest 2...
 
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
Scaffolding a legacy app with BDD scenarios using SpecFlow/Cucumber (BDD Lond...
 
Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...
Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...
Introducing BDD to Legacy Applications with SpecFlow/Cucumber (Agilia Confere...
 
Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)
Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)
Folyamatos integráció és kódépítés (ALM Day Budapest, 24/11/2015, Hungarian)
 
Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)
Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)
Given/When/Then-ready sprint planning (Agile Tour Vienna 2015)
 

Último

Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 

Último (20)

%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 

SpecFlow ❤ Xamarin (and Xamarin ❤ SpecFlow too!) - MonkeyFest 2017 Singapore, 23/09/2017

  • 1. SpecFlow ❤ Xamarin (and Xamarin ❤ SpecFlow too!) MonkeyFest 2017 – Global Xamarin Summit 23/09/2017 Gáspár Nagy coach • trainer • bdd addict • creator of specflow @gasparnagy • gaspar@specsolutions.eu
  • 2. Copyright © Gaspar NagyCopyright © Gaspar Nagy bdd addict given.when.then CAUTION! on the stage Gáspár Nagy coach, trainer and bdd addict creator of SpecFlow gaspar@specsolutions.eu https://specsolutions.eu @gasparnagy
  • 3. Copyright © Gaspar NagyCopyright © Gaspar Nagy Check out our new book! • A BDD book for everyone (PO, BA, dev, tester) • Practical guide • Demonstrates good collaboration techniques, illustrated by concrete examples Find it on Leanpub through http://bddbooks.com!
  • 4. Copyright © Gaspar NagyCopyright © Gaspar Nagy Agenda • Software Quality • Test Automation • Behavior Driven Development (BDD) with SpecFlow
  • 5. Copyright © Gaspar NagyCopyright © Gaspar Nagy Why quality is so important for mobile development?
  • 6. Copyright © Gaspar NagyCopyright © Gaspar Nagy TestMissionQuadrant testabilityeasier hard qualityimportantcritical Financial Frameworks Trivial mobile apps Microservices SPA Mobile apps Enterprise AppsConference Session Demos Desktop Apps Dev Tools
  • 7. Copyright © Gaspar NagyCopyright © Gaspar Nagy But what is quality?
  • 8. Copyright © Gaspar NagyCopyright © Gaspar Nagy Source: http://istqbexamcertification.com/what-is-software-quality/ What is software quality – ISTQB
  • 9. Copyright © Gaspar NagyCopyright © Gaspar Nagy Defining software quality is not easy… …we still try to measure it though
  • 10. Copyright © Gaspar NagyCopyright © Gaspar Nagy Measuring software quality • Number of bugs – contradicting measure: either good product or bad QA • Number of tests – hard to determine the right amount of tests; can lead to test gold-plating • Test coverage (% of lines) – loosely correlates to quality; devs like gaming • Code metrics – important factor, but not enough for quality • Production issues – good, but too late
  • 11. Copyright © Gaspar NagyCopyright © Gaspar Nagy Quality is about confidence My best way to measure quality is to regularly ask the team how they feel…
  • 12. Copyright © Gaspar NagyCopyright © Gaspar Nagy Testing is a tool for gaining confidence about software quality
  • 13. Copyright © Gaspar NagyCopyright © Gaspar Nagy What kind of tests do we need?
  • 14. Copyright © Gaspar NagyCopyright © Gaspar Nagy TestAutomation Pyramid Test Automation Pyramid: Mike Cohn – Succeeding with Agile Pic: http://gasparnagy.com/2017/02/balancing-scenarios-and-unit-tests-case-study-with-specflow/
  • 15. Copyright © Gaspar NagyCopyright © Gaspar Nagy Defining quality based on the Maslow’s pyramid (Gojko Adzic) Source: https://gojko.net/2012/05/08/redefining-software-quality/
  • 16. Copyright © Gaspar NagyCopyright © Gaspar Nagy Defining quality based on the Maslow’s pyramid (Gojko Adzic) Source: https://gojko.net/2012/05/08/redefining-software-quality/
  • 17. Copyright © Gaspar NagyCopyright © Gaspar Nagy A classification of quality aspects Functional • Works as expected • Expectations are good • Expectations are documented Usability • Secure • Fast • Convenient • Pretty • Consistent • Predictable Strategic • Architecture • Code quality • Easy to integrate • Flexible
  • 18. Copyright © Gaspar NagyCopyright © Gaspar Nagy Happy path Automatedtestsfora specificscenario Test Automation Pyramid: Mike Cohn – Succeeding with Agile Pic: http://gasparnagy.com/2017/02/balancing-scenarios-and-unit-tests-case-study-with-specflow/ Specific ScenarioTesting gap Functional Usability Strategic Specific Scenario Service-UI connection
  • 19. Copyright © Gaspar NagyCopyright © Gaspar Nagy Happy path Differentkindoftestson thetestingpyramid Test Automation Pyramid: Mike Cohn – Succeeding with Agile Pic: http://gasparnagy.com/2017/02/balancing-scenarios-and-unit-tests-case-study-with-specflow/ Specific Scenario Service-UI connection Functional Usability Strategic Smoke test Edge case Timeout handling Argument check
  • 20. Copyright © Gaspar NagyCopyright © Gaspar Nagy Unit test is a tool, not the goal
  • 21. Copyright © Gaspar NagyCopyright © Gaspar Nagy Functional quality tests: How do I ensure the expected behavior?
  • 22. Copyright © Gaspar NagyCopyright © Gaspar Nagy [HttpPost] public ActionResult Answer(int answer) { TriviaEntities db = new TriviaEntities(); var question = db.FindQuestion(CurrentQuestion); if (question.Type == QuestionType.Easy) { db.AddScore(question, user, 10); } else { db.AddScore(question, user, 50); } var model = new GameModel { Score = db.GetScore(question, user) }; return View(model); } implement feedback Agile mini-waterfall
  • 23. Copyright © Gaspar NagyCopyright © Gaspar Nagy How BDD can help?
  • 24. Copyright © Gaspar NagyCopyright © Gaspar Nagy Scenario: Correct easy answer scores 10 Given I register a team When I submit a correct easy answer Then my score should be 10 Discovery Automation with Cucumber/SpecFlow Examples link requirements to software Formulation
  • 25. Copyright © Gaspar NagyCopyright © Gaspar Nagy So, what is BDD? Discovery Shared understanding is established through collaboration and structured conversations Formulation Examples of system behaviour are documented as scenarios Automation Scenarios are automated to be able to verify the system’s behaviour
  • 26. Copyright © Gaspar NagyCopyright © Gaspar Nagy This is an example! Scenario: Correct easy answer scores 10 Given I register a team When I submit a correct easy answer Then my score should be 10
  • 27. Copyright © Gaspar NagyCopyright © Gaspar Nagy Let’sturnthetesting pyramid Test Automation Pyramid: Mike Cohn – Succeeding with Agile Pic: http://gasparnagy.com/2017/02/balancing-scenarios-and-unit-tests-case-study-with-specflow/ Functional Usability Strategic Happy path Specific Scenario Service-UI connection Smoke test Edge case Timeout handling Argument check
  • 28. Copyright © Gaspar NagyCopyright © Gaspar Nagy TestingIceberg! Test Automation Pyramid: Mike Cohn – Succeeding with Agile Pic: http://gasparnagy.com/2017/02/balancing-scenarios-and-unit-tests-case-study-with-specflow/ Functional Usability Strategic Happy path Specific Scenario Service-UI connection Smoke test Edge case Argument check Timeout handling
  • 29. Copyright © Gaspar NagyCopyright © Gaspar Nagy SpecFlow Basics Testing the view model Testing the UI SpecFlow ❤ Xamarin https://github.com/gasparnagy/Sample_Xamarin_GeekPizza
  • 30. Copyright © Gaspar NagyCopyright © Gaspar Nagy SpecFlow ❤ Xamarin • SpecFlow is a tool to support Behavior Driven Development • It can be used for Xamarin apps both for “UI” and “Service” tests • The shared code for the different platforms also reduces testing efforts! https://github.com/gasparnagy/Sample_Xamarin_GeekPizza
  • 31. Copyright © Gaspar NagyCopyright © Gaspar Nagy What we just learned
  • 32. Copyright © Gaspar NagyCopyright © Gaspar Nagy Define your own testing strategy! • Define your own quality criteria • Find the right tools for testing the particular aspects • BDD/SpecFlow can help to make “business-interesting” tests
  • 33. Copyright © Gaspar NagyCopyright © Gaspar Nagy Happy Testing!
  • 34. Gáspár Nagy coach • trainer • bdd addict • creator of specflow @gasparnagy • gaspar@specsolutions.eu Thank you! http://bddbooks.com
  • 35. Copyright © Gaspar NagyCopyright © Gaspar Nagy