Quboo – Code Quality Game

Quboo

Quboo applies Gamification to Sonar to encourage developers to pay the Technical Debt.

This project has got its own website. Please visit https://quboo.tpd.io for the complete documentation, installation instructions, etc.

Quboo logo - Code Quality Gamification

Introduction

Quboo is a simple web page that displays a ranking of teams (and developers) by how much technical debt they are fixing on Sonar. It promotes a friendly competition thus solving one of the main problems of fixing legacy code: it’s boring (believe me, I’m a developer).

It accomplishes that by connecting to your Sonar server, which may be privately hosted or cloud-based (sonarcloud.io). Given a list of user alias that you have to provide, it retrieves the issues that have been fixed by each one of them, converting them to points and presenting that in a ranking. The game is much better when you play as a team, so you can also group users together in the configuration to make the competition much more appealing.

Getting the game

The easiest way to get the game up and running is to follow the instructions on the Quboo website. You can deploy the game in less than five minutes using Docker.

Game basics

Getting score

The users are retrieved from your Sonar server; that’s the way the game gets its data.

Sonar - assign issue

To credit score for fixing a problem in Sonar, you assign the issue to yourself. Usually, issues in Sonar are assigned to the person who introduced them. However, since we’re trying to fix the legacy code and not new Sonar issues, the assigned person doesn’t necessarily match the user who fixed it. If you want to claim a fixed issue you should go to Sonar and assign it to you using the dropdown in the issues search result (see picture above).


Don’t use this game to fix new Sonar issues. Fixing the new ones should be part of your CI process so new code shouldn’t be merged into your stable branch if it’s not passing a strict threshold. On the other hand, if you activate score for new issues, it’s very easy to cheat the system by just introducing new issues on purpose — which is exactly the opposite effect that this game wants to achieve.

Legacy Date

The main goal of this application is fixing Legacy Code (old code that is difficult to maintain, not readable, and error-prone). You need to set a reasonable value to this property in the game configuration. Users will only get score if the issue they’re fixing was introduced before that date – thus this date is considered the one in which you started doing things properly and not allowing new important Sonar violations.

See the Game Installation page for more info about this.

Don’t go cowboy-fixing

Make sure that the violations you fix don’t have an unknown, expected side effect. Sometimes it may happen that you refactor your code to fix a Sonar issue and you introduce a bug that is much worse. To avoid it, always check that the code you’re changing is covered by Unit Tests. If it’s not, then you have a good opportunity to implement them before going ahead.

Badges

Right now there are two badges that you can win.

  • Early Bird. Configure the earlyBirdDate in the properties file. Those players who solve issues before that date will get that badge. This is to promote a better adoption of the game.
  • Unit Tester Ranks. These ones are related to the Unit Test Coverage and there are different ranges. If you assign to yourself issues about code coverage and fix them, you’ll get badges as soon as you pass 1, 10, 25 and 50 issues.

More information

Are you interested in the story behind this project? Why did I start it? Check out the post A gamification experiment with SonarQube.

If you like this project you can become a Patron. You can also star it on GitHub, that at least help me with a boost of motivation.