自動化測試工具的3個關鍵部分
今天看到Bret Pettichord的這篇文章:
http://www.io.com/~wazmo/blog/archives/2009_04.html#000293
一直以來對英文單詞“Harness”的意思都有點模糊,看來這篇文章後清晰了不少。
Harness的英文解釋是:
n.
(全套)馬具, 系在身上的繩子, 甲冑
vt.
上馬具, 披上甲冑, 利用(河流、瀑布等)產生動力(尤指電力)
但是作為IT術語好像有點難翻譯。
A test harness is responsible for executing tests and collecting and reporting results.
測試框架負責執行測試並收集和報告結果。(在這裡,Harness翻譯為框架應該合適!)
好,言歸正傳,談談這篇文章。在這裡,Bret Pettichord主要想釐清自動化測試工具中的3個關鍵組成部分:指令碼語言、驅動、框架。
對於Watir而言,Watir本身是驅動(瀏覽器的驅動)、Ruby是指令碼語言、框架則可採用Ruby自帶的單元測試框架Test::Unit,或者是Rspec 、Cucumber等,也可以自己開發。
Three Key Tools for Automated Testing: Language, Driver, Harness
When I started working on Watir, I was pushing a vision for automated testing. This vision still motivates my work with Watir. A couple of years ago, Brian Marick told me open-source developers should share their vision and let the community know why they built the tool. Here's the vision.
There are three essential elements of an automated testing system: language, driver and harness. Your tests need to be written in a language and you need a language to extend your testing system. I've long believed in scripting languages, such as Perl, Python and Ruby. I find that testers are more productive with them and find them easier to understand and use. I have reasons why I prefer Ruby, but there are other good automated testing systems written using other scripting languages. In fact over the years, I have built testing frameworks in Perl, Python and VB, usually building on languages that were already in use at the client. My emphasis on full-featured programming languages was a contrast to the proprietary languages that had been commonly used in commercial testing tool suites. I had no patience for them.
There are lots of languages to choose from. Finding a suitable driver, however, was often more difficult. A driver is what you need to drive your application. Watir is an example of a browser driver, suitable for web applications. Often the driver determines the language you use. Years ago, I used Expect as a driver for a command line application. Expect used TCL as its language, so the suite was written in TCL. I developed Watir because I wanted a browser driver in Ruby. Watir was our solution for Web Application Testing in Ruby.
The third thing you needed for a testing system was a harness. When we started, we all used Test::Unit, a Ruby test harness designed for unit testing. We found that it could be adapted for functional testing. More recently, Watir users have been using Rspec or Cucumber as their test harness. A test harness is responsible for executing tests and collecting and reporting results. Some people like to build their own test harnesses instead of using one of these.
I developed this vision while working with commercial testing tool suites like SilkTest and WinRunner. These packages are often referred to as tools, but I found that they actually comprised a collection of integrated tools. They had predefined usage expectations that often didn't match actual tester needs. Data-driven testing, for example, required us to break down the suite and then reassemble it in a more suitable configuration. I wanted testers to be able to identify the individual tools that made up a testing system.
Many new Watir users have trouble identifying where Watir (the driver) ends and Ruby (the language) begins. But learning this is key to becoming a proficient user. I'm told that some Java teachers don't like their students to use an IDE (such as Eclipse or Netbeans). Instead they want their students to learn to use the required tools separately -- the editor, the compiler. This way they learn the function of each tool. In the same way, I've also wanted testers to understand the functions of the different tools and components used in a testing system.
We often get questions from new Watir users whose answers are obvious once you understand this. Can Watir read CSV files? Can it do date math? Can it read from a database? The answer to all of these questions is that Watir can't do it, but Ruby can. No browser driver could do these things (it would be like asking whether your compiler supports search and replace), but any full-featured programming language can. It's just a matter of finding the library to do it. These questions are raised in the first place because testers are used to using commercial tool suites that were closed systems. So you only got the ability to do these kinds of things if the vendor added it to the package. Watir is part of an open system, so all the libraries are there already and more are being written all the time, often by people who are not part of the Watir community, per se, but rather part of the larger Ruby community.
相關文章
- Selenium Web Driver自動化測試(java版)系列下半部分(37) - 關鍵字驅動自動化測試框架(2)-測試過程...WebJava框架
- 國產自動化測試工具
- 自動化測試工具QTPQT
- 小程式自動化測試--測試3
- iOS自動化測試驅動工具探索iOS
- 自動化測試系列 —— UI自動化測試UI
- bats-Bash自動化測試工具BAT
- 微軟自動化測試工具palywright微軟
- Linux GUI自動化測試工具LinuxGUI
- 如何實現工具無關化?關於自動化測試指令碼的設計指令碼
- 【自動化測試】移動端測試輔助工具 - adb
- 談軟體自動化測試工具的評測方法
- 3個關鍵點助力工業機器人自動化機器人
- 自動化裝置測試與自動化測試的區別
- 如何理解自動化測試資料驅動與關鍵字驅動的區別?
- airtest自動化測試工具快速入門AI
- 效能自動化測試工具Loadrunner篇
- 【自動化測試入門】自動化測試思維
- 滲透測試與自動化安全測試工具比較
- 自動化測試進階課程——Selenium自動化測試通關實戰班
- 軟體自動化測試工具的那些事兒
- 如何選擇合適的自動化測試工具?
- Android 下的自動化測試工具總結Android
- 基於GUI的自動化軟體測試工具GUI
- 自動化測試的理想境界:AppCrawler自動遍歷工具APP
- 關於Web端-UI自動化測試WebUI
- 如何學習自動化測試?從手工測試到自動化測試的過程…
- 移動裝置的自動化測試工具,如何選型?
- Playwright自動化測試工具之高階使用
- Windows桌面自動化測試工具:WinAppDriverWindowsAPP
- 軟體測試:自動化測試
- 軟體自動化測試工具的歷史演進
- Routinebot - 一款小巧的GUI自動化測試工具GUI
- appium uiautomator 移動端自動化測試工具APPUI
- 全面解讀自動駕駛的關鍵組成部分自動駕駛
- 自動化測試理解
- 自動化測試思路
- airTest自動化測試AI