Software test case design summary

1. General principles

  1. Equivalence class division method, turning infinite tests into limited tests
  2. Boundary value analysis is a method that must be used in any use case
  3. The error value estimation method can help us add some use cases based on the original use cases.
  4. If the input conditions need to be considered in combination, the cause-and-effect diagram method and the decision table method can be used
  5. Testing of parameter configuration types can be combined with orthogonal testing methods to screen use cases
  6. For a system with clear business processes, scenario method can be used to design test cases.
  7. For situations where stateful migrations and logical functional paths are combined, consider using the function diagram approach.
    Check the logic coverage of the designed test cases against the program logic. If the required coverage standards are not met, sufficient test cases should be added.

2. Design thinking

(1) Reduce the big to small & modularize.
Overall analysis to get simple use cases.
Detailed analysis to refine the use cases.
Fill in data to improve the use cases.
(2) Optimize
and utilize 8 methods of designing test cases. Continuously decompose and merge test cases, and use divergent thinking to construct tests. Example.

3. Example of new positions

Business description:

  1. The superuser user can request to create a new position after logging in to the position.
  2. Enter the "Position Information Query" page and click Create a new position.
  3. When creating a new position, you can set the new position name, department, and position description information.
  4. The information for the new position cannot be missing. If an item is not written, a prompt will be given.
  5. The length of the position name should not exceed 100 characters
  6. Job description length should not exceed 1,000 characters
  7. The position name cannot be repeated when saving.
  8. After filling in the information, you can choose to save or cancel the operation, and then return to the "Position Information Description" page to end the process. The
    overall analysis leads to a simple use case.
elementary stream 1. Log in as superuser
2. Enter the "Position Information Query" page and click New
3. Open the new position page
4. Enter the new position information
5. Click Save
Alternative stream 1 In step 3 of the basic flow, the position information is not entered completely.
Alternative stream 2 Basic flow step 3 position name exceeds 100 characters
Alternative stream 3 Basic flow step 3 job description exceeds 1000 characters
Alternative stream 4 Duplicate position name when saving
Alternative stream 5 Select Cancel when saving

Insert image description here
Generate simple use cases

scene 1 elementary stream
Scene 2 Basic flow→Alternative flow 1
Scene 3 Basic flow→Alternative flow 2
Scene 4 Basic flow→Alternative flow 3
Scene 5 Basic flow→Alternative flow 4
Scene 6 Basic flow→Alternative flow 5
Use case ID Scenes scene description expected outcome
TC001 scene 1 Enter valid position information and save Successfully create the position and return to the position information description page
TC002 Scene 2 Enter incomplete job information and save It prompts that the input information is incomplete and the position information is not saved. Return to step 4.
TC003 Scene 3 Enter the position name with more than 100 characters and save it It prompts that the position name exceeds 100 characters and the position information will not be saved. Return to step 4.
TC004 Scene 4 Enter a job description that exceeds 1,000 characters It prompts that the job description exceeds 1000 characters and the job information will not be saved. Return to step 4.
TC005 Scene 5 Duplicate position name when saving It prompts that the position already exists. The save fails and returns to step 4.
TC006 Scene 6 Select Cancel when saving The position information is not saved. Return to the position information description page.

Detailed analysis and refinement of use cases

Use case ID Scenes scene description expected outcome
TC001 scene 1 Enter valid position information and save Successfully create the position and return to the position information description page
TC002 scene 1 Enter invalid position information and save (the position name contains illegal characters) It prompts that the position information contains illegal characters, the save fails, and returns to step 4.
TC003 scene 1 Enter invalid position information and save (the department contains illegal characters) It prompts that the position information contains illegal characters, the save fails, and returns to step 4.
TC004 scene 1 Enter invalid position information and save (the job description contains illegal characters) It prompts that the position information contains illegal characters, the save fails, and returns to step 4.
TC005 Scene 2 Enter incomplete position information and save (position name is empty) It prompts that the input information is incomplete and the position information is not saved. Return to step 4.
TC006 Scene 2 Enter incomplete position information and save (department is empty) It prompts that the input information is incomplete and the position information is not saved. Return to step 4.
TC007 Scene 2 Enter incomplete position information and save (position description is empty) It prompts that the input information is incomplete and the position information is not saved. Return to step 4.
TC008 Scene 3 Enter 99 characters for the position name and save it Successfully create the position and return to the position information description page
TC009 Scene 3 Enter 100 characters for the position name and save it Successfully create the position and return to the position information description page
TC010 Scene 3 Enter 101 characters for the position name and save it It prompts that the position name exceeds 100 characters and the position information will not be saved. Return to step 4.
TC011 Scene 4 Enter 999 characters for job description Successfully create the position and return to the position information description page
TC012 Scene 4 Enter 1000 characters of job description Successfully create the position and return to the position information description page
TC013 Scene 4 Enter 1001 characters of job description It prompts that the job description exceeds 1000 characters and the job information will not be saved. Return to step 4.
TC014 Scene 5 Duplicate position name when saving It prompts that the position already exists. The save fails and returns to step 4.
TC015 Scene 6 Select Cancel when saving The position information is not saved. Return to the position information description page.
TC016 Exception event flow 1 The database server failed and the network failed when saving. Position information is not saved, prompting system exception

Fill in the data to complete the use case.

4. Method application

Functional division should be simple and clear. Each test case only checks one functional module.
The division of test cases should also be simple. Each test case only checks one situation of the function point.
Test cases must have a simple purpose description, clear execution prerequisites, including environment, scenarios, data, and clear test data.
一般设计步骤
根据设计规格得出基本测试用例
1.补充边界值测试用例
2.补充错误猜测测试用例
3.补充异常测试用例
4.补充性能测试用例

Web类常用控件测试用例设计思路

Textbox实例1:要求一个textbox控件不能为空,可以填写任何字符,长度不能超过20,设计测试用例。
按长度用边界值法设计测试用例
1.输入0个字符(报错)
2.输入1个字符(正常)
3.输入19个字符(正常)
4.输入20个字符(正常)
5.输入21个字符(报错)
按字符类型设计测试用例
输入汉字(正常)
输入英文字符串(正常)
输入数字(正常)
输入符号(正常)
安全性方面设计测试用例
XSS攻击(正常)
Textbox实例2:一个textbox表示金额,小数点后最多2位,字符长度不超过10,设计测试用例
字符长度边界值测试
输入9位字符(正常)
输入10位字符(正常)
输入11位字符(报错)
小数位数边界值测试
输入为空(报错)
输入2位小数(正常)
输入3位小数(报错)
字符类型测试
输入汉字(报错)
输入string字符串(报错)
输入空格(报错)
输入除.外的符号(报错)
输入超过1个.(报错)
Select实例:一个下拉菜单框,默认值为空,有A,B,C3个选项,单选,不可写,设计测试用例
The default value is empty check (normal)
unwritable check (normal)
select A (normal)
select B (normal)
select C (normal)
single-select check (normal)
Web pages are usually divided into display type and submission type.
Display page test case design: a web page containing table data to display names and amounts in the database. Design test cases
Page element check Check
Table format (normal)
Check other page styles (normal)
Page data check
The name is empty (normal)
The name contains Chinese characters (normal)
The maximum length of the name (normal)
The amount is empty (normal)
The amount is 0 ( Normal)
Amount with 2 decimal places (Normal)
Maximum length of amount (Normal)

Note: Other invalid equivalent classes are designed by yourself.

Guess you like

Origin blog.csdn.net/u011090984/article/details/91409807