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
Behat - retour d'expérience
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Marek Kalnik
November 22, 2013
Programming
470
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Behat - retour d'expérience
Le talk sur Behat sur un projet de 15 devs, que j'ai donnée au ForumPHP 2013.
Marek Kalnik
November 22, 2013
More Decks by Marek Kalnik
See All by Marek Kalnik
Ma liste subjective des 10 développeurs à connaitre
marekkalnik
0
99
Le management LEAN
marekkalnik
0
87
Versioning mobile apps and apis
marekkalnik
0
120
Comment Ionic vous aide
marekkalnik
0
160
Pourquoi choisir Ionic ?
marekkalnik
0
290
Cordova vs. Steroids
marekkalnik
0
160
Arrêtons de parler de code de qualité, ce qu'il faut c'est du code agile !
marekkalnik
2
690
Code Agile - comment redéfinir la qualité
marekkalnik
2
210
Write your jQuery in console
marekkalnik
0
190
Other Decks in Programming
See All in Programming
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
750
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
510
AIに “答え“を書かせるのを やめてみた
___akari11
0
120
APNsからLive Activityを開始する話
yumnumm
0
170
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
ActionController meets Protocol Buffers
sorah
0
550
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
430
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
320
AmebaブログはKMPから卒業します
kmars0605
0
200
Atomic Design, Enforced: Scaling Mobile Design Systems (next.app devCon / droidCon Berlin 2026)
steliosf
PRO
0
170
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
790
Next.js: The final boss of Web Performance
guaca
0
270
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
10k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
780
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
67k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
30 Presentation Tips
portentint
PRO
1
430
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
Claude Code のすすめ
schroneko
67
230k
Design in an AI World
tapps
1
350
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
570
YesSQL, Process and Tooling at Scale
rocio
174
15k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
Transcript
Forum PHP Paris 2013, 22 Nov. 2013 retour d'expérience Behat
Hello !
Je m’appelle Marek
Viser le déploiement continu Behat : écrire les tests en
«humain» Réussir la mise en place de Behat Je vais vous parler de...
Dans l'économie d'aujourd'hui les rapides mangent les lents
le Time To Market est souvent ralenti par la phase
de tests
Comment font les grands ?
30 déploiements par jour
7.000 tests
2 déploiements par jour
une suite de tests fonctionnels lancée à chaque fois
We need to release new features faster and with good
quality Alan Faulkner, Test Engineer
« Right now, with the role I am in, I
spend less than 5% of my time doing manual testing » Alan Faulkner, Test Engineer
None
Un processus d'intégration continue permet de limiter les risques
être comme Google, Facebook, Etsy coder vite déployer vite déployer
sans risque
Viser le déploiement continu Behat : écrire les tests en
«humain» Réussir la mise en place de Behat
pourquoi Behat
parce que c'est cool !
comment maintenir 7000 tests ? comment impliquer le métier dans
les tests ? comment relier le business et les tests ?
Feature: Services Scenario: #10322 : an anonymous user can't see
the author's last name Given I am an anonymous user with my city registered When I go to the "service list" page Then I don't see the author's last name framework de tests en « langage naturel »
website feature framework de tests multi-niveaux context
framework de tests de grande taille PHPUnit Test d'intégration PHPUnit
Behat PHPSpec taille expressivité
Under the hood Given I am an anonymous user with
my city registered regexp match une fonction contexte driver navigateur web
Viser le déploiement continu Behat : écrire les tests en
«humain» Réussir la mise en place de Behat
Paralléliser dès le début 9 minutes 15 juil. 15 nov.
23 minutes 6 minutes 8 minutes seuil d'acceptabilité :-) :-( Règle 1 refactoring
factorisation de tests pour accélérer le build n'est pas efficace
il faut paralléliser pour obtenir des meilleurs résultats Paralléliser dès le début Règle 1
Environnement #serveurs web #workers #machines #cpu Penser infrastructure 2 Règle
Selenium flexible lourd Driver PhantomJS léger rapide cookies Goutte Penser
infrastructure 2 Règle
$ bin/behat -p prod # behat.yml prod: filters: tags: "@prod"
extensions: Behat\MinkExtension\Extension: base_url: http://www.example.org/ Faire une suite de tests dédie à la production 3 Règle
.advert-result .item-advert .body-article h2 a !? Stabiliser les sélecteurs CSS
4 Règle
l'équipe de tests doit se mettre d'accord avec l'équipe intégration
utiliser les ids pour Behat et les classes pour le CSS Stabiliser les sélecteurs CSS 4 Règle
Intégrer un chat dans l'équipe 0 Règle
Spinner... 5 Règle $this->getMainContext()->spin( function ($context) use ($listId) { $context->getMainContext()
->assertSession() ->elementExists('css', '#'.$listId); return true; } );
public function spin($closure, $tries = 15) { for ($i =
0; $i < $tries; $i++) { try { if ($result = $closure($this)) { return true; } } catch (\Exception $e) { // do nothing to continue the loop } usleep(300000); } throw new \Exception( $this->formatBacktrace(debug_backtrace()) ); } Spinner... 5 Règle
Respecter la pyramide de tests 6 Règle big medium small
pas celle-ci Respecter la pyramide de tests 6 Règle big
medium small
5 10 15 20 25 4 8 12 16 20
3 6 9 12 15 2 4 5 8 10 1 2 3 4 6 Impact business Probabilité de régression medium small big Ne pas tout tester 6 Règle ,5
Merci !
et on recrute ;-)
[email protected]
@marekkalnik @theodo