Embrace A/B Testing in your development process!

A/B Testing is not just for marketing. It can be used in software development as well. In this article, I'll show you how to apply A/B Testing in your development process.

Embrace A/B Testing in your development process!
Photo by Campaign Creators / Unsplash

A/B Testing is not just for marketing. It can be used in software development as well. In this article, I'll show you how to apply A/B Testing in your development process.

Introduction

Planning over coffee
Photo by Hope House Press - Leather Diary Studio / Unsplash

Let's imagine you're working on a new feature during your sprint. You've created a new Merge Request (MR). You're ready to start coding. You've done your research knowing what needs to be done. You start coding; after a few trials, you're happy with the result. You create a new MR ready to merge it into the main branch.

Now instead of creating a single MR, create another one but now use everything you've learned during the first iteration. Oftentimes, when we first start working on the solution, we don't have a clear picture of the system the smaller units and their relationships. It's possible that we don't take the optimal route, reinvent the wheel, or even overcomplicate the solution.

From my experience, esp. after a night of sleep, I often think of a much simpler solution in the following days. I can then create a new MR and compare the two solutions. This allows me to gather valuable feedback from my colleagues and deeper refine my code for optimal results.

Of course, let's not forget the popular phrase: "premature optimization is the root of all evil". So, don't overdo it.

Example

Allow me to illustrate this with an example:

Photo by Douglas Lopes / Unsplash

Let's say you're calling an external API endpoint and you need to parse the response. You want to use the existing libraries in your projects to parse, validate and serialize the response. However, you recently learned about a new library that can do all of that in a single line of code and is much faster.

You create two MRs:

  1. the first using the existing libraries and way of coding
  2. the second using the new library

Bonus: you also want to add the rationale behind the second MR and why you think it's better. In addition, providing some benchmarks would be great.

Conclusion

By creating two MRs, you can explore alternative solutions and gather feedback from your colleagues. This will help you refine your code for optimal results.