Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Moving to test and behaviour-driven development

Moving to test and behaviour-driven development

In this session I went over the benefits of introducing TDD and BDD: How to introduce them, their differences, how to deal with push back from team members and upper management.
The benefits of driving our development with tests, how it helps the quality and maintainability of our software, how it helps the business and the client. The types of tests that best serve us for the different layers of our application development and how business people can get benefit from TDD and especially BDD.

Kim Carter

March 05, 2013
Tweet

More Decks by Kim Carter

Other Decks in Technology

Transcript

  1. Acceptance Test Driven Development (ATDD) Acceptance Test Driven Development (ATDD)

    Automated Acceptance Testing (AAT) Automated Acceptance Testing (AAT) Behaviour Driven Development (BDD) Behaviour Driven Development (BDD) Pioneered by Dan North 2006 Pioneered by Dan North 2006 • Otsile Kesianye always start with bdd then move on to TDD, its a natural flow. took a while for me to get into this flow of this working idea but its natural. BDD then TDD is like starting with the destination then reconstructing the journey. BDD is the destination, TDD is the journey, the mode of transport.
  2. What are the goals? What are the goals? What's in

    it for The Development Team? What's in it for The Development Team? What is it going to cost The Development Team? What is it going to cost The Development Team? What's in it for the business? What's in it for the business? What is it going to cost the business? What is it going to cost the business? What does it mean to be doing BDD or ATDD What does it mean to be doing BDD or ATDD Tooling options? Tooling options? How to deal with push back from management or team members. How to deal with push back from management or team members.
  3. Goals Goals • Communication bridge Communication bridge • Measurability Measurability

    • Ultimate visibility Ultimate visibility • Assistance in being able to deliver every Sprint Assistance in being able to deliver every Sprint • Provide confirmation that we have implemented specification Provide confirmation that we have implemented specification • Code that is testable, of high quality, maintainable, extensible Code that is testable, of high quality, maintainable, extensible • RoI RoI • Write less code Write less code
  4. Higher level tests = more expensive to create and maintain

    Higher level tests = more expensive to create and maintain Slower to run, not run in CI, usually run in nightly build Slower to run, not run in CI, usually run in nightly build • Potential for latency in the development cycle Potential for latency in the development cycle • Developers less likely to run them manually Developers less likely to run them manually • Faults take longer to locate and fix Faults take longer to locate and fix Beware!
  5. What's in it for the Devs? What's in it for

    the Devs? Clear, concise and often terse automatable specifications Clear, concise and often terse automatable specifications Living (always up to date) documentation Living (always up to date) documentation Confidence we're only writing what's needed Confidence we're only writing what's needed Clarification of assumptions Clarification of assumptions Product quality Product quality Unit tests tell us our software works... Unit tests tell us our software works... BDD tells us it does what the customer wants BDD tells us it does what the customer wants Instant feedback Instant feedback Assists in tight iterations Assists in tight iterations
  6. Cost to the Development Team? Cost to the Development Team?

    Paradigm shift Paradigm shift Forced into active engagement Forced into active engagement Finding unit test and mocking frameworks Finding unit test and mocking frameworks Learning curve Learning curve Mocking frameworks I've evaluated recently: Mocking frameworks I've evaluated recently: • NMock2, 3 NMock2, 3 • Rhino Mocks Rhino Mocks • TypeMock TypeMock • Moq Moq
  7. Cost of not doing BDD Cost of not doing BDD

    • Product quality Product quality • Predictability Predictability • Accountability Accountability • Rework... Ultimately costing the business. Rework... Ultimately costing the business.
  8. What's in it for the Business? What's in it for

    the Business? • Executable, living specifications providing assurance that the Executable, living specifications providing assurance that the business functionality is “Done” business functionality is “Done” • Confidence in The Scrum Team Confidence in The Scrum Team • Solid development KPI Solid development KPI • Visibility of what to expect from a Done increment Visibility of what to expect from a Done increment • Visibility into how much business value is being delivered Visibility into how much business value is being delivered • Predictability. Empowerment Predictability. Empowerment • Higher product quality = less money spent on rework and Higher product quality = less money spent on rework and maintenance maintenance • Confidence that not only is the product being built correctly... Confidence that not only is the product being built correctly... but also that the but also that the correct product correct product is being built is being built
  9. Cost to the Business? Cost to the Business? • A

    little team planning and a spike on tools A little team planning and a spike on tools • PO and stakeholders to understand what they PO and stakeholders to understand what they are asking for. are asking for.
  10. Cost of not doing BDD Cost of not doing BDD

    • Visibility Visibility • Forecast-ability Forecast-ability • Ability to make informed decisions Ability to make informed decisions • Software that does what it should do. Software that does what it should do. • Speed to market. Software is a liability Speed to market. Software is a liability until it's released. until it's released.
  11. How do we do it? How do we do it?

    → → Once tools are chosen Once tools are chosen → → At the beginning of the Sprint At the beginning of the Sprint → → Test condition workshop... Test condition workshop... Search BinaryMist on how-to-optimise-your-testing-effort Search BinaryMist on how-to-optimise-your-testing-effort
  12. Resources: Resources: You'll find everything you need here: You'll find

    everything you need here: https://github.com/techtalk/SpecFlow/wiki/Documentation https://github.com/techtalk/SpecFlow/wiki/Documentation
  13. Resources: Resources: Best Intro Video: Best Intro Video: http://www.watchmecode.net/jasmine-standalone#preview http://www.watchmecode.net/jasmine-standalone#preview

    Standalone Runner: Standalone Runner: https://github.com/pivotal/jasmine/downloads https://github.com/pivotal/jasmine/downloads Best Intro Doc: Best Intro Doc: http://pivotal.github.com/jasmine/ http://pivotal.github.com/jasmine/ Serenity Runner with .NET: Serenity Runner with .NET: http://lostechies.com/josharnold/2012/02/25/running-jasmine-specs-i http://lostechies.com/josharnold/2012/02/25/running-jasmine-specs-i n-dotnet-with-serenity/ n-dotnet-with-serenity/
  14. FitNesse FitNesse Resources: Resources: Two Minute Example: Two Minute Example:

    http://fitnesse.org/FitNesse.UserGuide.TwoMinuteExample http://fitnesse.org/FitNesse.UserGuide.TwoMinuteExample Test Driven .NET Development with FitNesse by Gojko Adzic Test Driven .NET Development with FitNesse by Gojko Adzic Start here with Installation: Start here with Installation: http://fitnesse.org/FitNesse.UserGuide.DownloadingAndInstallingF http://fitnesse.org/FitNesse.UserGuide.DownloadingAndInstallingF itNesse itNesse FitSharp: FitSharp: https://github.com/jediwhale/fitsharp/downloads https://github.com/jediwhale/fitsharp/downloads Source: Source: https://github.com/unclebob/fitnesse https://github.com/unclebob/fitnesse
  15. Dealing with push back Dealing with push back This is

    never going to be easy. This is never going to be easy. Books I've found helpful: Books I've found helpful: • Fearless Change: Patterns for Introducing New Ideas Fearless Change: Patterns for Introducing New Ideas by Mary Lynn Manns and Linda Rising by Mary Lynn Manns and Linda Rising • Change Agent: Engaging your passion to be the one who makes Change Agent: Engaging your passion to be the one who makes a difference a difference by Os Hillman by Os Hillman
  16. Resources Resources • If not already TDD'ing If not already

    TDD'ing http://blog.binarymist.net/2012/12/01/moving-to-tdd/ http://blog.binarymist.net/2012/12/01/moving-to-tdd/ • Guidance on prioritising areas to test that give biggest bang for Guidance on prioritising areas to test that give biggest bang for your buck your buck http://blog.binarymist.net/2012/03/24/how-to-optimise-your-testin http://blog.binarymist.net/2012/03/24/how-to-optimise-your-testin g-effort/ g-effort/ • Book: Specification By Example Book: Specification By Example by Gojko Adzic by Gojko Adzic