Archive for mai, 2008

Retour sur le bar camp Rails du 17 Mai , à la Cantine (Paris)

Mercredi, mai 21st, 2008

Intéressé depuis quelque temps par le monde de Ruby et Ruby on Rails, j’ai décidé de m’inscrire au BarCamp Rails ce Samedi 17 Mai à Paris
A partir de 10h, les organisateurs ont mettent en place un tableau où les pesonnes désirant exposer leur travail ou découverte s’inscrivent.
(il y a 5 espaces disponibles à La Cantine, apparemment il faisait chaud à l’étage!; et les créneaux horaires durent de 1 à 2 heures)
Ensuite, après avoir présenté brièvement Silicon Sentier et d’autres sponsors, les organisateurs ont passé le micro à chacun des participants (une centaine quand même !) afin qu’ils se présentent : prénom + tags (j’ai choisi les tags développeur Java J2EE, d’autres tags comme “fille” ou “windows” étaient plus originaux !)
Les personnes s’étant inscrites sur le tableau démarrèrent dès 10h30.
Il y en avait pour tout le monde : débutant comme expérimenté ! (présentation ruby on rails, ruby en entreprise, facebook on rails !, etc…)
Voici mon choix pour la journée :

10:30 : présentation de l’intégration google maps dans rails avec geokit; par Sébastien Gruhier

Apres une présentation du projet, nous avons procédé à la génération d’une api key chez google maps, afin de pouvoir utiliser l’API (je crois que l’on a droit à 10000 requêtes par jour, à vérifier).
Nous avons ensuite créé un site rails, en ayant pris soin auparavant d’installer les gems de geokit et d’un module d’authentification.
Ensuite nous avons testé l’API par une console Rails, et enfin nous avons codé nos premiers fcihiers Rails avec des cartes.
L’API geokit permet de faire des travaux de geolocalisation (par IP) et de récupération de coordonnées, mais elle ne permet pas de générer des cartes gogole maps (en fait lors de la session nousa vons du coder du javascript pour cécupérer des cartes…)
Pour ceux qui craignent le Javascript, passez votre chemin donc, et dirigez vous plutôt vers un wrapper (comme YM4R sur rubyforge wrapper javascript)

14:30 : présentation jruby par Nicolas Mérouze

nous avons installé jruby bin (.zip ou tar gz).
A l’attaque, en lançant le script bat jruby.bat (ou jruby.sh)on peut d’ores et déjà installer des gems avec
jruby -S gem install un_gem_ruby
Plus généralement,
jruby -S "commande ruby"
Nicolas nous a montré beaucoup d’exemples sur Ruby qui utilise Java (normal il travaille sur un projet qui utilise des librairies java), peu dans l’inverse (dommage); sur le web, j’ai pu remarquer cet article qui permet de découvrir Jruby pour intégrer du Ruby dans Java

16:30 présentation faille sécurité ruby/ecommerce par Webpulser

Pendant cette session les participants ont pu échanger sur leurx expériences Ruby, ensuite l’équipe technique de Webpulser ont fait un petit tour des failles de sécurité en Ruby :
*Injection SQL : en donnant un ‘ à la fin d’une requete GET ,des attaquants pourraient terminer une clause SQL, ==> on utilise le ? à la printf de C pour échapper les caracteres spéciaux
*XSS en donnant du javascript dans l’url; on évite çà avec <%h= %> qui échappe le html
etc…

Sans parler de l’organisation qui était vraiment pro, un accueil chaleureux, bref, ce BarCampRails parisien vallait vraiment le détour !

XP Day France 2008 : Day 2

Mardi, mai 6th, 2008

I began this second day with a presentation of Rspec, Behaviour Driven Development and Selenium Grid, by Jean Michel Garnier. He told us about the history of software testing, Test Driven Development and Behaviour Driven Development.
So what is TDD against BDD ? Quite the something, from a technical point of view; but in fact it diminishes the distance between the client and the software engineer.
BDD is about writing sentences to describe tests.
A story (from Dan North point of view) (As … I want … To …)is divided into scenarios ( Given … When … Then …).
The thing is, the people who write specs “could” write Rspec classes, but the syntax is still a bit technical …
Then Jean Michel told us about Autotest, a framework to automatically run tests when you modify a source code; Rcov a software to measure code coverage of your tests (gem install rcov ; rake spec:rcov and finally Heckle, a framework that modifies your source code to … check that your tests are useful !

Next, I’ve seen a presentation of the origins of Agile methods; introducing the Agile Manifesto, agile principles,agile methods like Scrum (3 actors : product owner, scrum master and the team; product backlog to prioritize stories, sprint backlog to split stories in different tasks, and the sprint; and eXtreme Programmingwith its values simplicity, respect, courage, etc…)
The orator also remind the audience about older, predictive methods like cascade and V…

I’ve also attended a session proposed by Guillaume Carré, from Xebia presenting unit tests and Easymocks, where the audience was able to distinguish stubs from mocks, mocks being more faithful to the real behaviour of the class.
Easymock uses interfaces to create mocks, so you get all the mock coding job done !(but you have to describe the behaviour of your mock object).
The orator also talked about Mockito, from ThoughtWorks, which gets the description of the mock object according to the method called on this mock; you still describe the behaviour of the mock, but this time you verify the value returned at the end of your test, not before (which makes test code more readable than Easymock).

To finish the day, Jean François Helie, from Octo coded in front of us a blog engine, based on hibernate, maven, Spring, and Spring MVC but … using a test driven approach.
Jean François used Java 5 annotations to describe JUnits tests and once the tests were done, coded the application classes.
He first wrote code for the DAO classes, using Hibernate entity beans annotations (it looks so good persistence without XML).
Then he decided to lighten the test class code with Spring 2.5, using annotations to autowire bean dependencies (yeah annotations look good)
Once the model was written, he continued to the service, writing the test first, of course, but also using mock objects to be able to distinguish errors from the model to errors from the service class; for that he used Easymock linked with Junitils4 with annotations.
Finally, he wrote the controller, always writing the test class first, using Spring MVC framework (specifying the url mapping in the controller class)
The demonstration was quite impressive, I really enjoyed that one! (it reminded me that Java is still on !)

My colleagues from Valtech were not on holidays this second day, they presented Test Driven Requirements, using Fitnesse; continuous integration with Hudson (getting very popular now) and contracting Agile projects.

These XP day(s) were a great experience, I really hope I’ll be there next year !

XP Day France 2008 : Day 1

Lundi, mai 5th, 2008

This Monday 5 and Tuesday 6 of May 2008, I’ve been to my first XP Day(s, it actually lasts 2 days) in Paris, an event organized by the association XP France; here are my impressions…

At 8:30, slowly, every guest gets his ID tag, and a breakfast is offered, we’re discovering the schedule of the days to come: the event is divided into 4 rooms, and each day is divided into 4 1 hour and a half sessions (but a session can last all day long or also half a day); all sessions are in French language.
Many subjects are present, the advantage is that you’re sure to find something interesting; on the other hand, if 2 appetizing meetings take place at the same time, you have to choose.
Then, at 9 o’clock, we’re about 150 people (I think) and we are asked to go downstairs, to attend the introduction meeting where the organizers of the event introduce themselves (and also ask people to, if they can, contribute for the next XP days) and the following XP meetings (Agile Tour, round France, and Agile Open, where attendees will be able to turn into speakers); finally, the speakers of the day introduce what they will be talking about during the sessions they will present.
I chose to be present at the XP laboratory, presented by 2 folks working at Pyxis (a Quebec based company responsible, among others, of Green Pepper).
The session last all day long (but you’re free to leave or get back when you want) and invites people to work on a refactoring of the Miles card game (“1000 Bornes” in French), called XtremeMiles.
People immediately configure their laptop to get up and coding…
The thing is, the speakers turn themselves into the “Client” (or the product owner, because XtremeMiles is a Scrum project) and the “Scrum Master”, and they ask us, the developers, to adopt a Test Driven Development procedure (we write the tests, with JUnits, before we code).
But the main aspect developed is that we’re organized in a Scrum project (it was actually the first time I experienced this kind of Agile organization).
So to sum up the procedure :
• First, we have a meeting with the Scrum master and the product Owner to ask questions (5mn), to agree on engagement (5mn for the team to choose the cards proposed by the product owner, which contain stories, tracing functionalities) and for the sprint backlog (5mn);
• Then, the sprint lasts 3 days for each iteration (a day in this game lasts 20 minutes, divided into 2 minutes of stand up meeting, where developers tell the Scrum Master what they’ve done, the problems they’ve encountered and what they’re going to achieve; and 18 minutes of work)
• Finally, it’s time to show the demo where the developers and the Scrum Master present to the client what they have achieved during the iteration

To code, we used eclipse with subclipse and JUnit, the speakers prepared a Bamboo (continuous integration) to test if a commit would break the build (we were under pressure !)

I attended this session 3 hours (2 iterations) and it was quite fun and very interesting : we’ve been able to witness problems of communication between teams, the way an agile project can rapidly react, etc…
This session was so popular, the organization decided to make it last one day more !

The afternoon, I was present at the “Sujets Eclairs” (lightening talks) session; where anyone in the room can present a subject and explain it in 10 minutes.(usually people who talk during lightening talks are not familiar with public presentations; moreover subjects presented are usually not prepared)
Many topics were proposed, most of them were about project management and agility.(which was nice actually)
The first day finished with some words from the sponsors, among them, Valtech, my employer ! (and also an excellent dinner !)