CN109739760A - A kind of code commissioning test method and device, storage medium - Google Patents
A kind of code commissioning test method and device, storage medium Download PDFInfo
- Publication number
- CN109739760A CN109739760A CN201811623936.4A CN201811623936A CN109739760A CN 109739760 A CN109739760 A CN 109739760A CN 201811623936 A CN201811623936 A CN 201811623936A CN 109739760 A CN109739760 A CN 109739760A
- Authority
- CN
- China
- Prior art keywords
- test
- code
- function
- interface
- interface module
- 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.)
- Granted
Links
Abstract
The present invention relates to software testing technology field, a kind of code commissioning test method and device, storage medium are disclosed.The code commissioning test method includes: that the functional interface module that coupling meets preset condition is packaged into test interface;For different test interfaces, a general driving layer is designed;Construct test case and at least one function usage scenario;By the test case, the test interface is called by the general driving layer, is tested under each function usage scenario.The embodiment of the present invention constructs the technical method of the various usage scenarios of product using simulation building test application, packet, data, realizes functional interface moduleization test, reaching ensures the correct purpose of functions of modules;Function code can be carried out during module testing to distribute rationally, sufficiently promote code architecture stereovision, it is ensured that the correctness of functional interface module, transplantability improve efficiency to reduce the project development time.
Description
Technical field
The present invention relates to software testing technology field more particularly to a kind of code commissioning test methods and device, storage to be situated between
Matter.
Background technique
Existing function code module test method is primarily directed to different development languages, by downloading third-party testing
External member, construction or setting test data, carry out certain function code test, to achieve the effect that check code function.
This test method has the following deficiencies:
1: test scope has blind area: the functional module for carrying out joint debugging is excessive, can not cover to certain functions of modules test point entirely,
It would be possible that key code position is not tested, crucial bug can not find;
2: test position inaccuracy: being integrated by multimode influences, and can not determine mould for testing the mistake all occurred every time
Block position, it may be necessary to debug each functions of modules code and just find out erroneous point, influence the project development period;
3: this test method functional module is wider, and it is strong to simple function module progress function to can not achieve more usage scenarios
Strong property test;
4: third-party testing tool is used, to the maintenance of testing tool, management and again to testing tool upgrading exploitation
Certain limitation is deposited, project management is unfavorable for.
In addition, in item-function development process, if encountering the fortuitous event in exploitation, need to be exposed as early as possible and and
When solve, can ensure project quality.But during actual development, tested for code function, often in development late stage collection
It is carried out at test phase, it is difficult to accomplish to test in exploitation, and in later period integration testing, some logical codes are also difficult to
It is tested in integration testing.
Summary of the invention
The purpose of the present invention is to provide a kind of code commissioning test method and devices, storage medium, overcome the prior art
Model is tested and tested to middle be difficult to present in the development late stage integration testing using third-party testing external member in exploitation
The defects of being with blind area.
To achieve this purpose, the present invention adopts the following technical scheme:
A kind of code commissioning test method, comprising:
The functional interface module that coupling meets preset condition is packaged into test interface;
For different test interfaces, a general driving layer is designed;
Construct test case and at least one function usage scenario;
By the test case, the test interface is called by the general driving layer, uses field in each function
It is tested under scape.
Optionally, the functional interface module that coupling is met preset condition is packaged into test interface, comprising: to institute
The parameters for stating functional interface module carry out Testing factors analysis respectively, obtain analysis result;Check the functional interface mould
The code coverage degree of block;According to the analysis result and the code coverage degree, test interface encapsulation is carried out;Judge the function
Whether the code of interface module has change, if there is change, re-starts test interface encapsulation.
Optionally, described to be directed to different test interfaces, design a general driving layer, comprising: to each test interface
Function modoularization is carried out, each test interface function is parsed and realizes to construct the general driving layer.
Optionally, the building test case, comprising: carry out test function modularization, surveyed after calling test data
Data parsing is tried, test case is constructed according to parsing result.
Optionally, the constructing function usage scenario, comprising: all parameters and code of the functional interface module are covered
Cover degree is analyzed, and all customer service scenes are detected after analysis and carry out permutation and combination, construct the function usage scenario
And carry out data filling.
A kind of code commissioning test device, comprising:
Test interface encapsulation unit, the functional interface module for coupling to be met preset condition are packaged into test and connect
Mouthful;
Design cell is driven, for being directed to different test interfaces, designs a general driving layer;
Test case and usage scenario construction unit, for constructing test case and at least one function usage scenario;
Test cell, for calling the test interface each by the general driving layer for the test case
It is tested under the function usage scenario.
Optionally, the test interface encapsulation unit, is specifically used for: distinguishing the parameters of the functional interface module
Testing factors analysis is carried out, analysis result is obtained;Check the code coverage degree of the functional interface module;It is tied according to the analysis
Fruit and the code coverage degree carry out test interface encapsulation.
Optionally, the driving design cell, is specifically used for: carrying out function modoularization, solution to each test interface
Each test interface function is analysed to realize to construct the general driving layer.
Optionally, the test case and usage scenario construction unit, are specifically used for: carrying out test function modularization, adjust
With test data parsing is carried out after test data, test case is constructed according to parsing result;To the institute of the functional interface module
There are parameter and code coverage degree to be analyzed, all customer service scenes are detected after analysis and carry out permutation and combination, constructs institute
It states function usage scenario and carries out data filling.
A kind of storage medium, the storage medium are stored with a plurality of instruction, and described instruction is suitable for processor and is loaded, with
Execute the step in as above described in any item code commissioning test methods.
Compared with prior art, the embodiment of the present invention has the advantages that
The embodiment of the present invention constructs the technical side of the various usage scenarios of product using simulation building test application, packet, data
Method realizes functional interface moduleization test, and reaching ensures the correct purpose of functions of modules;Function can be carried out during module testing
Code optimization configuration, sufficiently promotes code architecture stereovision, it is ensured that the correctness of functional interface module, transplantability, to reduce
It project development time, improves efficiency.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention without any creative labor, may be used also for those of ordinary skill in the art
To obtain other attached drawings according to these attached drawings.
Fig. 1 is code commissioning test method flow chart provided in an embodiment of the present invention;
Fig. 2 is the packaging method flow chart of test interface provided in an embodiment of the present invention;
Fig. 3 is the design method flow chart of general driving layer provided in an embodiment of the present invention;
Fig. 4 is the construction method flow chart of test case provided in an embodiment of the present invention;
Fig. 5 is the construction method flow chart of function usage scenario provided in an embodiment of the present invention.
Specific embodiment
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention
Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that disclosed below
Embodiment be only a part of the embodiment of the present invention, and not all embodiment.Based on the embodiments of the present invention, this field
Those of ordinary skill's all other embodiment obtained without making creative work, belongs to protection of the present invention
Range.
To further illustrate the technical scheme of the present invention below with reference to the accompanying drawings and specific embodiments.
Embodiment one
Referring to Fig. 1, Fig. 1 is that code commissioning test method provided in this embodiment includes:
Step 101, the functional interface module that coupling is met to preset condition are packaged into test interface.
It is higher for certain function code couplings in this step, it needs to some code function interface module, with function
Test is provided and is used into test interface, module, convenient purification is packaged into for unit, test function code is without change to ensure.
Step 102 is directed to different test interfaces, designs a general driving layer.
For different signal interfaces, a general driving layer is designed, reaches each function, interface module test interface spirit
The purpose living dispatched, used.
Step 103, building test case and at least one function usage scenario.
By constructing various function usage scenarios, it is suitable for various test execution environments.
Step 104, by test case, test interface is called by general driving layer, under each function usage scenario into
Row test.
Each step will be described in detail respectively below.
Referring to Fig. 2, Fig. 2 is the packaging method of test interface provided in this embodiment, comprising:
Step 201 carries out Testing factors analysis to the parameters of functional interface module respectively, obtains analysis result.
The code coverage degree of step 202, audit function interface module.
Step 203, based on the analysis results with code coverage degree, carry out test interface encapsulation.
Step 204 judges whether the code of the functional interface module has change, if there is change, is back to step
203;If terminating this process without change.
In the process, need respectively to analyze all parameters of functional interface module and code coverage degree, with
Test interface encapsulation is carried out, and recurrence detection can be carried out to function code.
Referring to Fig. 3, Fig. 3 is the design method of general driving layer provided in this embodiment, comprising:
Step 301 carries out function modoularization to test interface.
Step 302, the function of parsing test interface are realized.
Step 303 constructs general driving layer according to parsing result.
Step 304 provides calling interface for test case, so that test case can correctly call test interface.
In this process, general driving layer primarily serves the effect of forming a connecting link.The calling function interface module institute of energy versatility
The test interface encapsulated, functional interface needed for upper layer test case can also be provided.This general driving layer is as test
The middle layer of use-case and test interface reaches test interface module, greatly facilitates the different test interface of different platform and surveys
Examination.
Referring to Fig. 4, Fig. 4 is test case construction method provided in this embodiment, comprising:
Step 401 carries out test function modularization.
Step 402, test data are called.
Step 403, test data parsing.
Step 404, test scene parsing.
Step 405 constructs test case according to parsing result.
Referring to Fig. 5, Fig. 5 is function usage scenario construction method provided in this embodiment, comprising:
Step 501, all parameters for checking functional interface module.
The code coverage degree of step 502, audit function interface module.
Step 503 checks user's applied business scene, and beats TAG.
Step 504, by all scene TAG permutation and combination, construct function usage scenario, and carry out data filling.
During constructing function usage scenario, all to functional interface module respectively parameter and code coverage degree are needed
It is checked, permutation and combination is carried out to customer service scene, constructs the true usage scenario of functional interface module, and to using
Scene carries out data filling, completes usage scenario building.
To sum up, it using testing scheme provided by the invention, has the advantages that
1) reducing the project later period there is bug problem, improves projects quality: original code function test one
As concentrate in integration testing, found the problem in time by early period, reduce bring risk to project because of bug in time, improve project
Quality.
2) removing function module testing blind area: it is exactly to carry out test to function point, code to arrive that item-function test is most ideal
Position by reduction, or even rejects blind area, reaches test most desired effect.
3) it functional module differentiation management: allows Implement of Function Module to break up, and then functional development, test, evades in time, solves
Functional module problem reduces functions of modules error property.
4) test function transplantability is high, adapts to different platform, different test code function interfaces, meets needed for project development
Flexibility and convenience.
Embodiment two
It will appreciated by the skilled person that all or part of the steps in the various methods of above-described embodiment can be with
It is completed by instructing, or relevant hardware is controlled by instruction to complete, which can store computer-readable deposits in one
In storage media, and is loaded and executed by processor.
For this purpose, the embodiment of the present invention provides a kind of storage medium, wherein being stored with a plurality of instruction, which can be processed
Device is loaded, to execute the step in code commissioning test method provided by the embodiment of the present invention.For example, the instruction can be with
Execute following steps:
The functional interface module that coupling meets preset condition is packaged into test interface;
For different test interfaces, a general driving layer is designed;
Construct test case and at least one function usage scenario;
By the test case, the test interface is called by general driving layer, is carried out under each function usage scenario
Test.
The specific implementation of above each operation can be found in the embodiment of front, and details are not described herein.
Wherein, which may include: read-only memory (ROM, Read Only Memory), random access memory
Body (RAM, Random Access Memory), disk or CD etc..
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although referring to before
Stating embodiment, invention is explained in detail, those skilled in the art should understand that: it still can be to preceding
Technical solution documented by each embodiment is stated to modify or equivalent replacement of some of the technical features;And these
It modifies or replaces, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution.
Claims (10)
1. a kind of code commissioning test method, which is characterized in that the code commissioning test method includes:
The functional interface module that coupling meets preset condition is packaged into test interface;
For different test interfaces, a general driving layer is designed;
Construct test case and at least one function usage scenario;
By the test case, the test interface is called by the general driving layer, under each function usage scenario
It is tested.
2. code commissioning test method according to claim 1, which is characterized in that described that coupling is met preset condition
Functional interface module be packaged into test interface, comprising: to the parameters of the functional interface module carry out respectively test because
Element analysis obtains analysis result;Check the code coverage degree of the functional interface module;According to the analysis result and the generation
Code coverage, carries out test interface encapsulation;Judge whether the code of the functional interface module has change, if there is change, weighs
It is new to carry out test interface encapsulation.
3. code commissioning test method according to claim 1, which is characterized in that it is described to be directed to different test interfaces, if
Count a general driving layer, comprising: function modoularization is carried out to each test interface, parses each test interface function
It realizes to construct the general driving layer.
4. code commissioning test method according to claim 1, which is characterized in that the building test case, comprising: into
Row test function modularization, carries out test data parsing after calling test data, constructs test case according to parsing result.
5. code commissioning test method according to claim 1, which is characterized in that the constructing function usage scenario, packet
It includes: all parameters and code coverage degree of the functional interface module being analyzed, all customer service fields are detected after analysis
Scape simultaneously carries out permutation and combination, constructs the function usage scenario and carries out data filling.
6. a kind of code commissioning test device, which is characterized in that the code commissioning test device includes:
Test interface encapsulation unit, the functional interface module for coupling to be met preset condition are packaged into test interface;
Design cell is driven, for being directed to different test interfaces, designs a general driving layer;
Test case and usage scenario construction unit, for constructing test case and at least one function usage scenario;
Test cell, for calling the test interface each described by the general driving layer for the test case
It is tested under function usage scenario.
7. code commissioning test device according to claim 6, which is characterized in that the test interface encapsulation unit, tool
Body is used for: being carried out Testing factors analysis respectively to the parameters of the functional interface module, is obtained analysis result;Described in inspection
The code coverage degree of functional interface module;According to the analysis result and the code coverage degree, test interface encapsulation is carried out.
8. code commissioning test device according to claim 6, which is characterized in that the driving design cell, it is specific to use
In: function modoularization is carried out to each test interface, each test interface function is parsed and realizes to construct described lead to
With driving layer.
9. code commissioning test device according to claim 6, which is characterized in that the test case and usage scenario structure
Unit is built, is specifically used for: carrying out test function modularization, test data parsing is carried out after calling test data, is tied according to parsing
Fruit constructs test case;All parameters and code coverage degree of the functional interface module are analyzed, institute is detected after analysis
There is user's business scenario and carry out permutation and combination, construct the function usage scenario and carries out data filling.
10. a kind of storage medium, which is characterized in that the storage medium is stored with a plurality of instruction, and described instruction is suitable for processor
It is loaded, the step in 1 to 5 described in any item code commissioning test methods is required with perform claim.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811623936.4A CN109739760B (en) | 2018-12-28 | 2018-12-28 | Code debugging test method and device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811623936.4A CN109739760B (en) | 2018-12-28 | 2018-12-28 | Code debugging test method and device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109739760A true CN109739760A (en) | 2019-05-10 |
CN109739760B CN109739760B (en) | 2022-07-08 |
Family
ID=66361859
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811623936.4A Active CN109739760B (en) | 2018-12-28 | 2018-12-28 | Code debugging test method and device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109739760B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111488285A (en) * | 2020-04-15 | 2020-08-04 | 北京字节跳动网络技术有限公司 | Interface testing method and device, electronic equipment and computer readable storage medium |
CN115509518A (en) * | 2022-09-20 | 2022-12-23 | 国科础石(重庆)软件有限公司 | Automatic driving function software system, construction method, electronic device and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110214107A1 (en) * | 2010-03-01 | 2011-09-01 | Experitest, Ltd. | Method and system for testing graphical user interfaces |
CN105679375A (en) * | 2015-12-31 | 2016-06-15 | 浪潮(北京)电子信息产业有限公司 | Automatic test system of storage equipment, and method thereof |
CN106021111A (en) * | 2016-05-30 | 2016-10-12 | 上海携程商务有限公司 | Interface testing method and system |
CN106339318A (en) * | 2016-08-29 | 2017-01-18 | 上海斐讯数据通信技术有限公司 | Automatic testing device and establishment method thereof |
CN107797930A (en) * | 2017-10-27 | 2018-03-13 | 东信和平科技股份有限公司 | Method, system, device and the readable storage medium storing program for executing of testing smart card function |
-
2018
- 2018-12-28 CN CN201811623936.4A patent/CN109739760B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110214107A1 (en) * | 2010-03-01 | 2011-09-01 | Experitest, Ltd. | Method and system for testing graphical user interfaces |
CN105679375A (en) * | 2015-12-31 | 2016-06-15 | 浪潮(北京)电子信息产业有限公司 | Automatic test system of storage equipment, and method thereof |
CN106021111A (en) * | 2016-05-30 | 2016-10-12 | 上海携程商务有限公司 | Interface testing method and system |
CN106339318A (en) * | 2016-08-29 | 2017-01-18 | 上海斐讯数据通信技术有限公司 | Automatic testing device and establishment method thereof |
CN107797930A (en) * | 2017-10-27 | 2018-03-13 | 东信和平科技股份有限公司 | Method, system, device and the readable storage medium storing program for executing of testing smart card function |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111488285A (en) * | 2020-04-15 | 2020-08-04 | 北京字节跳动网络技术有限公司 | Interface testing method and device, electronic equipment and computer readable storage medium |
CN111488285B (en) * | 2020-04-15 | 2023-05-12 | 抖音视界有限公司 | Interface testing method, device, electronic equipment and computer readable storage medium |
CN115509518A (en) * | 2022-09-20 | 2022-12-23 | 国科础石(重庆)软件有限公司 | Automatic driving function software system, construction method, electronic device and storage medium |
CN115509518B (en) * | 2022-09-20 | 2024-02-27 | 国科础石(重庆)软件有限公司 | Autopilot function software system, construction method, electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109739760B (en) | 2022-07-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102141962B (en) | Safety distributed test framework system and test method thereof | |
CN103812726B (en) | Automated testing method and device for data communication equipment | |
CN104268079B (en) | A kind of method and system of POS Application testings | |
CN104077140B (en) | Automation Compilation Method and compilation device for continuous integrating | |
CN104516818B (en) | The automatization test system and its method of compiler a kind of software suitable for Logical Configuration | |
CN103365770B (en) | Mobile terminal software test macro and method for testing software | |
CN104407977B (en) | Based on the automatization uniting and adjustment testing method of the task system stage by stage of model inspection | |
CN107368408A (en) | A kind of software fault towards interface injects automated testing method | |
CN102946616B (en) | Internet of things middleware performance testing system and testing method | |
CN104731566B (en) | Integrated Development Environment test device, method and system | |
CN107315679A (en) | A kind of embedded software automation exact p-value method and test system | |
CN105786695B (en) | Data test method and system | |
CN108460199B (en) | CNI modeling system | |
CN106330593A (en) | Protocol detection method and device | |
CN104484267B (en) | One kind test system and method | |
CN106708718A (en) | Service framework interface testing method and device | |
CN106502904A (en) | A kind of UI automated testing methods of intelligent appliance equipment application | |
CN109218139A (en) | Gateway test macro | |
CN109739760A (en) | A kind of code commissioning test method and device, storage medium | |
CN106055351A (en) | Development method and apparatus of control system | |
CN108984403A (en) | The verification method and device of FPGA logical code | |
CN108874470A (en) | A kind of information processing method and server, computer storage medium | |
CN106649073A (en) | Test method and device based on dynamic script template | |
CN114757135B (en) | Programmable logic device verification method and system based on demand drive verification | |
CN110287092A (en) | A kind of electricity transaction system and its automatic test approach based on graphical interfaces |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |