Skip to main content
QUICK REVIEW

[论文解读] On the Energy Footprint of Mobile Testing Frameworks

Luís Cruz, Rui Abreu|arXiv (Cornell University)|Oct 19, 2019
Green IT and Sustainability参考文献 36被引用 7
一句话总结

本文評估了八種移動端 UI 自動化框架在測試過程中的能耗開銷,發現部分框架的能耗最高可增加 2200%。Espresso 是能耗最低的框架,而使用基於內容的 UI 元素查找方法(例如「依內容查找」)的耗電量最高可達 600%。本研究提供了一棵決策樹與最佳實務建議,協助開發人員選擇具能耗意識的測試框架,並減少程式碼插入的開銷。

ABSTRACT

High energy consumption is a challenging issue that an ever increasing number of mobile applications face today. However, energy consumption is being tested in an ad hoc way, despite being an important non-functional requirement of an application. Such limitation becomes particularly disconcerting during software testing: on the one hand, developers do not really know how to measure energy; on the other hand, there is no knowledge as to what is the energy overhead imposed by the testing framework. In this paper, as we evaluate eight popular mobile UI automation frameworks, we have discovered that there are automation frameworks that increase energy consumption up to roughly 2200%. While limited in the interactions one can do, Espresso is the most energy efficient framework. However, depending on the needs of the tester, Appium, Monkeyrunner, or UIAutomator are good alternatives. In practice, results show that deciding which is the most suitable framework is vital. We provide a decision tree to help developers make an educated decision on which framework suits best their testing needs.

研究动机与目标

  • 探討 UI 自動化框架是否會引入顯著的能耗開銷,從而扭曲移動應用程式能耗效率的測量結果。
  • 比較常見使用者操作下,主流移動測試框架的能耗表現。
  • 識別撰寫具能耗效率的自動化測試腳本的最佳實務,特別是針對 UI 元素查找方法的考量。
  • 提供決策框架,協助開發人員根據專案限制選擇最節能的測試框架。

提出的方法

  • 作者評估了八種主流移動端 UI 自動化框架:Espresso、Appium、UIAutomator、Monkeyrunner、AndroidViewClient、Calabash,以及另外兩種框架。
  • 透過電源計量儀測量常見 UI 操作(點擊、長按、拖曳與放下、滑動、捏合與展開、返回按鈕、輸入文字,以及多種「尋找」操作)執行期間的能耗。
  • 本研究比較了各框架在相同操作下的能耗表現,以隔離出每種框架內部邏輯所引入的開銷。
  • 針對查找方法(依 ID、描述、內容)評估其能耗成本,特別關注基於內容的搜尋對效能的影響。
  • 根據能耗效率、功能支援與專案特定限制,建立決策樹,以協助框架選擇。
  • 最佳實務建議基於實證結果提出,特別強調應避免使用基於內容的查找,並建議快取 UI 元素的查找結果。

实验结果

研究问题

  • RQ1RQ1:UI 自動化框架所產生的能耗開銷是否會影響移動應用程式能耗效率測量的結果?
  • RQ2RQ2:哪種框架最適合用於分析能耗?
  • RQ3RQ3:在撰寫具能耗效率的自動化測試腳本時,是否存在任何最佳實務?

主要发现

  • Espresso 展現出最低的能耗表現,每次點擊僅消耗 0.09J,是評估中能耗最低的框架。
  • 部分框架在拖曳與放下操作中,能耗開銷最高可達 2200%,嚴重扭曲能耗測量結果。
  • 使用「依內容查找」進行 UI 元素查找,其能耗最高可達「依 ID 查找」的 600%,在 Espresso 中能耗從 1.4J 上升至 9.4J。
  • Appium、Monkeyrunner 和 UIAutomator 被識別為 Espresso 的強大替代方案,特別適用於 Espresso 存在限制(如需原始碼存取權限、不相容 WebView)的專案。
  • AndroidViewClient 和 Calabash 因其過高的能耗開銷,被判定不適合用於能耗效率測試。
  • 快取 UI 元素查找結果,並優先使用「依 ID 查找」或「依描述查找」而非「依內容查找」,可顯著降低測試腳本的能耗。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。