Cucumber lets software development teams describe how software should behave in plain text. The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid - all rolled into one format.
Feature: OSDC 2010 Talk
In Order to learn about using cucumber to test my Java Code
As a OSDC attendee
I want to attend the "You've got Cucumber in my Java....and it tastes great!!!" talk
Scenario: Cucumber Introduction
Given a lack of knowledge of cucumber
And an interest in Java testing techniques
When I am told what cucumber is
And how I can use it
Then I should have a basic understand of cucumber
Scenario: Using Cucumber and Java
Given I still have to program in Java
And I want a better way to test my code
When I am shown how to implement cucumber steps in Java
And shown some cool demos
Then I should be able to test my own Java code with cucumber
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
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