Randomized testing: Gotta Catch 'Em All

Played 6 times
Videos 1
First Jan 2026
Last Nov 2025

Randomized testing: Gotta Catch 'Em All

Chance does things well.

If we apply this idea to unit tests or integration tests, we can make our tests much more unpredictable — and as a result, uncover issues that our minds would never have dared to imagine! For example, I recently discovered a bug in a configuration management library that occurs when the Locale is set to AZ. 🤦🏼‍♂️

Another, even simpler, example:

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

This can generate -2147483648… which is quite unexpected for an absolute value! 😉
Randomized tests can uncover these twisted edge cases… That’s what the Elasticsearch team has been doing for years using the RandomizedTesting framework to test all their Java code.

Add to that real integration tests using TestContainers , and you’ll have a complete approach to tests that regularly fail!

After this talk, you’ll never look at the random() function the same way again — and you’ll discover how (bad) luck can actually help you! 🍀

Title

Randomized testing: Gotta Catch 'Em All

Abstract

> Chance does things well.

If we apply this idea to unit tests or integration tests, we can make our tests much more unpredictable — and as a result, uncover issues that our minds would never have dared to imagine! For example, I recently discovered a [bug](https://github.com/gestalt-config/gestalt/issues/242) in a configuration management library that occurs when the `Locale` is set to `AZ`. 🤦🏼‍♂️

Another, even simpler, example:

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

This can generate `-2147483648`... which is quite unexpected for an absolute value! 😉  
Randomized tests can uncover these twisted edge cases... That's what the Elasticsearch team has been doing for years using the [RandomizedTesting](https://labs.carrotsearch.com/randomizedtesting.html) framework to test all their Java code.

Add to that real integration tests using [TestContainers](https://java.testcontainers.org/modules/elasticsearch/), and you'll have a complete approach to tests that *regularly fail*!

After this talk, you'll never look at the `random()` function the same way again — and you'll discover how (bad) luck can actually help you! 🍀

Le hasard fait bien les tests

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 ! Par exemple, récemment, j’ai découvert dans une bibliothèque de gestion de configuration, un bug qui se produit lorsque la Locale est configuré en AZ. 🤦🏼‍♂️

Un autre exemple encore plus simple :

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… C’est ce que l’équipe elasticsearch a mis en place depuis plusieurs années à l’aide du framework RandomizedTesting pour tester tout le code Java.

Ajoutez à ça de vrais tests d’intégration à l’aide de TestContainers et vous aurez une approche complète pour des tests qui échouent régulièrement !

Après cette conférence, vous ne verrez plus jamais la fonction random() comme avant et découvrirez comment la (mal)chance peut vous aider ! 🍀

Title

Le hasard fait bien les tests

Abstract

> 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 ! Par exemple, récemment, j'ai découvert dans une bibliothèque de gestion de configuration, [un bug](https://github.com/gestalt-config/gestalt/issues/242) qui se produit lorsque la `Locale` est configuré en `AZ`. 🤦🏼‍♂️

Un autre exemple encore plus simple :

```java
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... C'est ce que l'équipe elasticsearch a mis en place depuis plusieurs années à l'aide du framework [RandomizedTesting](https://labs.carrotsearch.com/randomizedtesting.html) pour tester tout le code Java.

Ajoutez à ça de vrais tests d'intégration à l'aide de [TestContainers](https://java.testcontainers.org/modules/elasticsearch/) et vous aurez une approche complète pour des tests qui échouent régulièrement ! 

Après cette conférence, vous ne verrez plus jamais la fonction `random()` comme avant  et découvrirez comment la (mal)chance peut vous aider ! 🍀

Resources

Useful resources related to this talk.

Conferences

2026
2 talks
Le hasard fait bien les tests
🇫🇷 fr Upcoming

Le hasard fait bien les tests

Le hasard fait bien les tests
🇫🇷 fr Upcoming

Le hasard fait bien les tests

Snowcamp Jan 30
2025
3 talks
2016
1 talks

© 2010 - 2026 David Pilato

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

⚙️ Generated from 🇫🇷 with ❤️ on Fri Jan 9, 2026 at 12:32:30 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