Wednesday, October 31, 2012

Database Testing.

To test the database:
  • Create a controlled version of the migrated database.
  • Oracle recommends that you keep the database migration scripts in a source control system.
  • Design a set of test cases that you can use to test the Oracle database from unit to system level. The test cases should:
Ensure the following:
  • All the users in the source database have migrated successfully.
  • Privileges and grants for users are correct.
  • Tables have the correct structure, defaults are functioning correctly, and errors did not occur during mapping or generation.
Validate that the data migrated successfully by doing the following:
  • Comparing the number of rows in the Oracle database with those in the source database.
  • Calculating the sum of numerical columns in the Oracle database and compare with those in the source database.
Ensure that the following applies to constraints:
  • You cannot enter duplicate primary keys.
  • Foreign keys prevent you from entering inconsistent data.
  • Check constraints prevent you from entering invalid data.
  • Check that indexes and sequences are created successfully.
Ensure that views migrated successfully by doing the following:
  • Comparing the number of rows in the Oracle database with those in the source database.
  • Calculating the sum of numerical columns in the Oracle database and compare with those in the source database.
Ensure that triggers, procedures, and functions are migrated successfully. Check that the correct values are returned for triggers and functions.

Data integrity is tested by the following tests:
  • Verify that you can create, modify, and delete any data in tables.
  • Verify that sets of radio buttons represent fixed sets of values.
  • Verify that a blank value can be retrieved from the database.
  • Verify that, when a particular set of data is saved to the database, each value gets saved fully, and the truncation of strings and rounding of numeric values do not occur.
  • Verify that the default values are saved in the database, if the user input is not specified.
  • Verify compatibility with old data, old hardware, versions of operating systems, and interfaces with other software.