Le hasard fait bien les tests

Breizhcamp Rennes 🇫🇷France

Mar. 2016

David Pilato

Slides

Abstract

Souvent, “le hasard fait bien les choses”.

Si on applique cette idée aux tests unitaires ou aux tests d’intégration, on peut rendre nos tests beaucoup plus imprévisibles et du coup trouver des problèmes que notre esprit n’aurait jamais osé imaginer !

Venez découvrir comment l’équipe elasticsearch a mis en place une stratégie de tests aléatoires en Java à l’aide de RandomizedTesting et comment la (mal)chance peut vous aider.

Par exemple:

int input = generateInteger(
            Integer.MIN_VALUE, 
            Integer.MAX_VALUE);
int output = Math.abs(input);

Peut générer -2147483648… Ce qui est assez inattendu pour une valeur absolue ! :)

Les tests aléatoires peuvent découvrir ces cas tordus…

Ils nécessitent évidemment de tester sans arrêt le code et doivent s’accompagner d’outils d’intégration continue, tel que Jenkins.

Après cette conférence, vous ne verrez plus jamais la fonction random() comme avant !

© 2010 - 2026 David Pilato

🔍 Search is powered by QueryBox. Just hit CTRL+K or CMD+K to start searching.

⚙️ Generated from 🇫🇷 with ❤️ on Thu Jan 8, 2026 at 13:23:38 UTC

🌱 Powered by Hugo with theme Dream.

Details

I discovered Elasticsearch project in 2011. After contributed to the project and created open source plugins for it, David joined elastic the company in 2013 where he is Developer and Evangelist. He also created and still actively managing the French spoken language User Group. At elastic, he mainly worked on Elasticsearch source code, specifically on open-source plugins. In his free time, he likes talking about elasticsearch in conferences or in companies (Brown Bag Lunches AKA BBLs ). He is also author of FSCrawler project which helps to index your pdf, open office, whatever documents in elasticsearch using Apache Tika behind the scene.

Who am I?

Developer | Evangelist at elastic and creator of the Elastic French User Group . Frequent speaker about all things Elastic, in conferences, for User Groups and in companies with BBL talks . In my free time, I enjoy coding and deejaying as DJ Elky , just for fun. Living with my children in Cergy, France.

Social Links