北京第三期_安全测试基础_20181111

专项测试下文

adb shell am dumpheap com.xueqiu.android /data/local/tmp/1
adb pull /data/local/tmp/1
hprof-conv 1 1.jvm.hprof

1 2 3 4 5
2-1
3-1
4-1
5-1

测试流程

  • 启动app
  • 测试用例的setup,force gc + dump heap
  • 执行用例。滑动N次,进入某个activity然后再退回。。。
  • teardown中 force gc + dump heap
  • heap profile

电量消耗

git clone https://github.com/google/battery-historian.git
go get -d -u github.com/google/battery-historian/...
cd battery-historian
go run setup.go
go run cmd/battery-historian/battery-historian.go

http://jenkins.testing-studio.com:9999/

清理耗电量数据
adb shell dumpsys batterystats --reset
adb shell dumpsys batterystats --enable full-wake-history
运行测试用例
appium uiautomator
收集耗电量数据

=7.0 adb bugreport bugreport.zip
<=6.0 adb bugreport > bugreport.txt

参考读物

  • Linux性能之巅
  • Android移动性能实战
  • 移动App性能评测与优化

安全测试

https://testerhome.com/topics/16392

作业1

分析下刷新过程,对比内存增长情况。出一个5个阶段的数据对比

作业2

播放qq音乐15分钟,检查电量消耗数据