bdd on java concordion and selenium

25
BDD with Java using Concordion and Selenium September 2012 Oleksiy Rezchykov @ua_spring #JugLviv

Upload: springbyexample

Post on 09-May-2015

2.555 views

Category:

Technology


7 download

DESCRIPTION

My BDD presentation about Concordion and Selenium for JUG Lviv

TRANSCRIPT

Page 1: BDD on Java Concordion and Selenium

BDD with Java using Concordion and Selenium

September 2012Oleksiy Rezchykov

@ua_spring #JugLviv

Page 2: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 2

About me

Software Engineer for more than 10 years

Working with Spring during last 6 years

Pragmatic programmer

SpringByExample.com.ua founder

Testing Automation, Continuous Integration, Continuous Delivery Consultant

Page 3: BDD on Java Concordion and Selenium

3

Agenda

What is BDD for?

BDD + Selenium how this works together

Some code

Alternatives

Approach criticism

Conclusion

@ua_spring #JugLviv

Page 4: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 4

Everything started with XP

Page 5: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 5

Then comes TDD

Page 6: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 6

What is TDD?

Page 7: BDD on Java Concordion and Selenium

7

TDD is great, but…

Who will take care of the quality?

Page 8: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 8

What exactly TDD is?

A 2005 study found that using TDD meant writing more tests and, in turn, programmers who wrote more tests tended to be more productive. Hypotheses relating to code quality and a more direct correlation between TDD and productivity were inconclusive.

Wikipedia

Page 9: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 9

What exactly TDD is?

Test-driven development offers more than just simple validation of correctness, but can also drive the design of a program

Wikipedia

Page 10: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 10

An attempt to fix TDD - ATDD

Page 11: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 11

An attempt to fix TDD - ATDD

Acceptance Test Driven Development (ATDD) is a practice in which the whole team collaboratively discusses acceptance criteria, with examples, and then distills them into a set of concrete acceptance tests before development begins.

http://testobsessed.com/blog/2008/12/08/acceptance-test-driven-development-atdd-an-overview/

Page 12: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 12

An attempt to fix TDD - ATDD

Acceptance TDD helps coordinate software projects in a way that helps us deliver exactly what the customer wants when they want it, and that doesn’t let us implement the required functionality only half way.

http://www.methodsandtools.com/archive/archive.php?id=72

Page 13: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 13

What is BDD?

At the heart of BDD is a rethinking of the approach to unit testing and acceptance testing: unit test names are whole sentences starting with the word "should" and they are written in order of business value.

BDD encourages collaboration among developers, QA and non-technical or business participants in a software project. It has evolved over the last few years.

Wikipedia

Page 14: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 14

Magical words: GWT

Page 15: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 15

BDD + Selenium

Concordion is an open source tool for writing automated acceptance tests in Java*

* There are also versions for .NET, Python, Scala, and Ruby.

Page 16: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 16

How this works?

Concordion Test Runner

TestNG/JUnit test

Concordion test spec

TestNG/JUnit test

methods

PageObject

WebDriver Browser

Page 17: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 17

Some code

Site test example

Page 19: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 19

Alternatives: platform

Be pragmatic – don’t use Java where it is not needed.

Page 20: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 20

Alternatives: BDD frameworks

Cucumber

JBehave

easyB

Page 21: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 21

Alternatives: UI tests

Page 22: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 22

Approach criticism

Often “pure BDD” is not needed - ATDD is enough

Usually UI-tests are better to replace with lower-level tests (e.g. integration or even functional)

Page 23: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 23

Conclusion

Page 24: BDD on Java Concordion and Selenium

@ua_spring #JugLviv 24

Talking seriously…

BDD is designed for a projects where business and engineering are working tightly

BDD is not useful for every project

BDD adoption is a complex process

every team member is responsible for a product quality