Keyword-Based Automated Testing in software testing

Source: Internet
Author: User

This article from http://www.51testing.com/html/26/n-89826.html
Author: David W. Johnson Translator: Li Rong Source: 51testing electronic magazine contribution.

I. Keyword Concept

Create a keyword-basedTestDesign and TestAutomationThe premise is that discrete functional business events that constitute any application can be described using short text description keywords and associated parameter values. For example, most applications require a user to log on. The keyword of this business event can be "Login User", and the parameter can be "User ID" and "password ". By designing keywords to describe discrete functional business events, the tester starts to create a general key font that can be used to create a keyword test case. This is the actual process of creating a language (keyword) to describe a series of events (test cases) in an application.

If it is correctly implemented and maintained, the keywords will present a good return on investment, because every business event is designed, automated, and maintained as a discrete entity. Then these keywords can be used to design keyword test cases, but the design and automation overhead of the keywords themselves have been paid. When changes occur within any given keyword, it is easy to find the affected test case and make appropriate updates. In addition, any design and update of the keyword itself is only executed once. Compare it with recording/playback (capture part of a specific business event or business event each time you run a test case)-If you start 100 test cases at login, this event runs 100 times automatically and requires maintenance in 100 cases.

1. Keyword Development
Keyword development should be used with any formal developmentWorkIn the same way. Keywords need to be designed, encoded, implemented, and maintained.

2. Design
The test designer is responsible for the design of keywords-the design of keywords should at least include: keyword name, keyword description and keyword parameter.

3. Keyword name
Standard keyword naming rules are drafted first, and then designers are allowed to effectively share keywords. The keyword name should start with the executed operation <action>, followed by the functional entity <entity>, followed by the descriptive text <text> (if needed). The following are common examples:
Login User-Login User
Enter user name-enter user name
Enter user address-enter user address
Verify user name-verify User Name
Select User records-Select User records
The keyword name should be a shorthand description of the operation executed by the keyword.

4. Keyword description
Keyword description should describe the behavior of keywords and contain enough information for test automation engineers to build keywords. For designers, the description is a keyword definition, while for automation engineers, it is a functional specification. This description must be brief and accurate-The following is an example of the keyword "Logon user:

Logon user Description: enter a specific user ID and password on the logon page, and then click "OK.

5. Keyword Parameters
Keyword parameters should capture all business inputs that affect real-time business events defined by keywords. The simplest and most reliable way to obtain an appropriate parameter list is to capture and display things. For the keyword "Login User", the application displays three elements: "User ID", "password", and "OK" Buttons-two required parameters used to support this keyword are "User ID" and "password ". The "OK" button is not a required parameter because it is frequently used to describe the "OK" button. If there are multiple buttons (such as "OK", "cancel", and "exit"), the third parameter "Press" is required and the keyword description needs to be modified.

6. Encoding
  Automated TestingThe engineer selects the keyword name, description, parameter, test application and keyword development standard under the test and builds the password. If there is any problem with the keyword, the automation engineer will contact the test designer to modify the design to clarify the purpose of the keyword. If there are any automation/engineering problems, the automation engineer will contact the development team and tool manufacturer to find the appropriate automation solution that conforms to the automation framework.

7. Implementation
Keyword to use the same path as any project resource that can be shared. The keywords should meet at least the following conditions:Unit Test,Function TestingAnd integrated into the project "testware. This process does not require complexity or scalability, but must ensure that any implemented keywords are published in the test group and can implement the expected functions.

8. Maintenance
Keyword maintenance is required when a keyword fault is detected, business events are changed, or keyword standards are modified. Keyword maintenance follows the same deployment path as keyword development: design, encoding, and implementation.

Ii. Keyword test case

A keyword test case is a series of keywords designed for testing or applying one or more aspects of one or more applications that are being tested. Keyword test cases must be designed, executed, and maintained. Writing a keyword test case is the responsibility of the test designer/tester. The automation engineer is required only when the keyword test case fails during execution. Note: keyword design examples are often used when keyword automation is missing-this is an effective example of independent test design.

1. Design
Keyword test case design includes the purpose of planning test cases, using keywords to create test cases, and testing design for ongoing testing applications. At first glance, this seems to work with any of the test case DesignsOthersThere are two methods, but there is a significant difference between the keyword test case design and any test case design in the form of hand/text. Keyword test case design features:

Consistency-the same keywords are used to describe business events each time,
Data driver-keywords include the data required to perform the test steps,
Automatically generated document-Keyword description contains detailed information about the designer's purpose,
Maintainability-with consistency, the next step is maintainability. In the end, automation is supported, instead of changing from test design to script automation.
The test designer can obtain the permissions of test automation without being a test automation engineer.

2. Run
By performing the keyword step in sequence, the tester can manually execute the keyword test case-this should be executed as part of the keyword verification process. Test Cases are built with automated keywords and can be executed using test automation tools or integrated test management tools. Test Case execution is a mechanical exercise regardless of automation. The test case should contain the execution test case and all required information to determine whether the operation was successful or failed.

3. Maintenance
Test Case maintenance is required when application behavior is changed or when a keyword design is used in one or more test cases. The correctly implemented keyword framework will allow the tester to look for all the instances of the keyword through some query mechanism-reduce the process of finding the affected test case in a common and painful way to a simple step. Moreover, a well-implemented keyword framework should support global changes to keyword instances.

Iii. Keyword implementation

1. Gui (graphical user interface)
The keyword scheme of Gui-based applications is the easiest to understand and implement. Most commercial applications that share software, free software, and keyword testing are involved in this field.

2. API (Application Programming Interface)
API-based application keyword solutions seem complicated on the surface, but once these applications are subdivided into discrete function business events, their behavior is the same as that of the same GUI application. If a business event is a "Login User", no matter which application mechanism is used to implement the event, it does not matter. If the business driver is the same, the keyword search and behavior will be the same. There are several keyword solution providers related to the API field, and the same provider usually has a solution for GUI applications.

3. Telecommunications (communication protocols)
Keyword solutions in the telecom field (such as SS7) require a good understanding of telecommunications protocols. There are several providers that provide keyword solutions in this field.

Iv. keywords and test phase

1. Unit Test
Keywords can be used for unit tests, but this is not recommended. The development team should use the tools available in the Development Kit andTechnologyTo perform unit tests.

2. Functions (Comprehensive Test)
Keyword Testing Solution focuses on designing and implementing keywords as discrete function business events, providing a low-cost, efficient, and maintained testing framework for functional testing. In fact, some frameworks can match their short-term or long-term ROI (ROI) If you need or expect automated testing of GUI or API-based applications ).

3. System Test
A keyword-based testing solution that promotes keywords from function testing to system testing can help accelerate the testing process. A valid keyword framework allows the test designer to combine function-level keywords into system-level keywords. System-level keywords process complete business events, rather than discrete business events that constitute business threads. For example, a system-level keyword can be a "complete customer application", which can be composed of a series of function-level keywords: "Enter customer name" and "Enter customer contact information ", "Enter customer personal information" and "Save customer records ".

4. User Acceptance Test
Keywords can be used for user acceptance testing, but are not recommended unless this is an extension phase of the test. End-user groups use the best tools, technologies, and processes available in the User Acceptance Test.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.