Home > Ask the Software Quality Experts > Software Testing and Quality Assurance Questions & Answers > How to design test cases
Ask The Software Quality Expert: Questions & Answers
EMAIL THIS

How to design test cases

Karen N. Johnson EXPERT RESPONSE FROM: Karen N. Johnson

Pose a Question
Other Software Quality Categories
Meet all Software Quality Experts
Become an Expert for this site


Software quality news and advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 17 April 2007
How do I design a test case?

>
EXPERT RESPONSE

Hopefully, your design will result in practical, reusable test cases. I've outlined ideas to help you through the design process.

The first consideration is the audience. Who is going to read and use the test cases? If you're designing test cases for junior testers, experienced testers, or offshore testers, your test case design will vary. Think about your audience.

Are you writing cases so that new testers or offshore testers will have "all the information" they need contained in each test case? If yes, then test cases need to be fairly detailed. The test purpose for the test case should be clear. The test data might be provided with the test case; if you include the test data, then you need to identify whether the test data must be used "as defined" or if the test data supplied is an example.

Test data is such an important part of testing. If the test data written into the test case is an example of the type of data to be used and the tester has leeway to be creative and supply other test data, then the test case needs to identify this. Or you can state this fact for all the test cases defined and make sure this is clear to the team.

Let's look at an example. Imagine a test case designed to demonstrate that no two user accounts can be created with the same account credentials. With this stated test case purpose, as a tester, I would try any way I can think of to break this requirement. Maybe I'll create an account, deactivate the account, create another account with the same user credentials and then reactivate the first account. I'll be looking for ways to break the requirement. Compare this example to following a test case that states create a user account with the name Joe Smith, verify the account is created, then attempt to create another account with the name Joe Smith.

Since I want every tester to be creative in what they try -- a test purpose might be the most valuable aspect of a test case. And unless there is a reason to be prescriptive with the test data, I prefer to identify all test data as a variable. I want testers to think of additional ideas and to test with different test data.

Be clear when you need a test case executed as prescribed versus when you want a tester to be more creative. Be clear when you need the test data supplied to be used as defined versus when a tester can try different values. To clarify when test data was a variable, I once highlighted the variable test data in color.

Content is another consideration. Once you determine who will use the material, the tone and detail will be easier to set. How do you determine the content detail? If you work in a regulated environment and the product you're testing is subject to audits, then the decision has been made for you. You need to follow your guiding procedures and adhere to what is required. If you're working in a non-regulated, faster moving environment, then creating detailed step by step cases might result in throwaway test cases too cumbersome to update or be practical. The context of your environment and the specific product are factors to consider. Also consider the experience level of the test team both in terms of testing experience and specific product experience.

Format is another consideration. I personally don't feel the format matters very much; test cases should be about the content not the format. But you might have purchased a tool to store test cases and need to use the tool. You might have guiding practices that state test cases will be written in Word or Excel or Test Director. I like to make sure that the format I use is practical for testers and that the format doesn't cause additional work or otherwise distract testers from their overall goal is testing the software.

A final consideration might be ranking of test cases. The more test cases you have, the more test case maintenance becomes a factor. You might consider ranking test cases are you build cases understanding that both the product and the test cases will evolve over time. By ranking, I'm referring to a method to identify which test cases are critical for execution and which cases are less important to execute. If a test case has been designed for regression testing of each release and the test case covers critical functionality than you might consider grading or ranking the test case.

I once solved the ranking problem by marking each test case as a level 1-3. Level 1 cases needed to be executed for each build since the cases checked core functionality, level 2 cases where selected based on functional changes to the product and level 3 cases were used when a full regression suite was run. You will likely review all your test cases and reassess execution priority based on each product release but as you develop test cases; you might think about how critical each test case is to the product as a whole versus focusing only on the current release.

In sum, think practical and reusable. Detailed enough for your audience. Each test case should have a purpose and each test case should denote whether the test data supplied should be used "as is" or if the test data shown is an example. And the best format to use is one that's maintainable.

More information:


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Software Testing and Quality Assurance
Should you retest closed defects during regression testing?
Common mistakes of new software testers
How to test an application's scalability, performance
Integration testing: Is it black box or white box testing?
Test strategy document vs. an acceptance test plan
The future of software testing
Quality assurance testing vs. user acceptance testing
Eliminating testing environment troubles
How to use tools for system integration testing
How to match the test environment to the production environment

Software test design
Choosing code coverage tools
Performance testing and experimental design
How to test software with dynamic requirements
Test metrics and use case coverage during testing
How to determine test coverage
Software testing is improved by good bug reporting
Regression test cases in safety-critical software
Test cases from requirements specifications and use cases
Software testing fundamentals: Testing basics
How to thoroughly test a website without automated tools

Software regression testing
Should you retest closed defects during regression testing?
Use functional and regression testing to validate SOA solutions
How to determine test coverage
Regression test cases in safety-critical software
Software testing fundamentals: Regression testing
Regression testing: How to select test cases
Six functional tests to ensure software quality
Regression testing is more than retesting
How to conduct smoke and sanity tests
SOA prompts changes in quality assurance

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
gray box  (SearchSoftwareQuality.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Software Quality - Software Maintenance, Software Requirements, Software Standards
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2006 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts