Five years ago, I was working in a project with a huge amount of Legacy Code. That legacy was not only old but also incredibly fragile: almost nobody dared to change those lines. Even worse, you would never know if you broke something: those code components were barely covered by tests. These code pieces were difficult to maintain and full of quick-fixes.
We got used to just deal with it. The backlog was full with new features and we were not getting the extra energy needed to transform that unmaintainable code.
The technical debt became higher with time and we were paying a high price: tasks requiring much more time than normal only because they included modifications of legacy parts, long manual tests to verify that a couple of new lines of code did not break anything, etc.
It’s not that we were blind with respect to the Code Quality metrics: we used Sonar so we were perfectly aware of the problems when we saw all the blocker, critical and major issues that this tool reported. The new code was kept clean but the old code did not improve over time.
By that time, I just finished an online course about Gamification and I was enthusiastic about the topic. I thought that improving legacy code could be a good case to use gamification:
- We lacked motivation to improve that old code: it was risky and would not show any value immediately (even though it would have a great value long-term).
- It was boring: reading those ugly lines could make you sleep in a matter of minutes.
- It was repetitive: many of these blocks were duplicated all over the place.
If you know a bit about Gamification at work, you will identify those ingredients as a good base to bake a gamified project.
Gamification and SonarQube
The SonarQube REST API allows you to query issues and get information about who is assigned to fix it. I used some free time to check out these APIs and see if I could build a game on top of the results.
A Web Application seemed at that time the best way to materialize the game. I could have built a gamification SonarQube plugin but, back then, the documentation was not as good as it is now and I found it difficult to set up.
The game was born
After a meeting, I took five extra minutes to explain the game and how it works. I told everybody that playing the game was optional and that a nice mug would be the reward for the leader after a certain period of time. It was also clear that the goal was not fooling or manipulating people to get that done; it was just to make it more fun.
Some of the developers started participating in the game and fixing Legacy code. Of course, the quick-wins were the first issues to be fixed: high severity and high technical debt but not requiring a long time to be fixed. It would have helped if we would have a screen at that time, but still people were checking the application and having a friendly competition.
Even though the application was a bit unstable and included a couple of bugs, we had some fun while passing others in the ranking and being in the first positions for a while.
The proud winner got his mug by the end of the game.
From Legacy-Code Killers to Quboo
After that, I parked the project for some time. The main reason is that I decided to start The Practical Developer Blog and that was too much work to cope with.
I have always wanted to productify the game. Each time I talked about it with new colleagues or friends, I got good feedback about the idea. Also, I have been seen some activity on the GitHub repository: new clones, forks and even people creating issues and suggesting improvements.
But eventually, following the challenge-per-year initiative that I started in 2017 with the book, I convinced myself to invest some time on the game. I finished the pending parts: persistence and deployment with Docker. I made the web interface a bit more attractive (yet not fully convinced) and created the Quboo logo. This web was also an important part of making the game a product: a place to hold the documentation and the latest updates.
Quboo 1.0 has been released on October 2018 as an open source project. I would love to know if you give it a try and have some feedback: if you had fun, if it worked or even if it was a bad experience. New ideas are being included in the Quboo roadmap and I hope you can help me build a nice product.