測試工具廠商的程式語言什麼時候“退休”?
測試工具廠商的程式語言什麼時候“退休”?
Bret Pettichord在這篇文章中提到測試工具廠商的程式語言的種種弊端。我們必須學習這些程式語言才能用好他們的工具!
Hey Vendors, Give Us Real Scripting Languages
http://www.stickyminds.com/sitewide.asp?Function=edetail&ObjectType=COL&ObjectId=2326
For most of the test tools available today, you have to write test scripts in the tool’s scripting language. What drives me crazy is that most vendors have their own special language that you must learn in order to use their tool. They often have recorders to help you generate code, but invariably you need to go in and make changes and write code yourself. And you end up having to learn another language—another vendorscript—another dialect that is good for nothing but the one tool.
Undermining Collaboration
Because a vendorscript is a specialized language, developers are less likely to know it and little inclined to learn it. I frequently counsel testers and developers to work together on test automation projects. There are many reasons why this is a productive collaboration, but vendorscripts get in the way. They split testers from developers and from each other into tool-specific language isolation. This reduces the opportunities to share, collaborate, and improve the craft.
廠商語言阻礙了開發與測試人員之間的交流和協作!
We have enough trouble bringing developers and testers together in the testing process. The last thing we need is an inherent obstacle from the get-go in our testing tools. Ask a developer to learn Visual Basic? No problem. They can always use that knowledge in the future. Ask a developer to learn a specialized language unique to one tool? You're dreaming. You may already be having trouble getting the developer to pay attention to testing, and now you’re asking for more.
Why spend money on a tool that’s going to undermine the collaboration efforts between testers and developers?
Dialect Stew
There are various dialects of vendorscript. Some use C-like languages. What does this mean? It means that the code looks like C, but it doesn’t have pointers, so you can’t use any of the complex data structures that you learn about in any C course or book. C is really a poor basis for a scripting language. It is compiled, while test scripting languages are interpreted. This is why the C-like languages can't support pointers.
方言,到處是方言!類C不像C、類VB不像VB!
Others use a Visual Basic-like dialect. If you know Visual Basic, the code will look familiar, but you won’t be able to make use of standard Visual Basic libraries. Moreover, the things you learn about Visual Basic may or may not apply to the vendorscript.
Still another tool uses an object-oriented mongrel vendorscript. Being object-oriented is nice until you learn that modifications to a class won’t be inherited to its subclasses. What? This vendorscript thinks that this is a better arrangement for testing. Whether this actually helps testers is debatable, but what testers really need is not a special language designed for testing. Rather they deserve and work better with a full-fledged language.
Some of the newer test tools are using real scripting languages, such as JavaScript or Visual Basic for Applications. I can only hope that this tend continues. Moreover, it would be nice if some of the older tools would be reworked to support standard languages. Standardized languages have formal specifications, which tend to favor ease of programming instead of ease of implementing the interpreters. This makes them easier for you and your test team to use.
Reinventing the Wheel
The drawbacks of vendorscripts were illustrated in a recent article that described how a couple of test automators had collaborated to add stacks and queues to a vendorscript. The point of the article was to demonstrate what test automators could do when they worked together, but the lesson I drew was that vendorscripts can lead test automators to waste a lot of time and effort reinventing wheels. Stacks and queues are elementary data structures that require little effort to implement in standardized languages.
重複發明輪子! 重寫很多庫函式,例如字串操作、日期操作、數學運算…
I can sympathize, because I’ve been in the same situation. I have had to build libraries to support string manipulations, date math, and calculating permutations for various vendorscripts. Some vendorscripts have libraries for such things, but the libraries for standardized languages are much larger and more robust.
Back in the Old Days
Lots of nontesting tools have embedded vendorscripts as well. And it used to be even worse. About a decade ago, John Ousterhout decided to do something about it. He designed Tool Control Language (TCL), made it easy to integrate with C, and released it into the public domain. TCL is now used in some public-domain test tools.
Ousterhout makes a distinction between system programming languages (such as Pascal, C, C++, and Java) vs. scripting languages (such as Perl, Python, Rexx, TCL, Visual Basic, and Unix shells). System programming languages are better for building from scratch and optimizing for performance. Scripting languages are better for rapid development and reusing code. They are great for test automation.
指令碼語言更適合用在測試自動化!
Some of the test tool vendorscripts pre-date Ousterhout’s advances—created before TCL and when Perl was still in its infancy. But that was then. There are plenty of options now.
Retiring Vendorscripts
So with plenty of options, vendorscript should be retired. With one exception, there are no third-party books that you can use. You’ll have to rely on books from the vendors, which may or may not be frank about the vendorscript’s shortcomings. Courses are also hard to come by, expensive, and may require travel. If you are hiring, it will be hard to find people who are already trained.
要學些廠商的程式語言必須依賴廠商工具附帶的書,沒有其他參考書!
Test automation is hard enough without us having to flesh out the vendorscripts that come with many tools. Developers wouldn’t stand for programming languages with such limitations. We shouldn’t either.
Further Reading
Scripting: Higher Level Programming for the 21st Century, John K. Ousterhout, IEEE Computer, March 1998.
Breaking the Language Barrier, Christopher Meisenzahl and Ferry Firmansjah, STQE magazine, Nov 2000.
相關文章
- Python會在什麼時候被其他語言取代Python
- Go語言什麼時候該使用指標 與 指標使用分析Go指標
- 什麼是程式語言
- 安卓測試支付寶小程式的時候怎麼使用代理呀。安卓
- Haskell程式設計精華:什麼時候該註釋,什麼時候不該註釋Haskell程式設計
- C++中什麼時候用move,什麼時候用forward?C++Forward
- 為什麼需要更多的程式語言
- 現代程式語言用什麼語言寫成?
- 你打算敲程式碼到什麼時候?
- 手機工廠測試是什麼?有著怎樣的測試流程?
- 為什麼寫程式碼的時候聽音樂?
- 為什麼寫程式碼的時候聽音樂
- 什麼時候釋出
- 什麼時候呼叫layoutSubviewsView
- session是什麼時候建立的Session
- 從什麼時候開始,玩家成了遊戲裡的“工具人”?遊戲
- 看什麼程式語言都是天堂
- 為什麼自制指令碼語言是程式語言的最高境界?指令碼
- 何為程式語言?為什麼要學C語言?C語言
- 常見的程式語言python怎麼樣?各程式語言有什麼區別?Python
- 什麼時候應該避免註釋程式碼?
- 為什麼會有這麼多的程式語言?
- 中文程式語言——易語言,到底是用來幹什麼的?易語言值得學習嗎?易語言的優勢有什麼?
- 什麼時候採用socket通訊,什麼時候採用http通訊HTTP
- 你是什麼時候”突然”學會程式設計的程式設計
- 像蓋房子一樣寫程式碼:當我以測試驅動開發的時候,我在想些什麼
- 我寫了個工具,能知道我什麼時候死
- 新版什麼時候釋出?
- 什麼時候該用vuex?Vue
- 到底什麼時候使用mqMQ
- 什麼時候該用MongoDB?MongoDB
- 什麼是程式語言?程式語言都有哪些?以及主要用途
- Python的類什麼時候用Python
- 到底該學習什麼程式語言
- 程式語言成功的秘訣是什麼? -erik
- EJB2.0中什麼時候用local interface,什麼時候用remote interface (轉)REM
- 什麼是Go語言?Go語言有什麼特點?Go
- win11什麼時候釋出的 win11什麼時候推送詳細介紹