典型的測試錯誤有哪些?(18)

發表于:2014-12-08來源:uml.org.cn作者:不詳點擊數: 標簽:典型測試錯誤
Beware of expecting to rerun all manual tests. You will become bogged down rerunning tests with low bug-finding value, leaving yourself no time to create new tests. You will waste time documenting tes

  Beware of expecting to rerun all manual tests. You will become bogged down rerunning tests with low bug-finding value, leaving yourself no time to create new tests. You will waste time documenting tests that don't need to be documented.

  注意不要期望重新運行所有的手工測試。重新運行這些很少能找到 bug 的測試會使你停滯不前,使你自己沒有時間創建新的測試。你會把時間浪費在為不需要文檔的測試編寫文檔上。

  You could automate more tests if you could lower the cost of creating them. That's the promise of using GUI capture/replay tools to reduce test creation cost. The notion is that you simply execute a manual test, and the tool records what you do. When you manually check the correctness of a value, the tool remembers that correct value. You can then later play back the recording, and the tool will check whether all checked values are the same as the remembered values.

  如果你能夠降低創建自動測試的成本,就可以多做一些。這也是使用GUI捕獲/回放工具能夠減少創建測試的成本的承諾。這個想法是你只需要執行手工測試,工具會錄制下你所做的操作。當你手工檢查一個值是否正確時,工具會記著那個正確值。過后你可以回放錄制,工具會檢查是否所有檢查的值是否都與記憶的值相同。

  There are two variants of such tools. What I call the first generation tools capture raw mouse movements or keystrokes and take snapshots of the pixels on the screen. The second generation tools (often called "object oriented") reach into the program and manipulate underlying data structures (widgets or controls).

  這類工具有兩個變種。我稱為第一代的工具只是捕獲原始的鼠標移動或擊鍵操作,并記下屏幕上象素的瞬象。第二代工具(常稱為“面向對象的”)深入程序并操縱底層數據結構(小配件或控件)。

  First generation tools produce unmaintainable tests. Whenever the screen layout changes in the slightest way, the tests break. Mouse clicks are delivered to the wrong place, and snapshots fail in irrelevant ways that nevertheless have to be checked. Because screen layout changes are common, the constant manual updating of tests becomes insupportable.

  第一代工具產生的是不可維護的測試。不論什么時候,只要屏幕布局有了非常微小的變化,測試就要中斷。鼠標的點擊傳送到不正確的位置,瞬象以一種不相關的方式失敗,必須予以檢查。因為屏幕布局變化是常見情況,所以經常手動更新測試也變得無法忍受。

  Second generation tools are applicable only to tests where the underlying data structures are useful. For example, they rarely apply to a photograph editing tool, where you need to look at an actual image - at the actual bitmap. They also tend not to work with custom controls. Heavy users of capture/replay tools seem to spend an inordinate amount of time trying to get the tool to deal with the special features of their program - which raises the cost of test automation.

  第二代工具只有在底層數據結構有用時才是可行的。例如,它們很少能用于照片編輯工具,因為你需要查看實際的圖象,即實際的位圖。它們也不大能夠與定制的控件一起使用。大量用戶的捕獲/回放工具似乎都要花費大量時間來使得工具能夠處理他們程序的特殊功能——這增加了自動測試的成本。

  Second generation tools do not guarantee maintainability either. Suppose a radio button is changed to a pulldown list. All of the tests that use the old controls will now be broken.

  第二代工具也不能保證可維護性。假設一個單選按鈕改變為下拉列表。所有使用老控件的測試都將中斷。

  GUI interface changes are of course common, especially between releases. Consider carefully whether an automated test that must be recaptured after GUI changes is worth having. Keep in mind that it can be hard to figure out what a captured test is attempting to accomplish unless it is separately documented.

  GUI界面當然是常常會改變的,特別是在不同的發行版之間。仔細考慮一下一個在GUI變化之后必須重新捕獲的自動化測試工具是否值得擁有。記住,除非另外使用文檔記錄下來,否則想要了解一個錄制的測試能夠完成什么工作是一件困難的事。

  As a rule of thumb, it's dangerous to assume that an automated test will pay for itself this release, so your test must be able to survive a reasonable level of GUI change. I believe that capture/replay tests, of either generation, are rarely robust enough.

  一個基本原則是,認為自動化測試的投資在這個發行版就能收回的想法是危險的,所以在一個合理的GUI變化范圍之內測試必須能夠繼續使用。我相信不論是第一代還是第二代捕獲/回放測試,都不夠健壯。

原文轉自:http://www.uml.org.cn/Test/200709289.asp

国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97