Automated test cases

Source: Internet
Author: User
Tags writing test scripts

{
Tagshow (event, '% D7 % D4 % B6 % af % BB % af % B2 % E2 % Ca % D4 ');
} "Href =" javascript:; "target =" _ Self ">Automated TestingIt is becoming more and more deeply rooted in the hearts of the people, and its importance is self-evident. {
Tagshow (event, '% D0 % D4 % c4 % DC % B2 % E2 % Ca % D4 ');
} "Href =" javascript:; "target =" _ Self ">Performance TestingThe requirements for large-scale concurrency, the simulation of large-scale stress in stress testing, and the repeated execution of large-scale test cases in regression testing require a highly available and scalable automated testing framework system. Therefore, we need to study how to build a complete automated testing system under an open framework.

A complete automated testing framework system includes the following parts: 1. Automated Testing Framework; 2. Test script and test data management; 3. Test Script Execution Management System; 4. display and analysis system of test results. The most important part is the automated testing framework.

The first part is the automated testing framework. The problems to be solved by the automated testing framework are essentially the process of transparent distributed resources. Due to performance testing and stress testing requirements, we often need to build a distributed testing environment. In this distributed testing environment, we need multiple testing platforms (for example, multiple windows, multiple Linux instances ). The purpose of the automated testing framework is to convert various resources in the distributed environment into corresponding service objects. For example, a Windows machine is bound to a service object on a certain IP address instead of a Windows machine in the framework of automated testing. Through this object, we can tell this object through a common call method (calling a remote provided method locally requires the technology of object ing, let it do what we want it to do, for example, start a specified test script (this test script may be a test case we write daily, or it may be {
Tagshow (event, '% C6 % E4 % CB % FB ');
} "Href =" javascript:; "target =" _ Self ">OthersOperation ). In the implementation of the automated testing framework, it mainly establishes an underlying communication network that provides services. In terms of service applications, we can use the plug-in mode and object ing technology to dynamically and infinitely expand our services. According to my personal practice, the staf + Python development mode can well implement this framework. Staf mainly builds a network system so that various machine resources can communicate freely. Python can perform secondary development based on staf and build a dynamic insertion service system.

The second part is the management of test scripts and test data. Select an appropriate automated scripting language. Generally, you need to consider the following aspects: (1) high readability, (2) No compilation, (3) scalability, (4) powerful third-party support, especially for various data sources. We can use CVs or SVN to manage test scripts and test data. Here, we mainly rely on a highly organized directory structure. In particular, we need to match and manage the organization structure of the test suite, test module, and test cases in the actual test process. Form a complete library of test scripts and test cases. There are some basic requirements for writing test scripts: 1. Form a set of test script compiling specifications; 2. test scripts adopt a hierarchical design concept and a persistent layer (data resource library, object resource library, unified I/O), logic layer (encapsulates basic business logic and implements API-level calls), and script layer (implements the test case process, mainly describes the test steps ). Through this, testing engineers can easily write test scripts, greatly improve the test efficiency, and perform large-scale regression, it is no longer a dream to achieve automated testing even in the first round of testing.

Part 3: test the script execution management system. After a large number of test scripts are compiled, a very important step is to execute these test scripts in large batches. Through Management of CVs or SVN, a test resource library is generated, and a test case is a test script. The purpose of the test Script Execution Management System is to execute the user-selected test cases at the User-Defined time. The test script execution management system should also be able to dynamically track the status of the currently running tasks, such as the execution percentage, and implement multi-user management, for example, you can run a test request submitted by multiple users at the same time. At the same time, the test script management system should also implement the function of automatic deployment of the test environment. Generally, we need to deploy the test environment accurately before performing a large-scale automated test. here we need to use the latest code version for testing. Therefore, the automatic deployment of the test environment is also very important.

The fourth part is the display and analysis system of the test results. Through unified Io calls, we can call the error information generated during the test ,{
Tagshow (event, '% C8 % D5 % D6 % be ');
} "Href =" javascript:; "target =" _ Self ">LogsInformation and test results are dynamically stored in the desired location. The display and analysis system of the test results is based on the data. During the execution of each test case, a large amount of log information needs to be output, which is very important. Generally, we determine whether {
Tagshow (event, 'bug ');
} "Href =" javascript:; "target =" _ Self ">BugTo analyze the log information in depth. During the execution of test cases, you must not only print the relevant test data, but also the actual data obtained. In this way, you can analyze the test results easily. As for the display system, it mainly provides a classification search function for test results, which can generate various reports. For example, how many reports are passed in a module of 300 test cases, the number of failures and so on. There is a basic principle that is very important. Automated testing is not for automation, but for discovering bugs. If a bug cannot be found in automated testing, it makes no practical sense to spend a lot of manpower and material resources to automate it. Therefore, it is very important to thoroughly collect various information generated during the execution of test cases. My personal practical experience shows that this information plays a vital role in discovering bugs (the description of the test steps cannot be ignored ).

The automated testing system is not a tool, but can be implemented in an automated testing script language. It requires a complete solution. My personal practical experience shows that the introduction of automated testing frameworks, powerful resource integration capabilities, and the design of an effective automated testing system are very important factors to achieve automated testing.

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.