Building software is all about hitting the right spot between features and quality. But we rarely talk about how to measure quality. Let’s look at how a gamification system (points & leaderboard) within a GitHub action helped developers on my team care about quality!
How to Use Gamification to Improve Quality on Your Project
From:

JSNation 2022
Transcription
Hey everyone, welcome to my talk on using gamification to improve quality. Quick quote about myself. I'm Jonathan Wagner. I'm an engineering manager at Theater UK and I've been working as a tech lead for past four years on about 10 and more projects in production. I can tell you I've always told with Finding the red balance between pushing for faster delivery and having a good good quality on my projects and I've seen both extremes like product with 100% good coverage and project where just going straight to production testing anything. So it's always been a struggle and I want to talk to you about this. Something classic that people say in Social Engineering is that there are three happenings you have caching validation naming things and prioritizing good quality. What do you mean by good quality? Let's stay a little bit more to this. It's everything that contains technical debt maintainability factoring and so on. So it's finding the right balance between delivery and quality. But it's also deciding when to do the fix for the root cause versus the quick fix. I didn't want to do both maybe in the right order. So brightest. It's a quick fix and then invest time in cooking to the root cause and preventing the issue from happening again. But that's the this question of prioritizing. I didn't improve it. It's can be quite complex. I started to like develop etherion this and I'm going to try to explain this to you. So let's start by trying to speed the program to like small parts. So let's say you could base and you want to improve creating it first thing you can try is to look at nucogen you you add and then after that focus on. The Legacy cut. So first of all the simple part the new good you can start by creating a new standard training your team with this new standard and then making it hard for people to write bad code that's important step that the step you can automatically automate and to automate it you can use tools like isn't it the only solution it's definitely not perfect doesn't catch everything but it helps prevent bugs and often when analyzing food because of the book you can identify that when you're still good at prevented it. So it's a good occasion to add a new room 20 minutes. Make sure they know how to fix it and bit by bit do something about it. And that means that you could you write a speed standard and hopefully you improve the Legacy code as well. But this is good. It's it's hard to decide when to look at it or not. And it's even harder to motivate everyone in your team are mental teams if you have to look at it, so that's one it gets tricky. What do you do there? So, let me tell you a little story about how I approach the problem and explain some other things. I've learned along the way. So little story I will explain you in what state we started in. How we played with the CIA and gamification and then what happened? And what kind of results we we had? so initially we had a project with about 1,500 warnings so quite the warnings and this number was decreasing very slowly. So like every time there goes well, I think features it was known that there shouldn't be adding new warnings and progress will be blocked by the tech lead or the developers in the team. If this was a number increase that means there was a pressing the code where you can say, okay, this isn't about my mornings and if it changes it has to go down cannot go back. Have but in some cases we broke the deployment pipeline that would happen when two amazing deaths would want to decrease the number kind of at the same time at a different request. So let's say the first developer fixes two warnings. So it means the max running is now 100,498 and then the other developer opens another request fixes three different warnings. That means you get Max running down to 100,497 first one matches. Everything is green. All good. Second one matches didn't replace beforehand. Everything was green with that any much conflicts. and boom it breaks. Where does it break? It's because we now have minus 5 warnings instead of the expected. I just three or minus 2 that we had before and that means everything's broken. Someone has to learn fix, but I'm not sure why it's broken. You might not have the other thing might take forever to fix. So we want to avoid that at all cost and one way to do. This is to basically remove warnings. Let's say we don't want warnings anymore. We just whatever that's one way to look at it. That's what we tried. So basically I wanted to the Eastern config. We pressed all the warnings by errors and overload the one that would defaulted by the plugins we had. And we went from 1,500 warnings to zero, but then we had the same amount of errors and that meant Asia was was broken. But then good we had a little tour already existed which is a link config generator called Clinton Source you can use it as well and it helps you automatically. Add Eastern disabled commands everywhere you have an error and that means we don't have any more errors this here. We screen again, and we never had any more much conflict like this one. So first step quite simple straightforward fixes everything. But then we have room of decreasing our warnings. So that's when I started thinking about. Okay, let's try to do this. Let's try to put you know, the little Infinity in place. Let's try to make it like a game with read about so I went to I went on it to spend little quick including and came up with this. So to get action could be adapted to school CI I gitlab or any other CIA it will use it's quite simple. It's pretty posting a comment on your request and telling telling you how many points and in the pool request how many points you and since the beginning of the week and your current rank for this week and you can see the blue gym the fully the board and definition about how to unpoint physically what happens is Taking the good diff on the pull request and then counting how many lines? You added contained and yesly invisible and I'm glad to remove that container. And yes link disable one and based on this we get the score computer score for everyone as well and print the lead about you need to store anything. If anywhere it's just completed every time you're gonna put request takes less than 10 seconds. And that's the job just well. So I put that in place super bottom myself we listed first week. So many books. Lots of requests had 0 points when people should have had points people complained people were happy. I worked a bit on it and after that. It was a smooth ride for the next three months. So here's the data for the three months on the project. So we started that around 1600 and then we can see a few news didn't rules added and overall. It looks like it has increased quite a bit, but let's do a bit more and see what happens. So first meaning and just 3000 and then adding some bass lines. We can actually see that part from a couple weeks in April that were a bit bad. At the beginning and at the end we had some good times and this would be more computation on that. So. If we forget about every word we've added we actually decreased on another buffer was by 235 in about three months. So that's the rate of about 78 per month and assuming we started with now start at 3,500 meaning would take us for years to get down to zero. I can do a bit more math and be like, okay 78 per month. If we have a team of say 35 developers, that's about each step fixing whenever every two weeks. Not a lot. You can probably expect them to be fixing the two bugs in a week. That means divided by 4 the number it means in one year we could get down to zero. So is it good? Is it bad what you guys think? That's the kind of question that we're asking ourselves and that I can again explain what I've learned. First of all, should we aim for now errors? Is this something we should be like Should we fix everything should we go down to zero? my opinion is at when you touch Legacy code you might introduce new books because the code is working might not be well tested and by touching it you just increase agencies of introducing your equations, so Aiming for no errors means probably inserting new books in codebase and it's like the complete opposite of what I want to do in the first case. So maybe that's not actually the goal. Maybe we just be like normal to have a slope that it's quite good at the beginning and then after a while it stabilizes and it's normal because the new code is up to standard and learning to fix anything more something is that you can think of then is how do you mention that you get into the situation as fast as possible? And how do you detect when you get there? So maybe you can prove the tool maybe we can new features like making sure we block The Brew quest to put people from adding new members could could be showing potential points by looking at the files that have been touched. So if we look at each file and how many warnings they have then we can say, okay, how do you fixed everything in there? You would have won 20 points instead of just three And then we close to show the total weekly diff. So that every week you can actually make sure that the number is decreasing and not staying average like we had in April. And maybe there are other Alternatives. Maybe we shouldn't be just looking at instant maybe looking at tests. And making sure that when we get testify we endpoints as well. Maybe we could also incentive instant device before a bit more like people earning a price when they get the first place or you could also like put the leaderboard on a TV for everyone to see it at all time and make sure that it's present in everyone's mind that it's variety, but then that depends on is it actually a priority? Than most importantly was it fun to good? Definitely. I have had so much fun cutting this and I really hope that You guys start? Training it contributing. And yeah sitting up on your project playing with it opening group request. And improving quality everywhere. So that's it. Thank you. And please don't hesitate to reach out if you have any difficulties any questions. and they