• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

改进自动化测试套件的可维护性(三)

发布: 2010-6-22 10:50 | 作者: 不详 | 来源: 领测测试网采编 | 查看: 7次 | 进入软件测试论坛讨论

领测软件测试网

  改进自动化测试套件的可维护性(三)  软件测试

  4.use a framework-based architecture.

  4.使用基于框架的架构

  The framework provides an entirely different approach, although it is often used in conjunction with one or more data-driven testing strategies. Tom Arnold (one of the LAWST participants) discusses this approach in his book [8] and courses.

  虽然框架通常与一个或一个以上的数据驱动测试策略一同使用,但它本身却提供了一种完全不同的方法。Tom Arnold(LAWST成员之一)在它的书和课程中论述了这种方法。

  The framework isolates the application under test from the test scripts by providing a set of functions in a shared function library. The test script writers treat these functions as if they were basic commands of the test tool’s programming language. They can thus program the scripts independently of the user interface of the software.

  框架通过提供共享函数库中的一套函数,把应用程序从测试脚本中分离。这样,测试脚本编写者在处理这里函数时,就可以把它们视为测试工具的编程语言的基本命令。因此,他们能单独编写软件的用户界面脚本。

  For example, a framework writer might create the function, openfile(p). This function opens file p. It might operate by pulling down the file menu, selecting the Open command, copying the file name to the file name field, and selecting the OK button to close the dialog and do the operation. Or the function might be richer than this, adding extensive error handling. The function might check whether file p was actually opened or it might log the attempt to open the file, and log the result. The function might pull up the File Open dialog by using a command shortcut instead of navigating through the menu. If the program that you’re testing comes with an application programmer interface (API) or a macro language, perhaps the function can call a single command and send it the file name and path as parameters. The function’s definition might change from week to week. The scriptwriter doesn’t care, as long as openfile(x) opens file x.

  例如,一个框架编写者创建了函数openfile(p)。该函数用来打开文件p。它可以通过下拉文件菜单、选择打开命令、复制文件名到文件名域、点击OK按钮关闭对话框来完成操作。此外,这个函数也可以变得更复杂一些,比如,添加可扩展的错误处理功能。它能检查文件p是否已经被打开,或者记录打开文件的尝试以及对结果做日志。该函数还可以用一个命令快捷键,而不是菜单导航来弹出文件打开对话框。如果你的测试程序涉及到一个应用编程接口(API)或宏语言,那么该函数或许能调用一个单独的命令,并把文件名和路径作为参数传递给它。函数的定义经常在变化。但只要openfile(x)能打开文件x,脚本编写者就不必在意。

  Many functions in your library will be useful in several applications (or they will be if you design them to be portable). Don’t expect 100% portability. For example, one version of openfile() might work for every application that uses the standard File Open dialog but you may need additional versions for programs that customize the dialog.

  很多函数库中的函数在一些应用程序中依然有用(或者当它们被设计成可移植的时,也会很有用)。不要指望100%的可移植性。例如,openfile()的某个版本可以在每个应用程序中使用标准文件打开对话框,但你可能需要为那些有定制对话框的程序设计额外的版本。

  Frameworks include several types of functions, from very simple wrappers around simple application or tool functions to very complex scripts that handle an integrated task. Here are some of the basic types:

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/

TAG: 改进 套件 维护 自动化

61/6123456>

关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网