当前位置:网站首页>How to design test cases well
How to design test cases well
2022-07-26 18:34:00 【wangmcn】
How to do well in test case design
Catalog
1、 Test case design
1.1、 Determine test scope
1.2、 Use case design principles
1.3、 Use case design dimension
2、 Test case writing
2.1、 Test case writing premise
2.2、 Use case title
2.3、 Use case level distribution
2.4、 Preset conditions
2.5、 Operation steps
2.6、 Expected results
3、 Test case review
3.1、 Before review
3.2、 Under review
3.3、 After review
1、 Test case design
1.1、 Determine test scope
1、 There must be a complete requirements document
2、 Requirements have been reviewed and clarified
3、 There must be a complete list of functions
1.2、 Use case design principles
1、 follow “ The boundary value ” The principle of full coverage
2、 follow ” Equivalence class partition scenario “ The principle of full coverage
3、 follow ” The test case path is unique “ principle
When there are multiple paths , You need to create a new use case to cover . A use case covers only one test point . Reduce the risk of missing measurements .
4、 follow “ Single use case coverage is minimized ” principle
If you want to test a function A, It has three sub function points A1,A2 and A3, There are two ways to design test cases :
Method 1: Cover three sub functions with one test case - TestA1A2A3
Method 2: Three separate use cases are used to cover three sub functions - TestA1,TestA2,TestA3
Method 2 Followed “ Single use case coverage is minimized ” principle , benefits , When the use case execution fails , Reduce recurrence / Positioning complexity
5、 follow “ Minimum coupling between test cases ” principle
(1) Use the results of the previous test case carefully , As input for the next test case .
(2) Every test case , Should be completely independent .
The advantage of this is that it is easy to pull test cases 、 Reuse 、 Maintainable 、 Reduce subsequent input costs .
1.3、 Use case design dimension
1、 function
(1) positive ( normal ) scene
(2) reverse ( abnormal ) scene
2、 Non functional
(1) performance
Performance testing , First of all, we need to have specific 、 Clear performance index requirements .
Performance focus indicators :CPU、Memory、IO、 Network transmission rate, etc .
a. Item ( modular ) performance , such as SDK、 Algorithm 、 Individual performance requirements
b. Overall performance , Performance requirements after system integration
c. Network transmission performance
(2) reliable ( Stable ) sex
a. Time dimension
b. Load stability
(3) Robustness,
a. watchdog
b. Abnormal power failure
c. Restart again and again
(4) Ease of use
a. Ease of installation
b. O & M ease of use
c. Functional ease of use
(5) customer experience
For example, video playback effect 、 Whether the operation is smooth 、 Startup time, etc .
(6) Security
a. Data storage security
b. Network transmission security
2、 Test case writing
2.1、 Test case writing premise
1、 The test scope has been determined
2、 The test points have been sorted out
3、 Use case transformation path : Business needs - functional requirement - Test requirements - Test point - The test case
2.2、 Use case title
Outline the main content of the test case , Clarify the use case test intent
1、 The language is simple , Clarify what this use case does
2、 A complete sentence
3、 follow “ Conditions / action " The rules
2.3、 Use case level distribution
1、Lve 1: basic (~10%)
System basic function use cases , It can be used for smoke test during version submission , It can be used as the basis for whether the version passes the transfer test and business acceptance .
Basis of division : The failure of the execution of this use case will lead to the failure of many important functions .
for example : Switchgear 、 Upgrade, etc. .
2、Lve 2: important (~20%)
Important functional use cases in the system .
Basis of division : It mainly includes some functions related to interaction 、 Various application scenarios 、 Normal function test cases that are frequently used by customers .
for example : Equipment report 、 Video playback effect 、 Preview and other functions .
3、Lve 3: commonly (~60%)
General functions of the system .
Basis of division : General functional use cases , Test cases including exception paths ; The frequency of use is lower than 2 Level use cases .
for example : Form input boundary value 、 Verification of special characters, etc .
4、Lve 4: Obscure (~10%)
There are generally few use cases at this level . It is mainly some functions that are rarely used . If the use case execution fails , Test cases that will not cause too much harm to the system and business .
Basis of division : This use case corresponds to the less common preset conditions and data settings .
for example : Logging errors, etc .
2.4、 Preset conditions
1、 Key prerequisites for executing test cases
2、 Let the executor of the use case know more about the current state of the system
3、 Preset conditions cannot block the execution of test cases
2.5、 Operation steps
1、 It needs to be clear “ Test key inputs ” data
2、 The operation path is unique , If it is not unique, multiple use cases cover ( To reduce the coupling )
3、 With “ Process oriented ” Write in the form of
(1) The process description is accurate 、 unambiguous .
(2) The context must be consistent .
benefits : Reduce execution costs 、 Reduce the cost of subsequent maintenance
2.6、 Expected results
1、 Each step of operation has corresponding expected results
2、 The expected result must be objective 、 Decidable
(1) That is to say, the correctness of test execution results can be determined , Each test case should have the corresponding expected results .
(2) The expected results prohibit the use of correct , normal , Vague subjective words like mistakes .
3、 The expected result must meet the demand
4、 The expected result must be certain
For the same test case , The execution results of the system should be the same 、 affirmatory .
3、 Test case review
3.1、 Before review
1、 Make the review object familiar with test cases in advance
2、 Talk about requirements in reverse
3、 Clarify the final test scope
3.2、 Under review
1、 test
(1) Explanation of test cases .
(2) Once again, make a deep understanding of the requirements .
2、 Development
(1) From the perspective of development and coding , Check whether the test case is missing .
(2) From the perspective of code implementation , Provide suggestions on the internal association logic of the module .
3、 The product manager
(1) Check whether the test case scenario meets the business requirements .
(2) Provide suggestions for test cases from the customer's point of view .
3.3、 After review
1、 Send and file review minutes
2、 Update test cases according to review recommendations
边栏推荐
- Vector CANape - How to Send Receive CAN Message in CANape
- Pyqt5 rapid development and practice 3.5 menu bar and toolbar
- 打印日志的一些小技巧
- J9数字论:如何避免踩雷多头陷阱?
- Privacy computing basic component series - confusion circuit
- Duplicate gallerycms character length limit short domain name bypass
- Baidu PaddlePaddle easydl x wesken: see how to install the "eye of AI" in bearing quality inspection
- 自动化测试工具-Playwright(快速上手)
- [kitex source code interpretation] service discovery
- 还在用Xshell?推荐这个更现代的终端连接工具
猜你喜欢

Vector CANoe Menu Plugin拓展入门

Pyqt5 rapid development and practice 3.5 menu bar and toolbar

Hello World

LeetCode50天刷题计划(Day 4—— 最长回文子串 14.00-16:20)

还在用Xshell?推荐这个更现代的终端连接工具

Redis persistent rdb/aof

更安全、更健康、无续航焦虑,魏牌拿铁DHT-PHEV来了

Baidu PaddlePaddle easydl x wesken: see how to install the "eye of AI" in bearing quality inspection

offer-集合(1)

推荐效果不如意,不如试试飞桨图学习
随机推荐
Leetcode 50 day question brushing plan (day 5 - longest palindrome substring 10.50-13:00)
BulletGraph(子弹图、项目符号图)
Linear regression -- Taking an arithmetic sequence as an example
链表-合并两个排序的列表
LeetCode50天刷题计划(Day 1—— 两数相加 11.00-12.30)
Leetcode 50 day question brushing plan (day 3 - concatenate substrings of all words 10.00-13.20)
Day 4 of SSM practice_ Get user name_ User exit_ User CRUD_ Password encryption_ Roles_ jurisdiction
俄语翻译的就业前景怎样 如何做好俄语翻译工作
剑指offer 跳台阶扩展问题
14.梯度检测、随机初始化、神经网络总结
Leetcode 0137. number II that appears only once
Duplicate gallerycms character length limit short domain name bypass
The faith of circle justice
ALV屏幕输入选项学习
LeetCode_ 1005_ Maximized array sum after K negations
突发!Arm停止与华为合作!对华为影响究竟有多大?
LeetCode50天刷题计划(Day 5—— 最长回文子串 10.50-13:00)
LeetCode_ 134_ gas station
菜鸟 CPaaS 平台微服务治理实践
College personnel management system based on jsp+servlet