Jeff Atwood writes about The Gamification and he states that there is “… a long, rich history of programmers as gamers“. He writes that programmers want “…to move beyond being a mere player and change the game, control it, modify its parameters, maybe even create our own games.”
Sure, but even when this is not true I believe that most people enjoy to compete in a game like fashion. We see this happen at the supermarket where we can tag reduction stickers on products and where we can collect trophies when we shop enough (often aimed at kids, but enjoyed by a broad public).
Recently I ran into “ci-game” or as it is fully called “The Continuous Integration Game”. It is a plugin for Jenkins that allows comitters to compete and collect points by improving the code in the repository. It requires that you have set up Jenkins to autmatically build you project(s). When a user commits code, the change is evaluated by the plugin. The plugin calculates an amount of points, either positive or negative and that is added to the comitters current score.
Since we use a lot of PHP and the game was designed for Java it was a bit of a challenge to get it working. We installed jenkins from the Ubuntu 12.04 repository. After installing Jenkins we installed the required plugins. After that we set up the Template for Jenkins Jobs for PHP Projects. Then we upgraded Jenkins from within Jenkins itself. After that we installed the ci-game plugin. Everything works and we are enjoying some healthy competition in the office.
The rules of the game are:
- -10 points for breaking a build
- 0 points for breaking a build that already was broken
- +1 points for doing a build with no failures (unstable builds gives no points)
- -1 points for each new test failures
- +1 points for each new test that passes
Rules that depend on other plugins (and are therefor optional):
- PMD Plugin. Adding/removing a HIGH priority warning = -5/+5. Adding/removing a MEDIUM priority warning = -3/+3. Adding/removing a LOW priority warning = -1/+1.
- Task Scanner Plugin. Adding/removing a HIGH priority task = -5/+5. Adding/removing a MEDIUM priority task = -3/+3. Adding/removing a LOW priority task = -1/+1
- Violations Plugin. Adding/removing a violation = -1/+1. Adding/removing a duplication violation = -5/+5.
- FindBugs Plugin. Adding/removing a HIGH priority findbugs warning = -5/+5. Adding/removing a MEDIUM priority findbugs warning = -3/+3. Adding/removing a LOW priority findbugs warning = -1/+1
- Warnings Plugin. Adding/removing a compiler warning = -1/+1.
- Checkstyle Plugin. Adding/removing a checkstyle warning = -1/+1.