[go: up one dir, main page]

CN109558316A - A kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration - Google Patents

A kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration Download PDF

Info

Publication number
CN109558316A
CN109558316A CN201811393594.1A CN201811393594A CN109558316A CN 109558316 A CN109558316 A CN 109558316A CN 201811393594 A CN201811393594 A CN 201811393594A CN 109558316 A CN109558316 A CN 109558316A
Authority
CN
China
Prior art keywords
test
interface
parameter
list
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811393594.1A
Other languages
Chinese (zh)
Inventor
谢博钒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Popular Online Technology Co Ltd
Original Assignee
Wuhan Popular Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Popular Online Technology Co Ltd filed Critical Wuhan Popular Online Technology Co Ltd
Priority to CN201811393594.1A priority Critical patent/CN109558316A/en
Publication of CN109558316A publication Critical patent/CN109558316A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to a kind of HTTP interface mobilism parameter test methods of Test Strategy automatic configuration, and this method key step includes: the first step, and Test Strategy configuration module is arranged, and construct the incidence relation table of interface and code file;Second step, executes Test Strategy configuration module, and positioning epicycle needs to be implemented the interface of test;Third step uses the method for random selection parameter, each of loop test interface list to be measured interface.In implementation procedure, test execution efficiency is promoted using multi-thread concurrent mechanism;And by the way that random choosing ginseng is tested repeatedly, uninterruptedly, for a long time, the coverage rate of dirty data fault-tolerance test is improved;4th step obtains test result.Parameter, which is solved, with this solidifies that the Test coverage face that generates is insufficient, parameter is vulnerable, dirty data coverage rate is low, and code when changing the test due to caused by coverage assessment inaccuracy omit or the problems such as deviation, realize raising test data coverage rate, testing efficiency and the purpose of accuracy.

Description

A kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration
Technical field
The present invention relates to a kind of HTTP interface of Internet technical field more particularly to Test Strategy automatic configuration dynamics Change parameter test method.
Background technique
With the rapid development of internet area, HTTP (HyperText Transfer Protocol, Hyper text transfer Agreement) as a kind of network protocol being most widely used on internet, it appears it is even more important.And during application, Interface testing is vital part again.
Currently, the method for http interface testing has very much, but there is a problem of several universal.
Firstly, main test method is usually based on the basic theories such as equivalence class, boundary value in currently available technology, etc. Valence class partitioning needs all possible input data of program being divided into several equivalence classes, then tool is chosen from each part Representational data are reasonably classified as test case, to guarantee that test case has integrality and representativeness. And supplement of the boundary analysis as parity price class partitioning, principle are similar, are surveyed to the boundary value of input or output A kind of Black-box Testing method of examination, boundary of the test case from equivalence class.Since these methods are often first tested Case designing, then choose and meet the preset parameter of test case condition and tested, so automatic test also can only be by fixation Parameter input by associated script realization.But this test method for preset parameter is used, when data in database When the change of attribute, selected test case will fail before, need to reset use-case parameter.It will lead to automation in this way The efficiency of test reduces, and Test coverage face is relatively low.
Secondly, user uses http interfacing, i.e., when carrying out data transmitting with http protocol mode, server-side can will be used The incoming parameter in family carries out service logic operation, and operation result is returned to user.The operation of service logic can combined data Data in library are handled, and the data in database, can be generated because of the mistake of a variety of causes in exploitation or use process Some dirty datas that not in given range, data format is illegal or service logic is unclear.These dirty data characteristics are different, often It can not all be screened by unified condition.Data volume is bigger, and dirty data is more not easy to be found, to robustness, fault-tolerant Property etc. tests choosing ginseng bring difficulty.
In addition, in traditional method, general test script is by tester's manual configuration test scope.But In the process of development, due to demand change, function upgrading etc., the modification of code is often related to.And it is responsible for written in code work The developer of work and the tester of responsible test job convey not in time due to linking up insufficient or information sometimes, To make tester assess inaccuracy to the coverage that code changes, the test scope of manual configuration mismatches, causes to survey The raw omission of test manufacture or deviation.
Summary of the invention
For the technical problems in the prior art, the HTTP for providing a kind of Test Strategy automatic configuration connects the present invention Mouthful mobilism parameter test method can solve parameter simultaneously and solidify that Test coverage deficiency, the parameter generated be vulnerable, dirty data It is asked when being difficult to carry out Test coverage and code change due to testing omission or deviation etc. caused by coverage assessment inaccuracy Topic.
The technical scheme to solve the above technical problems is that a kind of HTTP interface of Test Strategy automatic configuration Mobilism parameter test method, mainly comprises the steps of:
Step 1, the incidence relation table of interface and code file is constructed;
The change of one file may influence multiple interfaces, so file and interface are many-one relationship.Structure is simple Engineering can establish incidence relation table by hand;Complicated engineering can establish association by parsing the adduction relationship of code file Relation table.Incidence relation list includes filename, file hash value, the corresponding relationship of the three parts such as affected interface;File Hash value is the numerical value obtained according to the data of file content by hashing algorithm, and the hash value that different files obtains is different , so hash value is file unique identification.
Step 2, Test Strategy configuration module is executed, positioning epicycle needs to be implemented the interface of test, generates interfaces column to be measured Table;
Before each round test execution, exact p-value range is required, that is, identifies which interface receives the shadow of code revision It rings.Tester only needs to test affected interface.
This step is completed by the Test Strategy configuration module inside test macro is arranged in.In internal system, test plan is set Slightly configuration module, the workflow of Test Strategy configuration module are as follows: the first step traverses code engineering All Files;Second step, The newest hash value of All Files is calculated, is compared with the old hash value of file stored in incidence relation list obtained in step 1 Right, the inconsistent i.e. file of hash value produces change, records all filenames changed, generates change file list; Third step inquires in interface and code file incidence relation table to the file of change, show which these files affect and connect Mouthful;4th step, impacted interface list are the test scope of epicycle test, generate interface list to be measured, list is transmitted to Testing execution module carries out test execution.
Step 3, each of loop test interface list to be measured interface;
This part is related to the generation of interface parameters, completes in internal system setting parameter generation module.The module is for every A interface configures a kind of parameter generation method, the parameter of corresponding 4 seed types of each generation method: any random parameter, illegal ginseng The parameter of the parameter of several, legal exception handling logic, legal normal processing logic.Each type of parameter, it is corresponding a kind of The method generated at random, including SQL is random, character string is random, numerical value is random etc., specific random rule is depending on business demand. Any random parameter chooses dirty data for probabilistic herein, and illegal parameter is used to cover the abnormality processing outside code logic, close The parameter of the exception handling logic of method is used to cover the exception handling logic in code logic, the ginseng of legal normal processing logic Number is for covering the regular traffic logic in code logic.
Specific testing process is as follows:
The first step, the interface list to be measured that obtaining step 2 is transmitted;
Second step takes out an interface as test object in order from interface list to be measured;
Third step calls the corresponding parameter generation method of the interface, generates 4 kinds of random parameters, specifically include: any random Parameter, illegal parameter, the parameter of legal exception handling logic, the parameter of legal normal processing logic;
4th step uses 4 kinds of parameter calling interfaces respectively, obtains the practical return value of interface, while this 4 kinds of parameters being passed To method for testing and analyzing, the expected results of interface are obtained;
5th step compares the practical return value of interface and expected results, and unanimously then test passes through, inconsistent, tests obstructed It crosses.
The test of cure parameter is to select a data from testing data set in sometime point and tested, with User's prolonged use system, choose before for test data may be deleted from testing data set, parameter It will fail.And ginseng data method is randomly choosed, and it is to be randomly selected immediately from testing data set, it is used as needed, to solve The certainly vulnerable problem of cure parameter.
During the test, to promote testing efficiency, multi-thread concurrent mechanism can be used, covered more with reaching in the short time The purpose of more test datas, the more logic branches of covering.Due to the uncertainty that dirty data generates, need to change through entire project For process, therefore dirty data test is executed using single process.Usually whole interfaces participate in test, and by any random Ginseng mode is selected, by the execution of long-time high frequency time, the probability for choosing dirty data at random is improved, reaches the mesh of fault-tolerance test 's.
Step 4, test result is obtained.
The beneficial effects of the present invention are:
Pass through tactful configuration module, the interface of automatic identification code change influence.Automatically identify which interface receives Iteration change influences, and is to have determined test scope automatically, completes cognizance code change coverage, specified epicycle test needs The function for the test script to be executed.The tendentiousness that Test coverage can accurately be adjusted makes test emphasis be partial to engineering code The change generated when iteration.In agile development system, Test Strategy configuration module adapts to agile development high-frequency iteration Feature is configured by adjust automatically, and test execution has more targeting.Reach test target automatically analyze, test scope it is automatic The effect of judgement.
Call parameters generation module in measuring executing process achievees the effect that test parameter mobilism and automatically generates.With Conventional method is compared, the mode that this method is joined using random choosing of having ready conditions, and realizes test case choosing ginseng automation, test case is certainly Dynamic generation and mobilism, to effectively improve the degree of automation and the Test coverage face of test.Secondly, using any random choosing ginseng Mode increase random covering surface by high frequency time, prolonged test execution, can achieve and dirty data is chosen to be tested Purpose.
Detailed description of the invention
Fig. 1 is group method flow chart of the invention.
Fig. 2 is Test Strategy configuration module work flow diagram of the present invention.
Fig. 3 is single face test method flow chart of the present invention.
Specific embodiment
The principle and features of the present invention will be described below with reference to the accompanying drawings, and the given examples are served only to explain the present invention, and It is non-to be used to limit the scope of the invention.
The present embodiment provides a kind of HTTP interface mobilism parameter test methods of Test Strategy automatic configuration, solve ginseng Number solidify that the Test coverages generated are insufficient, parameters are vulnerable, when dirty data is difficult to carry out Test coverage and code change due to Test caused by coverage assessment inaccuracy omits or the problems such as deviation, realizes and improves test coverage, testing efficiency with And the purpose of accuracy, comprising the following steps:
Step 1: building interface and code file incidence relation table.
The change of one file may influence multiple interfaces, so file and interface are many-one relationship.Structure is simple Engineering can establish incidence relation table by hand;Complicated engineering can establish association by parsing the adduction relationship of code file Relation table.
Finally formed sheet format is as follows:
Step 2: positioning epicycle needs to be implemented the interface of test.
Before each round test execution, exact p-value range is required, that is, identifies which interface receives the shadow of code revision It rings.Tester only needs to test affected interface.
This step is completed by the Test Strategy configuration module inside test macro is arranged in.In internal system, test plan is set Slightly configuration module, the workflow of Test Strategy configuration module are as follows: the first step traverses code engineering All Files;Second step, The newest hash value of All Files is calculated, is compared with the old hash value of file stored in incidence relation list obtained in step 1 Right, the inconsistent i.e. file of hash value produces change, records all filenames changed, generates change file list; Third step inquires in interface and code file incidence relation table to the file of change, show which these files affect and connect Mouthful;4th step, impacted interface list are the test scope of epicycle test, and list is transmitted to testing execution module, are carried out Test execution.
This step can achieve test target automatically analyze, test parameter mobilism and test dynamic parameter automatically generate, The effect that test scope determines automatically.It automatically identifies which interface receives iteration change influence, is to determine automatically Test scope completes the function of cognizance code change coverage, the test script that specified epicycle test needs to be implemented.
Step 3: each of loop test interface list to be measured interface.
This part is related to the generation of interface parameters, completes in internal system setting parameter generation module.The module is for every A interface configures a kind of generation method, the parameter of corresponding 4 seed types of each generation method: any random parameter, illegal parameter, conjunction The parameter of the parameter of the exception handling logic of method, legal normal processing logic.Each type of parameter, a kind of corresponding random life At method, including SQL is random, character string is random, numerical value is random etc., and specific random rule is depending on business demand.Appoint herein Meaning random parameter chooses dirty data for probabilistic, and illegal parameter is used to cover the abnormality processing outside code logic, and legal is different Often the parameter of processing logic is used to cover the exception handling logic in code logic, and the parameter of legal normal processing logic is used for Cover the regular traffic logic in code logic.
Specific testing process is as follows:
The first step, the interface list to be measured that obtaining step 2 is transmitted;
Second step takes out an interface as test object in order from interface list to be measured;
Third step calls the corresponding parameter generation method of the interface, and it is (any random parameter, illegal to generate 4 kinds of random parameters Parameter, the parameter of legal exception handling logic, the parameter of legal normal processing logic);
4th step uses 4 kinds of parameter calling interfaces respectively, obtains the practical return value of interface, while using test analysis Method analyzes this 4 kinds of parameters, obtains the expected results of interface;
5th step compares the practical return value of interface and expected results, and unanimously then test passes through, inconsistent, tests obstructed It crosses.
During the test, to promote testing efficiency, multi-thread concurrent mechanism can be used, covered more with reaching in the short time The purpose of more test datas, the more logic branches of covering.Due to the uncertainty that dirty data generates, need to change through entire project For process, therefore dirty data test is executed using single process.Usually whole interfaces participate in test, and by any random Ginseng mode is selected, by the execution of long-time high frequency time, the probability for choosing dirty data at random is improved, reaches the mesh of fault-tolerance test 's.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (4)

1. a kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration characterized by comprising step 1, the incidence relation table of interface and code file is constructed, filename, file hash value, affected interface three parts content are included Corresponding relationship;Step 2, Test Strategy configuration module is run, positioning epicycle needs to be implemented the interface of test, generates interfaces column to be measured Table;Step 3, each of loop test interface list to be measured interface;Step 4, test result is obtained.
2. the HTTP interface mobilism parameter test method of a kind of Test Strategy automatic configuration according to claim 1, Be characterized in that, the step 1 specifically includes: the adduction relationship by parsing code file establishes being associated with for interface and code file Relation table.
3. the HTTP interface mobilism parameter test method of a kind of Test Strategy automatic configuration according to claim 1, Be characterized in that, the step 2 specifically includes: the first step traverses code engineering All Files;Second step calculates All Files most New hash value is compared with the old hash value of file stored in incidence relation table obtained in step 1, and hash value is inconsistent i.e. File produces change, records all filenames changed, generates change file list;Third step, to the text of change Part is inquired in interface and code file incidence relation table, show which interface these files affect, form impacted connect Mouth list;4th step, impacted interface list are the test scope of epicycle test, and list is transmitted to testing execution module, Carry out test execution.
4. the HTTP interface mobilism parameter test method of a kind of Test Strategy automatic configuration according to claim 1, It is characterized in that, the step 3 specifically includes: the first step, the interface list to be measured that obtaining step 2 is transmitted;Second step connects to be measured An interface is taken out in order as test object in mouth list;Third step calls the corresponding parameter generation method of the interface, raw At 4 kinds of random parameters;4th step uses 4 kinds of parameter calling interfaces respectively, obtains the practical return value of interface, while using survey Examination analysis method analyzes this 4 kinds of parameters, obtains the expected results of interface;5th step, by the practical return value of interface and in advance Phase Comparative result, unanimously then test passes through, inconsistent, tests and does not pass through.
CN201811393594.1A 2018-11-21 2018-11-21 A kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration Pending CN109558316A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811393594.1A CN109558316A (en) 2018-11-21 2018-11-21 A kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811393594.1A CN109558316A (en) 2018-11-21 2018-11-21 A kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration

Publications (1)

Publication Number Publication Date
CN109558316A true CN109558316A (en) 2019-04-02

Family

ID=65866847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811393594.1A Pending CN109558316A (en) 2018-11-21 2018-11-21 A kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration

Country Status (1)

Country Link
CN (1) CN109558316A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110806979A (en) * 2019-10-31 2020-02-18 北京东软望海科技有限公司 Interface return value checking method, device, equipment and storage medium
CN110908920A (en) * 2019-12-03 2020-03-24 浪潮商用机器有限公司 An interface function testing method, device and related components
CN112068875A (en) * 2020-08-04 2020-12-11 广州太平洋电脑信息咨询有限公司 System and method for realizing thread filtering strategy based on java dynamic loading
CN112328486A (en) * 2020-11-06 2021-02-05 深圳壹账通智能科技有限公司 Interface automation test method and device, computer equipment and storage medium
CN112699023A (en) * 2020-12-25 2021-04-23 深圳市彬讯科技有限公司 Project interface testing method and device, computer equipment and storage medium
CN115426266A (en) * 2022-10-09 2022-12-02 中国工商银行股份有限公司 Configuration issuing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164330A (en) * 2011-12-14 2013-06-19 航天信息股份有限公司 Automatic generation method for software test case
CN106484624A (en) * 2016-10-21 2017-03-08 天津海量信息技术股份有限公司 The method of testing of interface automatic test
AU2017203608A1 (en) * 2012-02-07 2017-06-15 Visa International Service Association Mobile human challenge-response test
CN107908540A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Test case creation method, apparatus, computer equipment and medium
CN108509337A (en) * 2018-03-15 2018-09-07 链家网(北京)科技有限公司 The dynamic testing method and device called based on interface

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164330A (en) * 2011-12-14 2013-06-19 航天信息股份有限公司 Automatic generation method for software test case
AU2017203608A1 (en) * 2012-02-07 2017-06-15 Visa International Service Association Mobile human challenge-response test
CN106484624A (en) * 2016-10-21 2017-03-08 天津海量信息技术股份有限公司 The method of testing of interface automatic test
CN107908540A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Test case creation method, apparatus, computer equipment and medium
CN108509337A (en) * 2018-03-15 2018-09-07 链家网(北京)科技有限公司 The dynamic testing method and device called based on interface

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110806979A (en) * 2019-10-31 2020-02-18 北京东软望海科技有限公司 Interface return value checking method, device, equipment and storage medium
CN110806979B (en) * 2019-10-31 2023-04-07 望海康信(北京)科技股份公司 Interface return value checking method, device, equipment and storage medium
CN110908920A (en) * 2019-12-03 2020-03-24 浪潮商用机器有限公司 An interface function testing method, device and related components
CN112068875A (en) * 2020-08-04 2020-12-11 广州太平洋电脑信息咨询有限公司 System and method for realizing thread filtering strategy based on java dynamic loading
CN112068875B (en) * 2020-08-04 2024-05-17 广州太平洋电脑信息咨询有限公司 System and method for realizing thread filtering strategy based on java dynamic loading
CN112328486A (en) * 2020-11-06 2021-02-05 深圳壹账通智能科技有限公司 Interface automation test method and device, computer equipment and storage medium
CN112699023A (en) * 2020-12-25 2021-04-23 深圳市彬讯科技有限公司 Project interface testing method and device, computer equipment and storage medium
CN112699023B (en) * 2020-12-25 2024-05-03 深圳市彬讯科技有限公司 Project interface testing method and device, computer equipment and storage medium
CN115426266A (en) * 2022-10-09 2022-12-02 中国工商银行股份有限公司 Configuration issuing method and device
CN115426266B (en) * 2022-10-09 2024-04-30 中国工商银行股份有限公司 Configuration issuing method and device

Similar Documents

Publication Publication Date Title
CN109558316A (en) A kind of HTTP interface mobilism parameter test method of Test Strategy automatic configuration
US10318412B1 (en) Systems, methods, and apparatus for dynamic software generation and testing
US8341178B2 (en) SQL performance analyzer
US12141144B2 (en) Column lineage and metadata propagation
US10162612B2 (en) Method and apparatus for inventory analysis
US8621417B2 (en) Rule merging in system for monitoring adherence by developers to a software code development process
US8150674B2 (en) Automated testing platform for event driven systems
CN111832236A (en) A chip regression test method, system, electronic device and storage medium
DE102021133809A1 (en) METHOD AND DEVICE FOR AUTOMATIC DETECTION OF SOFTWARE ERRORS
US8930918B2 (en) System and method for SQL performance assurance services
US10013336B2 (en) Information technology testing and testing data management
US8311794B2 (en) Testing executable logic
KR20170052668A (en) Data-driven testing framework
CN110134582A (en) The processing of test case and data processing method and device
US7203671B1 (en) System and method for validating the technical correctness of an OLAP reporting project
CN114185791B (en) A data mapping file testing method, device, equipment and storage medium
CN112559525A (en) Data checking system, method, device and server
WO2022012327A1 (en) Code analysis method and system, and computing device
CN110134583A (en) Software test and data processing method and device
Wen et al. LLM-Based Misconfiguration Detection for AWS Serverless Computing
CA2739762C (en) Rule merging in system for monitoring adherence by developers to a software code development process
CN107341110A (en) A tool and implementation method for software testing and locating patch modification and scope of influence
CN114911773A (en) Universal meta-model design method
Omori et al. Comparing concept drift detection with process mining tools
CN114238053A (en) Pressure measurement script generation method, device, equipment and medium based on automatic packet grabbing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190402

RJ01 Rejection of invention patent application after publication