SlideShare a Scribd company logo
1 of 27
Download to read offline
Java EE Behave!!!!
                                     Behaviour-Driven Development with Java EE

                                                                     Aaron Walker
                                                        a.walker@base2services.com
                                                                       @aaronwalker
                                                               http://aaronwalker.me
                                                       http://www.base2services.com
                                                                              #jeebehave
base2Services Pty Ltd Commercial in Confidence 2010
Agenda
                        • What is this BDD thingy
                        • JBehave
                        • How to make your tests behave!
                               •         { Demo }

                        • Java EE flavouring
                               •         { Demo }

                        • Q &A
                                                                     #jeebehave
                                                              base2Services Pty Ltd 2011
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.”

                                                                                 #jeebehave
                                                                          base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 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 + 2 should yield 8

                                                                              #jeebehave
                                                                       base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
BDD's Core Principles

                   •        The evolution of test-driven development
                            (TDD) and acceptance-test driven design
                   •        Shifts the vocabulary from being test-based
                            to behaviour-based
                   •        Essentially a design philosophy


                                                                      #jeebehave
                                                               base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
Unit testing
                          frameworks mismatch
                                                     It’s all about the Behaviour




                                                                                    #jeebehave
base2Services Pty Ltd Commercial in Confidence 2010
Oh JBehave
                        •       a framework for Behaviour-Driven
                                Development.

                        •       pure Java implementation

                        •       Users can specify and run plain text-
                                based user stories

                        •       Annotation-based configuration and
                                Steps class specifications

                        •       Dependency Injection support (more
                                on this one later)

                        •       Tool/IDE integration

                               •       Ant, Maven, Selenium, Eclipse, IntelliJ,
                                       Netbeans

                                                                                         #jeebehave
                                                                                  base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
Yep....plain text




                                                                                #jeebehave
                                                                         base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
Narrative
                   • Describes the overall intent of the story
                   • Generally describes a single feature or use
                            case
                   • Should include any participating actors
                            “In order to learn about BDD and JBehave as
                            a JavaOne attendee I will attend session
                            24421- JEE Behave!”
                                                                        #jeebehave
                                                                 base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
Scenario

                   • Describes a specific interaction
                   • Generally fine-grained
                               •         test valid and invalid outcomes

                   • Support for parametrisation
                            “Scenario: User signs up with invalid data”

                                                                                  #jeebehave
                                                                           base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
Given|When|Then|And
                        • Given ... setting up system to a known
                                 state
                        • When ... exercising an event
                        • Then ... verifying an outcome
                        • And ... used to chain multiple Given, When
                                 and Then statements

                                                                    #jeebehave
                                                             base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
So where’s the Java?
                        •        Mapping Textual Scenario Steps to Java Methods via
                                 annotations
                        •         Steps instances may inherit or implement other class/
                                 interface as required by the model of the application under
                                 test.
                        •        allows many different ways to configure Embeddable Java
                                 classes
                               •         ConfigurableEmbedder: allows the specification of the
                                         Configuration and CandidateSteps.
                               •         InjectableEmbedder: allows the injection of a fully specified
                                         Embedder.
                                                                                                 #jeebehave
                                                                                          base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
JUnit
                        •        JUnit is supported out-of-the-box via several
                                 Embeddables implementations:
                               •         JUnitStory: provides a one-to-one mapping
                                         with the textual story via the
                                         StoryPathResolver.
                               •         JUnitStories: provides a many-to-one
                                         mapping with the textual story paths
                                         explicitly specified by overriding the
                                         storyPaths() method.
                                                                                        #jeebehave
                                                                                 base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
One Step at a time




                                                            #jeebehave
                                                     base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
And the config
                        • Fluent API for specifying configuration




                                                                            #jeebehave
                                                                     base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
{ Demo }
                                                      Enough Slide-ware
                                                     Show me the Code!!!




                                                                                  #jeebehave
                                                                           base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
Now lets sprinkle a
                            little bit of JEE on top

                                                            #jeebehave
                                                     base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
CDI/Weld

                        • Contexts and Dependency Injection for
                                 Java
                               •         (JSR-299 included in JEE6)

                        • Weld is the reference implementation
                               •         http://seamframework.org/Weld



                                                                                #jeebehave
                                                                         base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
JBehave CDI support
                        • jbehave-weld module
                               •         Uses Weld Java-SE integration to bootstrap the CDI
                                         container

                        • can inject configuration and steps using
                                 CDI annotations
                        • greatly simplifies the configuration and
                                 management of step classes
                                                                                           #jeebehave
                                                                                    base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
Inject the Configuration
                        •        Use a CDI @Produces along with a
                                 @WeldConfiguration qualifier annotation
                        •        Gets automatically injected into the running
                                 scenario




                                                                               #jeebehave
                                                                        base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
What about the Steps
                        •        Simply mark Step classes with a @WeldStep
                                 annotation
                        •        They get automatically added as candidate steps
                        •        Steps can use @Inject to inject dependencies




                                                                              #jeebehave
                                                                       base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
{ Demo }
                                                     Show me a better way!!!




                                                                                      #jeebehave
                                                                               base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
JBehave Web
                        • JBehave Web is an extension of the JBehave
                                 framework providing a web integration layer
                        • Features include:
                               •         Web Queue to allow generic stories to be run asynchronously
                                         via a simple web interface.

                               •         Web Runner to allow generic stories to be run synchronously
                                         via a simple web interface.

                               •         Selenium integration module to allow automation of stories
                                         for web applications using Selenium.
                                                                                                #jeebehave
                                                                                         base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
{ Demo }
                                                 Now let’s put all this together




                                                                                          #jeebehave
                                                                                   base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
System Integration
                                           Testing
                        • JBehave is a good language for describing
                                 system integration
                        • BA’s, QA’s, architects, and developers are all
                                 speaking the same language
                        • Self documented acceptance tests
                                                                       #jeebehave
                                                                base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
What’s Next

                        • Custom CDI Scopes
                         • @StoryScope, @ScenarioScope
                        • Arquillian Integration
                        • ???????
                                                                          #jeebehave
                                                                   base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010
Q &A
                        • http://behaviour-driven.org/
                        • http://jbehave.org - JBehave project site
                        • github.com/aaronwalker/JavaOne2011 -
                                 demo code
                        • http://aaronwalker.me - blog
                        • a.walker@base2services.com - email
                        • @aaronwalker - twitter
                                                                       #jeebehave
                                                                base2Services Pty Ltd 2011
base2Services Pty Ltd Commercial in Confidence 2010

More Related Content

What's hot

The Executive Centre Brisbane
The Executive Centre BrisbaneThe Executive Centre Brisbane
The Executive Centre Brisbaneferrypranata
 
Introduction to design specifications to Summer of Code NZ students
Introduction to design specifications to Summer of Code NZ studentsIntroduction to design specifications to Summer of Code NZ students
Introduction to design specifications to Summer of Code NZ studentsLulu Pachuau
 
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...TAUS - The Language Data Network
 
IPexcel - Company Overview
IPexcel - Company OverviewIPexcel - Company Overview
IPexcel - Company OverviewIPexcel
 
Final indocorp group brochure small size
Final indocorp group brochure small sizeFinal indocorp group brochure small size
Final indocorp group brochure small sizeSrikant Gupta
 

What's hot (6)

The Executive Centre Brisbane
The Executive Centre BrisbaneThe Executive Centre Brisbane
The Executive Centre Brisbane
 
Introduction to design specifications to Summer of Code NZ students
Introduction to design specifications to Summer of Code NZ studentsIntroduction to design specifications to Summer of Code NZ students
Introduction to design specifications to Summer of Code NZ students
 
Business Skils For Technical Profession
Business Skils For Technical ProfessionBusiness Skils For Technical Profession
Business Skils For Technical Profession
 
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...
TAUS MT SHOWCASE, Strategies for Building Competitive Advantage and Revenue f...
 
IPexcel - Company Overview
IPexcel - Company OverviewIPexcel - Company Overview
IPexcel - Company Overview
 
Final indocorp group brochure small size
Final indocorp group brochure small sizeFinal indocorp group brochure small size
Final indocorp group brochure small size
 

Similar to Java EE Behave!!!!

OSDC 2010 - You've Got Cucumber in my Java and it Tastes Great
OSDC 2010 - You've Got Cucumber in my Java and it Tastes GreatOSDC 2010 - You've Got Cucumber in my Java and it Tastes Great
OSDC 2010 - You've Got Cucumber in my Java and it Tastes GreatAaron Walker
 
Enterprise IPv6 Deployment
Enterprise IPv6 Deployment Enterprise IPv6 Deployment
Enterprise IPv6 Deployment Cisco Canada
 
Running successful agile projects
Running successful agile projectsRunning successful agile projects
Running successful agile projectsMartin Aspeli
 
The Conversation Roadmap A Foundation for Better Sales Tools and More
The Conversation Roadmap A Foundation for Better Sales Tools and MoreThe Conversation Roadmap A Foundation for Better Sales Tools and More
The Conversation Roadmap A Foundation for Better Sales Tools and MoreCorporate Visions
 
Ebsylon & IRML KIID Services
Ebsylon & IRML KIID ServicesEbsylon & IRML KIID Services
Ebsylon & IRML KIID Servicesebsylon
 
A study of the characteristics of Behaviour Driven Development
A study of the characteristics of Behaviour Driven DevelopmentA study of the characteristics of Behaviour Driven Development
A study of the characteristics of Behaviour Driven DevelopmentCarlos Solís
 
Common mistakes, pitfalls and misconceptions to avoid when launching your DAM...
Common mistakes, pitfalls and misconceptions to avoid when launching your DAM...Common mistakes, pitfalls and misconceptions to avoid when launching your DAM...
Common mistakes, pitfalls and misconceptions to avoid when launching your DAM...joel_warwick
 
Enterprise Cloud Development and Agile Transformation Strategy - China 2012
Enterprise Cloud Development and Agile Transformation Strategy - China 2012 Enterprise Cloud Development and Agile Transformation Strategy - China 2012
Enterprise Cloud Development and Agile Transformation Strategy - China 2012 Laszlo Szalvay
 
Capture is Powerful - Harvey Spencer presentation to AIIM Ottawa Event Oct 27...
Capture is Powerful - Harvey Spencer presentation to AIIM Ottawa Event Oct 27...Capture is Powerful - Harvey Spencer presentation to AIIM Ottawa Event Oct 27...
Capture is Powerful - Harvey Spencer presentation to AIIM Ottawa Event Oct 27...Cheryl McKinnon
 
DbyDx Software Corporate Presentation
DbyDx Software Corporate PresentationDbyDx Software Corporate Presentation
DbyDx Software Corporate PresentationDbyDx Software
 
ETIS10 - BI Business Requirements - Presentation
ETIS10 - BI Business Requirements - PresentationETIS10 - BI Business Requirements - Presentation
ETIS10 - BI Business Requirements - PresentationDavid Walker
 
ProV - Your search for IT services partner ends here
ProV - Your search for IT services partner ends hereProV - Your search for IT services partner ends here
ProV - Your search for IT services partner ends hereProV International
 
Craft Compelling Interactive Content for Live Online Training
Craft Compelling Interactive Content for Live Online TrainingCraft Compelling Interactive Content for Live Online Training
Craft Compelling Interactive Content for Live Online TrainingRaptivity
 
HP Discover Session BB2160: Agile DevOps Continuous Delivery
HP Discover Session BB2160:  Agile DevOps Continuous DeliveryHP Discover Session BB2160:  Agile DevOps Continuous Delivery
HP Discover Session BB2160: Agile DevOps Continuous DeliveryCapgemini
 
Unlock Value in Your Oracle Business Intelligence Investments
Unlock Value in Your Oracle Business Intelligence InvestmentsUnlock Value in Your Oracle Business Intelligence Investments
Unlock Value in Your Oracle Business Intelligence InvestmentsJade Global
 
Composite Applications with SOA, BPEL and Java EE
Composite  Applications with SOA, BPEL and Java EEComposite  Applications with SOA, BPEL and Java EE
Composite Applications with SOA, BPEL and Java EEDmitri Shiryaev
 
2007: Achieving Interoperability In Systems Architecture - SOA Vision And Rea...
2007: Achieving Interoperability In Systems Architecture - SOA Vision And Rea...2007: Achieving Interoperability In Systems Architecture - SOA Vision And Rea...
2007: Achieving Interoperability In Systems Architecture - SOA Vision And Rea...rchopra13
 

Similar to Java EE Behave!!!! (20)

OSDC 2010 - You've Got Cucumber in my Java and it Tastes Great
OSDC 2010 - You've Got Cucumber in my Java and it Tastes GreatOSDC 2010 - You've Got Cucumber in my Java and it Tastes Great
OSDC 2010 - You've Got Cucumber in my Java and it Tastes Great
 
Telcom Offshoring
Telcom OffshoringTelcom Offshoring
Telcom Offshoring
 
Enterprise IPv6 Deployment
Enterprise IPv6 Deployment Enterprise IPv6 Deployment
Enterprise IPv6 Deployment
 
Running successful agile projects
Running successful agile projectsRunning successful agile projects
Running successful agile projects
 
The Conversation Roadmap A Foundation for Better Sales Tools and More
The Conversation Roadmap A Foundation for Better Sales Tools and MoreThe Conversation Roadmap A Foundation for Better Sales Tools and More
The Conversation Roadmap A Foundation for Better Sales Tools and More
 
Ebsylon & IRML KIID Services
Ebsylon & IRML KIID ServicesEbsylon & IRML KIID Services
Ebsylon & IRML KIID Services
 
A study of the characteristics of Behaviour Driven Development
A study of the characteristics of Behaviour Driven DevelopmentA study of the characteristics of Behaviour Driven Development
A study of the characteristics of Behaviour Driven Development
 
Common mistakes, pitfalls and misconceptions to avoid when launching your DAM...
Common mistakes, pitfalls and misconceptions to avoid when launching your DAM...Common mistakes, pitfalls and misconceptions to avoid when launching your DAM...
Common mistakes, pitfalls and misconceptions to avoid when launching your DAM...
 
Siebel_CRM_6yrs_Prof
Siebel_CRM_6yrs_ProfSiebel_CRM_6yrs_Prof
Siebel_CRM_6yrs_Prof
 
Enterprise Cloud Development and Agile Transformation Strategy - China 2012
Enterprise Cloud Development and Agile Transformation Strategy - China 2012 Enterprise Cloud Development and Agile Transformation Strategy - China 2012
Enterprise Cloud Development and Agile Transformation Strategy - China 2012
 
Capture is Powerful - Harvey Spencer presentation to AIIM Ottawa Event Oct 27...
Capture is Powerful - Harvey Spencer presentation to AIIM Ottawa Event Oct 27...Capture is Powerful - Harvey Spencer presentation to AIIM Ottawa Event Oct 27...
Capture is Powerful - Harvey Spencer presentation to AIIM Ottawa Event Oct 27...
 
DbyDx Software Corporate Presentation
DbyDx Software Corporate PresentationDbyDx Software Corporate Presentation
DbyDx Software Corporate Presentation
 
ETIS10 - BI Business Requirements - Presentation
ETIS10 - BI Business Requirements - PresentationETIS10 - BI Business Requirements - Presentation
ETIS10 - BI Business Requirements - Presentation
 
ProV - Your search for IT services partner ends here
ProV - Your search for IT services partner ends hereProV - Your search for IT services partner ends here
ProV - Your search for IT services partner ends here
 
Craft Compelling Interactive Content for Live Online Training
Craft Compelling Interactive Content for Live Online TrainingCraft Compelling Interactive Content for Live Online Training
Craft Compelling Interactive Content for Live Online Training
 
HP Discover Session BB2160: Agile DevOps Continuous Delivery
HP Discover Session BB2160:  Agile DevOps Continuous DeliveryHP Discover Session BB2160:  Agile DevOps Continuous Delivery
HP Discover Session BB2160: Agile DevOps Continuous Delivery
 
Unlock Value in Your Oracle Business Intelligence Investments
Unlock Value in Your Oracle Business Intelligence InvestmentsUnlock Value in Your Oracle Business Intelligence Investments
Unlock Value in Your Oracle Business Intelligence Investments
 
Composite Applications with SOA, BPEL and Java EE
Composite  Applications with SOA, BPEL and Java EEComposite  Applications with SOA, BPEL and Java EE
Composite Applications with SOA, BPEL and Java EE
 
2007: Achieving Interoperability In Systems Architecture - SOA Vision And Rea...
2007: Achieving Interoperability In Systems Architecture - SOA Vision And Rea...2007: Achieving Interoperability In Systems Architecture - SOA Vision And Rea...
2007: Achieving Interoperability In Systems Architecture - SOA Vision And Rea...
 
Dbydx profile
Dbydx profileDbydx profile
Dbydx profile
 

More from Aaron Walker

Just Enough Infrastructure
Just Enough InfrastructureJust Enough Infrastructure
Just Enough InfrastructureAaron Walker
 
Amazon VPC Lattice: The Service Mesh you actually want!!
Amazon VPC Lattice: The Service Mesh you actually want!!Amazon VPC Lattice: The Service Mesh you actually want!!
Amazon VPC Lattice: The Service Mesh you actually want!!Aaron Walker
 
Berlin AWS User Group - 10 May 2022
Berlin AWS User Group - 10 May 2022 Berlin AWS User Group - 10 May 2022
Berlin AWS User Group - 10 May 2022 Aaron Walker
 
Do you REALLY know what is going on in your AWS Accounts?
Do you REALLY know what is going on in your AWS Accounts?Do you REALLY know what is going on in your AWS Accounts?
Do you REALLY know what is going on in your AWS Accounts?Aaron Walker
 
Berlin CI/CD Meetup - Reusable Serverless CI/CD pipelines with Jenkins
Berlin CI/CD Meetup - Reusable Serverless CI/CD pipelines with JenkinsBerlin CI/CD Meetup - Reusable Serverless CI/CD pipelines with Jenkins
Berlin CI/CD Meetup - Reusable Serverless CI/CD pipelines with JenkinsAaron Walker
 
Meetup - AWS Berlin October 2018 - Account Management and AWS Organizations
Meetup - AWS Berlin October 2018 - Account Management and AWS OrganizationsMeetup - AWS Berlin October 2018 - Account Management and AWS Organizations
Meetup - AWS Berlin October 2018 - Account Management and AWS OrganizationsAaron Walker
 
Meetup AWS Berlin July 2018 - You're writing WAY too much CloudFormation
Meetup AWS Berlin July 2018 - You're writing WAY too much CloudFormationMeetup AWS Berlin July 2018 - You're writing WAY too much CloudFormation
Meetup AWS Berlin July 2018 - You're writing WAY too much CloudFormationAaron Walker
 
Berlin DevOps Meetup 2018-07-12
Berlin DevOps Meetup 2018-07-12Berlin DevOps Meetup 2018-07-12
Berlin DevOps Meetup 2018-07-12Aaron Walker
 
Enabling your DevOps culture with AWS-webinar
Enabling your DevOps culture with AWS-webinarEnabling your DevOps culture with AWS-webinar
Enabling your DevOps culture with AWS-webinarAaron Walker
 
Enabling your DevOps culture with AWS
Enabling your DevOps culture with AWSEnabling your DevOps culture with AWS
Enabling your DevOps culture with AWSAaron Walker
 
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the CloudJavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the CloudAaron Walker
 
OSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suckOSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suckAaron Walker
 

More from Aaron Walker (12)

Just Enough Infrastructure
Just Enough InfrastructureJust Enough Infrastructure
Just Enough Infrastructure
 
Amazon VPC Lattice: The Service Mesh you actually want!!
Amazon VPC Lattice: The Service Mesh you actually want!!Amazon VPC Lattice: The Service Mesh you actually want!!
Amazon VPC Lattice: The Service Mesh you actually want!!
 
Berlin AWS User Group - 10 May 2022
Berlin AWS User Group - 10 May 2022 Berlin AWS User Group - 10 May 2022
Berlin AWS User Group - 10 May 2022
 
Do you REALLY know what is going on in your AWS Accounts?
Do you REALLY know what is going on in your AWS Accounts?Do you REALLY know what is going on in your AWS Accounts?
Do you REALLY know what is going on in your AWS Accounts?
 
Berlin CI/CD Meetup - Reusable Serverless CI/CD pipelines with Jenkins
Berlin CI/CD Meetup - Reusable Serverless CI/CD pipelines with JenkinsBerlin CI/CD Meetup - Reusable Serverless CI/CD pipelines with Jenkins
Berlin CI/CD Meetup - Reusable Serverless CI/CD pipelines with Jenkins
 
Meetup - AWS Berlin October 2018 - Account Management and AWS Organizations
Meetup - AWS Berlin October 2018 - Account Management and AWS OrganizationsMeetup - AWS Berlin October 2018 - Account Management and AWS Organizations
Meetup - AWS Berlin October 2018 - Account Management and AWS Organizations
 
Meetup AWS Berlin July 2018 - You're writing WAY too much CloudFormation
Meetup AWS Berlin July 2018 - You're writing WAY too much CloudFormationMeetup AWS Berlin July 2018 - You're writing WAY too much CloudFormation
Meetup AWS Berlin July 2018 - You're writing WAY too much CloudFormation
 
Berlin DevOps Meetup 2018-07-12
Berlin DevOps Meetup 2018-07-12Berlin DevOps Meetup 2018-07-12
Berlin DevOps Meetup 2018-07-12
 
Enabling your DevOps culture with AWS-webinar
Enabling your DevOps culture with AWS-webinarEnabling your DevOps culture with AWS-webinar
Enabling your DevOps culture with AWS-webinar
 
Enabling your DevOps culture with AWS
Enabling your DevOps culture with AWSEnabling your DevOps culture with AWS
Enabling your DevOps culture with AWS
 
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the CloudJavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
JavaOne 2009 - Full-Text Search: Human Heaven and Database Savior in the Cloud
 
OSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suckOSDC-2010 Database Full-text Search.... making it not suck
OSDC-2010 Database Full-text Search.... making it not suck
 

Recently uploaded

Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهMohamed Sweelam
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...SOFTTECHHUB
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?Paolo Missier
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistandanishmna97
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfAnubhavMangla3
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfOverkill Security
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiRaviKumarDaparthi
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 

Recently uploaded (20)

Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdfFrisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
Frisco Automating Purchase Orders with MuleSoft IDP- May 10th, 2024.pptx.pdf
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Navigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi DaparthiNavigating the Large Language Model choices_Ravi Daparthi
Navigating the Large Language Model choices_Ravi Daparthi
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 

Java EE Behave!!!!

  • 1. Java EE Behave!!!! Behaviour-Driven Development with Java EE Aaron Walker a.walker@base2services.com @aaronwalker http://aaronwalker.me http://www.base2services.com #jeebehave base2Services Pty Ltd Commercial in Confidence 2010
  • 2. Agenda • What is this BDD thingy • JBehave • How to make your tests behave! • { Demo } • Java EE flavouring • { Demo } • Q &A #jeebehave base2Services Pty Ltd 2011 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.” #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 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 + 2 should yield 8 #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 5. BDD's Core Principles • The evolution of test-driven development (TDD) and acceptance-test driven design • Shifts the vocabulary from being test-based to behaviour-based • Essentially a design philosophy #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 6. Unit testing frameworks mismatch It’s all about the Behaviour #jeebehave base2Services Pty Ltd Commercial in Confidence 2010
  • 7. Oh JBehave • a framework for Behaviour-Driven Development. • pure Java implementation • Users can specify and run plain text- based user stories • Annotation-based configuration and Steps class specifications • Dependency Injection support (more on this one later) • Tool/IDE integration • Ant, Maven, Selenium, Eclipse, IntelliJ, Netbeans #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 8. Yep....plain text #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 9. Narrative • Describes the overall intent of the story • Generally describes a single feature or use case • Should include any participating actors “In order to learn about BDD and JBehave as a JavaOne attendee I will attend session 24421- JEE Behave!” #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 10. Scenario • Describes a specific interaction • Generally fine-grained • test valid and invalid outcomes • Support for parametrisation “Scenario: User signs up with invalid data” #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 11. Given|When|Then|And • Given ... setting up system to a known state • When ... exercising an event • Then ... verifying an outcome • And ... used to chain multiple Given, When and Then statements #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 12. So where’s the Java? • Mapping Textual Scenario Steps to Java Methods via annotations • Steps instances may inherit or implement other class/ interface as required by the model of the application under test. • allows many different ways to configure Embeddable Java classes • ConfigurableEmbedder: allows the specification of the Configuration and CandidateSteps. • InjectableEmbedder: allows the injection of a fully specified Embedder. #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 13. JUnit • JUnit is supported out-of-the-box via several Embeddables implementations: • JUnitStory: provides a one-to-one mapping with the textual story via the StoryPathResolver. • JUnitStories: provides a many-to-one mapping with the textual story paths explicitly specified by overriding the storyPaths() method. #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 14. One Step at a time #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 15. And the config • Fluent API for specifying configuration #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 16. { Demo } Enough Slide-ware Show me the Code!!! #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 17. Now lets sprinkle a little bit of JEE on top #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 18. CDI/Weld • Contexts and Dependency Injection for Java • (JSR-299 included in JEE6) • Weld is the reference implementation • http://seamframework.org/Weld #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 19. JBehave CDI support • jbehave-weld module • Uses Weld Java-SE integration to bootstrap the CDI container • can inject configuration and steps using CDI annotations • greatly simplifies the configuration and management of step classes #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 20. Inject the Configuration • Use a CDI @Produces along with a @WeldConfiguration qualifier annotation • Gets automatically injected into the running scenario #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 21. What about the Steps • Simply mark Step classes with a @WeldStep annotation • They get automatically added as candidate steps • Steps can use @Inject to inject dependencies #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 22. { Demo } Show me a better way!!! #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 23. JBehave Web • JBehave Web is an extension of the JBehave framework providing a web integration layer • Features include: • Web Queue to allow generic stories to be run asynchronously via a simple web interface. • Web Runner to allow generic stories to be run synchronously via a simple web interface. • Selenium integration module to allow automation of stories for web applications using Selenium. #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 24. { Demo } Now let’s put all this together #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 25. System Integration Testing • JBehave is a good language for describing system integration • BA’s, QA’s, architects, and developers are all speaking the same language • Self documented acceptance tests #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 26. What’s Next • Custom CDI Scopes • @StoryScope, @ScenarioScope • Arquillian Integration • ??????? #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010
  • 27. Q &A • http://behaviour-driven.org/ • http://jbehave.org - JBehave project site • github.com/aaronwalker/JavaOne2011 - demo code • http://aaronwalker.me - blog • a.walker@base2services.com - email • @aaronwalker - twitter #jeebehave base2Services Pty Ltd 2011 base2Services Pty Ltd Commercial in Confidence 2010