Bugzilla:Tutorial:Testcases
Overview
Testcases are a small examples of a problem striped of unnecessary pieces. For example let's take a bug 424672 - Page Zoom: Pixel Gap after background image. A reporter, John, filed a proper bug with all required informations about on which version of a product did he reproduce the problem and he even provided a screenshot of the problem (it's important for people who are trying to verify that the bug exists to see what they should look for and how the bug looks like). What he did not provide are: proper steps to reproduce and a testcase.
In result of the former, people were not able to confirm the problem. In Comment #3 reporter finally figured out full steps to reproduce. In Comment #5 he also provided a regression range which is a interval in which the change that caused this bug has been made.
Without a testcase, you have to scan through the whole source of the example website to identify which element may cause this bug. Each bug may be caused by several reasons, and without a testcase that narrows the source its very hard to work on the problem.
In this case, in Comment #9, Mats Palmgren provided a minimized testcase. What he did was to take a source of the website and remove elements one by one until you removed everything that does not change the problematic behavior and left only the pieces required for the bug to appear. We call it minimized testcase.
How to prepare testcase
- Find a bug you want to work on. You can search bugs filed today or bugs with qawanted keyword.
- See if the steps to reproduce contain a URL to a complex website.
- If so, load the website, download it to your computer and start removing parts that are not needed. After each chunk reload the page and make sure that without removed part the bug is still reproducible.
- Remember to make sure that the bug with your testcase is reproducible on the latest version or nightly build on a clear profile.
- Once the source is smallest possible, attach it as a testcase.