Page 106 - 《软件学报》2025年第5期
P. 106

软件学报 ISSN 1000-9825, CODEN RUXUEW                                        E-mail: jos@iscas.ac.cn
                 2025,36(5):2006−2025 [doi: 10.13328/j.cnki.jos.007203] [CSTR: 32375.14.jos.007203]  http://www.jos.org.cn
                 ©中国科学院软件研究所版权所有.                                                          Tel: +86-10-62562563



                                                                         *
                 基于事件标记的多粒度结合安卓测试序列约减

                 郝    蕊,    冯    洋,    李玉莹,    陈振宇


                 (计算机软件新技术国家重点实验室 (南京大学), 江苏 南京 210093)
                 通信作者: 冯洋, E-mail: fengyang@nju.edu.cn

                 摘 要: 针对安卓自动化测试工具生成的崩溃测试序列包含过多冗余事件, 造成测试回放、缺陷理解与修复困难
                 的现状, 很多测试序列约减工作被提出. 但目前工作仅关注应用界面状态变化而忽略了程序执行过程中内部状态
                 变化, 此外, 目前工作仅在单一抽象粒度上对应用状态进行建模, 例如控件粒度或活动粒度, 导致约减后测试序列
                 过长或约减效率低下. 针对以上问题, 提出基于事件标记的多粒度结合的安卓测试序列约减方法, 结合安卓生命周
                 期管理机制、程序静态数据流分析等对触发程序崩溃的关键事件进行标记, 缩小序列约减空间, 并设计了低粒度
                 粗筛选、高粒度细约减的策略. 最后, 收集包含程序间交互、用户输入等复杂场景的崩溃测试序列集, 在此数据集
                 上与其他测试序列约减工作的对比评估结果也验证了所提方法的有效性.
                 关键词: 安卓测试; 崩溃回放; 测试序列约减
                 中图法分类号: TP311

                 中文引用格式: 郝蕊, 冯洋, 李玉莹, 陈振宇. 基于事件标记的多粒度结合安卓测试序列约减. 软件学报, 2025, 36(5): 2006–2025.
                 http://www.jos.org.cn/1000-9825/7203.htm
                 英文引用格式: Hao R, Feng Y, Li YY, Chen ZY. Multi-granularity Fusion Android Test Sequence Reduction Based on Event Labeling.
                 Ruan Jian Xue Bao/Journal of Software, 2025, 36(5): 2006–2025 (in Chinese). http://www.jos.org.cn/1000-9825/7203.htm

                 Multi-granularity Fusion Android Test Sequence Reduction Based on Event Labeling
                 HAO Rui, FENG Yang, LI Yu-Ying, CHEN Zhen-Yu
                 (State Key Laboratory for Novel Software Technology (Nanjing University), Nanjing 210093, China)
                 Abstract:  As  too  many  redundant  events  included  in  crash  test  sequences  generated  by  Android  automated  test  tools  may  result  in  test
                 replay,  defect  comprehension,  and  repairing  difficulty,  a  great  number  of  test  sequence  reduction  works  have  been  proposed.  While  current
                 works  only  focus  on  the  application  interface  changes  and  ignore  the  internal  state  changes  during  program  execution.  Moreover,  current
                 works  only  model  application  states  at  a  single  and  abstract  granularity,  such  as  control  widget  granularity  or  activity  granularity,  resulting
                 in  long  test  sequences  after  reduction  or  inefficient  reduction.  This  study  proposes  an  Android  test  sequence  reduction  method  combined
                 with  multi-granularity  based  on  event  labeling.  By  taking  into  account  the  Android  lifecycle  management  mechanism  and  data  flow
                 analysis  to  label  critical  events  that  trigger  crashes,  this  method  can  narrow  the  sequence  reduction  space  and  design  a  strategy  of  rough
                 selection  under  low  granularity  and  detailed  reduction  under  high  granularity.  At  last,  a  crash  test  sequence  set  containing  complex
                 scenarios  such  as  inter-application  interaction  and  user  input  is  collected,  and  the  comparison  with  other  test  sequence  reduction  works  on
                 this set verifies the effectiveness of the method proposed in this study.
                 Key words:  Android test; crash replay; test sequence reduction

                    截至  2022  年第  3  季度, Google Play Store 拥有超过  350  万个安卓应用  [1] , 下载次数超过  270  亿次  [2] , 占据了市
                 场份额的   80%, 与此同时, 复杂的交互环境、网络状态、多种系统兼容要求等也使得安卓应用相比传统的软件更
                 易发生崩溃问题, 严重影响用户体验, 这也是导致应用程序用户评分低的最重要的问题之一                             [3−5] . 为了保障安卓应


                 *    部分工作为郝蕊在武汉理工大学做博士后期间完成
                  收稿时间: 2023-10-01; 修改时间: 2024-01-08; 采用时间: 2024-04-08; jos 在线出版时间: 2024-06-20
                  CNKI 网络首发时间: 2024-06-21
   101   102   103   104   105   106   107   108   109   110   111