zoukankan      html  css  js  c++  java
  • app专项性能测试测试指标和测试方法

    工作中没有做过app这块的性能测试,但是你有面试问到过,现在做个总结如下

    1、首次加载(冷启动) 

    A.使用logcat监控activitymanager

    B.adb shell am start -w

    C.人工秒表计数

    2、非第一启动(热启动)

    应有运行在后台后,直接用冷启动监控的方法

    3、内存测试

    A.在核心功能页面使用android sdk的monitor观察

    B.monkey随机事件,adb shell dumpsys meminfo监控内存每秒使用

    4、cpu占用率测试

    A.monkey随机事件,adb shell dumpsys cpuinfo监控内存每秒使用

    B.在具体页面用top监控每秒使用情况

    5、耗电量

    A.采用市场上提供的第三方工具,入金山电池,管家之类的

    B.通过自写工具进行这里一般会使用3种方法

    a.第一种是基于android提供的powermanager,wakelock来进行

    b.第二种比较复杂点,功耗的计算=CPU消耗+vakelock消耗+数据传输消耗+cps消耗+wifi连接消耗

    c.第三种通过 adb shell dumpsys  battery来获取

    6、流量使用情况

    A.第三方流量宝之类的

    B.抓包工具,如 tcpdump

    C.adb shell cat proc/uid_stat/(uid#)/tcp_rcv

       adb shell cat proc/uid_stat/(uid#)/tcp_snd

    D.adb shell cat /proc/net/xt_qtaguid/stats | grep uid

    7、UI性能测试

    打开开发者中的CPU渲染

    8、fps测试(每秒传输帧数)

    A.adb shell dumpsys gfxinfo "应用名字" > fps.txt  常见情况是应该是16ms左右 1秒60帧

    B.可使用HierarchyViewer工具分析

    9、图片压缩

    抓包app的请求得到图片的大小

    10、缓存测试

    A.第一次查看图片列表和第二次查看图片抓包对比

    B.第一次查看城市分布和第二次查看城市分类抓包对比

     

     

     

  • 相关阅读:
    Power of Cryptography
    Radar Installation
    Emag eht htiw Em Pleh
    Help Me with the Game
    89. Gray Code
    87. Scramble String
    86. Partition List
    85. Maximal Rectangle
    84. Largest Rectangle in Histogram
    82. Remove Duplicates from Sorted List II
  • 原文地址:https://www.cnblogs.com/xdg920/p/14116550.html
Copyright © 2011-2022 走看看