Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Behat - retour d'expérience
Search
Marek Kalnik
November 22, 2013
Programming
450
1
Share
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
88
Le management LEAN
marekkalnik
0
78
Versioning mobile apps and apis
marekkalnik
0
97
Comment Ionic vous aide
marekkalnik
0
150
Pourquoi choisir Ionic ?
marekkalnik
0
280
Cordova vs. Steroids
marekkalnik
0
150
Arrêtons de parler de code de qualité, ce qu'il faut c'est du code agile !
marekkalnik
2
660
Code Agile - comment redéfinir la qualité
marekkalnik
2
190
Write your jQuery in console
marekkalnik
0
190
Other Decks in Programming
See All in Programming
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
12k
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
310
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
250
OSもどきOS
arkw
0
450
The NotImplementedError Problem in Ruby
koic
1
600
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
540
Oxlintのカスタムルールの現況
syumai
5
1k
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.3k
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
2.4k
JavaDoc 再入門
nagise
0
280
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
140
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
320
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
220
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
440
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
190
sira's awesome portfolio website redesign presentation
elsirapls
0
270
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
210
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
530
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
200
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Test your architecture with Archunit
thirion
1
2.3k
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