当前位置:网站首页>Skills of writing test cases efficiently
Skills of writing test cases efficiently
2022-06-24 17:43:00 【Software test network】

Align test case requirements
First 、 Specify the test case document objectives and requirements to be completed , Templates 、 Range 、 Particle size, etc .
- Use case document users : Testers
- Scope of use case document : Cover all requirements of the product
- Use case template content : Number 、 modular 、 Sub module 、 Test function point 、 Preset conditions 、 data 、 step 、 Expected results 、 priority 、 Use case types 、 Linked requirements 、( Prepared by 、 Update time 、 Executor 、 state 、 execution time 、 Execution results )
- Test case granularity : Positive and negative use cases of all functions
- Person in charge of test case acceptance : See you for a long time ( Align target )
Quickly understand the product
Get familiar with the product business background and technical architecture as soon as possible , So as to outline the overall framework of test cases . Any product , Can eventually be mapped to 【 Horizontal scaling 】+【 Vertical stratification 】 Complete the use case coverage under the combination mode of .
Horizontal business expansion
It refers to the auxiliary level of the product , What are the total business scenarios , What capabilities are provided , That is, the functional panorama of the top layer of the product .
Vertical architecture layering
It refers to the analysis from the technical architecture level of the product , The current products can be divided into several layers , So that the use case verification is to verify and cover the use case from different levels .
Take the big data cloud platform of a cloud as an example , The core of big data cloud platform is cluster . The big data cloud platform cluster is composed of one or more virtual machine instances Hadoop、Flink、ZooKeeper colony . With Hadoop For example , There are usually some running on each virtual machine instance daemon process ( for example ,NameNode、DataNode、ResouceManager and NodeManager), Various big data service components can also be installed on the cluster ( for example :HBase、Hive、Presto、Spark etc. ).
Panoramic circuit diagram of horizontal core business functions of big data cloud platform ( With Hadoop Clusters, for example ), Its core processes are :Hadoop Create cluster -> Cluster management -> Big data component management -> Virtual host management -> ... ->Hadoop Cluster release ; The functional panorama is shown in the figure 1 Shown :

Panorama of big data cloud platform functions
The vertical core architecture of big data cloud platform is simplified into the following four layers , Pictured 2:
- At the top : Portal console interface of big data cloud platform 【UI】
- Second floor : The back-end platform of cloud big data API【OpenApi】
- The second floor : The server of big data cloud platform 【 Big data service components 】
- At the bottom : Infrastructure of big data cloud platform 【 Cloud server 】

Big data cloud platform architecture diagram
Make a quick plan
Use case coverage
Starting from the panorama of product business functions , around PRD(Product Requirement Document)、 Combined with the vertical architecture level , The use case has no dead corner and fully covers the product ( On scope ).
(1) Widen horizontally 【 Width 】, The main life cycle of its products ranges from large modules to small modules 、 The main function to the secondary function is gradually expanded , Borrow the fish bone diagram to comb ( Here's the picture 3) or Xmind Brain map to sort out . First sort out the inside , Then sort out the service or product scenarios of external docking ( Such as : Message center 、 Cost center 、 Alarm Center 、 Document center 、 Data development and so on ).


(2) After the lateral expansion divergence is completed , Start longitudinal excavation 【 depth 】, such as , The core architecture of big data cloud platform is divided into four layers , Each layer needs to be taken apart :
- At the top :UI Layer end-to-end use case walk through ( As described above ), From the top floor UI Operational testing is in addition to inspection UI result 、 Also ensure that the actual results on the underlying cluster server are consistent with the interface display
- Second floor : The second layer is the portal backend Api, Call directly OpenApi The relevant test cases cover
- The second floor : Direct operation, use or strong intervention Hadoop Cluster service component 、 Test the quality of the whole big data cloud platform ; Because there are many service components on the big data platform ( There are more than thirty ), In addition to the use of a single service , More importantly, multiple common service components should be combined for verification
- At the bottom : Direct operation, use or strong intervention in the server layer ( increase 、 Delete 、 stop 、 restart 、 expand 、 shrink 、 l 、 The Internet 、 disk 、 Software configuration, etc ), Test the quality of the whole big data cloud platform

So far , The whole big data cloud platform Hadoop All test cases of the cluster have been sorted out .
Use case design method
Starting from the type of test , Functional and non functional test cases cover . There is no need to deliver non functional use cases this time , So don't expand ; Functional use case design method :
- Division of equivalence class ( Positive equivalence class 、 Negative equivalence class )
- Boundary value analysis ( Within the boundary 、 Outside the boundary )
- Decision table analysis
- Cause and effect diagram
- Wrong guess

Use case writing principles
- Resolution principle : The full text establishes a unified boundary . such as : Take the module as the boundary 、 When there is correlation and interaction between different modules 、 Preset conditions as boundaries , The contents of the preset conditions are put in the upstream module for verification .
- Priority principle :【 establish 】【 see 】【 Use ( Start stop, etc )】【 modify 】【 Delete 】 In order 【 Main scene 】 first 、【 Secondary scenario 】 secondly 【 Example 】 first 、【 Counter example 】 secondly
- Basic principles : The use case is not repeated 、 There is no omission , Principle of unicity 、 That is, a use case covers only one scenario and clear steps 、 There is no ambiguity in the clear expected results Repeated execution results in the same
Write tips quickly
Set uniform standards
Take a cloud big data cloud platform product as an example , A lot of functions are required in a unified way , To this end, design a set of standardized use cases :
- such as : Create a new page , Form entry , Unified requirements ( If required 、 Length limit 、 Character requirements ), Design a set of standardized use cases , For reuse by other pages .
- such as : Authority test cases for each module , Design unified standard use cases ;
- such as : be-all OpenApi test , All for return codes 200、400、401、403、405、500 The scene test ;
- such as : Big data platform services 30 Multiple , Each service is different , But the operation is similar : add to 、 start-up 、 stop it 、 Modify the configuration 、 Deploy , Design unified standard use cases for this purpose ( Do you have a visual sense of code refactoring at the moment , Define a standard method 、 For you to call repeatedly ).
Extract common components
Take a cloud big data cloud platform product as an example , Which includes 10 More than one list page , For each list, there is a paging component 、 Screening 、 Search for 、 Sort , The use cases of these common components are drawn as 【 Common component use cases 】, Design a set of standardized use cases , Relevant pages can be reused .
Be careful : In the unified standard use case , Variable items use {ABC} To replace , such as : When filtering cluster status in the cluster view list , Unify... In standard use cases {ABC} Replace with { State of the cluster } that will do .
Batch writing and automatic generation
In the case writing process , Found a lot of things except { A name or field } Different , Everything else is the same , At this time, you can write in batch ( Such as : With the help of Sublime Or directly transfer variables and generate them with code ), This can also greatly improve the writing efficiency .

Writing OpenApi Related test cases , Directly define a set of OpenApi Standard use cases , With QA The designed standard use case is the template , Then write code to generate use cases , By reading the OpenApi Of Json file , Quickly generate 71 individual Api Test cases for , near 1000 Detailed test cases , Efficient .
Replace with full text
When writing use cases ,QA Personnel must use unified language or format , First, it is convenient for readers 、 Second, it is convenient to find and replace , That is, through full-text search and replacement, you can Quick maintenance use case .
There was a demand change : From the original first level menu A001 Lower secondary menu B002, Change to level one C001 Next D002; Because in the use case of the whole product , Enter the secondary menu from the primary menu , All use :A001->B002 This format , This demand change , Direct full-text search and replacement with one click .
As mentioned earlier, several sets of unified standard use cases have been designed , When new pages are reused , Replace variable contents directly , Generate the current use case . Or what the requirements change is just the content of the unified standard use case , Find and replace with full text 、 Use case maintenance in one minute .
All in all , We must sum up a set of our own methods to deal with such a huge amount of writing workload , Otherwise, it cannot be completed in a short time . And the second trick of writing use cases efficiently , It is inseparable from reusability 、 Look for commonalities 、 Refine unified standards , Borrow some means or tools to automatically generate .
Send you a word at the end : Draw the boundaries of the field 、 High reuse 、 Low coupling .
边栏推荐
- Erc-721 Standard Specification
- Use BPF to count network traffic
- Mengyou Technology: tiktok current limiting? Teach you to create popular copywriting + popular background music selection
- Cloud MySQL importing cloud data warehouse PostgreSQL best practices
- 浅谈云流送多人交互技术原理
- EasyPlayer流媒体播放器播放HLS视频,起播速度慢的技术优化
- "Gambler" bubble Matt turns around
- How does the video platform import the old database into the new database?
- As for IOT safety, 20 CSOs from major manufacturers say
- Realize business development on behalf of small programs, and 99% restore the function of service category management in the background of official account
猜你喜欢

How to start cloud native application development

How does the chief information security officer discuss network security with the enterprise board of directors

Six configuration management tools that administrators must know

C language - structure II

LC 300. Longest increasing subsequence

Number of occurrences of numbers in the array (medium difficulty)
Issue 39: MySQL time class partition write SQL considerations

Constantly changing the emergency dialing of harmonyos ETS during the new year

13 ways to reduce the cost of cloud computing

NVM download, installation and use
随机推荐
【你真的会用ES吗】ES基础介绍(一)
03. Tencent cloud IOT device side learning -- overview of mqtt control package
持续助力企业数字化转型-TCE获得国内首批数字化可信服务平台认证
What securities dealers recommend? Is it safe to open an account online now?
Design topic: MATLAB cellular automata personnel evacuation
How to create simple shapes in illustrator 2022
Litamin: SLAM Based on geometric approximation of normal distribution
PHP WMI get hostname
Memory alignment in golang
TCE was shortlisted as a typical solution for ICT innovation of the Ministry of industry and information technology in 2020
H265 video streaming web page without plug-in player easywasmlayer Troubleshooting and solution of JS unable to set cover photo
From file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql The GPG key to retrieve the key source "MySQL 5.7 community server" is installed, but not applicable to
The RTSP video image intelligent analysis platform easynvr cascades to the superior platform through the national standard for playback optimization
On software requirement analysis
13 skills necessary for a competent QA Manager
Do you charge for PDF merging software? Programmers make one by themselves
Easycvr, an urban intelligent video monitoring image analysis platform, plays national standard equipment videos and captures unstable packets for troubleshooting
视频平台如何将旧数据库导入到新数据库?
It is often blocked by R & D and operation? You need to master the 8 steps before realizing the requirements
EasyNVR使用Onvif探测设备失败,显示“无数据”是什么原因?