Home > Articles > Programming

This chapter is from the book

29.3 First Day Automated Testing

Jonathon Lee Wright, United Kingdom

Consultant and speaker

In the past decade, I have dealt with a number of ways of creating testware frameworks and found advantages and disadvantages in each of the following approaches:

  • Modularity driven
  • Keyword driven
  • Data driven

In 2009, I was tasked with automating the testing of a new package for the New Zealand Lotteries Commission. The requirements phase had only just been completed, and the scheduled testing was looking very tight—less than a month (the schedule was imposed on us by marketing, who had already overcommitted their advertising!).

With just 2 months until the release would be delivered, this was an opportunity to adapt the testware frameworks I had used before, combining them with the latest technologies to develop what I refer to as a hybrid (keyword-/data-driven) automation framework.

Not only would this meet all the requirements set by the business, but more important, it would allow us to start the development of the testware framework immediately.

29.3.1 Initial Investment

The inherent problem with the hybrid approach is the large initial investment in time and effort to design the testware framework. Consequently, it was important that the development of this framework be treated as a legitimate project in its own right with its own planning, design, development, and testing phases together with the necessary resources. Table 29.1 shows our estimates for the effort required to create 100 test scenarios.

Table 29.1 Simple Calculations for Initial Testware Preparation Effort

Approach

Effort

Manual

2 weeks

Existing framework

1 month

Hybrid framework

2 months

In essence, the hybrid approach would take roughly twice as long as the previous automation approach, which in turn would take twice as long to automate than the preparation for manual testing.

29.3.2 What Is to Be Automated?

Given the limited time available and the increased initial effort required, it was critical that we identified the optimum test coverage. To avoid developing unnecessary test components, we used the MoSCoW method:

  • What must be automated?
  • What should be automated?
  • What could be automated?
  • What won’t be automated?

This method allowed us to focus our efforts on those test components that were necessary and would give the greatest value by assessing the associated business risk, reusability, usage, complexity, and feasibility of each test component.

The test components were regarded as individual jigsaw pieces, but we kept in mind what was needed to complete the entire puzzle.

Business process modeling (BPM) was used within the centralized test management tool (Quality Centre) to represent the individual puzzle pieces (test components); mapping the pieces revealed the workflow through the system.

Figure 29.1 shows how one BPM may only include 5 puzzle pieces but enable more than 20 different paths through the system under test (SUT), with each path having a different business risk and impact assessment.

Figure 29.1

Figure 29.1 Business process model of the SUT.

This made it easier to decide which automation modules to develop first by starting small and automating only the most critical business processes—keeping it as simple as possible while recognizing that the test coverage could be increased as the framework matured over time.

The decomposition of the workflows into a high-level model visualizes and enables an agile approach to the framework development. The development’s build order and resource focus becomes obvious.

Each path through the system represents an agile feature, which may be in or out of scope depending on time and resources. Another benefit of this approach is that the model becomes an artifact that may be shared between the test framework and target application developers.

29.3.3 First Day Automated Testing

The key to first day automated testing is to create a dynamic object repository based on a combination of fuzzy logic and descriptive programming supporting the design and development of test scenarios before the actual delivery of the SUT.

Traditionally, because of the dependency on building the object repository, test automation is carried out at the end of the software development lifecycle once the SUT is delivered. However, because we had only a single month in which to execute testing but a full 2 months before the SUT was delivered, it seemed logical to develop the testware framework beforehand while the application was still in development.

29.3.3.1 Business-Level Keywords

To allow the creation of test scenarios ahead of the SUT delivery, a high-level keyword approach was used to represent:

  • Specific BPM and business process testing (BPT) modules
  • Specific/collections of user stories
  • Assigned work items
  • Queries against the test asset database

Using high-level business-level keywords, such as Login.Process, allows complexity hiding and reusable encapsulation. Login.Process contains a number of low-level keywords, such as Enter Username Text and Press Login Button.

The collection of application keywords represents natural domain-specific languages that translate into a number of lower-level actions performed before and after the core event. This included checking that the pretest and posttest conditions were met and the actions and reactions, including any popup/error recovery, were processed correctly.

Using this approach meant we had a foundation upon which to design and develop reliable, domain-specific, and reusable test scenarios before the release of the SUT.

Writing the test scenarios (manual or automated) as business-level keywords combined with natural language made it accessible to application domain experts, business analysts, and developers. The test language was self-validating and human readable, which removed the requirements to educate the end user in the tool. The verbs and nouns in the domain-specific language were written in natural language using context-sensitive validation. This improved the utilization of resources by encouraging joint collaboration between multifunctional teams while supporting behavior-driven development (BDD).

The Scrum team was made up of a number of multidiscipline team members (business analysts, testers, and developers) sharing the various roles of the test design phase without any previous automation experience. This allowed teams to collaborate and share test assets such as BPM/BPT modules, user stories, and work items. They could also run queries against previously created test scenarios and reuse shared test cases and steps.

The flexibility of having the test scenarios stored in a database also allowed for full/partial fallback support for legacy manual testing because the test data could be easily extracted into a traditional test scenario format. It was easy to read because of the use of natural language combined with valid test data that could be easily used in manual test execution.

In summary, this approach of managing centralized test assets to generate sanitized test scenarios validated against business rules provided ready-to-use tests and data in the correct format. This was evidenced by the ability to generate tests featuring over 10,000 ticket number combination states covering all possible combinations of ticket types and amounts (this excluded specialized test runs such as boundary and negative tests, which were run separately) before the SUT had even been written.

29.3.4 Problems and Solutions

We found problems stemming from procedures not being followed consistently. For example, changes to the functionality of reusable test components’ jigsaw pieces were not being checked in correctly. This was caused by not having an enforceable gated check-in procedure and consequently resulted in limited reusability of some of the test components. The problem was solved by enforcing the check-in procedures in the Configuration Management tool.

It became apparent when the testware framework entered the execution phase and was distributed across a pool of remote test clients generated by a virtual machine (VM) dispenser that there was limited direct visibility into the test execution status.

While it was relatively easy to identify primary core modules failing on startup, more subtle changes to reusable test components were much harder to spot. The requirement for a test asset loader to validate the current SUT build against the test asset database before execution could have prevented this.

Without the ability to monitor runtime failure, especially controlled failure (i.e., scenario recovery), a significant amount of execution time was wasted. For example, a discrete change to a test component could cause a false-positive error, which in turn caused the testware framework to repeatedly retry the current test scenario before attempting to continue through the remaining test cases. What was needed here was a suitable real-time dashboard that could provide notifications regarding the SUT health as well as progress of test client execution.

We solved this problem by devising a way to flag the overall status of a test set—In Progress, Ready, Repair, or Blocked—to keep the tester informed. This would affect the current test run and associated test client VM’s state where, for example, a Blocked status did not allow the test run to be continued until the necessary pretest conditions were met (e.g., the Lotto product draw had been successfully processed).

29.3.5 Results of Our First Day Automation Approach

This approach worked extremely well, and we realized a good return on investment (ROI) for the additional effort in developing the framework.

Once the release was delivered, the execution was run constantly, day and night. This was made possible by having dedicated resources available during the day to deal with basic debugging of failed scripts and execution. Developers based in another time zone were also available in the evening to maintain the framework and provide additional support for improved test coverage.

Overall, this approach was found to work well in this case study by demonstrating its innate advantages, reflected in what I like to call the approach: Hybrid Keyword Data-Driven Automation Framework.

  • Hybrid: Utilizing the best technologies and resources to do the job.
  • Keyword: Creating simple and robust test scenarios written in business-level keywords combined with natural language.
  • Data: Effective use of dynamic business data to provide an input source.
  • Driven: Reusable component modules and libraries to provide reliable processing of generic actions, objects, and events.
  • Automation: That is collaborative, distributed, and scalable.
  • Framework: Independent of application, technology, or environment under test.

The best aspects of these proven approaches demonstrate how they have evolved over the past decade; this echoes some of the progress toward leaner and more agile business methodologies. They are in a constant state of evolution—just as the underpinning technologies evolve over time.

A significant benefit was that the framework had the ability to support multiple browsers, platforms, and technology stacks under a unified engine with the capability to deal with generic object classes as well as application-specific classes.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020