The Complete Magazine on Open Source

Use Bugzilla to Manage Defects in Software

/ 222 0


In the quest for excellence in software products, developers have to go through the process of defect management. The tool of choice for defect containment is Mozilla’s Bugzilla. Learn how to install, configure and use it to file a bug report and act on it.

In any project, defect management and various types of testing play key roles in ensuring quality. Defects need to be logged, tracked and closed to ensure the project meets quality expectations. Generating defect trends also helps project managers to take informed decisions and make the appropriate course corrections while the project is being executed. Bugzilla is one of the most popular open source defect management tools and helps project managers to track the complete lifecycle of a defect.

Installation and configuration of Bugzilla
Step 1: Getting the source code
Bugzilla is part of the Mozilla foundation. Its latest releases are available from the official website. This article will be covering the installation of Bugzilla version 4.4.2. The steps mentioned here should apply to later releases as well. However, for version-specific releases, check the appropriate release notes. Here is the URL for downloading Bugzilla version 4.4.2 on a Linux system:
Pre-requisites for Bugzilla include a CGI-enabled Web server (an Apache http server), a database engine (MySQL, PostgreSQL, etc) and the latest Perl modules. Ensure all of them are on your Linux system before proceeding with the installation. This specific installation covers MySQL as the backend database.

Step 2: User and database creation
Before proceeding with the installation, the user and database need to be created by following the steps mentioned below.
The names used here for the database or the users are specific to this installation, which can change between installations.

  • Start the service by issuing the following command:
$/etc/rc.d/init.d/mysql start
  • Trigger MySQL by issuing the following command (you will be asked for the root password, so ensure you keep it handy):
$mysql -u root -p
  • Use the following keywords as shown in the MySQL prompt for creating a user in the database for Bugzilla:

mysql > CREATE USER ‘bugzilla’@’localhost’ IDENTIFIED BY ‘password’;
> GRANT ALL PRIVILEGES ON *. * TO ‘bugzilla’@’localhost’;
mysql > CREATE DATABASE bugzilla_db CHARACTER SET utf8;
REFERENCES ON bugzilla_db.* TO ‘bugzilla’@’localhost’ IDENTIFIED BY ‘cspasswd’;

  • Use the following command to connect the user with the database:
$mysql -u bugzilla -p bugzilla_db
$mysql > use bugzilla_db

Step 3: Bugzilla installation and configuration

After downloading the Bugzilla archive from the URL mentioned above, untar the package into the /var/www directory. All the configuration related information can be modified by the localconfig file. To start with, set the variable $webservergroup as ‘’www‘ and set other items as mentioned in Figure 1.
Followed by the configuration, installation can be completed by executing the following Perl script. Ensure this script is executed with root privileges:

$ ./
Fig 1_ bugzilla_configuration

Figure 1 : Configuring Bugzilla by changing the localconfig file

Step 4: Integrating Bugzilla with Apache
Insert the following lines in the Apache server configuration file (server.xml) to integrate Bugzilla into it. Place the directory bugzilla inside www in our build folder:

<Directory /var/www/bugzilla>
AddHandler cgi-script.cgi
Options +ExecCGI
DirectoryIndex index.cgi index.html
AllowOverride Limit FileInfo Indexes Options
Fig 2_bugzilla_main_page

Figure 2 : Bugzilla main page


Figure 3 : Defect lifecycle

Our set up is now ready. Let’s hit the address in the browser to see the home page of our freshly deployed Web application (http://localhost/bugzilla)

Defect lifecycle management
The main purpose of Bugzilla is to manage the defect’s lifecycle. Defects are created and logged in various phases of the project (e.g., functional testing), where they are created by the test engineer and assigned to development engineers for resolution. Along with that, managers or team members need to be aware of the change in the state of the defect to ensure that there is a good amount of traceability of the defects. When the defect is created, it is given a ‘new’ state, after which it is assigned to a development engineer for resolution. Subsequently, it will get ‘resolved’ and eventually be moved to the ‘closed’ state.


Figure 4 : New Account creation

Step 1: User account creation
To start using Bugzilla, various user accounts have to be created. In this example, Bugzilla is deployed in a server named ‘hydrogen’. On the home page, click the ‘New Account’ link available in the header/footer of the pages (refer to Figure 4). You will be asked for your email address; enter it and click the ‘Send’ button. After registration is accepted, you should receive an email at the address you provided confirming your registration. Now all you need to do is to click the ‘Log in’ link in the header/footer at the bottom of the page in your browser, enter your email address and the password you just chose into the login form, and click on the ‘Log in’ button. You will be redirected to the Bugzilla home page for defect interfacing.

Step 2: Reporting the new bug
1. Click the ‘New’ link available in the header/footer of the pages, or the ‘File a bug’ option displayed on the home page of the Bugzilla installation as shown in Figure 5.
2. Select the product in which you found a bug. Please note that the administrator will be able to create an appropriate product and corresponding versions from his account, which is not demonstrated here.
3. You now see a form on which you can specify the component, the version of the program you were using, the operating system and platform your program is running on, and the severity of the bug, as shown in Figure 5.
4. If there is any attachment like a screenshot of the bug, attach it using the option ‘Add an attachment’ shown at the bottom of the page, else click on ‘Submit Bug’.


Figure 5 : New defect creation

Step 3: Defect resolution and closure
Once the bug is filed, the assignees (typically, developers) get an email when the bug gets fixed. If the developers fix the bug successfully by adding the details like a bug fixing summary and then marking the status as ‘resolved’ in the status button, they can route the defect back to the tester or to the development team leader for further review. This can be easily done by changing the ‘assignee’ field of a defect and filling it with an appropriate email ID. When the developers complete fixing the defect, it can be marked as shown in Figure 6. When the test engineers receive the resolved defect report, they can verify it and mark the status as ‘closed’. At every step, notes from each individual are to be captured and logged along with the time-stamp. This helps in backtracking the defect in case any clarifications are required.


Figure 6 : Defect resolution


Figure 7 : Simple search

Step 4: Reports and dashboards
Typically, in large scale projects, there could be thousands of defects logged and fixed by hundreds of development and test engineers. To monitor the project at various phases, generation of reports and dashboards becomes very important. Bugzilla offers very simple but very powerful search and reporting features with which all the necessary information can be obtained immediately. By exploring the ‘Search’ and ‘Reports’ options, one can easily figure out ways to generate reports. A couple of simple examples are provided in Figure 7 (search) and Figure 8 (reports). Outputs can be exported to formats like CSV for further analysis.


Figure 8 : Simple dashboard of defects

Bugzilla is a very simple but powerful open source tool that helps in complete defect management in projects. Along with the information provided above, Bugzilla also exposes its source code, which can be explored for further scripting and programming. This helps to make Bugzilla a super-customised, defect-tracking tool for effectively managing defects.