bdd on java concordion and selenium

Post on 09-May-2015

2.555 Views

Category:

Technology

7 Downloads

Preview:

Click to see full reader

DESCRIPTION

My BDD presentation about Concordion and Selenium for JUG Lviv

TRANSCRIPT

BDD with Java using Concordion and Selenium

September 2012Oleksiy Rezchykov

@ua_spring #JugLviv

@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

3

Agenda

What is BDD for?

BDD + Selenium how this works together

Some code

Alternatives

Approach criticism

Conclusion

@ua_spring #JugLviv

@ua_spring #JugLviv 4

Everything started with XP

@ua_spring #JugLviv 5

Then comes TDD

@ua_spring #JugLviv 6

What is TDD?

7

TDD is great, but…

Who will take care of the quality?

@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

@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

@ua_spring #JugLviv 10

An attempt to fix TDD - ATDD

@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/

@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

@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

@ua_spring #JugLviv 14

Magical words: GWT

@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.

@ua_spring #JugLviv 16

How this works?

Concordion Test Runner

TestNG/JUnit test

Concordion test spec

TestNG/JUnit test

methods

PageObject

WebDriver Browser

@ua_spring #JugLviv 17

Some code

Site test example

@ua_spring #JugLviv 19

Alternatives: platform

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

@ua_spring #JugLviv 20

Alternatives: BDD frameworks

Cucumber

JBehave

easyB

@ua_spring #JugLviv 21

Alternatives: UI tests

@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)

@ua_spring #JugLviv 23

Conclusion

@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

top related