bdd with java_using_concordion_and_selenium_ui_tests
DESCRIPTION
My automated-testing.info meet-up #16 presentationTRANSCRIPT
![Page 1: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/1.jpg)
A U T O M AT E D -T E S T I N G . I N F O
BDD на Java при помощи Selenium UI тестов
Май 2012Алексей Резчиков
![Page 2: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/2.jpg)
A U T O M AT E D -T E S T I N G . I N F O
• Java разработчик и тимлидс более чем 10-летним стажем
• Евангелист автоматизированноготестирования уже более 4-х лет
• Энтузиаст XP/Agile/Lean
• Успел «понюхать порох» вместе с eBay и HP
Обо мне
2
![Page 3: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/3.jpg)
A U T O M AT E D -T E S T I N G . I N F O
План
• В чем польза BDD?• BDD + Selenium : как это работает
вместе?• Практика (live coding)• Альтернативы• Критика подхода • Выводы
3
![Page 4: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/4.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Все началось с XP
4
![Page 5: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/5.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Потом придумали TDD
5
![Page 6: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/6.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Суть TDD
6
![Page 7: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/7.jpg)
A U T O M AT E D -T E S T I N G . I N F O
TDD это прекрасно, но…
7
Кто будет думать о качестве?
![Page 8: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/8.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Что ИМЕННО дает TDD?
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
8
![Page 9: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/9.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Что ИМЕННО дает TDD?
Test-driven development offers more than just simple validation of correctness, but can also drive the design of a programWikipedia
9
![Page 10: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/10.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Попытка исправить TDD – ATDD
10
![Page 11: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/11.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Попытка исправить TDD – ATDDAcceptance 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
/
11
![Page 12: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/12.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Попытка исправить TDD – ATDDAcceptance 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
12
![Page 13: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/13.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Что же такое 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
13
![Page 14: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/14.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Магия слов: GWT
14
![Page 15: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/15.jpg)
A U T O M AT E D -T E S T I N G . I N F O
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.
15
![Page 16: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/16.jpg)
A U T O M AT E D -T E S T I N G . I N F O
How it works?
Concordion Test
Runner
TestNG/JUnit test
Concordion test spec
TestNG/JUnit test methods
PageObject
WebDriver Browser
16
![Page 17: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/17.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Практика
Пример тестирования сайта
17
![Page 18: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/18.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Альтернативы: платформа
Стоит быть прагматичными – не стоит добавлять Java в проекты где ее нет.
18
![Page 19: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/19.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Альтернативы: BDD фреймворк• Cucumber• JBehave• easyB…
19
![Page 20: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/20.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Альтернативы: UI тестыне Selenium’ом единым
20
![Page 21: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/21.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Критика подхода
• BDD может быть не нужен, достаточно ATDD
• часто разумней заменить UI тесты более низкоуровневыми
21
![Page 22: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/22.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Выводы
22
![Page 23: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/23.jpg)
A U T O M AT E D -T E S T I N G . I N F O
А если серьезно
• BDD незаменим в проектах, где необходима тесная связь бизнеса с командой разработки
• BDD имеет свою четкую область применения
• внедрение BDD это комплексный процесс
• успешная команда работает на качество вместе
23
![Page 24: Bdd with java_using_concordion_and_selenium_ui_tests](https://reader033.vdocuments.mx/reader033/viewer/2022061121/5468c2a9af7959a75e8b5649/html5/thumbnails/24.jpg)
A U T O M AT E D -T E S T I N G . I N F O
Вопросы
@twincengray
http://mcgray.com.ua24