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?


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


RELATED CONTENT
Software Testing and Quality Assurance
What are the top free and not-free automated test tools?
Test case preparation for a Web-based application
The difference between functional testing and regression testing
Free load/performance testing tools for Java-based Web applications
Mapping results in test environment to production environment
What are some debugging shortcuts to reduce frequent debugging?
How to get a software testing job in a recession
How to write a test strategy document
What are the risks in using open source test automation tools?
What is system integration testing?

Software test design
How test managers can shine in agile development: Tutorial, part two
Testing mobile Web applications for usability and context
Test case preparation for a Web-based application
Agile software development tutorial: Agile testing
Six software test planning tips for better QA testing ROI
Software testing deliverables: Developing a software testing strategy
How to write a test strategy document
Perfect Software, Ch. 8: What Makes a Good Test
Pros and cons of requirements-based software testing
Using proactive test design methods to catch requirements issues early

Software regression testing
Three software regression testing steps can perfect defect fixes
The difference between functional testing and regression testing
TD Ameritrade gets proactive about application performance problems
Two-minute guide to determining software testing coverage
Open source QA tool for automated Web application testing
Browser compatibility testing basics
Increasing productivity with unit testing
Giving advice to software development team as a black-box tester
Should you retest closed defects during regression testing?
Use functional and regression testing to validate SOA solutions

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


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:




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 technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




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