| With the development of information technology, software testing plays more and more important role in the development and application of computer science. We just paid attention to the testing work itself before; actually, the testing environment configuring work is also very important in software testing work. Testers need to prepare different testing environments for different test purpose, and each testing environment may be deployed to different machines. Furthermore, the work may repeat many times in the whole test lifecycle.Traditionally, testers configure the testing environment manually; it might be Time-consuming and not satisfactory. Firstly, the testing environment configuring work is complex and even stymied, which often includes many steps and checkpoints. So it needs testers to keep on monitoring the target machine, following the steps and checkpoints and reacting according to the status of the computer. It would be inefficient because the testers may spend too much time on testing environment configuring work rather then the work itself as the checkpoint which needs timely reaction can not be expected. Secondly, it is inevitable that manual testing environment configuring work may take some mistakes which cause terrible result to the further testing work.Many of new research achievements and products have emerged in the software testing field, and automated testing is an important researching direction. In order to solve the problem we mentioned above, we add the automated testing technology into the testing environment configuring work. We research and implement the automatic software testing environment configuring tool AutoHCI which would be helpful in improving the efficiency and quality of the tester. AutoHCI releases the testers from complicated manual testing environment configuring work.AutoHCI automatically simulates the operation of mouse as well as keyboard and analyzes the state of the computers. Although testing environment configuring work is complex and even some trivial, it still can be decomposed to a series of basic operations of mouse and keyboard on computer. Therefore, we can record these operations of mouse and keyboard into a configuration file according to the special grammar, and then AutoHCI starts to parse the configuration file and simulate the operation of mouse and keyboard. At last, the testing environment will be configured automatically rather than manually.In the practice application, the software testing environment will be deployed on the different platforms. AutoHCI can support Windows and Unix platforms effectively. Actually, there are some slight differences in configuration files and deploying method between different platforms. During the implementation of AutoHCI, we use X Window and Extra!X tool to make AutoHCI support the testing environment configuring work on Windows as well as Unix platforms in instead of developing different versions of AutoHCI for different platforms.AutoHCI includes following parts: Configuration File Processing part, mouse and keyboard Simulating part, as well as state Judgment part.In the configuration file processing part, we design a kind of grammar with XML Format for testing environment configuration file, which combine the features of program Language(eg, designing jump command to improve the flexibility of configuration file)and record the information of operation of mouse and keyboard and judgment of the state.We use DOM as the XML parser when reading established testing environment configuration file. After traversing XML tree of the corresponding configuration file, we save the content in one command buffer,so that it could not only release the burden of memory caused by XML tree but also improve the efficiency of program. When traversing XML tree, we should firstly make a judgment on the category of node according to the design of configuration file. Furthermore, we have already processed the jump command in advance when saving in command buffer.In the mouse and keyboard simulating part, we simulate the operation of mouse and keyboard by"java.awt.Robot"provided by JDK. Firstly, we read from the command buffer one by one in the part of configuration file processing, then go into different process, and simulate the operation of mouse and keyboard by Robot. We adopt the system of state judgment to ensure that the real operating window of Robot is the target window.In the state judgment part, we implement with the windows dll,which is regarding some methods of positioning and operating windows. Few state judgments are implemented by other methods. Finally, we implement AutoHCI with Java language and Eclipse Develop KitWe should notice that if software testing environment need to be configured on the Unix platform, the deployment of AutoHCI and the content of testing environment configuration file should accord to the requirement.Nowadays, as the fast development of computer science, we are expected to perfect AutoHCI with other technology such as HCI. What is more, we could release more people from complex work by applying AutoHCI into more and more fields. |