OracleBIBlog Search

Friday, June 18, 2010

Effective Regression Testing for OBIEE Applications

It's a dark and stormy Friday night, and as you drift off into slumberland in your warm, dry and cozy bed, a thought pops up in your mind: "If a butterfly flaps its wings in Costa Rica tonight, will the CFO's Executive Financial Summary dashboard still work?" Suddenly you are wide awake and feeling a bit of paranoia. You jump out of bed, fire up your laptop, log into the corporate VPN and then into OBIEE...

This sounds like the beginning of a bad BI horror story -- and hopefully for all of you a scenario like this truly is just that - a story. But we've all experienced some variation of this scene. The OBIEE equivalent of butterflies do flap their wings in Costa Rica, and the result does sometimes alter the OBIEE equivalent of weather patterns in Japan. Change the name of a presentation column... or the mapping rules of a logical column... or the aggregation rules of a logical table... or a minor extraction rule in the warehouse ETL logic... or even simply merge your local RPD work into a MUD repository... and you risk causing an error in a report that might not be noticed until days after the change -- usually when the report is most needed.

The real truth is that an OBIEE system just like any other software implementation has some inherent fragility that requires vigorous regression testing strategies to keep it running smoothly. But while most "traditional" software systems have very clearly defined behaviors that lend themselves well to control by means of various specific testing strategies, a Business Intelligence application by nature does not always necessarily have completely predictable outcomes - especially true in OBIEE given the complexity of the BI Server and, for example, how it constructs queries against the underlying data.

Given the complexity of the OBIEE architecture and the fleeting nature of the data, establishing an adequate regression testing strategy is a challenge.

One excellent approach is to identify commonly executed queries with Usage Tracking (or just identify a specific request's logical query), then execute the corresponding logical sql using nqcmd.exe. This is an excellent approach but can respond to only two results: success or failure. In most cases this is entirely adequate.

Another approach favored of course by Oracle is to implement their Application Testing Suite, which looks ike a promising tool but frankly I have not heard of any usage in the real world -- if anyone has direct experience with this tool, feel free to respond. Moreover it goes without saying that license fees would be a significant factor in evaluating its total ROI.

A third way to address regression testing in OBIEE is to set up a series of webcat (HTTP) requests that can be executed on a scheduled basis by an automated web testing utility. Several such utilities exist - LoadRunner being the most prevalent - but as with Oracle's offering, most require licensing.

One popular web testing utility distributed as open-source software and therefore free of licensing costs has gained some following among the developer community: a Firefox plugin called Selenium (the IDE flavor, to be precise), which can execute a wide range of web page interactions and combine them into test scripts. These test scripts can then be assembled into test suites and exported to a full-fledged program in a variety of commonly used languages/frameworks (C#, Java, Perl, PHP, Python, Ruby), at which point this program can be scheduled for execution just like any other.

While Selenium is highly flexible, fairly easy to use and very cheap (at least in terms of licensing costs), it also has some drawbacks, particularly when used to test an OBIEE system. In the hopes of blazing the "Selenium for OBIEE" trail, I have attempted my own small POC by writing some basic test scripts against the Paint webcat. In doing so I identified some gotchas and workarounds that will at the very least help you successfully construct OBIEE test scripts using this very capable tool. I will explore those workarounds and advanced configurations in later posts. But my overall opinion is that Selenium is a very capable testing tool which deserves serious consideration for use in an OBIEE environment.

Here are what I consider general strengths of Selenium:

Flexible

  • Can execute a variety of actions: open urls, click links, interact with prompts, execute javascript ...
  • Can be designed to respond to specified conditions either by failing OR by simply logging and continuing
  • Can assemble multiple test scripts within a single test suite
  • Can export scripts in a variety of languages / platforms - C#, Java, Perl, PHP, Python, Ruby
Straightforward to use
  • Scripts can be written using a simple Firefox plugin
  • Applies open standards: page elements are identified using Xpath
Economical
  • Open Source therefore no licensing
  • Fairly wide adoption therefore a decent user community
  • Commercial organizations exist that specialize in Selenium development & support
And some general challenges:

Somewhat steep learning curve
  • Though basic use is straightforwad, still takes a bit to get the hang of the tool
  • Because it's based on open standards like XPath, the skills learned are not "siloed" but can be useful elsewhere
  • Extending test suites for scheduled execution requires a leap of additional complexity
Open Source = No official support
  • On the other hand, there are plenty of answers to common problems on the web
  • Googling a solution is probably just as fast as relying on traditional paid support
OBIEE-Specific Challenges
  • Problematic handling of daughter or "target" windows
  • Default page element XPath queries cannot be used because they rely on IDs, which in OBIEE are dynamic

1 comments:

Anonymous said...

Hi Joseph,
This sounds very interesting - can't wait to see some details of how you get on. How have you dealt with things like delayed loads (where you get "Searching..." before a report's data is returned) and charts?
cheers, Robin.