Editor’s notes: Wayne Yaddow is an independent consultant with over 20 years’ experience leading data migration/integration/ETL testing projects at organizations including J.P. Morgan Chase, Credit Suisse, Standard and Poor’s, AIG, Oppenheimer Funds, IBM, and Achieve3000. Additionally, Wayne has taught IIST (International Institute of Software Testing) courses on data warehouse, ETL, and data integration testing. He continues to lead numerous ETL testing and coaching projects on a consulting basis. You can contact Wayne at firstname.lastname@example.org.
This article was originally published on https://www.logigear.com
A characteristic of DW development is the frequent release of high quality data for user feedback and acceptance. At the end of each iteration of DW ETLs, data tables are expected to be of sufficient quality for the next ETL phase. This objective requires a unique approach to quality assurance methods and tools. Foremost it means integrating QA efforts and automation into ETL development iterations.
Essential to integrated ETL testing is test automation. Manual testing is not practical in a highly iterative and adaptive development environment. There are two key problems with manual testing.
First, it takes too long and is therefore a significant inhibitor to the frequent delivery of working software. Teams that rely primarily on manual testing ultimately end up deferring testing until dedicated testing periods, which allows bugs to accumulate.
Second, manual ETL testing is not sufficiently repeatable for regression testing. While seeking to embrace and adapt to change, we must always be confident that features that were “done, complete!” in previous iterations retain their high quality considering the changing systems.
Test automation requires initial planning and ongoing diligence, but once technical teams embrace automation, project success is more assured.
Data Warehouse test automation
Data warehouse test automation is described as the use of tools to control 1) the execution of tests, 2) the comparison of actual outcomes to predicted outcomes, 3) the setting up of test preconditions, and other test control and test reporting functions. Commonly, test automation involves automating a manual process already in place that uses a formalized testing process.
Although manual ETL tests may find many data defects, it is a laborious and time-consuming process. In addition, manual tests may not be effective in finding certain classes of defects. DW test automation involves writing programs for testing that would otherwise need to be done manually. Once tests have been automated, they can be run quickly and repeatedly. This is often the most cost-effective method for a DW that may have a long maintenance life because even minor patches or enhancements over the lifetime of the warehouse can cause features to break which were working earlier.
Integrated automated testing in ETL development presents a unique set of challenges. Current automated testing tools designed for software development are not easily adaptable for database and ETL projects; large data volumes can make automated testing a daunting task. The wide variety of DW architectures further complicate these challenges because they involve multiple databases which require special coding for data extraction, transformations, and loading, also data cleansing, data aggregations, data enrichments.
Test automation tools can be expensive; the tools are usually employed in combination with manual testing. However, they can become cost-effective in the longer term, particularly when used repeatedly in regression testing.
Goals for test automation in DW ETL processes
What to automate, when to automate, or even whether one really needs automation are crucial decisions which the testing (or development) team must make. Selecting the correct features of the product for automation largely determines the success of the automation.
Automating unstable features or features that are undergoing changes should be avoided. Today, there is no known commercial tool or a set of methods / processes that can be said to represent comprehensive end to end DW testing. Leading ETL tool vendors from Informatica, Microsoft, and others do not promote any one test tool as the answer to ETL automated testing.
Common objectives for ETL test automation
- Automate as many DW testing cycle activities as possible
- Develop a regression test suite for system testing and production monitoring
- Focus on numeric financial information for compliance and financial reporting
- Identify mismatched and missing data
- Profile the performance of the DW
- Provide assurances to auditors that all financial information residing within a DW can be trusted
- Reconcile data between input and transformation processes
- Reduce manual testing workloads which is often thousands of SQL scripts
- Validate information between sources and their final destination in the DW
- Verify all data, not just a subset or sample
- Verify implementation of complex data transformation rules
- Verify target data after each the ETL process
Automation of these tests may also be required due to the complexity of processing and the number of sources and targets that require checks. Without automation, these checks are often costly or in some cases impossible to do manually.
ETL functions that are often candidates for test automation
- Data aggregation processing
- Data cleansing and archiving
- Dimension table data loads
- End to end testing
- Extract transform load (ETL) validation and verification testing
- Fact table data loads
- File/data loading verification
- Incremental load testing
- Load and scalability testing
- Performance testing
- Regression Testing
- Security testing
- Source data testing and profiling
- Staging, ODS data validations
- BI report testing
For most DW development, the ETL test processes are designed to check for and implement data quality. Therefore, selection of a high-function ETL tool (e.g., Informatica, SSIS, DataStage, in-house developed, etc.) is a serious concern for the DW project.
Deciding which ETL tests to automate
The trick is to figure out what needs to be automated, and how to approach this task. An array of questions must be considered in the course of automating tests such as:
- How much will it cost to automate tests?
- Who will do the automation (ex., Dev., QA)?
- What testing tools should be used (ex. open source, commercial)?
- How will the test results be reported?
- Who will interpret the test results?
- What will script maintenance consist of?
- What will happen to the test scripts after the launch of the application?
Figure 1 shows examples of time durations for manual vs. automated test cases for a sample set of test cases.
A primary objective of automated DW testing is coverage of the most critical functions of loading a DW – synchronization and reconciliation of source and target data.
Benefits and limitations of automated ETL testing
Some ETL Test Automation Challenges
- Large numbers of source and target tables and records
- Testing the data synchronization for all DW tables
- Testing business intelligence or analytic reports through automation
- Executing test cases faster. Automation can speed up test case implementation
- Results in reusable test suites. Once test scripts have been created with automation tools, they can be saved for easier recall and reuse.
- Eases test reporting. An attractive feature of many automated tools is their ability to generate reports and test records. Such capabilities provide an accurate representation of the state of the data, clearly identify any defects, and be used in compliance audits.
- Reduces staffing and rework costs. The time that would be spent on manual testing or retesting after fixing defects can be spent on other initiatives within the IT department.
- Can not eliminate manual testing. Although automation can be used for many applications and test cases, it can not totally replace manual testing. Complex test cases will still exist where automation may not catch everything, and for user acceptance testing, end users must often manually run tests. Therefore, it is important to have the right mix of automated and manual testing in the process.
- Cost of tools. Automated testing tools can be costly, depending on their size and functionality. At first glance, the business may not see this as a necessary cost; however, the reusability alone can quickly turn it into an asset.
- Cost of training. Some automated tools can be complex to use and may require training to get started. Testers must be trained not only on the software, but also on the automated test planning process.
- Automation needs effective planning, preparation, and dedicated resources. The success of automated testing is highly dependent on clear testing requirements and careful test case development before testing begins. Because each organization, and DW application can be unique, an automated testing tool will not frequently create test cases. Unfortunately, test case development is still a manual process.
Getting started with ETL test automation
Not all ETL testing is suitable for automation. Assess the situations mentioned above to determine which types of automation would benefit the testing process and how much is needed. Evaluate testing requirements and identify inefficiencies that may be fixed with automated testing. QA teams that spend a lot of time on regression testing will benefit the most.
Develop a business case for automated testing. Automated testing generally comes at an additional cost over manual testing, so in order to convey the value to the business, IT must first make the case.
Evaluate the options. After evaluating the current state and requirements within the IT department, investigate which tools fit the organization’s testing processes and environments. Options may include vendor, open source, in-house, or a combination of the tools.
Typical automated ETL testing scenarios
A principle of agile and other modern development is automated testing. We can apply this awareness to DW.
An important DW testing consideration is that the number of tests that are run will continue to grow to verify added functionality.
As shown in Figure 2, there are four major areas of end-to-end ETL testing. For data automation testing, the emphasis at each test entry point is the validation of data integrity.
When implementing test automation, data can be tracked from the source layer, through ETL processing, to loads in the DW, then finally to the front-end applications or reports. If corrupt data is found in a front-end application or report, the execution of automated suites can help to more rapidly determine whether the problem is located in the data source, an ETL process, in a DW database/data mart or in the business intelligence reports.
For performance testing, the same test entry points are utilized to focus on characterizing subsystem response under load. A similar strategy is used for data integrity validation to determine the origin of performance issues. Subsystem performance can be measured at any of the identified test entry points.
An emphasis on rapid localization of either data and performance problems in complex DW architectures provides a key tool for promoting efficiencies in development, for shortening build cycles, and meeting release targets.
Automated testing tools are most helpful when used in the following circumstances.
- Repetitive, mundane tasks. As ETL processes are developed, they will be exposed to many revisions and through many versions – each of which must be tested. By creating test scripts once, automated testing allows reuse for future versions.
- Regression testing. Each time a change is made to data or business rules, testers using a manual approach must go through each function and make sure it does not affect any other part of the system. Automated regression testing executes test cases to do this much faster.
- Multiple combinations. In increasingly complex environments where many scenarios must be examined, automated testing can rapidly run many test case combinations using a few scripts.
- Re-usability: These automated tests can be reused with minimum efforts for regression testing when newer versions of the source systems are introduced.
As test automation has rapidly become an essential alternative to manual testing, more companies are looking for tools and strategies to successfully apply automation. This trend has led to the significant growth in test automation tools based on Selenium, Katalon Studio, Appium, and many more.
However, to fully utilize these automation tools, DW and BI QA teams must possess appropriate programming skills. Adding to that. businesses are becoming more agile and applications are updated more frequently.
Many IT experts have predicted that ongoing, the knowledge gap between the testers and developers must and will be narrowed. Automated ETL testing tools can significantly reduce the amount of time spent testing code in comparison to traditional manual methods. Other benefits include the creation of reusable code and a reduction in costs associated with personnel and rework.
Gain knowledge about automated DW testing and tools to decide if it’s right for your QA project.