如何开展性能测试?

2012-02-01  张林 

Trade Secrets from a Web Testing Expert

"You should simulate user abandonment as realistically as possible. If you don’t, you’ll be creating a type of load that will never occur in real life—and creating bottlenecks that might never happen with real users. At the same time, you will be ignoring one of the most important load testing results: the number of users that might abandon your Web
site due to poor performance. In other words, your test might be quite useless.”
-“Trade Secrets from a Web Testing Expert”

性能测试是非功能测试重要的一部分
, 越早开始越好!

但是大多数客户或是经理不知道性能测试有什么需求!

一句话要做性能测试,不能像12306.cn那样! 知道重要不知道如何入手 ......

如何开展性能测试?

我试着提出问题,请相关人员回答我的问题, 通过回答问题从而明确性能测试需求:

 1.  项目性能测试将关注哪些关键业务流程?

What are the critical workflows of the application to be considered as candidates for performance testing?

比如:  作为注册用户, 登录->浏览酒店/机票/度假-> 选择产品->下单->支付

 2. 期望项目多少用户在线或上并发?

What is the expected workload (number of simultaneous virtual users) to be tested?

比如: 期望上线能支持1000在线用户, 50用户并发操作

 3. 一个典型项目互联网户平均多长时间完成他的业务操作?

What is the average session duration of a user? - Average time a user would be logged into the application.

比如: 项目典型是游客/注册用户,而不是管理员或上运营操作人员, 10分钟完成下单流程

 4. 产品上线每天运行多长时间/被哪类典型用户访问? 比如: 项目 7x24运行, 游客/注册/运营用户的比例等

How many hours in a day the application would be available/accessed by the users?

 5. 业务性能期望目标? 系统支撑每天/每小时处理多少订单? 比如: 项目系统支撑每天1000订单

Do you have any specific performance objective (SLAs) for this test? E.g. 1000 Invoices to be processed in a Day

 6. 基什么测试环境,线上线下, 墙内还是墙外, WAN还是LAN?

Where is the test environment setup? – Inside the Firewall in an isolated LAN environment or outside the firewall.

 7.  项目用到哪些技术(web 1.0/2.0)? 特别是缓存机制/callback

What technologies have been used to develop the application?

 8. 项目用到哪些第三方接口? QQ微博登陆

What are the interfaces of the application? e.g., Payment gateways, web services etc.,

 9.  简介一下项目核心业务流程,比如, 什么样的用户或是角色, 可以用项目, 提供什么信息做什么操作完成用户业务?

Briefly describe the business/domain of the application.

 10. 项目上否已经上线? 是否考虑之前线上性能基准? 或着需要线上测试?

Is the application already in production? - Is this performance testing being conducted pre-production or post-production?

 11. 提供产品环境/测试环境软硬件配制列表

Please provide the test environment (Hardware and Software) configuration.

 ==参考以下性能测试模型=======

1.       Identify performance benchmarks/acceptance goal

Identify the key business critical scenarios

Identify the workload and usage pattern for simulation

Identify the key performance metrics/parameters to be monitored/measured

Identify the SLAs for performance testing

2.       Setup test environment

Identify the physical test environment including hardware, software and network configurations

Identify the tools and other resources required for conducting the performance test

3.       Plan and design tests

Setup performance test lab

Plan the tests in accordance with the identified acceptance criteria

Develop performance test script for the identified key business scenarios

Execute the script for one user and unit test to ensure script robustness and correctness

4.       Simulate load

Simulate the workload by executing performance test scripts adhering to the test plan

Monitor the resources utilization and the key performance parameters such as throughput, hits/second etc., during the test

5.       Analyze report and retest

Analyze the collected performance test results and identify bottlenecks and errors

Report the performance bottlenecks and errors with possible remediation

Plan for retest after the identified bottlenecks are resolved.

437°/4371 人阅读/0 条评论 发表评论

登录 后发表评论