Professional Documents
Culture Documents
Index/Constraint Check
Verify that proper constraints and indexes are defined on the database tables as per the design
specifications.
Verify that the columns that cannot be null have the 'NOT NULL' constraint.
Verify that the unique key and foreign key columns are indexed as per the requirement.
Verify that the table was named according to the table naming convention.
Example 1: A column was defined as 'NOT NULL' but it can be optional as per the design.
Example 2: Foreign key constraints were not defined on the database table resulting in orphan records in
the child table.
SELECT fst_name, lst_name, mid_name, date_of_birth, count(*) FROM Customer GROUP BY fst_name,
lst_name, mid_name HAVING count(*)>1
Example: In a ERP scerario, Order Line table has a foriegn key for the Order Header table. Check for
Orphan Order line records without the corresponding Order header record.
1. Count of nulls in the Order Header foreign key column in the Order Line table:
SELECT count(order_header_id) FROM order_lines where order_header_id is null
2. Count of invalid foriegn key values in the Order Line table:
SELECT order_header_id FROM order_lines
minus
SELECT h.order_header_id FROM order_header h, order_lines l where
h.order_header_id=l.order_header_id
ETL Validator comes with Data Rules Test Plan and Foreign Key Test Plan for automating the data
quality testing.
Data Rules Test Plan: Define data rules and execute them on a periodic basis to check for data that
violates them.
Foreign Key Test Plan: Define data joins and identify data integrity issues without writing any SQL
queries.
ETL Validator comes with Baseline & Compare Wizard and Data Rules test plan for automatically
capturing and comparing Table Metadata.
Baseline reference data and compare with the latest copy to track changes to reference data.
Define data rules to verify that the data conform to the domain values
Example: In a financial company, the interest earned on the savings account is dependent the daily
balance in the account for the month. A database procedure was written in the application to calculate the
interest earned as part of the month end process.
1. Review the requirement and design for calculating the interest and come up with the test cases.
2. Setup test accounts and the corresponding daily balance records.
3. Execute procedure for calculating the interest passing the corresponding account and month details.
Verify that the interest output from the procedure is the expected value.
4. Cleanup test account and daily balance data from database tables.
Changes to Metadata
Track changes to table metadata such as adding or dropping of columns, new constraints and
tables. Often database metadata changes are not communicated to the QA and Development teams
resulting in Application failures. Maintaining a history of DDL changes will help narrow down the tests
that need to be run.
Example 1: The length of a comments column was increased in the application UI but the corresponding
increase was not made in the database table.
Example 2: One of the index in the database was dropped accidentally which resulted in application
performance issues.
ETL Validator comes with a Metadata Compare Wizard that helps track changes to Table
metadata over a period of time. This helps ensure that the QA and development teams are aware of
the changes to table metadata.
ETL Validator also has the capability to Baseline and Compare the output of database
procedures so that any changes in the output can be validated.
Example: One of the optional postal address field in the UI was not getting saved to the database
because of an application defect. The issue was only identified after the application went live when some
of the mails were returned.
Example: The application UI allowed the user to enter the comments larger than 2000 characters while
the corresponding database column was defined as VARCHAR(2000). Any user comments longer than
2000 characters were getting truncated by the database procedure during the insert.