Game Coding Complete

I've worked with a few different bug databases. Good ones can actually help you predict when you'll ship your game (more on that later). Bad ones can make everyone's life a living hell. Don't think for a moment that you can do without one. Even better, convince yourself that writing your own database in MySQL is a horrible idea; go out there and find something that works today. Your job, after all, is to write a fantastic game for your players. Don't waste time writing, fixing, and tweaking a home-grown bug database.

A Tale from the Pixel Mines

When I was at Origin Systems the bug database was not much more than a simple system built on FoxPro, an off the shelf database system. The bug database was difficult to use, extremely slow, and didn't provide useful information beyond simple bug counts. This system, and I use that term loosely, motivated me to make a horrible decision when I was the project director on Ultima VIII. I decided not to use the database at all. Instead, I decided it would be better for the team to use paper bugs, one bug per piece of paper clipped on a clipboard. What a tragic error! A few months before the ship date the test team called me into a meeting where they were concerned about the high bug count. I didn't show a high bug count (maybe 2 to 3 inches of paper) in my "records." The reality was that somehow an enormous stack of bugs, many hundreds of them, had never been assigned to the team. A few others and I spent hours sorting through the mess, assigning bugs, and coming to a serious understanding about the magnitude of my error in judgment. Since then, I've been very serious about bug databases.

Perhaps the best bug database I've ever used is RAID. Don't go searching for it on the Internet because you won't find it for sale. It is the internal application Microsoft uses to track bugs. It's a proprietary client application to a Microsoft SQL back end, and it has a number of important features that every good bug database must have. There are some excellent bug databases out there, and I'm sure some will run circles around RAID. The particular database product you choose should at least provide a few basic features. On non-Microsoft projects, I use PVCS Tracker for our bug database. It's not quite as good as RAID, but it gets the job done. It has all of the features a good bug database needs.

It goes without saying that the database should have flexible searching criteria. Almost any game will have hundreds, if not thousands, of issues. Finding all the bugs assigned to a particular person is pretty simple, but searching through the thousands of bugs that have been closed for a particular text string in the bug history might be a lot tougher. Inevitably you'll remember something about a previous bug that has relevance to today's project stopping problem. If the bug database puts every byte of information at your fingertips you'll be able to make good use of solutions in the can.

Essentially, you want a database that exposes an ad-hoc query mechanism that lets you construct your own queries. Stay away from a database that uses a simple menu system or dialog box. Those might be nice for some executives out there but programmers and other folks in the trenches want to construct very specific searches. If your database lets you construct SQL queries or something similar, you're way ahead of the game.

Here are some examples of common queries to a bug database:

Storing and categorizing information in a database is just the starting point. You need to be able to make use of that information to increase the quality of your game. Take a look at the fields that are commonly used in most every bug database, and how they can be used.

The bug description should be incredibly detailed. If it is done properly a programmer should be able to diagnose the problem quickly. It should include instructions to reproduce the bug, what the bug did, and what was expected. Take a look at the following example:

The description is a short summary of the bug. When the programmer follows the repro steps exactly, they should be guaranteed to see the same results in the debugger, hopefully catching the bug in the act. The results are what the tester observed after the repro steps were followed, and the expected results were what the tester expected to observe.

Gotcha

Some bugs cannot be reproduced 100%. As hard as the testers try, they might not be able to find a clear set of steps that will always result in the bug appearing. All good testers check each questionable bug before writing it up. If they can't reproduce the bug every single time with the steps they suggest, they must also include the percentage chance that it will occur. Every developer should insist on this from their test team, because if a bug only happened once and was never seen again it shouldn't have a high priority. The percentage chance might also be a valuable clue to a programmer, so always get it in the bug report.

You might wonder why we bother writing the expected results—shouldn't it be obvious? The answer is decidedly not. Testers make use of the design document heavily when they create their test plans, and where the design document leaves off their imaginations and creativity picks up. Their expectations of your game's response to their wacky input might be completely justified either by the design document or their intuition.

The most commonly searched field in a database is the status field. Most databases I've worked with have a status field with three states:

An important feature of many databases that I've worked with is that some database fields, especially the status field, are secure and can't be edited directly. It wouldn't be appropriate (as much as some programmers would want to) for a development team member to simply 'close' a bug without having it run though the test team. Even if all fields are editable, a record of each change to the bug should be kept in a running log of the bug's history. This is extremely useful for mining information out of the database. You'll get to see a great example of this when we see the next bug report.

When the test team works like crazy they'll write hundreds of bug reports and dump them onto the development team, usually on a Friday afternoon! Usually the lead programmer and the project director will sit in front of the bug database and try to make reasonable decisions about assigning bugs to others on the development team. The bug database must make this process fast and painless or it will be deemed useless by people that need it most. Make sure your bug database can do the following things:

Now that the bugs are all assigned, your team members will want to be able to look through the bug on their list. There are a couple of good fields that the team can use to prioritize bugs and bug fixing:

Gotcha

When you have tons of bugs on your plate you tend to mechanically work on each one as it is sorted, without really even looking at the bug. Sometimes you'll even wonder "why in the hell is this bug assigned to me? That code isn't mine!" or "Hey, I thought the game was supposed to work that way." Always approach a bug with 10% skepticism. The bug might not even be a real bug. This is especially true when everyone is tired and overworked. Try to keep just enough neurons firing to make your own judgment calls about each bug before you start to fix it.

When the bug is finally resolved the following fields should get filled in:

Beyond those fields it's also a great idea to make use of the bug history to record some details about the exact nature of the fix. It's not uncommon to see snippets of code in our bug history showing the change and why the code was broken in the first place.

A Sample Bug Report

I promised you a good bug with some decent bug history, and here it is. This is a bug report written up by one of the senior testers at Microsoft on a version of Freecell that I wrote for one of their card game products. It turns out that I didn't quite understand the nuances of Freecell. It also turns out that the original programmer of Microsoft Freecell, Jim Horne, chimed in to set me straight.

The bug history contains a lot of information, not the least of which is a conversation between the tester and me. It also shows each change that was made to the bug during its lifetime as it was being assigned to various developers, managers, and testers.

Other Nice Features

There were some extremely nice features in some of the bug databases in my past. These features made life much easier. If you can find a bug database with all these features don't ask how much it is, just go get it. You'll be glad you did.

Customizable fields let the test and production teams add very game specific information to the database, and make searching on these fields much more robust. An excellent example would be the addition of a "Mission" field to an action adventure game, or a "Map Coordinates" field to an RPG or MMP game. Driving games might have a field for the kind of car or the weather conditions. This information helps the team figure out who is the best person to fix the bug, and where the majority of problems collect.

The bug database should be remotely accessible via the web or proprietary client. The team leads can log in from wherever they are (airport, home, trade show) and deal with any problems or issues. It goes without saying that third-party developers are far flung from their testing team, and sending the bug database via FTP just won't cut it. The bug database is constantly changing and should always be available to every team member wherever they are.

The database should be able to include file attachments as a part of the bug. This can be invaluable for getting a test script, screen shot, saved game file, or other piece of information from the test team to the developers. A web based bug database makes this trivial, since you can simply put a link in the bug history.

Категории