Test case

From Oracle FAQ
Jump to: navigation, search

A Test case is a sequence of repeatable steps that can be used to: (1) test or verify that an application is functioning as expected; or (2) demonstrate a bug or functionality that doesn't work. A test case should at least contain an input description, the test sequence, and a description of the expected behaviour.

[edit] Minimalism

Always remove unnecessary information from the test case. It is important to spend some time on this, if not you are going to waste a lot of people's time. For example, remove unnecessary columns from tables; remove unneeded fields from SQL*Loader control files; remove superfluous functions and code from programs, etc.

[edit] Required information

Ensure you include the right information to make your test case reproducible and repeatable. Some suggestions:

SQL and PL/SQL issues or errors:

Include the CREATE table statement, provide sample data (INSERT statements) as well as the expected result. Also include the SQL code that's not working and the error you are getting. For PL/SQL errors, provide the code with the error's line number and the method that was used to call it.

SQL performance problems:

Include the SQL statement and an explain plan; provide a list of the table's indexes and useful statistics (number of rows in the table, number of distinct values in the columns...); specify if statistics are gathered and up to date.

SQL*Loader problems:

Provide a control file with only the fields required to demonstrate the problem. Also include sample data within the control file (at the end after a BEGINDATA statement).

Program errors:

Post the code required to reproduce the error (trim it down, see Minimalism above). Include the error code and line number where the problem occured.

[edit] External links