Welcome!

IBM Cloud Authors: Zakia Bouachraoui, Elizabeth White, Yeshim Deniz, Pat Romanski, Liz McMillan

Related Topics: IBM Cloud

IBM Cloud: Article

How To Use Enterprise Open Source Tool "OpenSTA" With IBM's WebSphere Application Server

How the open source tool OpenSTA facilitated system integration testing of a middleware solution based on WAS

Testing distributed transactional systems involves wrangling a lot of test data and test scripts. IBM's Greg Herringer describes how OpenSTA helped to automate his project's system integration testing activity without breaking the testing budget.

The article describes how the open source tool OpenSTA facilitated system integration testing of a middleware solution based on IBM WebSphere Application Server and the WebSphere Branch Transformation Toolkit (BTT). OpenSTA automation improved test execution accuracy and reproducibility while preserving the project's tight test budget. With the benefit of the lessons learned and key OpenSTA workarounds documented in this article, you may want to consider OpenSTA for your own distributed application testing strategy.

Customizing the Test Script Template
The generic design of the test script template results in only four lines that have to be modified for each specific test script:

  • Line 4 contains the test script name per the project's naming convention. This name appears in the test results.
  • Lines 15 and 17 point to the IFX-encoded request and model response specific to the test script.
  • Line 46 calls the subroutine designed to make specific comparisons of the actual response to the model response based on the type of test being run.
Test Script Subroutines
The OpenSTA Script Control Language supports several structured programming techniques. The test script template exploits OpenSTA's support for user-defined subroutines. By defining a generic test script template that was used for all tests, any logic changes or enhancements made to the test script capabilities could be contained in two files, IFX_SUBROUTINES.INC and IFX_VARIABLES.INC. This eliminates the need to refresh the entire set of test scripts when a scripting enhancement is identified. Instead, these two common files could be deployed to the test clients.

Of the 24 custom subroutines supporting these test scripts, the following three subroutines from the IFX_SUBROUTINES.INC file are representative of OpenSTA's various capabilities:

  • Read_Rq - this subroutine makes use of the character string variable REQUEST_LINE shown in Listing 1 to read in the IFX-encoded request message at script execution time. The OpenSTA Script Control Language reference suggests using the built-in command OPEN for file handling; however, there is an outstanding bug in OpenSTA, so only the first line of a file can be read. The Read_Rq subroutine provides a custom alternative to using the built-in command.
  • Remove_NewUpDt - this subroutine makes extensive use of the string manipulation commands available in OpenSTA. Its purpose is to remove those IFX elements from both the model response and actual response that contain timestamps. Since the timestamp elements of the actual response is different for every execution of the test script, they are removed from the comparison of the actual response with the model response. For the initial system integration test cycles, the test team visually inspects the timestamp elements of the actual response to ensure that the value is in the correct format and time range.
  • Generate_RqUID - this subroutine uses OpenSTA's current date, current time, and random number generation features to generate a unique identifier for each IFX-encoded request sent to the middleware. This unique identifier is subsequently associated with the actual IFX-encoded response per the project's IFX specification.
The IFX_SUBROUTINES.INC and IFX_VARIABLES.INC files are included in the OpenSTA script package available with this article online at http://websphere.sys-con.com/ (WebSphere Journal archives Vol: 4, Iss: 8).

There are some limitations imposed by OpenSTA on the design of the subroutines and the use of variables in those subroutines. For instance, the variables defined are all global. This means that local variables can't be used in the subroutines. Local variable techniques could have reduced the amount of duplicated logic in the subroutines.

Another OpenSTA limitation is that there can be at most 128K of character string data defined by any one script. This proved to be a challenge since some of the IFX-encoded messages can be up to 15K in length. In combination with the variables used to store message fragments for various parsing routines, the scripts come close to breaking this character string data maximum.

Loop control also proved to be a challenge. Specifically, OpenSTA can't specify a "do while" or "do forever" control for loops in which the number of iterations isn't known in advance. The solution is illustrated in Listing 1.

Listing 1 shows that a loop count maximum has been specified (MAXFILESIZE). If the last line of the IFX-encoded message is encountered before the loop count maximum, additional subroutines are called and the loop is ended. If the loop count is exceeded, a message is recorded in the test script log and is considered by the tester to be a failure in the test script. Fortunately, this message wasn't encountered during the formal system integration test cycles.

Executing the Tests
Once the test scripts were prepared, the formal system integration testing could begin. OpenSTA provides a test execution framework that lets testers execute one or more scripts in various combinations and a configurable number of iterations. Figure 1 shows a typical OpenSTA Test designed to run all the tests in project test category 00_4A one at a time with a delay of five seconds between each test execution as indicated in the Start column. Note that since there's only one iteration of each test script, the delay options shown at the bottom of Figure 1 don't apply.

As the tests were executed, OpenSTA tracked the test results in two files: TestRep.txt and TestLog.txt. OpenSTA provided additional test result files, but these were the two used by the test team.

The TestRep.txt file recorded all the messages issued by the REPORT command in the test script, including the REPORT commands that wrote the actual IFX-encoded response. It also recorded the pass/fail flag for the test case. The testers used the TestRep.txt file to verify the test case results, investigating the test cases flagged as failed.

The TestLog.txt file tracked the execution of the test, recording each subroutine used by the test and any script execution errors. This file was useful while testing the logic of the test scripts and as a double check during formal execution of the test scripts.

Lessons Learned
In summary, OpenSTA satisfied our requirement for a test automation tool. The following lessons learned provide additional detail.

OPENSTA MET OUR NEEDS WITH SOME WORKAROUNDS
The test team was able to stay within the project test budget and schedule by creatively using a combination of OpenSTA features. As noted throughout this article, several workarounds were devised when OpenSTA didn't perform as expected or documented; however, the time spent finding and circumventing these issues was minimal. It should be noted that though OpenSTA can only be executed on a Windows platform, it can send and receive HTTP requests to servers deployed on any technology.

OPENSTA USERS SHOULD BE COMFORTABLE WITH SCRIPTING LANGUAGES
The OpenSTA Script Control Language lets testers devise complex test scenarios complete with test result validation. To do this, the test script authors must have programming experience in languages similar to the Script Control Language such as Unix shell scripting or IBM REXX.

MODULAR DESIGN GREATLY REDUCES THE EFFORT TO DEPLOY TEST SCRIPT ENHANCEMENTS
The test scripts were designed to exploit OpenSTA's modular architecture. By designing a generic test case template with calls to common subroutines, script enhancements were easily deployed to the test environment by simply updating two files: IFX_SUBROUTINES.INC and IFX_VARIABLES.INC. The hundreds of test case scripts developed for the project would automatically reference the script enhancements in these files.

TEST SCRIPT NAMING CONVENTION IS ESSENTIAL
The test team found it beneficial to adopt a rigorous naming standard for the test cases and the test scripts even though this wasn't a mandatory OpenSTA requirement. The naming convention helped the team organize all the test script components and facilitated incident reporting.

Part 1 of this article appeared in the August 2005 issue of WebSphere Journal Vol: 4, Iss: 8.

Resources

More Stories By Greg Herringer

Greg Herringer is an IT Architect with 15 years of experience in customer relationship management and contact center technologies, with a focus on the financial services and public sector industries. His background cuts across the entire application development lifecycle.

Comments (2)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


IoT & Smart Cities Stories
Moroccanoil®, the global leader in oil-infused beauty, is thrilled to announce the NEW Moroccanoil Color Depositing Masks, a collection of dual-benefit hair masks that deposit pure pigments while providing the treatment benefits of a deep conditioning mask. The collection consists of seven curated shades for commitment-free, beautifully-colored hair that looks and feels healthy.
The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today. According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...
The textured-hair category is inarguably the hottest in the haircare space today. This has been driven by the proliferation of founder brands started by curly and coily consumers and savvy consumers who increasingly want products specifically for their texture type. This trend is underscored by the latest insights from NaturallyCurly's 2018 TextureTrends report, released today. According to the 2018 TextureTrends Report, more than 80 percent of women with curly and coily hair say they purcha...
We all love the many benefits of natural plant oils, used as a deap treatment before shampooing, at home or at the beach, but is there an all-in-one solution for everyday intensive nutrition and modern styling?I am passionate about the benefits of natural extracts with tried-and-tested results, which I have used to develop my own brand (lemon for its acid ph, wheat germ for its fortifying action…). I wanted a product which combined caring and styling effects, and which could be used after shampo...
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected pat...
There are many examples of disruption in consumer space – Uber disrupting the cab industry, Airbnb disrupting the hospitality industry and so on; but have you wondered who is disrupting support and operations? AISERA helps make businesses and customers successful by offering consumer-like user experience for support and operations. We have built the world’s first AI-driven IT / HR / Cloud / Customer Support and Operations solution.
Codete accelerates their clients growth through technological expertise and experience. Codite team works with organizations to meet the challenges that digitalization presents. Their clients include digital start-ups as well as established enterprises in the IT industry. To stay competitive in a highly innovative IT industry, strong R&D departments and bold spin-off initiatives is a must. Codete Data Science and Software Architects teams help corporate clients to stay up to date with the mod...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
Druva is the global leader in Cloud Data Protection and Management, delivering the industry's first data management-as-a-service solution that aggregates data from endpoints, servers and cloud applications and leverages the public cloud to offer a single pane of glass to enable data protection, governance and intelligence-dramatically increasing the availability and visibility of business critical information, while reducing the risk, cost and complexity of managing and protecting it. Druva's...
BMC has unmatched experience in IT management, supporting 92 of the Forbes Global 100, and earning recognition as an ITSM Gartner Magic Quadrant Leader for five years running. Our solutions offer speed, agility, and efficiency to tackle business challenges in the areas of service management, automation, operations, and the mainframe.