SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler 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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

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