Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Beyond Testing
Search
Michael Bodnarchuk
September 15, 2015
Programming
72
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Beyond Testing
Things you should know maintaining stable testing suite
Michael Bodnarchuk
September 15, 2015
More Decks by Michael Bodnarchuk
See All by Michael Bodnarchuk
Codeception 3.0: Long Bloody Story
davert
0
130
DESIGN DECISIONS FOR PERFECT JS E2E TESTING FRAMEWORK
davert
0
750
Bugira
davert
0
80
CodeceptJS Workshop
davert
1
160
Designing Tests Architecture That Does Not Suck
davert
1
310
Beyond Testing
davert
1
480
Beyond Testing for DutchPHP
davert
0
330
Особенности тестирования PHP проектов
davert
0
94
BeTesting
davert
1
140
Other Decks in Programming
See All in Programming
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
750
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
160
AWSに止められる覚悟してますか?
morizo_1984
2
490
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
32
14k
The Rails Doctrine Decade
koic
2
450
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
520
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
250
mrbgem 三角測量 開発
ogom
0
170
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
330
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Rails World 2026, Austin, Texas
marcoroth
0
140
Featured
See All Featured
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.8k
Abbi's Birthday
coloredviolet
4
10k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
600
YesSQL, Process and Tooling at Scale
rocio
174
15k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Bash Introduction
62gerente
615
220k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
270
Darren the Foodie - Storyboard
khoart
PRO
4
4k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
270
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
250
Transcript
Michael Bodnarchuk BEYOND TESTING
WHO AM I • Michael Bodnarchuk @davert • Web-developer from
Kyiv, Ukraine • Lead developer of Codeception testing framework and other OS tools like: Robo, AspectMock, etc
WHAT IS IT ALL ABOUT • What to do when
PHPUnit is installed and first tests are done • What you should know writing a test • Choosing the best tool for testing • Creating test environment
KINDS OF TESTS • Acceptance • Functional • Integration •
Unit
BEST PRACTICES SOME KIND OF
IDEAL TEST ▪Condition (Given) ▪Action (When) ▪Assertion (Then)
HOW TO WRITE TEST • Separate configuration from test •
Do not use hierarchy for testcases (use traits when needed) • Separate test code from support code • Make test simple and verbose
DON'T DO IT THIS WAY move to configuration use traits
IMPLEMENT YOUR OWN ASSERTIONS custom assertions make code more readable
MAKE IT SIMPLER!
WHAT IS HARD TO TEST • Asynchronous stuff • Remote
Services • Real Data
TESTS CRITERIA • Execution Stability ↓ • Stability to Changes
↑ • Speed ↓ • Coverage ↑ • Preciseness ↓ • Readability ↕ Unit => Integration => Functional => Acceptance
PRICE OF A FAULT REGRESSION TESTS
DATA MANAGEMENT HOW TO TEST DB INTERACTION
MANAGING TEST DATA WITH • Fixtures (nelmio/alice) • Dumps •
Factories (thephpleague/factory-muffin)
FACTORY_MUFFIN IN REAL LIFE
DATA CLEANUP STRATEGIES • Manually create/delete data between tests •
Recreate the database between tests • Using transactions – reverting changes with rollback
TOOLS FOR TESTING YOU SHOULD PROBABLY KNOW
PHPUNIT • Standard de-facto • Monolithic framework • Two mocking
engines included (why not 3?) • JUnit, HTML, reports... and codecoverage • And other 100500 sometimes used features
PHPSPEC • TDD framework • Classes are generated from tests
• Dependencies are described through mocking • Does not replace PHPUnit • For development, not for testing
BEHAT • BDD-framework • Ubiquitous language (Gherkin) • Acceptance testing
via Mink (Selenium, Goutte, etc)
CODECEPTION • BDD-style testing framework • Scenario DSL for describing
tests • Over 20 modules to cover the most of possible cases • Testing via Selenium, PhpBrowser, frameworks...
TESTING EMAILS: MAILCATCHER
MAILCATCHER • Ruby application with web interface • SMTP-mock •
Provides REST API for sent emails • API can be used in tests • Alternative in Go - MailHog
TESTING WEB APPLICATIONS • Selenium • PhantomJS • Browser emulation
via HTTP client
USING SELENIUM ON CI SERVER • Selenium Server • Xvfb
– Virtual Framebuffer • Firefox or Chromium
INSTEAD OF CONFIGURING IT MANUALLY docker run -d -p 4444:4444
-e APP_HOST=myapp davert/selenium-env
WHAT IS DOCKER? • Docker is an open platform distributed
apps • Runs and manages isolated Linux containers • Provides GitHub-like infrastructure
PARALLEL TESTING • Tests separation • Jobs isolation
HOW TO PARALLEL TESTS WITH DOCKER • Build container(s) for
test environment • Run container(s) with Docker Compose • Use Jenkins Matrix to run concurrent builds
docker run -i -t -v $WORKSPACE:/project test_container ./runtests.sh $SUITE
CONCLUSIONS • Testing is not just about unit tests •
Tests are code: make them easy to read and maintain • Testing is about tools, environment and infrastructure as well
QUESTIONS? • My name is Michael Bodnarchuk • Twitter: @davert
• GitHub: DavertMik • ….and don't forget to try http://codeception.com