layout: true name: titleslide class: center, middle .footnote[ ###
@schmonz
] --- layout: true name: footnotelinks .left-column[ ] .footnote[ ###
@schmonz
] --- template: titleslide # Behavior-Driven Development
for Everyone
## Amitai Schleier ### 2018/01/18 ??? 1. Press 'C' to clone and move it to projector 2. Press 'P' to show these here presenter notes ### 90 minutes Problems are better solved when you're better involved. That's how you make your living, and that's what BDD is all about. We'll work together to solve a problem in a way we can all understand and trust, expressing what we want in plain English and automating our tests with a tool called Cucumber. Don't worry, you won't be put on the spot at the keyboard -- I'll handle all the coding! --- layout: false template: footnotelinks .right-column[ # Goals For This Session 1. **Learn** what BDD _isn't_, and what it is 2. **See** an approximation of what BDD can be like 3. **Consider** the possible value of BDD in your context ] --- .right-column[ # What _isn't_ BDD? - Basically the same as Test-Driven Development - Programmers do it behind the scenes - A kind of automated test - A software tool - Requires a software tool ] --- .right-column[ # What _is_ BDD? - Everyone on the team does it **together** - A shared focus on overall **system behavior** - Enough **shared language** to deliver on that focus - _May_ result in **automated acceptance tests** - _May_ be more valuable with a **supporting tool** ] --- .right-column[ # How important is BDD? ## Can we use it to **work together more effectively**? ## If we can't, then it's not important! ## If we can, then it is. ] --- .right-column[ # Does BDD require great programming skill? I'm not a great programmer. Especially in front of a crowd. I'm hardly a BDD expert. I've **learned by doing**, and continue to. BDD is most useful when applied by people who: - Want to do work that **matters** - Accept the **limits** of their knowledge - Are willing to **ask** for, and **offer**, help ] --- .right-column[ # Um, so what's BDD again? If I develop it **all by myself**, there's **no BDD**. If we think, try, check, learn, and solve it **together**, that might well be BDD. It helps to focus on the smallest end-to-end **system behavior** we want next. It helps to use **words we all understand** in the same way. It helps to use our words of understanding to **verify the system**. _If_ we want to verify our understanding automatically, we can use a **software tool**. ] --- .right-column[ # Simultaneously reasonable and vague ## BDD relies on examples. ## BDD might be best explained **with** examples. ] --- .right-column[ # "Three Amigos" For every role that has an interest in what it means for a story to be **valuable**, **ready**, and **done**, let's hear from someone representing that interest. Usually one each of: - Product Owner - Tester - Developer Let's use what we hear to build a shared understanding. ] --- .right-column[ # Let's do some thinking, together I'm going to write some code to solve a problem. I promise to help you understand and trust that the code solves the problem. Do you promise to help me solve it? ] --- .right-column[ # Teams, self-organize! Before we start working, let's split into three groups: - Product Owners - Testers - Developers Join a group you're not usually part of. I promise you will **not** be put on the spot. ] --- .right-column[ # FizzBuzz I'll briefly explain the rules of FizzBuzz. Questions? Let's go! ] --- .right-column[ # Bowling (10-pin) I'll briefly explain what I know of the rules of bowling. Our job is to keep score for one player's game. Questions? Let's develop! ] --- .right-column[ # Retrospective (1/4) Why did it say "4 tests"? It didn't look like 4 tests. Running verbosely, we can see what's counted as a test: ``` :; prove -v t/cucumber.t .. ok 1 - require './bin/game.pl'; # Feature: Compute bowling score # As a very amateur bowler # I want the score to be computed for me # So that all I need to do is pretend I'm aiming # # Scenario: Gutter game ok 2 - Given a new game ok 3 - When I knock down 0 pins 20 times ok 4 - Then my score is 0 # 1..4 ok All tests successful. ``` ] --- .right-column[ # Retrospective (2/4) - Different groups sliced differently: - Total rolls - Frames - Number of rolls per frame - Perfect game first!?!?! - Within one group: disagreed, split, tried both in parallel, got back together and picked one - In conversation, we could refer to scenarios by name - Struggled with priority: which scenarios first? - One solution: just ideate (and defer prioritizing) - We wrote lots of scenarios all at once, based on our understanding of the entire game of bowling - Another approach: one new scenario at a time, implementing as we go, reflecting on what we learn - Everyone understands bowling better than they did an hour ago! ] --- .right-column[ # Retrospective (3/4) - Some folks might try this BDD way of talking in their jobs tomorrow - Three Amigos: attend sometimes, observe and contribute ("if you see something, say something") - You don't have to say "Given, When, Then", but it tends to aid shared understanding - Who writes the scenarios? Everyone in the room. Doesn't matter who records them. Take turns. ] --- .right-column[ # Retrospective (4/4) - Why were examples so helpful for understanding? - The simplistic formula we tried broke down - Abstract language leaves lots of room for miscommunication - Specific examples reveal shallow agreement, so we can seek deeper agreement - AKA
Specification by example
- One set of examples that often helps: James Grenning's [ZOMBIES](http://blog.wingman-sw.com/archives/677) - In a UX context? Examples might look like wireframes. Still useful, as are the words "Given When Then" - Llewellyn pointed us at a video: [Nordstrom Innovation Lab: Sunglass iPad App Case Study](https://www.youtube.com/watch?v=szr0ezLyQHY) - Can your customers understand your scenarios? Probably! (Hey, maybe invite one to Three Amigos!) - Don't use Perl ] --- .right-column[ # References - [Introducing BDD](http://dannorth.net/introducing-bdd/) ([Dan North](https://twitter.com/tastapod), dannorth.net, March 2006) - [The Three Amigos: All For One, One For All](http://www.stickyminds.com/sites/default/files/magazine/file/2013/3971888.pdf) ([George Dinwiddie](https://twitter.com/gdinwiddie), _Better Software_, November/December 2011) - [What is BDD?](http://lizkeogh.com/2015/03/27/what-is-bdd/) ([Liz Keogh](https://twitter.com/lunivore), lizkeogh.com, March 2015) - [The Bowling Game Kata](http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata) ([Robert C. Martin](https://twitter.com/unclebobmartin), butunclebob.com, 2005) ] --- .right-column[ # Agile in 3 Minutes ##
agilein3minut.es
> "Before Agile in 3 Minutes, I couldn't get my team to have a > conversation about important topics. Now I have to timebox it."
-
8: Care
-
9: Pair
-
32: Mob
] --- .right-column[ # Agile in 3 Minutes: The Book ## [leanpub.com/agilein3minutes
/c/dc18](https://leanpub.com/agilein3minutes/c/dc18) The simplest _essays_ that could possibly work. $4 USD today! ] --- .right-column[ # Let's Keep Going ## [announce-subscribe@schmonz.com](mailto:announce-subscribe@schmonz.com) To have these slides sent to you, join my mailing list. (Also talks, podcasts, blog posts.) ## [latentagility.com](https://latentagility.com) Does your company deliver valuable software? Maybe I can help. Consulting, coaching, training. ] --- template: titleslide # Behavior-Driven Development
for Everyone
## Amitai Schleier ## [latentagility.com](https://latentagility.com)