change anything with cucumber and atdd
DESCRIPTION
Step beyond unit tests and into acceptance testsTRANSCRIPT
![Page 1: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/1.jpg)
Change AnythingWith Cucumber and ATDD
![Page 2: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/2.jpg)
(remember last time…..)
Unit Tests
Wrapped Generics
no temp variablesAND
Impl
refactoring
![Page 3: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/3.jpg)
(…. your class) (…. your unit test)
if () { int tempVariable; List<> for (some : List<>) boolean innerFlag for (nested : loop) { //comment Map<Map<List>>.add } }}(Java Flab)
![Page 4: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/4.jpg)
(…. your class) (…. your unit test)
object.doSomething(with)
object.otherThing(group.find)
(Java Fab)
![Page 5: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/5.jpg)
(…. your class) (…. your unit test)
object.doSomething(with)
object.otherThing(group.find)
(it’s all good)
![Page 6: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/6.jpg)
(…. your class) (…. your unit test)
![Page 7: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/7.jpg)
![Page 8: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/8.jpg)
(Strange Loop 2011)
Rich Hickey (made clojure)
“Make Simple Easy”
![Page 9: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/9.jpg)
“What type of runner can run full speed from the very start of the race?
Thats right. Someone who runs very short distances. But as programmers, we
are smarter than that. We just fire the starter pistol again every 100 yards. I don’t know why runners haven’t figured that out.”
(cough cough Scrum)
Rich Hickey (made clojure) Thanks @markwshead
![Page 10: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/10.jpg)
(sorry Groovy fans)
“…do fewer semi colons make the customer
happier?….”
Rich Hickey (made clojure)
![Page 11: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/11.jpg)
Unit Tests == Guard Rails
“We say, “I can make a change because I have
tests.”… Who does that? Who drives their car around banging into the guard
rails!?”
Rich Hickey (made clojure) Thanks @markwshead
![Page 12: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/12.jpg)
Unit Tests == Guard Rails
“…may keep you on the road, but won’t
necessarily help you get where you are going….”
Rich Hickey (made clojure)
![Page 13: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/13.jpg)
(in regards to everything)
Does what you’re doing add value to the
customer?
Rich Hickey (made clojure)
(sorry for the business speak)
![Page 14: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/14.jpg)
(hmm…..)
Unit Tests
Fast Iterations
No Semi Colons
(…who are these for more)
![Page 15: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/15.jpg)
It Works
(what the customer actually wants)
![Page 16: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/16.jpg)
Functional Programming
Better Tests
![Page 17: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/17.jpg)
My mind on Testing
(startup weblogic)
(update my code)
(find correct test data)(check the happy path)
(build the project)
(launch the app)
(eat sunflower seeds)
(check email)
(test corner case 1)
(test corner case 2)(test corner case 3)(regression test 1)
(regression test 2)(regression test 3)
![Page 18: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/18.jpg)
My mind on Testing
(startup weblogic)
(update my code)
(find correct test data)(check the happy path)
(build the project)
(launch the app)
(eat sunflower seeds)
(check email)
(test corner case 1)
(test corner case 2)(test corner case 3)(regression test 1)
(regression test 2)(regression test 3)
(find correct test data)(check the happy path)
(test corner case 1)
![Page 19: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/19.jpg)
My mind on Testing
(startup weblogic)
(update my code)
(find correct test data)(check the happy path)
(build the project)
(launch the app)
(eat sunflower seeds)
(check email)
(test corner case 1)
(test corner case 2)(test corner case 3)(regression test 1)
(regression test 2)(regression test 3)
![Page 20: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/20.jpg)
(complexity)
Hey! The average person can only juggle 3 – 9 balls.
Not 90 or 900
Rich Hickey (made clojure)
(mentally of course)
![Page 21: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/21.jpg)
My mind on Testing
(startup weblogic)
(update my code)
(find correct test data)(check the happy path)
(build the project)
(launch the app)
(eat sunflower seeds)
(check email)
(test corner case 1)
(test corner case 2)(test corner case 3)(regression test 1)
(regression test 2)(regression test 3)
![Page 22: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/22.jpg)
My mind on Testing
(startup weblogic)
(update my code)
(find correct test data)(check the happy path)
(build the project)
(launch the app)
(eat sunflower seeds)
(check email)
(test corner case 1)
(test corner case 2)(test corner case 3)(regression test 1)
(regression test 2)(regression test 3)
BUG
BUG
![Page 23: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/23.jpg)
(…. your class) (…. your unit test)
(even though)
BUG
![Page 24: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/24.jpg)
(hmm…..)
Too Big
Unexpected
Didn’t have time
(we’ve heard err… said these before)
Couldn’t be tested
![Page 25: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/25.jpg)
(…. your class) (…. your test)
(hmm… as a whole)
![Page 26: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/26.jpg)
(better yet)
![Page 27: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/27.jpg)
Robert Martin (really cool dude)
(testing the whole isn’t new)
![Page 28: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/28.jpg)
Cucumber
![Page 29: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/29.jpg)
“The hardest part of building a software system is deciding precisely what to build”
Fred Brooks, The Mythical Man Month: Essays on Software Engineering, 2nd ed. (New York: Addison Wesley Professional, 1995).
![Page 30: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/30.jpg)
…Gherkin in Action
![Page 31: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/31.jpg)
…that’s bumper to bumper testing
![Page 32: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/32.jpg)
…that’s a web interface
![Page 33: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/33.jpg)
…that’s a Swing interface
![Page 34: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/34.jpg)
FA –>DEV
…FA writing …DEV programming
Walkthrough
YIKES!
![Page 35: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/35.jpg)
FA –>DEV
…FA writing …DEV programming
Walkthrough
new Cucumber Test
![Page 36: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/36.jpg)
100%Coverage
Unit Tests Acceptance Tests
Performance Tests
50%Coverage
10 %
C., Robert. The Clean Coder: A Code of Conduct for Professional Programmers. 2011. 115. Print.
![Page 37: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/37.jpg)
Quality Software
Automated Testing
Dev Verification User Verification
Code Reviews
![Page 38: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/38.jpg)
Lisa Crispin and Janet Gregory, Agile Testing: A Practical Guide for Testers and Agile Teams. (Boston: Addison Wesley, 2009).
![Page 39: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/39.jpg)
Given….
When….
Then….
…Gherkin
![Page 40: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/40.jpg)
…Gherkin in Action
![Page 41: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/41.jpg)
…That’s the Why
![Page 42: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/42.jpg)
…That’s the How
![Page 43: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/43.jpg)
…so easy!
![Page 44: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/44.jpg)
…regex generated for you!
![Page 45: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/45.jpg)
![Page 46: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/46.jpg)
…insert variable arguments
![Page 47: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/47.jpg)
…you get method arguments
![Page 48: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/48.jpg)
![Page 49: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/49.jpg)
…staying DRY
![Page 50: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/50.jpg)
…staying DRY
![Page 51: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/51.jpg)
![Page 52: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/52.jpg)
![Page 53: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/53.jpg)
![Page 54: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/54.jpg)
…only run scenarios with WIP
![Page 55: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/55.jpg)
…only this scenario!
![Page 56: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/56.jpg)
…Paul Rayner (Cucumber Expert)
![Page 57: Change Anything with Cucumber and ATDD](https://reader034.vdocument.in/reader034/viewer/2022051513/547e34a7b4af9f6c0e8b482e/html5/thumbnails/57.jpg)
…go check it out
https://github.com/MoMenne/grails-baseball-scoreboard