当前位置:网站首页>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 .
边栏推荐
- Cloud MySQL importing cloud data warehouse PostgreSQL best practices
- Five steps to effectively monitor network traffic
- You don't know about this inspection platform. It's a big loss!
- On the principle of cloud streaming multi person interaction technology
- [2021 taac & Ti-One] frequently asked questions related to the notebook function
- How can programmers reduce bugs in development?
- As for IOT safety, 20 CSOs from major manufacturers say
- LC 300. Longest increasing subsequence
- Cloud native monitoring practice (2) monitoring and collection of components outside the TKE cluster
- EasyGBS视频平台TCP主动模式拉流异常情况修复
猜你喜欢

LC 300. Longest increasing subsequence

13 ways to reduce the cost of cloud computing
SQL basic tutorial (learning notes)

Five skills of selecting embedded programming language

Error reported after NPM I

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

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

It is often blocked by R & D and operation? You need to master the 8 steps before realizing the requirements

C language - structure II

High quality defect analysis: let yourself write fewer bugs
随机推荐
Continue to help enterprises' digital transformation -tce has obtained the certification of the first batch of digital trusted service platforms in China
Ten software development indicators for project managers
Live broadcast Preview - on April 1, I made an appointment with you to explore tcapulusdb with Tencent cloud
QQ domain name detection API interface sharing (with internal access automatic jump PHP code)
13 ways to reduce the cost of cloud computing
When the game meets NFT, is it "chicken ribs" or "chicken legs"?
Management system permission design
[play with Tencent cloud] play with cloud database mysql
Solutions for RTSP video streaming played by several browsers
Error reported after NPM I
Five skills of selecting embedded programming language
Will the easycvr video channel of the urban intelligent video monitoring image analysis platform occupy bandwidth after stopping playing?
Noi Mathematics: solution of quadratic congruence equation
投资理财产品的钱能随时取出来吗?
Constantly changing the emergency dialing of harmonyos ETS during the new year
03. Tencent cloud IOT device side learning -- overview of mqtt control package
Leveldb source code analysis -- writing data
13 skills necessary for a competent QA Manager
C language | logical operators
Issue 39: MySQL time class partition write SQL considerations