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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Marek Kalnik
November 22, 2013
Programming
480
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
100
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
200
Other Decks in Programming
See All in Programming
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
330
Next.js: The final boss of Web Performance
guaca
0
390
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
320
ChromeでローカルLLM
ryu1013
0
200
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
310
GraphQL の onError と Nullability のこれから
quramy
0
210
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
210
Crash Auto Pipelines
veronikapj
1
400
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
110
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
3
1.5k
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
330
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
410
Featured
See All Featured
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
600
Site-Speed That Sticks
csswizardry
13
1.6k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Curse of the Amulet
leimatthew05
3
17k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Fireside Chat
paigeccino
43
4.1k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
330
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
The SEO Collaboration Effect
kristinabergwall1
1
620
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
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