测试用例模板
测试用例 (Test case)
用例名称
用例编号 重要程度
用例设计人 代码负责人
测试人 测试时间
English version
Title
Case ID Level
Designer Developer
Tester Time
测试场景描述 (Case scenario)
场景描述
子场景(可选)
子场景1 例如,返回10条记录
子场景2 例如,返回100条记录
测试流程 (Testing process)
描述被测试应用场景的商业流程,流程必须在实际测试中发挥良好的导航作用,使不熟悉该系统的使用者能够对商业流程有清晰的了解。
(被测的商业流程应该事先通过检测,以确保功能的顺利运行。应用程序代码在测试阶段应该被冻结)
1.
2.
3.
测试条件和要求 (Requirements)
环境要求
硬件要求:
WEB服务器 - 配置1.2 (详细配置信息见测试计划文档,或附录)
软件要求:
补丁要求:
网络要求:
性能基线和衡量指标 (Testing baseline & metrics)
前提 (测试结果有效的先决条件)
1. 例如:无内存泄漏;HTTP错误个数为0
2. 数据库数据要求
例如:流水表已有20万条记录
3. 并发连接数要求
4. 测试周期或测试次数
性能基线
1. 例如:每秒钟完成XXX笔交易
2.
3.
监视参数 (详情见附录)
1. 例如:Performance Monitor: Private Byte
2.
3.
性能计算方式
1. 例如:数据库交易表增加纪录数 / 总时间(秒)
2.
3.
测试数据和脚本 (Testing data, Scripts)
测试数据准备
包括登陆账号组,输入数据;可以事先保存在某个文本文件中
测试数据库
数据库、表、存储过程、视图、用户帐号、相关数据
测试脚本
根据测试工具编写相应脚本或编写手工测试脚本
for Example
1LBrowser
1. Navigate to the home page of the Online Shopping site.
2. Click “Help.”
3. Click “FAQ.”
4. Click “Shopping” on FAQ.
5. Click “Shopping/Our Products” on the main menu.
6. Click “Product Search.”
7. Click “Special Offers.”
8. Click “Store Finder.”
9. Click Central Scotland to view shop addresses.
10. Click “Edinburgh” to see details.
11. Click “After Sales.”
12. Click “Basket.”
13. Navigate to the home page of the Online Shopping site.
14. Click on Advert at bottom of page.
测试手段 (Testing instrument)
例如: 编写自动测试工具
或使用专用测试工具。
备注 (Remarks)
附录A – 应用软件性能数据分类
4.1 应用软件性能数据概述
在企业级应用的负载测试过程中,测试工具通过部署一整套性能监视器,来收集和显示各个架构层次、服务器和组件上的性能数据,包括网络、操作系统、应用服务器、中间件、应用程序、.NET服务器、Web服务器和数据库服务器。在进行负载测试时,这些数据用来精确测量系统各个方面的性能,从而用户可以快速、简便地定位问题和瓶颈的来源。最终,这些数据用来生成各种文档和图表,并判断出应用程序的性能是否满足业务的需要。
4.2 应用软件常用性能数据描述
1. Number of Concurrent Users (NCU)
并发用户数 – 在指定时刻,系统观察到的并发用户连接数。
2. Request Per Second (RPS)
每秒处理请求数 – 指示服务器平均每秒钟能处理的用户事务请求数量。
3. Response Time
响应时间 – 指从客户发出一个事务请求到收到处理结果的最后一个字节的时间长度。
4. Time to First Byte (TTFB)
客户端收到响应的第一个字节的平均毫秒数。
5. Time to Last Byte (TTLB)
客户端收到响应的最后一个字节的平均毫秒数。
6. Think Time
思考时间 – 用户在发送下一个请求前花在浏览页面上的时间。
7. Hits per Second
每秒点击次数
8. Throughput
吞吐量 – 以kilobyte为单位,客户每秒接收的数据总量。
9. Pages per Second
每秒下载页数 – 每秒内从Web服务器上下载到客户端的Web页面数量。
10. User-define Data Point (supported by LoadRunner)
用户自定义性能指标 – 由LoadRunner支持的自定义性能指标,比如: Transaction Response Time, Transaction Per Second Passed, Failed。
11. %Processor Time:CPU平均利用率
12. %User Time:用户态CPU平均利用率
13. % Privileged Time:核心态CPU平均利用率
14. Processor Queue Length:处理器队列中的线程数
15. Context Switches per Second:每秒线程切换次数
16. Interrupts/Sec:每秒中断数
17. Page Faults / sec:每秒内存换页数
18. Memory, Available Bytes:平均剩余的可用内存
19. Private Bytes:进程分配内存数
20. Process, Handle Count:进程使用系统句柄数
21. Memory, Pool Paged Bytes:可交换到硬盘的系统物理内存byte数。
22. Memory, Pool Non-paged Bytes:不可交换到硬盘的系统物理内存byte数。
23. Network Interface, bytes total/sec:网络带宽利用率
24. Network Interface, Output Queue Length:网络适配器输出队列长度
25. Physical Disk, %Disk Time:物理磁盘利用率
26. Physical Disk, Avg Disk Queue Length:物理磁盘平均磁盘I/O队列长度
27. Physical Disk, Current Disk Queue Length:物理磁盘当前磁盘I/O队列长度
28. Physical Disk, Disk Read/Sec, Disk Write/Sec:物理磁盘每秒读/写操作次数
29. COM+ Authenticate (by LoadRunner):COM+ 调用级别验证成功频率
30. COM+ Authenticate Failed (by LoadRunner):COM+ 调用级别验证失败的频率
31. COM+ Activation (by LoadRunner):COM+ 应用激活频率
32. COM+ Failed (by LoadRunner):COM+ 应用关闭频率
33. COM+ Thread Start (by LoadRunner):STA的线程启动的比率
34. COM+ Thread Terminate (by LoadRunner):STA的线程中止的比率
35. Transaction Duration (by LoadRunner):COM+事务的平均周期
36. Transaction Start (by LoadRunner):COM+事务启动比率
37. Transaction Prepared (by LoadRunner):COM+事务进入准备阶段的比率
38. Transaction Aborted (by LoadRunner):COM+事务回滚的比率
39. Transaction Commited (by LoadRunner):COM+事务提交的比率
40. Object LifeTime(by LoadRunner):COM+组件平均生命期
41. Object Create (by LoadRunner):创建COM+组件实例的比率
42. Object Destroy (by LoadRunner):释放COM+组件实例的比率
43. Object Activate (by LoadRunner):COM+ JIT-actived对象激活的比率
44. Object Deactivate (by LoadRunner):COM+ JIT-actived对象失活的比率
45. Disable Commit (by LoadRunner):COM+对象处于DisableCommit状态的比率
46. Enable Commit (by LoadRunner):COM+对象处于Enable状态的比率
47. Set Complete (by LoadRunner):COM+对象处于SetComplete状态的比率
48. Set Abort (by LoadRunner)COM+对象处于SetAbort状态的比率
49. COM+ Method Duration (by LoadRunner):COM+方法调用平均持续时间
50. COM+ Method Frequency (by LoadRunner):COM+方法调用频率
51. COM+ Method Failed (by LoadRunner):COM+方法失败的频率
52. COM+ Method Exception (by LoadRunner):COM+方法抛出异常的频率
53. Active Server Page, Request per Second:ASP每秒执行请求数
54. Active Server Page, Request Queue:ASP请求队列长度
55. Active Server Page, Requests Execute Time:ASP平均请求执行时间
56. Active Server Page, Requests Wait Time:ASP平均请求等待时间
57. Active Server Page, Session Current:当前活动Session计数
58. .NET CLR Data, SqlClient, Current # Pooled Connection:当前被连接池缓存的数据库连接
59. .NET CLR Data, SqlClient, Current # Pooled and Non-pooled Connection
当前所有的数据库连接,缓存和未缓存的
60. .NET CLR Memory, Gen 0、1、2 heap size:.NET中0、1、2代虚拟堆的大小
61. .NET CLR Memory, # bytes in all Heaps:.NET中托管内存的总数
62. ASP.NET, Application Restarts:ASP.NET中应用重新启动的次数
63. ASP.NET, Work Process Restarts:ASP.NET中工作进程重新启动的次数
64. ASP.NET, Request Execution Time:ASP.NET平均请求执行时间毫秒数
65. ASP.NET, Request Wait Time:ASP.NET平均请求等待时间毫秒数
66. ASP.NET, Requests Queued:ASP.NET平均请求队列长度
67. ASP.NET Application, Requests/Sec:ASP.NET某特定应用每秒钟处理的请求数
68. ASP.NET Application, Requests Executing:ASP.NET某特定应用正在执行的请求数
69. ASP.NET Application Sessions Active:ASP.NET某特定应用中活动的Session数
70. Web Service, Get Requests per Second:HTTP的GET方法每秒请求数
71. Web Service, Post Requests per Second:HTTP的POST方法每秒请求数
72. Distributed Transaction Coordinator, Transactions/Sec
每秒的分布式事务数
73. Distributed Transaction Coordinator, Committed Transactions
提交的分布式事务总数
74. Distributed Transaction Coordinator, Aborted Transactions
回滚的分布式事务总数
75. Distributed Transaction Coordinator, Active Transactions
当前活动的分布式事务数
76. Distributed Transaction Coordinator, Response Time – Average
分布式事务从开始到提交的平均时间间隔
77. SQL Server, Cache Manager, Cache Hit Ratio:SQL Server的缓存区命中率
78. SQL Server, Cache Manager, Cache Used Counts per Second
SQL Server每秒内使用的缓存对象数
79. SQL Server, Locks, Exclusive/Shared & Users blocked
SQL Server 每秒内用户由于表级锁被阻塞数
80. SQL Server, % Procedure Cache Used & % Procedure Cache Active
SQL Server存储过程缓存使用率
81. SQL Server, Transaction/Sec:SQL Server每秒的事务数
82. SQL Server, General statistics, User Connections
SQL Server 当前用户连接数
83. SQL Profiler, Audit Login/Logout
SQL Profiler中跟踪用户登入/登出数
84. SQL Profiler, Stored Procedure, RPC Completed
SQL Profiler中跟踪存储过程的调用
85. SQL Profiler, TSQL, Batch Completed:SQL Profiler中跟踪TSQL语句的调用
86. SQL Profiler, SQL Transaction:SQL Profiler 中跟踪事务的提交。
4.3 应用软件性能数据分类
企业应用程序可以根据系统架构分成以下类型
Client/Server – 客户机/服务器架构 l 基于浏览器/Web服务器的三层架构 l 基于中间件应用服务器的三层架构 l 基于Web服务器和中间件的多层架构
以上架构都由客户机、Web服务器、中间层应用服务器、数据库服务器组成。通过针对不同层次的性能指标监测,可以分析出整体架构的性能指标和性能瓶颈。
1. 数据库服务器的性能指标监测
l Processor, %Processor Time
Processor, %User Timel
Processor, %l Privileged Time
Processor, Processor Queue Lengthl
System, Contextl Switches per Second
Memory, Page Faults/secl
Memory, Availablel Bytes
Memory, Pool Paged Bytesl
Network Interface, bytes total/secl
l Network Interface, Output Queue Length
Physical Disk, %Disk Timel
l Physical Disk, Current Disk Queue Length
Physical Disk, Avg Disk Queuel Length
Physical Disk, Disk Read/Sec, Disk Write/Secl
SQL Server,l General statistics, User Connections
SQL Server, Transaction/Secl
SQLl Server, Cache Manager, Cache Hit Ratio
SQL Server, Cache Manager, Cachel Used Counts per Second
SQL Server, Locks, Exclusive/Sharedl & Users blocked
SQL Server, % Procedure Cache Usedl & % Procedure Cache Active
SQL Profiler, Audit Login/Logoutl
SQL Profiler, Storedl Procedure, RPC Completed
SQL Profiler, TSQL, Batch Completedl
SQLl Profiler, SQL Transaction
2. Web服务器的性能指标监测
Processor, %Processorl Time
Processor, %User Timel
Processor, % Privileged Timel
l Processor, Processor Queue Length
System, Context Switches per Secondl
l Process, Private Bytes
Memory, Page Faults/secl
Memory, Availablel Bytes
Memory, Pool Paged Bytesl
Network Interface, bytes total/secl
l Network Interface, Output Queue Length
Physical Disk, %Disk Timel
l Physical Disk, Avg Disk Queue Length
Number of Concurrent Users (NCU)l
l Request Per Second (RPS)
Response Timel
Time to First Byte (TTFB)l
l Time to Last Byte (TTLB)
Think Timel
Web Service, Get Requests perl Second
Web Service, Post Requests per Secondl
Active Server Page,l Request per Second
Active Server Page, Request Queuel
Active Serverl Page, Requests Execute Time
Active Server Page, Requests Wait Timel
l Active Server Page, Session Current 。
3. 基于ASP.NET的Web服务器或Web Service服务器性能指标监测
Processor, %Processor Timel
Processor, %User Timel
l Processor, % Privileged Time
Processor, Processor Queue Lengthl
System,l Context Switches per Second
Process, Private Bytesl
Memory, Pagel Faults/sec
Memory, Available Bytesl
Memory, Pool Paged Bytesl
l Network Interface, bytes total/sec
Network Interface, Output Queuel Length
Physical Disk, %Disk Timel
Physical Disk, Avg Disk Queuel Length
Number of Concurrent Users (NCU)l
Request Per Second (RPS)l
l Response Time
Time to First Byte (TTFB)l
Time to Last Byte (TTLB)l
l Think Time
Web Service, Get Requests per Secondl
Web Service, Postl Requests per Second
ASP.NET, Application Restartsl
ASP.NET, Workl Process Restarts
ASP.NET, Request Execution Timel
ASP.NET, Request Waitl Time
ASP.NET, Requests Queuedl
ASP.NET Application, Requests/Secl
l ASP.NET Application, Requests Executing
ASP.NET Application Sessionsl Active
4. 中间层应用服务器的性能指标监测
Processor, %Processor Timel
Processor,l %User Time
Processor, % Privileged Timel
Processor, Processor Queuel Length
System, Context Switches per Secondl
Process, Private Bytesl
l Memory, Page Faults/sec
Memory, Available Bytesl
Memory, Pool Pagedl Bytes
Network Interface, bytes total/secl
Network Interface, Outputl Queue Length
Physical Disk, %Disk Timel
Physical Disk, Avg Disk Queuel Length
COM+ Authenticate (by LoadRunner)l
COM+ Authenticate Failed (byl LoadRunner)
COM+ Activation (by LoadRunner)l
COM+ Failed (byl LoadRunner)
COM+ Thread Start (by LoadRunner)l
COM+ Thread Terminatel (by LoadRunner)
Transaction Duration (by LoadRunner)l
Transaction Startl (by LoadRunner)
Transaction Prepared (by LoadRunner)l
Transactionl Aborted (by LoadRunner)
Transaction Commited (by LoadRunner)l
Objectl LifeTime(by LoadRunner)
Object Create (by LoadRunner)l
Object Destroyl (by LoadRunner)
Object Activate (by LoadRunner)l
Object Deactivate (byl LoadRunner)
Disable Commit (by LoadRunner)l
Enable Commit (byl LoadRunner)
Set Complete (by LoadRunner)l
Set Abort (byl LoadRunner)
COM+ Method Duration (by LoadRunner)l
COM+ Method Frequencyl (by LoadRunner)
COM+ Method Failed (by LoadRunner)l
COM+ Methodl Exception (by LoadRunner)
.NET CLR Data, SqlClient, Current # Pooledl Connection
.NET CLR Data, SqlClient, Current # Pooled and Non-pooledl Connection
.NET CLR Memory, Gen 0、1、2 heap sizel
.NET CLR Memory, #l bytes in all Heaps
Distributed Transaction Coordinator,l Transactions/Sec
Distributed Transaction Coordinator, Committedl Transactions
Distributed Transaction Coordinator, Aborted Transactionsl
l Distributed Transaction Coordinator, Active Transactions
Distributedl Transaction Coordinator, Response Time – Average
5. 客户机的性能指标监测
l Processor, %Processor Time
Process, Private Bytesl
Process, Handlel Counts
Network Interface, bytes total/secl
Network Interface, Outputl Queue Length
Physical Disk, Avg Disk Queue Lengthl
.NET CLR Memory, Genl 0、1、2 heap size
.NET CLR Memory, # bytes in all Heapsl
Number ofl Concurrent Users (NCU)
Request Per Second (RPS)l
Response Timel
l Hits per Second
Throughputl
Pages per Secondl
User-define Datal Point
Time to First Byte (TTFB)l
Time to Last Byte (TTLB)l
Thinkl Time |