SlideShare une entreprise Scribd logo
1  sur  19
Ch♥uch♥utez votre
 code JavaScript
     Romain Linsolas

      @romaintaz




                       1
Abstract
La recette du “JavaScript aux petits oignons” :

2.Écrire des tests pour son JavaScript
3.Analyser son code pour enlever les bugs
4.Bien couvrir
5.Laisser mijoter dans un serveur d’intégration continue

                                                           2
Romain Linsolas

•Développeur Java / Web depuis 2002
•Éleveur d'usines logicielles
•@ Société Générale

       http://linsolas.free.fr/wordpress

       @romaintaz

                                           3
1. Testons !



               4
 Notre cobaye…

•60+ méthodes utilitaires
•Support pour la programmation fonctionnelle

      http://documentcloud.github.com/underscore/
      @DocumentCloud



                                                    5
 Notre (1ère) librairie de tests JavaScript

•BDD (Behavior Driven Development)
•Nombreux supports : Java (Maven), .Net, Ruby, Node.js, JsTestDriver, etc.


        http://pivotal.github.com/jasmine/
        @JasmineBDD


                                                                             6
7
2. Analysons !



                 8
 Notre outil d'analyse du code

•Plateforme de suivi de la qualité du code
•Mesure de la dette technique
•Multi-langages : Java, C#, PHP, JS, Python, etc.

         http://www.sonarsource.com/
         @SonarSource


                                                    9
10
3. Couvrons !



                11
js-test-driver
 Notre 2ème framework de test JavaScript

•Syntaxe proche de JUnit (assertXXX)
•Propose un plugin de mesure de couverture de code


       http://code.google.com/p/js-test-driver/




                                                     12
Exemple de code js-test-driver
GreeterTest = TestCase("GreeterTest");




GreeterTest.prototype.testGreet = function() {

     var greeter = new myapp.Greeter();

     assertEquals("Hello World!", greeter.greet("World"));

};




                                                             13
14
3. Intégrons !



                 15
 Notre serveur d’intégration continue

•Très facile d'utilisation
•Développement & communauté très actifs
•400+ plugins

      http://jenkins-ci.org/

      @JenkinsCI

                                          16
17
D’autres choix…
•   QUnit : http://docs.jquery.com/QUnit

•   YUI Test : http://yuilibrary.com/yui/docs/test/

•   Mocha : http://visionmedia.github.com/mocha/

•   RhinoUnit : http://code.google.com/p/rhinounit/

•   JsUnit : http://www.jsunit.net/

•   TestSwarm : https://github.com/jquery/testswarm/


                                                       18
Questions…




             19

Contenu connexe

En vedette

En vedette (20)

C.2.1. couleur des objets(1)
C.2.1. couleur des objets(1)C.2.1. couleur des objets(1)
C.2.1. couleur des objets(1)
 
Una llamada al amor a. de mello
Una llamada al amor  a. de mello Una llamada al amor  a. de mello
Una llamada al amor a. de mello
 
Max y min
Max y minMax y min
Max y min
 
3673 (preventivas y proteccion)
3673 (preventivas y proteccion) 3673 (preventivas y proteccion)
3673 (preventivas y proteccion)
 
Las Regiones de México
Las Regiones de MéxicoLas Regiones de México
Las Regiones de México
 
Guide Speedfan
Guide SpeedfanGuide Speedfan
Guide Speedfan
 
Alimentation20
Alimentation20Alimentation20
Alimentation20
 
Alpiste una panacea
Alpiste una panaceaAlpiste una panacea
Alpiste una panacea
 
Publicidad en internet
Publicidad en internetPublicidad en internet
Publicidad en internet
 
Case snow
Case snowCase snow
Case snow
 
Josemanuel
JosemanuelJosemanuel
Josemanuel
 
Pictures
PicturesPictures
Pictures
 
Optimization Web 2.0_2009
Optimization Web 2.0_2009Optimization Web 2.0_2009
Optimization Web 2.0_2009
 
Tamara 1
Tamara 1Tamara 1
Tamara 1
 
Uriarte 2419 - Brochure
Uriarte 2419 - BrochureUriarte 2419 - Brochure
Uriarte 2419 - Brochure
 
Josemanuel
JosemanuelJosemanuel
Josemanuel
 
Présentation institutionnelle du Cluster
Présentation institutionnelle du ClusterPrésentation institutionnelle du Cluster
Présentation institutionnelle du Cluster
 
Sustentación proyecto 4
Sustentación proyecto 4Sustentación proyecto 4
Sustentación proyecto 4
 
Reseller Hotelevolution.com.ar
Reseller Hotelevolution.com.arReseller Hotelevolution.com.ar
Reseller Hotelevolution.com.ar
 
Ubuntu
UbuntuUbuntu
Ubuntu
 

Similaire à Devoxx java script-1280-720

Solutions Linux 2014 – Alter Way : Industrialisation des développements en Ja...
Solutions Linux 2014 – Alter Way : Industrialisation des développements en Ja...Solutions Linux 2014 – Alter Way : Industrialisation des développements en Ja...
Solutions Linux 2014 – Alter Way : Industrialisation des développements en Ja...ALTER WAY
 
20080923 04 - Selenium web application testing system
20080923 04 - Selenium web application testing system20080923 04 - Selenium web application testing system
20080923 04 - Selenium web application testing systemLeClubQualiteLogicielle
 
Scub Foundation, usine logicielle Java libre
Scub Foundation, usine logicielle Java libreScub Foundation, usine logicielle Java libre
Scub Foundation, usine logicielle Java libreStéphane Traumat
 
Être productif avec JHipster - Devoxx France 2017
Être productif avec JHipster - Devoxx France 2017Être productif avec JHipster - Devoxx France 2017
Être productif avec JHipster - Devoxx France 2017Julien Dubois
 
Javascript & tools
Javascript & toolsJavascript & tools
Javascript & toolsSlim Soussi
 
Tests automatisés java script
Tests automatisés java scriptTests automatisés java script
Tests automatisés java scriptPascal Laurin
 
Paris Web 2015 - Atelier desendettement javascript
Paris Web 2015 - Atelier desendettement javascriptParis Web 2015 - Atelier desendettement javascript
Paris Web 2015 - Atelier desendettement javascriptMichael Akbaraly
 
Node, Grunt et leurs copains qui font de l’accessibilité tout seuls !
Node, Grunt et leurs copains qui font de l’accessibilité tout seuls !Node, Grunt et leurs copains qui font de l’accessibilité tout seuls !
Node, Grunt et leurs copains qui font de l’accessibilité tout seuls !vincent aniort
 
Automatisation des tests - objectifs et concepts - partie 2
Automatisation des tests  - objectifs et concepts - partie 2Automatisation des tests  - objectifs et concepts - partie 2
Automatisation des tests - objectifs et concepts - partie 2Christophe Rochefolle
 
Javascript as a first programming language : votre IC prête pour la révolution !
Javascript as a first programming language : votre IC prête pour la révolution !Javascript as a first programming language : votre IC prête pour la révolution !
Javascript as a first programming language : votre IC prête pour la révolution !VISEO
 
Octo RefCard test front-end
Octo RefCard test front-endOcto RefCard test front-end
Octo RefCard test front-endClément Dubois
 
Octo Technology - Refcard Tests Web front-end
Octo Technology - Refcard Tests Web front-endOcto Technology - Refcard Tests Web front-end
Octo Technology - Refcard Tests Web front-endFrançois Petitit
 
Gwt oxiane-novae-lr
Gwt oxiane-novae-lrGwt oxiane-novae-lr
Gwt oxiane-novae-lroxmed
 
Présentation Rex GWT 2.0
Présentation Rex GWT 2.0Présentation Rex GWT 2.0
Présentation Rex GWT 2.0Ippon
 
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et Mobile
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et MobileNouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et Mobile
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et MobileIppon
 
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et mobilité
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et mobilitéNouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et mobilité
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et mobilitéJulien Dubois
 
Paris Web 2015 - Atelier désendettement Javascript legacy
Paris Web 2015 - Atelier désendettement Javascript legacyParis Web 2015 - Atelier désendettement Javascript legacy
Paris Web 2015 - Atelier désendettement Javascript legacyFrançois Petitit
 

Similaire à Devoxx java script-1280-720 (20)

Solutions Linux 2014 – Alter Way : Industrialisation des développements en Ja...
Solutions Linux 2014 – Alter Way : Industrialisation des développements en Ja...Solutions Linux 2014 – Alter Way : Industrialisation des développements en Ja...
Solutions Linux 2014 – Alter Way : Industrialisation des développements en Ja...
 
Usine Logicielle 2013
Usine Logicielle 2013Usine Logicielle 2013
Usine Logicielle 2013
 
Cerberus Testing
Cerberus TestingCerberus Testing
Cerberus Testing
 
20080923 04 - Selenium web application testing system
20080923 04 - Selenium web application testing system20080923 04 - Selenium web application testing system
20080923 04 - Selenium web application testing system
 
Scub Foundation, usine logicielle Java libre
Scub Foundation, usine logicielle Java libreScub Foundation, usine logicielle Java libre
Scub Foundation, usine logicielle Java libre
 
Être productif avec JHipster - Devoxx France 2017
Être productif avec JHipster - Devoxx France 2017Être productif avec JHipster - Devoxx France 2017
Être productif avec JHipster - Devoxx France 2017
 
Javascript & tools
Javascript & toolsJavascript & tools
Javascript & tools
 
Tests automatisés java script
Tests automatisés java scriptTests automatisés java script
Tests automatisés java script
 
Paris Web 2015 - Atelier desendettement javascript
Paris Web 2015 - Atelier desendettement javascriptParis Web 2015 - Atelier desendettement javascript
Paris Web 2015 - Atelier desendettement javascript
 
Node, Grunt et leurs copains qui font de l’accessibilité tout seuls !
Node, Grunt et leurs copains qui font de l’accessibilité tout seuls !Node, Grunt et leurs copains qui font de l’accessibilité tout seuls !
Node, Grunt et leurs copains qui font de l’accessibilité tout seuls !
 
Automatisation des tests - objectifs et concepts - partie 2
Automatisation des tests  - objectifs et concepts - partie 2Automatisation des tests  - objectifs et concepts - partie 2
Automatisation des tests - objectifs et concepts - partie 2
 
Javascript as a first programming language : votre IC prête pour la révolution !
Javascript as a first programming language : votre IC prête pour la révolution !Javascript as a first programming language : votre IC prête pour la révolution !
Javascript as a first programming language : votre IC prête pour la révolution !
 
Octo RefCard test front-end
Octo RefCard test front-endOcto RefCard test front-end
Octo RefCard test front-end
 
Octo Technology - Refcard Tests Web front-end
Octo Technology - Refcard Tests Web front-endOcto Technology - Refcard Tests Web front-end
Octo Technology - Refcard Tests Web front-end
 
Maven
MavenMaven
Maven
 
Gwt oxiane-novae-lr
Gwt oxiane-novae-lrGwt oxiane-novae-lr
Gwt oxiane-novae-lr
 
Présentation Rex GWT 2.0
Présentation Rex GWT 2.0Présentation Rex GWT 2.0
Présentation Rex GWT 2.0
 
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et Mobile
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et MobileNouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et Mobile
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et Mobile
 
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et mobilité
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et mobilitéNouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et mobilité
Nouveau look pour une nouvelle vie : HTML5, Spring, NoSQL et mobilité
 
Paris Web 2015 - Atelier désendettement Javascript legacy
Paris Web 2015 - Atelier désendettement Javascript legacyParis Web 2015 - Atelier désendettement Javascript legacy
Paris Web 2015 - Atelier désendettement Javascript legacy
 

Plus de Romain Linsolas

Devoxx France 2015 - Développement web en 2015
Devoxx France 2015 - Développement web en 2015Devoxx France 2015 - Développement web en 2015
Devoxx France 2015 - Développement web en 2015Romain Linsolas
 
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2Romain Linsolas
 
Devoxx 2014 - JavaScript tooling - Don't be naked in front of JavaScript
Devoxx 2014 - JavaScript tooling - Don't be naked in front of JavaScriptDevoxx 2014 - JavaScript tooling - Don't be naked in front of JavaScript
Devoxx 2014 - JavaScript tooling - Don't be naked in front of JavaScriptRomain Linsolas
 
Devoxx france 2014 - Création d'un web component avec Google Polymer
Devoxx france 2014 - Création d'un web component avec Google PolymerDevoxx france 2014 - Création d'un web component avec Google Polymer
Devoxx france 2014 - Création d'un web component avec Google PolymerRomain Linsolas
 
Devoxx 2013 JavaScript Software Factory
Devoxx 2013 JavaScript Software FactoryDevoxx 2013 JavaScript Software Factory
Devoxx 2013 JavaScript Software FactoryRomain Linsolas
 
Softshake 2013 - Du JavaScript propre ? Challenge Accepted!
Softshake 2013 - Du JavaScript propre ? Challenge Accepted!Softshake 2013 - Du JavaScript propre ? Challenge Accepted!
Softshake 2013 - Du JavaScript propre ? Challenge Accepted!Romain Linsolas
 
JavaScript Devoxx France 2013
JavaScript Devoxx France 2013JavaScript Devoxx France 2013
JavaScript Devoxx France 2013Romain Linsolas
 
Devoxx 2012 hibernate envers
Devoxx 2012   hibernate enversDevoxx 2012   hibernate envers
Devoxx 2012 hibernate enversRomain Linsolas
 

Plus de Romain Linsolas (9)

Devoxx France 2015 - Développement web en 2015
Devoxx France 2015 - Développement web en 2015Devoxx France 2015 - Développement web en 2015
Devoxx France 2015 - Développement web en 2015
 
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2
 
Devoxx 2014 - JavaScript tooling - Don't be naked in front of JavaScript
Devoxx 2014 - JavaScript tooling - Don't be naked in front of JavaScriptDevoxx 2014 - JavaScript tooling - Don't be naked in front of JavaScript
Devoxx 2014 - JavaScript tooling - Don't be naked in front of JavaScript
 
Devoxx france 2014 - Création d'un web component avec Google Polymer
Devoxx france 2014 - Création d'un web component avec Google PolymerDevoxx france 2014 - Création d'un web component avec Google Polymer
Devoxx france 2014 - Création d'un web component avec Google Polymer
 
Devoxx 2013 JavaScript Software Factory
Devoxx 2013 JavaScript Software FactoryDevoxx 2013 JavaScript Software Factory
Devoxx 2013 JavaScript Software Factory
 
Softshake 2013 - Du JavaScript propre ? Challenge Accepted!
Softshake 2013 - Du JavaScript propre ? Challenge Accepted!Softshake 2013 - Du JavaScript propre ? Challenge Accepted!
Softshake 2013 - Du JavaScript propre ? Challenge Accepted!
 
JavaScript Devoxx France 2013
JavaScript Devoxx France 2013JavaScript Devoxx France 2013
JavaScript Devoxx France 2013
 
Devoxx 2012 hibernate envers
Devoxx 2012   hibernate enversDevoxx 2012   hibernate envers
Devoxx 2012 hibernate envers
 
Devoxx test ng
Devoxx test ngDevoxx test ng
Devoxx test ng
 

Devoxx java script-1280-720

  • 1. Ch♥uch♥utez votre code JavaScript Romain Linsolas @romaintaz 1
  • 2. Abstract La recette du “JavaScript aux petits oignons” : 2.Écrire des tests pour son JavaScript 3.Analyser son code pour enlever les bugs 4.Bien couvrir 5.Laisser mijoter dans un serveur d’intégration continue 2
  • 3. Romain Linsolas •Développeur Java / Web depuis 2002 •Éleveur d'usines logicielles •@ Société Générale http://linsolas.free.fr/wordpress @romaintaz 3
  • 5.  Notre cobaye… •60+ méthodes utilitaires •Support pour la programmation fonctionnelle http://documentcloud.github.com/underscore/ @DocumentCloud 5
  • 6.  Notre (1ère) librairie de tests JavaScript •BDD (Behavior Driven Development) •Nombreux supports : Java (Maven), .Net, Ruby, Node.js, JsTestDriver, etc. http://pivotal.github.com/jasmine/ @JasmineBDD 6
  • 7. 7
  • 9.  Notre outil d'analyse du code •Plateforme de suivi de la qualité du code •Mesure de la dette technique •Multi-langages : Java, C#, PHP, JS, Python, etc. http://www.sonarsource.com/ @SonarSource 9
  • 10. 10
  • 12. js-test-driver  Notre 2ème framework de test JavaScript •Syntaxe proche de JUnit (assertXXX) •Propose un plugin de mesure de couverture de code http://code.google.com/p/js-test-driver/ 12
  • 13. Exemple de code js-test-driver GreeterTest = TestCase("GreeterTest"); GreeterTest.prototype.testGreet = function() { var greeter = new myapp.Greeter(); assertEquals("Hello World!", greeter.greet("World")); }; 13
  • 14. 14
  • 16.  Notre serveur d’intégration continue •Très facile d'utilisation •Développement & communauté très actifs •400+ plugins http://jenkins-ci.org/ @JenkinsCI 16
  • 17. 17
  • 18. D’autres choix… • QUnit : http://docs.jquery.com/QUnit • YUI Test : http://yuilibrary.com/yui/docs/test/ • Mocha : http://visionmedia.github.com/mocha/ • RhinoUnit : http://code.google.com/p/rhinounit/ • JsUnit : http://www.jsunit.net/ • TestSwarm : https://github.com/jquery/testswarm/ 18