Test case

From Wikipedia, the free encyclopedia

Software development process
Activities and steps
Requirements · Architecture
Design · Implementation
Testing · Deployment
Models
Agile · Cleanroom · Iterative · RAD
RUP · Spiral · Waterfall · XP · Scrum
Supporting disciplines
Configuration management
Documentation
Quality assurance (SQA)
Project management
User experience design
This box: view  talk  edit

A test case in software engineering is a set of conditions or variables under which a tester will determine if a requirement or use case upon an application is partially or fully satisfied. It may take many test cases to determine that a requirement is fully satisfied.

Test cases are often incorrectly referred to as test scripts. Test scripts are lines of code used mainly in automation tools.

Written test cases are usually collected into test suites.

Contents

[edit] Formal requirement-based test cases

In order to fully test that all the requirements of an application are met, there must be at least one test case for each requirement unless a requirement has sub-requirements. In that situation, each sub-requirement must have at least one test case. This is frequently done using a traceability matrix. Some methodologies, like RUP, recommend creating at least two test cases for each requirement. One of them should perform positive testing of requirement and other should perform negative testing. Written test cases should include a description of the functionality to be tested, and the preparation required to ensure that the test can be conducted.

What characterizes a formal, written test case is that there is a known input and an expected output, which is worked out before the test is executed. The known input should test a precondition and the expected output should test a postcondition.

[edit] Informal requirement-based test cases

For application without formal requirements, test cases can be written based on the accepted normal operation of programs of a similar class. In some schools of testing, test cases are not written at all but the activities and results are reported after the tests have been run.

[edit] Typical Test Cases format

Test Cases usually have the following components.

  • Test Case Summary
  • Configuration
  • Initial Condition
  • Steps to run the test case
  • Expected behavior/outcome

[edit] Further reading

Under special circumstances, there could be a need to run the test, produce results, and then a team of experts would evaluate if the results can be considered as a pass. This happens often on new products' performance number determination. The first test is taken as the base line for subsequent test / product release cycles.

A variation of test cases are most commonly used in acceptance testing. Acceptance testing is done by a group of end-users or clients of the system to ensure the developed system meets the requirements specified. User acceptance testing is usually differentiated by the inclusion of happy path or positive test case.

[edit] References