All Posts
How test frameworks work: A basic mental model
Understanding how your test framework works is a good start to avoid making mistakes. In this post, I share my basic mental model of how most test frameworks work. This is not 100% accurate, but it is...
read articlePipDecks Iphone Widget
I started using Readwise a few months ago. The app allows you to highlight articles or books you read and aims to help memory retention by resurfacing content regularly. One way to do this is by...
read articleExpected, actual, and super fast assertion creation
If you follow this blog[1] you know that one thing I enjoy is improving my workflow inside my IDE. The feeling of productivity of being able to code something in seconds instead of minutes brings me...
read articleRemove all services arguments from Symfony config with a script
I'm helping a team migrate from Symfony 3.4 to a newer version of the framework. One of our objectives is to move away from using the container to get access to services and use dependency injection...
read articleCausal Loop Diagram Asymmetrical Level Pattern
I participated in a workshop on System Thinking hosted by Kent Beck (Yep, that Kent Beck) and Jessica Kerr (Yep, the real Jessitron) during NCraft this year. We draw a lot of causal loop diagrams all...
read articleQuickly jump to periodic file in Obsidian
I'm currently working with a client to unstuck a team blocked by a legacy codebase and complicated work processes. I send a weekly report of things we've done and things I think we should work on to...
read articleDisplay a message when you enter a directory
A few days ago, I was doing something I do from time to time with a CLI tool. The command requires a bunch of parameters, and I usually go through my command history to find the previous usage, change...
read article3 hacks for a magical code kata in PHP
When creating content for people to learn from, having a story as a backbone can be a good idea. In my improving tests class, I’ve constructed most chapters with a story. To make a story more...
read articleApproval testing: 3 technics to deal with randomness
When dealing with legacy code, randomness is not something you enjoy meeting. Creating a test harness on top of a system with random results can be pretty challenging. Obviously, you’d like your tests...
read articleFacilitation Nightmares: How to escape a workshop not going on as planned
A few days ago, I hosted a session about Facilitation Nightmares during a Virtual DDD gathering organised as an open forum. The idea was for the participants to share some of their stories of...
read articleCoder ses tests sans les mains grâce aux Live Templates de PhpStorm
Je ne tape pas particulièrement vite, en tous clairement pas avec les 5 doigts des 2 mains[1] mais j’arrive à compenser parce que j’ai trouvé différentes manières d’écrire le même code que quelqu’un...
read articleLe tags, la fonctionnalité oubliée des lanceurs de tests
Il y a une fonctionnalité des lanceurs de tests que l’on utilise bien trop peu, moi le premier : les tags. Avec un peu d’imagination ils peuvent pourtant nous rendre de chouettes services, et voir...
read articleDes solutions pour les conflits au niveau de la base de données pour les tests exécutés en parallèle
On m’a demandé il y a quelques jours si j’avais des ressources parlant de solution aux conflits entre tests joués en parallèle lorsqu’ils touchent à la base de données. J’avais quelques pistes à...
read articleDes tests super lisibles
Cet article est une traduction et légère adaptation d’un article précédent écrit il y a déjà plusieurs années sur ce même blog. Les techniques exposées ici me sont toujours utiles et je pense qu’elles...
read articleLe dummy, un indice pas si con à propos de votre design...
Je l’ai déjà évoqué dans le précédent article, je suis persuadé que nos tests nous fournissent des informations pertinentes quant au design de nos applications. Il faut savoir les entendre. Pour une...
read articleComment tester une méthode privée ?
Dans cet article quand j’utilise le terme "méthode privée" cela correspond aux méthodes qui ne sont pas accessibles depuis l’interface publique d’une classe. En PHP, par exemple, il peut...
read articleTest suite guidelines
Yesterday I watched again the "Breaking up (with) your test suite" talk by Justin Searls, and it resonated with an idea I recently had while working on a project for one of my clients. I...
read articleUsing Property Based Testing to test priorities
I was recently working on a project with an Angular frontend where we displayed an action button. That button had to be disabled when some conditions were met. Examples of conditions are: not the...
read articleComposing data using Postgres Foreign Data Wrapper
Say you decided to go the micro-service way, split your database into pieces, and are now requested a feature that needs to display data stored from several of these databases. Fetching the data from...
read articleAn alias to easily debug PHP scripts
As I said before, I’m trying to save some time when using the CLI, and I rely more and more on aliases. Aliases are fantastic to save some keystrokes, and they also significantly help with something...
read articleGenerating dates and UUIDs easily in PhpStorm
Legacy codebases tend to lack tests. One way to introduce some safety net before messing around with the code is to add characterization tests. In this kind of test, we feed some input to the system...
read articleAn alias to learn aliases
I’m trying to save some time by reducing the number of keystrokes I need to do something. I’m pretty efficient with my IDE’s shortcuts, but I have vast room for improvement in my console. The obvious...
read articleBuilding an event-sourced game with Phoenix Liveview: Unit testing patterns
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleBuilding an event-sourced game with Phoenix Liveview: Decrementing the timer
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleBuilding an event-sourced game with Phoenix Liveview: Building the view's states from the events and reacting to changes
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleBuilding an event-sourced game with Phoenix Liveview: Acting on the game from the views
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleBuilding an event-sourced game with Phoenix Liveview: Game Server
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleBuilding an event-sourced game with Phoenix Liveview: Making game states explicit
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleBuilding an event-sourced game with Phoenix Liveview: Expressing domain concepts in the code
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleBuilding an event-sourced game with Phoenix Liveview: Handling errors
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleBuilding an event-sourced game with Phoenix Liveview: An event sourced model
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleBuilding an event-sourced game with Phoenix Liveview: Architecture
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleBuilding an event-sourced game with Phoenix Liveview: Introduction
This article is part of a series on building an event-sourced game in Elixir with Phoenix Liveview. Other articles are: Introduction Architecture Game logic: an event...
read articleTesting that a GenServer exited
In the project I'm working on, I need to keep a GenServer up for a while, but I don't want to keep it up forever as I want to free resources. The solution is to use the timeout mechanism with an...
read articlePassing data to session while testing in Elixir
I struggled a while when I tried to pass data to the session while setting up a Liveview test. I googled a lot and asked on the elixir slack for a solution, but everything I saw seemed quite...
read articleBeing lazy with Postman scripts and dynamic variables
I'm probably really late to the show as Postman is known to be a great tool when it comes to work with API. I've never took the time to dig in what this tool can do but I recently had a workflow...
read articleFaster environment with xDebug and Docker
I have to admit that I've always been lazy when it came to set up xDebug as it felt tedious the few times I've to do it. It made me an almost perpetual member of the var_dump debug team. Nevertheless,...
read articleUsing data provider to express business rules in test
When we write tests we want to achieve several things: ensure that the code works, create documentation, gain feedback about the ease of use of the system we are building and the quality of its...
read articleNaming collision
The context I don't know if I already shared that I work at Evaneos, a travel market place. Our job is to interconnect future travelers with travel agencies all over the world so they can benefit a...
read articleWhat if someday...
"What if someday..." These three words are probably one of the main causes of accidental complexity and late delivery in the software industry. As software developers we always try to guess...
read articleAsk about the freelancer
A few days ago I was involved in a discussion on twitter about a modeling problem. As a support for the discussion we were talking about a time tracking system and the concept of time sheet. I...
read articleIt should not throw an exception
I’m very interested in living documentation because it provides some great values. First, you finally have documentation, which is up to date and under version control. The other great thing about it...
read articleExtra readable tests
I’ve been doing some experiments with tests for the last few weeks. In this article I’ll share some tricks I’ve learned from others, mainly Sandro Mancuso, Matthias Verraes, and, of course, from...
read articleUnique instance anti-pattern
I'm back from the past. I have been trying to introduce some tests in one of the oldest part of our codebase. I'm back from a time where using Service Locator was the norm for a lot of people,...
read articleStop using the database for everything
First thing first, database are useful in a lot of cases and we need them. We need them when we have to store information provided by users or information changing on a regular basis. This is not the...
read articleWrite code for the dumbest person you know
I wrote this text a few months ago while I was angry and decided not to publish it right away, letting it sink in. I kept it, made a few changes and finally decided to publish it. I'm dumb You're...
read articleRemoving ifs
I'm not a big fan of if statements. They make source code harder to reason about, force us to write more test cases and increase cyclomatic complexity... We even debated with some colleagues on the...
read articleTravis and different PHP versions in the same repo
At work we have one git repository for several projects. While this has some advantages their is also some drawbacks. Setting up a CI is one of them, especially when all the applications can't run on...
read articleOOP Layers
Yesterday at work I ran into a pretty nasty bug and while looking through the code I spotted something which even if it wasn't the primary cause of all the mess made it really worst. The code was...
read articleTest for behaviour not for implementation
While working on SearchCache I made a test which was ensuring that two shared search results coming from a same search - using the same search parameters - should be stored using the same key. Here it...
read articleRefactoring VoteValidator with tests
A few days ago I decided that the t-shirt a day application doesn't need the complexity of a vote validator with a validation handler and only a method stating if a vote is valid or not returning a...
read articleWhy are 404 pages still a thing ?
In this article every time you’ll see "a 404 page" please read "The dumb 404 page with an apology and a link to the home page". This doesn’t concern 404 in other contexts, please...
read articleProject macro structure
File organization is something crucial if you have to maintain a project for the long run but is often overlooked by developers. The way files are organized within a project is very important because...
read articleBDD and domain code
Behat is a well known tool for end-to-end testing but as Konstantin Kudryashov pointed out in his article Introducing Modelling by Example it can be used as a modeling tool too. As Konstantin points...
read articleTShirt a day
I've been reading a lot of books and blog posts, watching a lot of conferences about development for the past year and I was searching a project to help me wrap my head around all the interesting...
read articleSmurfing a Twitter bot
The idea The idea came up a while ago when I was talking with colleagues : Would it be possible to make a bot able to retweet speaking as a Smurf ? Smurfs, or Schtroumpfs in french, are an imaginary...
read articleAdd more element forms the nice way with AngularJs
We sometimes have to deal with forms where user can add items to a list. Most of the time an "Add more" button is created and we add an input to the form when it's clicked. I'll show you in...
read articleIn modal nested states with AngularJs ui-router
In an AngularJs application I'm working on we need to display details about an object on a modal and to be able to switch to an edit mode in the same modal. An other requirement is that the modal is...
read articleUsing PrismJs with AngularJs
In a project I’m working on I need to display code snippets. I found PrismJs library, which is lightweight and cover a lot of languages. The application is based on AngularJs, and code snippets are...
read article