Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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

253 views

Published on

In this session, you can learn how Behavior Driven Development fits into the development process of a Xamarin app and how the test automation can be supported with SpecFlow.
SpecFlow is a tool to practice Behavior Driven Development (BDD), which is a new way of thinking about quality. BDD is more relevant to mobile development than you would think.
Mobile applications are short-lived. With the extremely fast changes of technology, devices, and markets, you should expect to make a major update to your app every second year. So we need to remain flexible.
Mobile apps have high impact. The market can turn away from your app from one day to another. So we need quality.
BDD allows you to focus your testing efforts, but remain reactive to technology and market changes. But for this purpose, we have to rethink our definitions about testing and quality.

Published in: Software
  • Be the first to comment

  • Be the first to like this

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

  1. 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. 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. 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. 4. Copyright © Gaspar NagyCopyright © Gaspar Nagy Agenda • Software Quality • Test Automation • Behavior Driven Development (BDD) with SpecFlow
  5. 5. Copyright © Gaspar NagyCopyright © Gaspar Nagy Why quality is so important for mobile development?
  6. 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. 7. Copyright © Gaspar NagyCopyright © Gaspar Nagy But what is quality?
  8. 8. Copyright © Gaspar NagyCopyright © Gaspar Nagy Source: http://istqbexamcertification.com/what-is-software-quality/ What is software quality – ISTQB
  9. 9. Copyright © Gaspar NagyCopyright © Gaspar Nagy Defining software quality is not easy… …we still try to measure it though
  10. 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. 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. 12. Copyright © Gaspar NagyCopyright © Gaspar Nagy Testing is a tool for gaining confidence about software quality
  13. 13. Copyright © Gaspar NagyCopyright © Gaspar Nagy What kind of tests do we need?
  14. 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. 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. 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. 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. 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. 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. 20. Copyright © Gaspar NagyCopyright © Gaspar Nagy Unit test is a tool, not the goal
  21. 21. Copyright © Gaspar NagyCopyright © Gaspar Nagy Functional quality tests: How do I ensure the expected behavior?
  22. 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. 23. Copyright © Gaspar NagyCopyright © Gaspar Nagy How BDD can help?
  24. 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. 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. 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. 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. 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. 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. 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. 31. Copyright © Gaspar NagyCopyright © Gaspar Nagy What we just learned
  32. 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. 33. Copyright © Gaspar NagyCopyright © Gaspar Nagy Happy Testing!
  34. 34. Gáspár Nagy coach • trainer • bdd addict • creator of specflow @gasparnagy • gaspar@specsolutions.eu Thank you! http://bddbooks.com
  35. 35. Copyright © Gaspar NagyCopyright © Gaspar Nagy

×