Interface testing tool development documentation

1  Development plan

1.1 Developers

Role

main duty

Responsible module

personnel

Remark

nxxx module

xxx

1.2  Development Plan

<Attached development schedule>

1.3  Development environment and tools

development tools

tool

effect

Notepad++

editor

Perl

interpreter

2  overall design

Design idea: Because of testing app and server. First of all, the communication between the app and the server must be disconnected to construct a connection layer, and then the case design and the feedback of the case to the app should be designed based on this connection layer.

2.1  Concept term description

2.1.1  Terminology 1

<Description of term 1>

2.1.2  Terminology 2

<Description of term 2>

2.1.3  Description of algorithm used

none

2.1.4  Module dependencies:

⒈ JSON, providing json parsing function

2. Parallel::ForkManager, which provides multi-process fork and other functions.

⒊ HTTP::Proxy, provides proxy function.

⒋Log::Fast, provides log function

2.2  Basic design description

A multi-process CS model is adopted. The modules and functions are roughly divided into 4 categories:

(1) Data synchronization module, which mainly synchronizes online and offline data. The online module is read-only for the data of this module.

⑵. Configure the parsing module. Mainly JSON parsing, which parses the overall Case configuration file to generate a list of all cases.

⑶, HttpProxy proxy module, the main function is to proxy http requests and record the content of http requests. A thing to do for future analysis and comparison of Http requests.

a) Start Proxy when CaseManager starts.

b), other functions to be determined/****/

⑷ , Executor module. The main function is to connect to the Manager and execute the content assigned to it by the Manager. And send the execution results to the Manager.

a) After startup, connect to the fixed port of the server. After connecting to Chen Gong, wait for the server to issue tasks.

b) Parse the task command issued by the server in the form of JSON, and execute it according to the content of the command.

⑸ . CaseManager module, whose main function is to manage cases and assign tasks to Executors. Receive the execution results sent back by the Executor.

a) Load the parsing configuration at startup and exit if failed.

b), start SOCKETserver and initialize the binding port. Must support stub and mesgtype for subsequent expansion

c), fork out some processes, and then assign tasks.

d) Receive some information sent back by the Executor and process it /**Need to discuss**/

e) Wait for the case to be issued and the Executor to complete the cleanup action.

⑹. Generate the final report. (optional modules)

⑺, other necessary components.

2.2.1  Overall logical structure/flow chart of the system (Figure 1)

2.2.2  Configuration file guidance/instructions

{
 
"Proxy": {
 
这里是代理相关的配置
 
},
 
"Global": {
 
"LocaleType": "utf8",#本地语言,可以为空,默认ascii
 
"Protocal": "HTTP",#协议的类型,http或者https目前只支持Http
 
"IsRsyncData": 0,#是否需要从线上同步数据
 
"DataServerIp": "127.0.0.1",#从线上同步数据的IP
 
"DataServerPort" : "127.0.0.1",#从线上同步数据的Port
 
"RequestType":[ "POST", "GET" ],#需要测试的Request类型
 
"PostReqSkipSection": ["aa","bb"],#POST请求类型需要忽略的section,开启之后所在的sections里面所有的POST类型的请求case都将不会执行。
 
"GetReqSkipSection": ["aa","bb"],#GET请求类型需要忽略的section,开启之后所在的sections里面所有的GET类型的请求case都将不会执行。
 
"PostReqSkipFunction": ["aa","bb"],#POST请求类型需要忽略的case名称,开启之后所有的名字和列表中名字相同的POST类型的请求case都将不会执行。
 
"GetReqSkipFunction": ["aa","bb"], GET请求类型需要忽略的case名称,开启之后所有的名字和列表中名字相同的GET类型的请求case都将不会执行。
 
"Version":[
 
#需要测试的所有的server的版本列表
 
{
 
"VersionNumber": "xx.xx.xx.xx",#版本号
 
"AddressIP": "127.0.0.1",#对应的server的IP
 
"AddressPort": "9999",#对应的server的Port
 
"VersionSkipFunction":[],#本版本不测试的case名称
 
"VersionSkipSection": []##本版本不测试的Section名称
 
},{#同上
 
"VersionNumber": "xx.xx.xx.xc",
 
"AddressIP": "127.0.0.1",
 
"AddressPort": "9999",
 
"VersionSkipFunction":[],
 
"VersionSkipSection": []
 
}
 
]
 
},
 
"Sections": {#这个Sections的名字就叫Sections
 
"Normal":{#名字为function_name的case。
 
"function_name":{
 
"url":"/api/plugInfo",#Version中的IP+PORT+url即是当前请求的URL
 
"ReqHeaderArgs": [],#需要添加的header的内容
 
"ReqContentArgs": [],#需要添加httpcontent内容,位于HTTP-content中。
 
"ReqArgs":[ ##需要添加content内容,位于HTTP-content中。
 
{"aaaa": "bbb"},
 
{"aaaa": "bbb"}
 
#例如www.baidu.com/login?user=aa&passwrod=bb这个请求构造的过程中ReqArgs = [{“user”: “aa”},{“password”:”bb”}]而ReqHeaderArgs和ReqContentArgs可以置空。
 
],
 
"Asserts": [
 
{"/code" : 0, type : equal },
 
{"/cc": 1, type : diff, "force" : 1 }
 
{"/cc": 1, "type": "between", "force" :1,"from": 0, "to": 1}
 
#断言列表,对于server反悔的JSON值。断言的类型有两种,between ,equal和nequal分别表示在from和to之间,相等和不等。如果force值为1,那么说明这个断言是强制满足的。以路径表示返回值的内容。例如:
 
要判断marketingImage的url是否是null,加一个断言即可{"/plug/marketingImage/url": NULL}
 
]
 
}
 
},
 
"Exception":{#这个Sections的名字叫Exception
 
"exception_name":{#同上
 
"url":"/api/plugInfo",
 
"ReqHeaderArgs": [],
 
"ReqContentArgs": [],
 
"ReqArgs":[
 
{"aaaa": "bbb"},
 
{"aaaa": "bbb"}
 
]
 
}
 
},
 
"Bound":{#这个Sections的名字叫Bound
 
"exception_name":{#同上
 
"url":"/api/plugInfo",
 
"ReqHeaderArgs": [],
 
"ReqContentArgs": [],
 
"ReqArgs":[
 
{"aaaa": "bbb"},
 
{"aaaa" :"bbb"}
 
]
 
}
 
}
 
}
 
}

2.3  Main interface process description

none

2.4  Module list

Module name (English)

Function

Remark

Module1Module1

Module2Module2

Module3Module3

3  data structure

Data table list

Table Name

effect

<Attached SQL database structure definition document>

If you are not using a database, you don’t need to write it.

4  module design

4.1  Module1 design

<Refined module design for more specific situations>

4.1.1  Module Design Description

4.1.2  Module interface description

4.2  Module2 design

5Appendix  _

5.1 Problems encountered and solutions

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:

insert image description here

These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. I hope it can help you too!  

Guess you like

Origin blog.csdn.net/nhb687095/article/details/132716110