Ask the Expert

What is test granularity?

What is test granularity?

    Requires Free Membership to View

Test granularity is the level of detail at which your tests address your project. For instance, a project that opens a file, converts it from .bmp to .jpg, and saves it can have any level of granularity. The lowest granularity, of course, would be to simply open a .bmp and save it as a .jpg. Higher granularity starts testing things like what file location the tests are opened from (disk, USB, network share, URL, etc.), saving to various file locations (disk, USB, network share, URL, etc.) and file formats (valid BMP, invalid BMP), saving over an existing file, etc.

Many IT shops focus on the lowest possible granularity, which tests I call "validation" or "verification." The tests are focused primarily on just the functionality requested, and rarely consider negative (failure) test cases.

While organizations think they're helping themselves by keeping testing costs low, they are actually hurting themselves. Those negative test cases that aren't discovered during the product development phase will typically surface during support, dragging resources off the next project back onto the original project.

Test case granularity is definitely a function of the application, the project criticality, and the schedule. You may work on projects where only the most basic negative cases are required. You may also have projects where deep negative testing is required -- for instance, a simple content-only website versus a medical device or piece of medical record software. When in doubt, revert to the customer, provide them with concrete examples of the test granularity you're thinking of working to, and help them find the right level of granularity.

This was first published in March 2009

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: