CE Stress & Hopper的原理

UI压力测试工具需要比用户还了解用户的操作,能够捕捉到边缘操作问题(甚至用户都想不到的操作,比如在没有输入框的界面下狂点输入法。)

 

如何解决压力测试发现的问题

1.工具

CE里面我们有CeStress以及Hopper工具,Android里我们有Monkey

Windows下我们的分析工具有:Windbg、Platform Builder以及CeDebugX等插件

 

Windows CE>!help

CEDEBUGX

File Version    : 6.00.0000
Product Version : 6.00.0000

COMMANDS:

To see detailed help type the command followed by /?

Extension Information and Control:

  help                      - display this list
  version                   - display version information for this extension
  refresh                   - refresh cached info (must call after any run/break cycle).
  xml                       - capture debug info in an xml file and display formatted data.
  save                      - prompts the user for a location in which to save all files generated in the session.
  getworkingpath            - display the path to the debugger extension's current working folder.
  setworkingpath            - specify a path to use as a new destination for saved files (working folder)

General Information:

  exception                 - exception info and current call stack
  kinfo                     - prints the UserKInfo table
  toc                       - prints ROM table of contents
  oat                       - prints OEM Address Table
  disasm                    - retrieve disassembly for a given address
  getsym                    - list nearest symbol at addr
  checksymbols              - validate that correct symbols are in use.
  dd                        - dump data at given address
  ll                        - prints linked lists generically
  expr                      - evaluate an expression
  getsizeof                 - get the size, in bytes, of a type or expression
  d2x                       - convert a decimal integer to a hex value.
  x2i                       - convert a hex value to a singed integer.
  x2u                       - convert a hex value to an unsigned integer.
  ms2t                      - display a value in milliseconds as hours, minutes, and seconds.

Diagnostics:

  diagnose                  - provide detailed information about hangs or crashes

Threads:

  thread                    - prints thread information from thread ptr
  threadh                   - prints thread information from thread handle
  threadlist                - enumerate all threads (basic info). use "threadlist ?" for more options
  allthreads                - enumerate all threads (extended info)
  runlist                   - enumerate threads on the scheduler's run list.
  sleeplist                 - enumerate threads on the scheduler's sleep list.
  context                   - print context information for a given thread.
  stackeval                 - prints all values on a thread's stack, looking for potential symbols and known objects
  stacktrace                - prints stack ptr and frame ptrs with PC and ret addr for a given thread

Processes and Modules:

  proc                      - prints process information
  proclist                  - lists all processes
  module                    - prints module information
  modlist                   - lists all loaded modules

Handles:

  handlelist                - prints active handle list
  handle                    - evaluates a handle to determine type
  h2p                       - get kernel object ptr from a handle
  p2h                       - get a handle from a kernel object ptr

Blocked Threads:

  proxy                     - prints detailed information about a particular proxy (i.e. blocking object)
  proxylist                 - lists all of the proxies in the system or owned by a particualr process
  blocked                   - prints list of blocking objects (proxies) and the threads they are blocking
  cslist                    - prints a list of critical sections that are currently blocking threads
  eventlist                 - prints a list of events that are currently blocking threads
  sending                   - prints a list of threads blocked in SendMessage calls

Heaps:

  alloclist                 - prints allocations in a process grouped by allocating function or thread.
  heaplist                  - prints summary information about all heaps in the system
  heap                      - prints detailed information about a particular heap.
  region                    - prints detailed information about a particular heap region.
  heapwalk                  - print a list of all items in one or more heaps
  regionwalk                - print a list of all items in one or more regions
  heapvalist                - print list of heap items greater than 16Kb in size
  dumpitem                  - prints contents of a heap item
  finditem                  - finds and prints info about a heap item at a given address
  listitems                 - list all heap items meeting given criteria (e.g. size, allocator, data, etc.)

Memory:

  meminfo                   - prints system memory information
  valist                    - prints virtual allocations associated with a process
  fsmaplist                 - prints summary information about all memory-mapped files
  fsmap                     - prints information about a memory-mapped file
  fsviewlist                - prints summary information about all memory-mapped views
  fsview                    - prints information about a memory-mapped view
  pgpool                    - prints information about the page pools

GWES:

  win                       - enumerate all windows (use it without arguments for more options)
  winh                      - prints the window information for a handle (can use p|c|n|d|a) for navigation
  gditable                  - enumerate all GDI entries
  gdih                      - prints the information of the GDI entity related to the provided handle
  gdiobj                    - prints the information of the GDI entity related to the provided gdi object
  screenshot                - creates and shows a screenshot of the current UI state of the device
  msgqueues                 - lists active message queues

Internal:

  match                     - find a duplicate bug (must first 'diagnose')

 

2.Repro or Not Repro

第一个问题要了解问题能不能复现(Repro),这里说Not Repro的意思是问题几乎不能复现(因为Repro的环境非常苛刻,或者概率很低)

 

3.需要哪些知识和能力

喜欢福尔摩斯吗?

罪犯在有“压力”的情况下犯的案,比较难分析。经常遇到“太阳怎么从西边出来了”这样的问题。

较强的问题分析能力

能够通过一些信息片段还原整个流程

汇编(了解)、操作系统、C/C++

 

4.常用的方法:

a.小组对照实验

b.Automation得到大量数据

c.正向思维和逆向思维

d.先发散思维,从广度得到数据,然后从深度分析,直到找到Root Cause

 

5.从哪里得到数据?

a.Log信息(RETAILMSG/NKPrint…) Output窗口/Log file

b.Visual Studio中的Watch窗口/Memory窗口…

c.汇编窗口

d.靠眼睛看现象/靠听/靠闻?望闻问切?

 

6.什么样的Bug最难解?

Not Repro的问题

 

如何解决小概率问题