自动化测试框架剖析

 

Anatomy of an Automated Testing Framework

http://www.pragmaticsw.com/Newsletters/newsletter_2009_07_SP.htm

这篇文章讲到一个成功的自动化测试框架的主要组成部分和特性。

 

 

Why Automate Your Test Cases?   (为什么要把测试用例自动化)
Many companies run their regression test cases manually, so when does it make sense to begin automating your regression test cases? It makes sense to automate your test cases when you can no longer run the regression test cases on each build created. For example, if you are doing daily or weekly builds of your code to quality assurance and you cannot quickly run your regression test cases with each build, it is time to consider automating them.  Automating your test cases provide these benefits:

  • Quicker Releases (更快速的版本发布)– By having your regression test cases run automatically, your software quality team can concentrate on testing new features of your software and less time regressing existing features.
  • Higher quality releases (更高质量的版本发布) – Your software releases will have fewer bugs and require less customer support because they will be of higher quality.
  • Happier Customers (更加满意的顾客)– Your customers will be happier and more willing to serve as testimonials for future prospects.

What is an Automated Testing Framework?(为什么使用自动化测试框架)
Most automated tools require the test engineer to understand a scripting language (VB Script, Java Script, etc.) to write their automated test cases.  These tools usually have the ability to create the scripts using record and playback, but this does not always write the most efficient scripting code and is not as re-usable and maintainable.  An Automated Testing Framework is a set of assumptions, concepts, and practices that provide support for automated software testing, allowing you to re-use automated test cases, reduce maintenance, and enhance maintainability.

Anatomy of a Successful Automated Testing Framework(一个成功的自动化测试框架的组成部分)
When designing your Automated Testing Framework, consider these features, as they can dramatically improve success and reduce the chance of abandonment:

  1. Keyword Driven Testing(关键字驱动测试) - If your test engineers are not experts at scripting languages, consider replacing your automated scripts with keyword driven testing.  This approach allows a tester (or even a subject matter expert) to create automated tests by describing each step of the automation.  For example, if you are automating the login process of your application, your user will access your application, type in their user-id and password and press a button to login.  Traditionally, testers would do this by writing VB Script that will navigate to your application, identify each object on the screen (user-id, password and login button), then write script to enter in the user-id, password and to press the login button.   With keyword driven testing, the tester does not need to understand the scripting language to make this happen, they can simply describe the event (navigate to your application, enter in "abc" for the user-id, enter in "xxx" for the password, press the Login button when done). As you can imagine, this is a much simpler approach to automated testing than scripting. 
  2. Allow Data Iterations(支持数据驱动测试) - It is good practice to allow your testers to re-use automated test cases, but allow them to run them with different sets of data.  For example, you might use the same automated test case for logging into your software, but allow the test case to be run multiple times with different user-id and password combinations to test different scenarios.  If your automated testing framework is flexible enough to allow your testers to define different data iterations, it will reduce time spent creating automated test cases.
  3. Allow Running on Multiple Hosts(支持多机运行) - When designing your automated testing framework, consider multiple hosts.  For example, as your quality assurance demands grow, you may need to setup a QA Lab with multiple servers.   Once that is done, you will need a way to launch your automated test cases on multiple servers, so consider building that into your automation framework.
  4. Allow Scheduling of Automation Runs(支持定时自动运行) - Once you have developed your automated test cases, you will want to schedule them so that they can run unattended.   When designing your automation framework, build in the capabilities to schedule automation runs at different intervals (days of the week), allow recurrence (run every day at 6 p.m., etc.), and allow them to be scheduled on different hosts.
  5. Reporting Run Results(报告运行的结果) - When developing your automation framework, consider how you will report on the run activity of your automation effort.  If you are using an existing test management solution for your manual test effort, consider integrating your automated test result data in with the reporting of your test management solution, that way you can analyze your manual and automated test effort in a consolidated fashion.

 

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值