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
84
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
650
Code Agile - comment redéfinir la qualité
marekkalnik
2
190
Write your jQuery in console
marekkalnik
0
180
Other Decks in Programming
See All in Programming
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
380
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
120
実践CRDT
tamadeveloper
0
610
煩雑なSkills管理をSoC(関心の分離)により解決する――関心を分離し、プロンプトを部品として育てるためのOSSを作った話 / Solving Complex Skills Management Through SoC (Separation of Concerns)
nrslib
4
1.1k
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.3k
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.3k
書き換えて学ぶTemporal #fukts
pirosikick
1
310
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
120
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
310
GitHubCopilotCLIをはじめよう.pdf
htkym
0
300
JOAI2026 1st solution - heron0519 -
heron0519
0
160
CDK Deployのための ”反響定位”
watany
5
910
Featured
See All Featured
Tell your own story through comics
letsgokoyo
1
910
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
380
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
The SEO Collaboration Effect
kristinabergwall1
1
430
Code Review Best Practice
trishagee
74
20k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
680
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
54k
Side Projects
sachag
455
43k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
530
Making the Leap to Tech Lead
cromwellryan
135
9.8k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
200
Writing Fast Ruby
sferik
630
63k
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