老外讨论自动化测试开发(基本原则)

发表于:2011-1-11 11:42

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:msw_cn    来源:51Testing软件测试博客

分享:

  6. Of the bugs found during an automated testing effort, 60%-80% are found during development of the tests. That is, unless you create and run new test cases under the automation tool right from the start, most bugs are found during manual testing. (Consensus)

  在一次自动化测试工作中找到的bug里,60%到80%是在开发测试中被发现的。也就是说,除非你从一开始就用自动化工具创建并运行新的测试用例,不然大多数bug都会在手动测试中被发现。(一致同意)

  Most of us do not usually use the automation tool to run test cases the first time. In the traditional paradigm, you run the test case manually first, then add it to the automation suite after the program passes the test. However, you can use the tool more efficiently if you have a way of determining whether the program passed or failed the test that doesn’t depend on previously captured output. For example:

  我们大多数人都不是第一次使用自动化工具来运行测试用例。在传统规范中,你首先要手动运行测试用例,然后在程序通过测试后把它添加到自动化套件中。但是,如果你有一种办法不依靠先前的截取的输出结果就能确定程序是否通过了测试,那么你就能更加有效的使用工具。例如:

  Run the same series of tests on the program across different operating system versions or configurations. You may have never tested the program under this particular environment, but you know how it should work.

  要在不同的操作系统版本或配置上运行相同系列的测试。你可能从未在一种特殊配置环境下测试过程序,但是你知道它应该怎样工作。

  Run a function equivalence test. [11] In this case, you run two programs in parallel and feed the same inputs to both. The program that you are testing passes the test if its results always match those of the comparison program.

  要运行一个功能等价测试。这时,你可以并行地运行两个程序,并且给它们同样的输入。如果程序的结果总是与对照程序一样,就说明它通过了测试。

  Instrument the code under test so that it will generate a log entry any time that the program reaches an unexpected state, makes an unexpected state transition, manages memory, stack space, or other resources in an unexpected way, or does anything else that is an indicator of one of the types of errors under investigation. Use the test tool to randomly drive the program through a huge number of state transitions, logging the commands that it executes as it goes. The next day, the tester and the programmer trace through the log looking for bugs and the circumstances that triggered them. This is a simple example of a simulation. If you are working in collaboration with the application programming team, you can create tests like this that might use your tool more extensively and more effectively (in terms of finding new bugs per week) than you can achieve on your own, scripting new test cases by hand.

  要在测试中操作代码,这样就能在出现异常情况时生成日志,比如,程序到达了一个异常状态、做了一个异常状态转换、以异常方式管理内存、堆栈或其他资源、或者做了任何一种错误的事情。先通过大量的状态转换以及记录执行的命令使用测试工具随机地驱动程序。然后在第二天,测试人员和程序员通过跟踪日志来寻找bug和触发它们的环境。这是模拟出的一个简单例子。如果你正在与应用程序团队合作,那你就能像这样,相对自己手工编写新的测试用例脚本,更加扩展地、有效地(每周都可以找到新的bug)用你的工具创建测试。

  7. Automation can be much more successful when we collaborate with the programmers to develop hooks, interfaces, and debug output. (Consensus)

  当我们与程序员合作开发链接、接口和调试输出时,自动化会更加成功。(一致同意)

  Many of these collaborative approaches don’t rely on GUI-based automation tools, or they use these tools simply as convenient test drivers, without regard to what I’ve been calling the basic GUI regression paradigm. It was fascinating going around the table on the first day of LAWST, hearing automation success stories. In most cases, the most dramatic successes involved collaboration with the programming team, and didn’t involve traditional uses (if any use) of the GUI-based regression tools.

  很多这种协作方法并不依赖基于GUI的自动化工具,或者说,人们只是用这些工具做测试驱动,并没有考虑我提到的基于GUI的回归测试规范。在LAWST会议的第一天,我们兴高采烈地听着自动化的成功案例。但这其中,很多重大的成功都涉及到与编程团队的协作,而并没有涉及到传统的基于GUI回归测试工具的使用。

  We will probably explore collaborative test design and development in a later meeting of LAWST.

  我们将在今后的LAWST会议中探讨可协作的测试设计与开发。

  8. Most code that is generated by a capture utility is unmaintainable and of no long term value. However, the capture utility can be useful when writing a test because it shows how the tool interprets a series of recent events. The script. created by the capture tool can give you useful ideas for writing your own code. (Consensus)

  大多数用截取工具生成的代码是不可维护的,且没有长期价值。但是,在编写测试时,截取工具很有用,因为它能显示工具是如何翻译一系列最近发生事件的。而且,用截取工具生成的脚本能在你编写代码时给你有用的信息。(一致同意)

  9. We don't use screen shots "at all" because they are a waste of time. (Actually, we mean that we hate using screen shots and use them only when necessary. We do find value in comparing small sections of the screen. And sometimes we have to compare screen shots, perhaps because we’re testing an owner-draw control. But to the extent possible, we should be comparing logical results, not bitmaps.) (Consensus)

  我们根本不使用屏幕截图,因为这是在浪费时间。(事实上,我们的意思是我们不喜欢使用屏幕截图并只在必要时使用它。例如,我们发现它在对比屏幕小分区方面有一定价值。而且,我们有时不得不对比屏幕截图,或许是因为我们正在测试一个自绘制控件。但是更可能的情况是,我们会对比逻辑结果,而不是位图。)(一致同意)

  10. Don't lose site of the testing in test automation. It is too easy to get trapped in writing scripts instead of looking for bugs. (Consensus)

  不要在测试自动化时弄丢测试点。比起查找bug,在编写脚本时犯糊涂真是太容易了。(一致同意)

版权声明:本文出自msw_cn的51Testing软件测试博客

22/2<12
《2023软件测试行业现状调查报告》独家发布~

精彩评论

  • avi9111
    2011-1-26 10:44:07

    First generalization?第一代,我不是找作者麻烦,至少证明了作者是直接翻译的,没有经过测试的,还90%是正确的

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号