Maintainability of an automated test kit - 4

zhaozj2021-02-16  55

Many functions in the library you created can be used in several applications (or you design very flexible). Don't expect 100% flexible. For example, a version of the OpenFile function may be useful for each program that uses the standard file dialog box, but you have to use the custom dialog that adds additional functions.

The framework contains several types of functions, based on the application simple packaging function or uses a complex script function that handles an integration task. Low is some basic types:

a. Define the feature of each application

You write a function, drop-down menu, set a variable value, or issue a command. If one of the functions of the UI changes, you can only change the function function. When the connection is recompiled, any script for this function is automatically updated.

The nature of the frame is to process the custom control, such as the self-drawing control. The self-drawing control is the programmer's drawing command dialog. Automated Test Tool knows there is a form, but it will not know how internal. When he doesn't know if there is a button, how do you click on the button in the dialog box? When you don't know where there is a listbox box there, how do you use the tool to choose the options in the list box? You may apply some tips to select the third option in the list, but how do you choose a project in a list that is growing anywhere? The problem with follow: How do you handle the buttons and list boxes and other interface elements that are generally not displayed when you decide.

At the Lawst meeting, we discussed how to combine the idea together. Some participants have confirmed about half of the automated development time in handling the problem of custom controls.

The combination of these ideas is complex, the maintenance is very large, and it is a distracted thing for script developers. I think they are the cause of the automation tool instead of testing a script program. They transfer the focus of the testers to the disadvantages of the tool, not potential issues in discovering and reporting the program.

If you insist on self-drawing controls, compress every function of your program may be the most pressing task in your framework. Hide each assembled function. Which feature is used, the programmer calls that feature without considering the assembled function. If the UI interface changes, the assembly function does not need to be rewritten without affecting the script.

b. Define the characteristics of the command or test tool language

Automated tool has its own scripting language. You may find that it is difficult to package each command into an indirect layer. The package function is packaged in other functions. The simple example is that only a function of a package is called. You can modify the package function, add or modify the function to solve the defect of the test tool, or enhance the advantages of the scripting language.

Tom Arnold provides an example of WMenuselect, a function of a Visual Test selection menu. He encapsulates the selmenu function, and Selmenu is simply calling the wmenuselect function. This is flexible. For example, you can modify the selmenu function, add log functions or error handling or memory monitoring, and you can think of any feature. After adding, each script does not have to add any code to get a new feature. This is very suitable for pressure testing, performing results analysis, error analysis, and the purpose of reporting and debugging.

Participants who use this method say this can be reused.

C. Define small, conceptual frequent unified goals

The OpenFile function is a simple example of this type of function. The script developer writes thousands of scripts that require great open files, as long as they are concerned about the files opened in these scripts. For tests, it is like files to open, complete the goals of his test. Writing a library function can save scripts to write time, improve the quality of script maintenance.

This is the easiest way to reuse the code, regardless of the development of test automation or other software development.

d. Define big and complex application to large test cases in some test cases

The compressed sequence command is reasonable. Especially you do this, it is risky. A complex sequence command may not be used in a lot of test scripts, so it is not worth promoting, and it turns out that the error handling code should be added to you expect to suit the write library function. Similarly, the more complex sequence, the more maintained when the UI changes. A very small script command may take up a large part of your library dimension cost. e. Define utility functions

For example, you can create a function that records the test results to the hard disk with a standard method. You can call it as a standard when developing scripts to call this function after each test case.

Each test tool provides yourself in advance. You can add or do not add additional functions.

Some of the risks of some frameworks

You can't add all your commands to your library. You don't have enough support. Some automation project failures are the reason for the test provider wants to create the final must have every programming library. Management maintenance can no longer be supported before the framework is used. You have to distinguish priority. Have to time out the compiling library.

Don't expect the library where everyone will use it. Some people have different coding styles. If you don't have a variable declaration, the parameter order of the function, the standard for global variables, etc., these are reasonable but may be unreasonable for others. Similarly, some people hate not what they write. Some people are familiar with the project code, and I don't know what the library has. They always have a rush to start programming any time. You have to try to maintain the normal operation of these libraries.

Finally, be careful to set up, especially if you have custom controls in your program. In version 1.0 (or version of the early start automation test), most of the time you may take to include creation of the module framework similar to the click button, select the list item, select the TAB page, and so on. You can save the time for version 2 write scripts. Establishing a frame is expensive. Please consider your expectations from your new.

4. Confirm the fact

You must train your management to some stable versions.

First, many testers are primary programmers. They don't have much experience in designing systems. The unreasonable framework is also affecting the project. So you need an experienced person. If automation is successful, you have to need a person with extensive programming experience to join the test team.

Second, many black box testers have little programming experience. They can provide similar experts or other user experiences, which are unable to programmers. These are an indispensable of effective strong tests. Therefore, you need a stable development strategy that doesn't have to write test code. You have to solve the problem that creates a test developer's non-test developer. It is very common, and there is a losing rationality and opposing multiple production in the team of automated test tools in my point of view. This will hurt the old non-test developers, which will cost more energy test procedures, rather than user needs itself.

Non-developed testers develop test cases by writing test programs to spreadsheets --- is also the data driver method, which will do very well.

Third, be careful with the implementation of automated testing. They not only have to develop experience, but also shoulder the training or more daily tasks.

Finally, you must let the manager know that automation is required, and do not expect benefits in the automation program developed in the initial version. If you apply a test target at the level, you can add more goals. If a project is manually testing a year, you can add two test staff of two excellent automation, this time you have 10 testers two developers. In the next version, you can reduce the time of the tester. In this release, you will save some of the same task time (such as configuration test) but you will lose time on training and management costs. At the end of each project, it can improve the recession test software to delay the ability to complete the test, and it is determined at the last minute to help you take a slightly useless test, better to cut off the chance of stabilizing the stable version.

转载请注明原文地址:https://www.9cbs.com/read-23755.html

New Post(0)