计算机科学 ›› 2017, Vol. 44 ›› Issue (2): 216-221.doi: 10.11896/j.issn.1002-137X.2017.02.035

• 软件与数据库技术 • 上一篇    下一篇

面向场景的安卓应用代码定位方法

吕照进,沈立炜,赵文耘   

  1. 复旦大学计算机科学技术学院 上海201203 上海市数据科学重点实验室复旦大学 上海201203,复旦大学计算机科学技术学院 上海201203 上海市数据科学重点实验室复旦大学 上海201203,复旦大学计算机科学技术学院 上海201203 上海市数据科学重点实验室复旦大学 上海201203
  • 出版日期:2018-11-13 发布日期:2018-11-13
  • 基金资助:
    本文受国家自然科学基金:安卓应用开发中模式驱动的代码推荐与完成技术研究(61402113)资助

Scenario-oriented Location Method of Android Applications

LV Zhao-jin, SHEN Li-wei and ZHAO Wen-yun   

  • Online:2018-11-13 Published:2018-11-13

摘要: 在开发新的需求功能或维护已有代码的过程中,安卓应用开发者会尝试获取与特定主题功能相对应的代码片段并了解其逻辑结构。当涉及代码层次上的分析工作时,复杂的源代码结构以及开发者不良的代码风格将会导致开发者需要花费大量的时间去定位代码片段并理清实现逻辑。因此,找出一种能够快速定位到代码片段的方法对于开发者具有重要的实际意义。提出了一种面向场景的安卓应用代码定位方法,其目标是根据特定主题功能的执行场景,综合运用动态与静态相结合的分析技术来确定与该主题功能相关的代码片段。此方法的执行步骤包括主题功能执行轨迹的收集与分析、安卓应用源代码的静态分析、基于静态与动态方法信息的匹配与综合以及方法信息的可视化展现。基于该方法实现了一款插件工具,该工具支持用户便捷查找与主题功能相关的代码信息,并支持高亮标记用户所指定的方法片段。

关键词: 安卓应用,主题功能,动态分析,静态分析,特征定位,方法宿主关联图,方法调用图

Abstract: During the process of implementing new requirements or maintaining existing project codes,Android application developers often try to acquire code fragments related to specific themes and understand their logical structures.As it involves analytical work on the code level,it costs developers much time to locate code fragments and sorts out the implementation logic due to the complexity of codes’ structures and bad code style of developers.Therefore,it is important to find a method that can be used to locate the fragments quickly.In this paper,we proposed a scenario-oriented location method of Android applications.This method combines static analysis and dynamic analysis techniques according to an execution scenario of a specific theme,and then locates code fragments associated with the specific themes.The method comprises the steps of collecting and analyzing theme execution traces,static analyzing of Android source codes,information matching and synthesizing on top of static and dynamic methods,and visualizing the method information.We furthermore implemented a plug-in tool to facilitate the search process of codes’ information with respect to specific theme and support the highlight of code fragments specified by developers.

Key words: Android application,Theme function,Dynamic analysis,Static analysis,Feature location,Method host association graph,Method call graph

[1] PAYET ,SPOTO F.Static analysis of Android programs[J].Information and Software Technology,2012,54(11):1192-1201 .
[2] Klocwork.[2015-12-10].http://klocwork.com/index.asp.
[3] BURGUERA I,ZURUTUZA U,NADJM-TEHRANI S.Crowdroid:Behavior-Based Malware Detection System for Android[C]∥Proceedings of the 1st ACM Workshop on Security and Privacy in Smartphones and Mobile Devices.2011:16-26.
[4] YAN L K,YIN H.DroidScope:Seamlessly Reconstructing theOS and Dalvik Semantic Views for Dynamic Android Malware Analysis[C]∥21st USENIX Security Symposium.2012:569-584.
[5] WILDE N,SCULLY M C.Software Reconnaissance:Mapping Program Features to Code[J].Software Maintenance:Research and Practice,1995,7(1):49-62.
[6] EISENBARTH T,KOSCHKE R,SIMON D.Derivation of feature component maps by means of concept analysis[C]∥Proceedings of European Conference on Software Maintenance and Reengineering.2001:176-179.
[7] EISENBERG A D,DE VOLDER K.Dynamic Feature Traces:Finding Features in Unfamiliar Code[C]∥Proceedings of 21st IEEE International Conference on Software Maintenance.2005:337-346.
[8] EISENBARTH T,KOSCHKE R,SIMON D.Aiding programcomprehension by static and dynamic feature analysis[C]∥Proceedings of International Conference on Software Maintenance.2001:602-611.
[9] KSTNER C,TRUJILLO S,APEL S.Visualizing SoftwareProduct Line Variabilities in Source Code[C]∥Proc.SPLC Workshop on Visualization in Software Product Line Enginee-ring.2008:303:312.
[10] KSTNER C,APEL S,KUHLEMANN M.Granularity in Software Product Lines[C]∥Proceedings of the 30th International Conference on Software Engineering.ACM,2008:311-320.
[11] TraceView.[2015-12-10].http://developer.android.com/tools/debugging/debugging-tracing.html.
[12] WOLFSON M.Android Developer Tools Essentials:AndroidStudio to Zipalign[M].O’Reilly Media,2013.
[13] AN L J.Design and implementation of the android system log storage and viewing tools[D].Beijing:Beijing University of Posts and Telecommunications,2012.(in Chinese) 安立君.Android系统日志存和查看工具的设计与实现[D].北京:北京邮电大学,2012.
[14] WEISER M D.Program slices:formal,psychological,and practical investigations of an automatic program abstraction method[M].University of Michigan,Ann Arbor,MI,1979 .
[15] OTTENSTEIN K J,OTTENSTEIN L M.The program depen-dence graph in a software development environment[J].ACM Sigplan Notices,1984,9(5):177-184.
[16] HAN Z,CHEN S H.Analysis on follow region and algorithm for construction program dependence graph[C]∥China National Computer Conference.2009:499-507.(in Chinese) 韩喆,陈世鸿.跳转语句跟随域分析与程序依赖图构造算法[C]∥中国计算机大会.2009:499-507.
[17] Zest.[2015-12-10]:http://www.eclipse.org/gef/zest.

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!