Unit Testing Template For Etl Process

Unit Testing Template For Etl Process Rating: 3,9/5 5708votes

Before we learn anything about ETL Testing its important to learn about Business Intelligence and Dataware. Let’s get started – What is BI? Business Intelligence is the process of collecting raw data or business data and turning it into information that is useful and more meaningful. The raw data is the records of the daily transaction of an organization such as interactions with customers, administration of finance, and management of employee and so on. These data’s will be used for “Reporting, Analysis, Data mining, Data quality and Interpretation, Predictive Analysis”.

Unit Testing Template For Etl Process

Medical Physiology Boron Torrent Pdf Books. What is Data Warehouse? A data warehouse is a database that is designed for query and analysis rather than for transaction processing.

The data warehouse is constructed by integrating the data from multiple heterogeneous sources.It enables the company or organization to consolidate data from several sources and separates analysis workload from transaction workload. Data is turned into high quality information to meet all enterprise reporting requirements for all levels of users. ETL stands for Extract-Transform-Load and it is a process of how data is loaded from the source system to the data warehouse. Data is extracted from an OLTP database, transformed to match the data warehouse schema and loaded into the data warehouse database. Many data warehouses also incorporate data from non-OLTP systems such as text files, legacy systems and spreadsheets. Let see how it works For example, there is a retail store which has different departments like sales, marketing, logistics etc.

Browse other questions tagged unit-testing etl. ETL Metrics and ETL Process Definitions and Deliverables. ETL Test Plan Template Completed.

Each of them is handling the customer information independently, and the way they store that data is quite different. The sales department have stored it by customer’s name, while marketing department by customer id. Now if they want to check the history of the customer and want to know what the different products he/she bought owing to different marketing campaigns; it would be very tedious. The solution is to use a Datawarehouse to store information from different sources in a uniform structure using ETL. Eml To Pst Converter Keygen Download. ETL can transform dissimilar data sets into an unified structure.Later use BI tools to derive meaningful insights and reports from this data. The following diagram gives you the ROAD MAP of the ETL process • Extract • Extract relevant data • Transform • Transform data to DW (Data Warehouse) format • Build keys - A key is one or more data attributes that uniquely identify an entity.

Various types of keys are primary key, alternate key, foreign key, composite key, surrogate key. The datawarehouse owns these keys and never allows any other entity to assign them. • Cleansing of data:After the data is extracted, it will move into the next phase, of cleaning and conforming of data.

Cleaning does the omission in the data as well as identifying and fixing the errors. Conforming means resolving the conflicts between those data’s that is incompatible, so that they can be used in an enterprise data warehouse. In addition to these, this system creates meta-data that is used to diagnose source system problems and improves data quality. • Load • Load data into DW ( Data Warehouse) • Build aggregates - Creating an aggregate is summarizing and storing data which is available in fact table in order to improve the performance of end-user queries. What is ETL Testing?

ETL testing is done to ensure that the data that has been loaded from a source to the destination after business transformation is accurate. It also involves the verification of data at various middle stages that are being used between source and destination. ETL stands for Extract-Transform-Load. ETL Testing Process Similar to other Testing Process, ETL also go through different phases. The different phases of ETL testing process is as follows ETL testing is performed in five stages • Identifying data sources and requirements • Data acquisition • Implement business logics and dimensional Modelling • Build and populate data • Build Reports Types of ETL Testing Types Of Testing Testing Process Production Validation Testing “Table balancing” or “production reconciliation” this type of ETL testing is done on data as it is being moved into production systems.

To support your business decision, the data in your production systems has to be in the correct order. Data Validation Option provides the ETL testing automation and management capabilities to ensure that production systems are not compromised by the data. Source to Target Testing (Validation Testing) Such type of testing is carried out to validate whether the data values transformed are the expected data values. Application Upgrades Such type of ETL testing can be automatically generated, saving substantial test development time.

This type of testing checks whether the data extracted from an older application or repository are exactly same as the data in a repository or new application. Metadata Testing Metadata testing includes testing of data type check, data length check and index/constraint check. Data Completeness Testing To verify that all the expected data is loaded in target from the source, data completeness testing is done.

Some of the tests that can be run are compare and validate counts, aggregates and actual data between the source and target for columns with simple transformation or no transformation. Data Accuracy Testing This testing is done to ensure that the data is accurately loaded and transformed as expected. Data Transformation Testing Testing data transformation is done as in many cases it cannot be achieved by writing one sourcequery and comparing the output with the target. Multiple SQL queries may need to be run for each row to verify the transformation rules.

Data Quality Testing Data Quality Tests includes syntax and reference tests. In order to avoid any error due to date or order number during business process Data Quality testing is done. Syntax Tests: It will report dirty data, based on invalid characters, character pattern, incorrect upper or lower case order etc. Reference Tests: It will check the data according to the data model.

For example: Customer ID Data quality testing includes number check, date check, precision check, data check, null check etc. Incremental ETL testing This testing is done to check the data integrity of old and new data with the addition of new data. Incremental testing verifies that the inserts and updates are getting processed as expected during incremental ETL process. GUI/Navigation Testing This testing is done to check the navigation or GUI aspects of the front end reports. How to create ETL Test Case ETL testing is a concept which can be applied to different tools and databases in information management industry.

The objective of ETL testing is to assure that the data that has been loaded from a source to destination after business transformation is accurate. It also involves the verification of data at various middle stages that are being used between source and destination. While performing ETL testing, two documents that will always be used by an ETL tester are • ETL mapping sheets:An ETL mapping sheets contain all the information of source and destination tables including each and every column and their look-up in reference tables.

An ETL testers need to be comfortable with SQL queries as ETL testing may involve writing big queries with multiple joins to validate data at any stage of ETL. ETL mapping sheets provide a significant help while writing queries for data verification. • DB Schema of Source, Target: It should be kept handy to verify any detail in mapping sheets. ETL Test Scenarios and Test Cases.

Test Scenario Test Cases Mapping doc validation Verify mapping doc whether corresponding ETL information is provided or not. Change log should maintain in every mapping doc. Validation • Validate the source and target table structure against corresponding mapping doc. • Source data type and target data type should be same • Length of data types in both source and target should be equal • Verify that data field types and formats are specified • Source data type length should not less than the target data type length • Validate the name of columns in the table against mapping doc. Constraint Validation Ensure the constraints are defined for specific table as expected Data consistency issues • The data type and length for a particular attribute may vary in files or tables though the semantic definition is the same. • Misuse of integrity constraints Completeness Issues • Ensure that all expected data is loaded into target table.

• Compare record counts between source and target. Automation of ETL Testing The general methodology of ETL testing is to use SQL scripting or do “eyeballing” of data.

These approaches to ETL testing are time-consuming, error-prone and seldom provide complete test coverage. To accelerate, improve coverage, reduce costs, improvedetection ration of ETL testing in production and development environments, automation is the need of the hour. One such tool is Informatica.

ETL Test Scenarios are used to validate an ETL Testing Process. The following table explains some of the most common scenarios and test-cases that are used by ETL testers. Test Scenarios Test-Cases Structure Validation It involves validating the source and the target table structure as per the mapping document. Data type should be validated in the source and the target systems. The length of data types in the source and the target system should be same. Data field types and their format should be same in the source and the target system. Validating the column names in the target system.

Validating Mapping document It involves validating the mapping document to ensure all the information has been provided. The mapping document should have change log, maintain data types, length, transformation rules, etc. Validate Constraints It involves validating the constraints and ensuring that they are applied on the expected tables.

Data Consistency check It involves checking the misuse of integrity constraints like Foreign Key. The length and data type of an attribute may vary in different tables, though their definition remains same at the semantic layer.

Data Completeness Validation It involves checking if all the data is loaded to the target system from the source system. Counting the number of records in the source and the target systems. Boundary value analysis. Validating the unique values of primary keys.

Data Correctness Validation It involves validating the values of data in the target system. Misspelled or inaccurate data is found in table. Null, Not Unique data is stored when you disable integrity constraint at the time of import. Data Transform validation It involves creating a spreadsheet of scenarios for input values and expected results and then validating with end-users.

Validating parent-child relationship in the data by creating scenarios. Using data profiling to compare the range of values in each field. Validating if the data types in the warehouse are same as mentioned in the data model. Data Quality Validation It involves performing number check, date check, precision check, data check, Null check, etc. Example − Date format should be same for all the values. Null Validation It involves checking the Null values where Not Null is mentioned for that field.

Duplicate Validation It involves validating duplicate values in the target system when data is coming from multiple columns from the source system. Validating primary keys and other columns if there is any duplicate values as per the business requirement. Date Validation check Validating date field for various actions performed in ETL process. Common test-cases to perform Date validation − • From_Date should not greater than To_Date • Format of date values should be proper. • Date values should not have any junk values or null values Full Data Validation Minus Query It involves validating full data set in the source and the target tables by using minus query. • You need to perform both source minus target and target minus source.

• If the minus query returns a value, that should be considered as mismatching rows. • You need to match the rows in source and target using the Intersect statement. • The count returned by Intersect should match with the individual counts of source and target tables. • If the minus query returns no rows and the count intersect is less than the source count or the target table count, then the table holds duplicate rows. Other Test Scenarios Other Test scenarios can be to verify that the extraction process did not extract duplicate data from the source system. The testing team will maintain a list of SQL statements that are run to validate that no duplicate data have been extracted from the source systems.

Data Cleaning Unwanted data should be removed before loading the data to the staging area.