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
Why do performance testers write new scripts so often?
How to create performance testing workload models
Fixing Web application performance troubleshooting problems
Expert advises on implementation of Selenium IDE for effective software testing
When should regression testing occur in an automated test plan?
Achieving peak performance in integration testing
Getting answers about OpenSTA script problems
Defining core software regression tests
Breaking in functionality on UI application pages
Where to find good methodology guides for software testing

Software test design
How to create performance testing workload models
CA's APM solution helps JN Data address performance issues
Parasoft Concerto targets policy-driven development
Why automated software testing fails and pitfalls to avoid
Essentials of static source code analysis for Web applications
Leaner test cases speed test planning, design
Streamlining test planning and design
Conformiq taps multi-core power for automated test case design
How test managers can shine in agile development: Tutorial, part two
Testing mobile Web applications for usability and context

Software regression testing
Software Testing Ezines
When should regression testing occur in an automated test plan?
Defining core software regression tests
How to overcome lackluster software quality through testing
How to approach regression testing, selection of tools and frameworks
How to achieve peak performance during integration 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

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