OSDC 2010 - You've Got Cucumber in my Java and it Tastes Great

Aaron Walker
Aaron WalkerTechnology Director at base2Services and the Everything as code guy
You've got Cucumber in my
                              Java....and it tastes great!!!

                                                        Emmanuel Bernard

                                                       > Aaron Walker
                                                        Hibernate Search in Actio
                                           a.walker@base2services.com
                                                      > blog.emmanuelbernard.c

                                                        @aaronwalker
                                                      > twitter.com/emmanuelbe

                                                www.base2services.com

base2Services Pty Ltd 2010
• BDD WTF???


base2Services Pty Ltd Commercial in Confidence 2010
BDD
                                  ~ Behaviour Driven Development ~

                                “BDD facilitates agile development, which is an
                               approach to develop functional software, within
                             reasonable timeline, making everyone happy, without
                                               killing anyone, or
                                           burning down any bank.”



base2Services Pty Ltd 2010
BDD's Core Principles
                     •       It's all behaviour
                              “ The business & technology people should be
                              speaking the same words when referring to the
                              same idea,there should not be any translator.”
                     Behaviour: the addition of N values should yield the
                     summation of them

                     Example: the addition of 2 + 4 +1 should yield 8



base2Services Pty Ltd 2010
BDD's Core Principles

                     •       Deliver stakeholder value
                             “ Whatever you are doing, it should be delivering
                             business value, or increasing our ability to deliver
                               value, if the activity doesn't achieve this, stop
                                                    doing it”




base2Services Pty Ltd 2010
Cucumber
                                                         $'
(

                             •   Is not something your mother
                                 made you eat
                             •   a tool for functional testing
                             •   by Aslak HellesØy,  many other
                                 nice people
                             •   allows non-technies to express
                                 app's functions in plain text
                             •   plain text serves as
                                 documentation  executable
                                 examples
                                                                     




base2Services Pty Ltd 2010
YES....plain text
                      	%% +




                                                          
base2Services Pty Ltd 2010
Given | When |Then

                             • GIVEN ... setting up system to a known
                                 state
                             •   WHEN ... exercising an event
                             •   THEN ... verifying an outcome



base2Services Pty Ltd 2010
An now for the JAVA
                             • Cuke4Duke
                              • Cucumber support for the JVM:
                                • Java, Scala, Groovy, Clojure, Ioke,
                                   Javascript, Spring, Guice, PicoContainer,
                                   WebDriver, Ant and Maven
                             • http://github.com/aslakhellesoy/cuke4duke/
base2Services Pty Ltd 2010
Enough Slide-ware
                             Show me the Code!!!


base2Services Pty Ltd 2010
Questions

                             • http://cukes.info/ - Cucumber
                             • http://github.com/aslakhellesoy/cucumber
                             • http://github.com/aslakhellesoy/cuke4duke
                             • a.walker@base2services.com
                             • github.com/aaronwalker

base2Services Pty Ltd 2010
1 of 11

More Related Content

OSDC 2010 - You've Got Cucumber in my Java and it Tastes Great

  • 1. You've got Cucumber in my Java....and it tastes great!!! Emmanuel Bernard > Aaron Walker Hibernate Search in Actio a.walker@base2services.com > blog.emmanuelbernard.c @aaronwalker > twitter.com/emmanuelbe www.base2services.com base2Services Pty Ltd 2010
  • 2. • BDD WTF??? base2Services Pty Ltd Commercial in Confidence 2010
  • 3. BDD ~ Behaviour Driven Development ~ “BDD facilitates agile development, which is an approach to develop functional software, within reasonable timeline, making everyone happy, without killing anyone, or burning down any bank.” base2Services Pty Ltd 2010
  • 4. BDD's Core Principles • It's all behaviour “ The business & technology people should be speaking the same words when referring to the same idea,there should not be any translator.” Behaviour: the addition of N values should yield the summation of them Example: the addition of 2 + 4 +1 should yield 8 base2Services Pty Ltd 2010
  • 5. BDD's Core Principles • Deliver stakeholder value “ Whatever you are doing, it should be delivering business value, or increasing our ability to deliver value, if the activity doesn't achieve this, stop doing it” base2Services Pty Ltd 2010
  • 6. Cucumber $' ( • Is not something your mother made you eat • a tool for functional testing • by Aslak HellesØy, many other nice people • allows non-technies to express app's functions in plain text • plain text serves as documentation executable examples base2Services Pty Ltd 2010
  • 7. YES....plain text %% + base2Services Pty Ltd 2010
  • 8. Given | When |Then • GIVEN ... setting up system to a known state • WHEN ... exercising an event • THEN ... verifying an outcome base2Services Pty Ltd 2010
  • 9. An now for the JAVA • Cuke4Duke • Cucumber support for the JVM: • Java, Scala, Groovy, Clojure, Ioke, Javascript, Spring, Guice, PicoContainer, WebDriver, Ant and Maven • http://github.com/aslakhellesoy/cuke4duke/ base2Services Pty Ltd 2010
  • 10. Enough Slide-ware Show me the Code!!! base2Services Pty Ltd 2010
  • 11. Questions • http://cukes.info/ - Cucumber • http://github.com/aslakhellesoy/cucumber • http://github.com/aslakhellesoy/cuke4duke • a.walker@base2services.com • github.com/aaronwalker base2Services Pty Ltd 2010