CN109739760B - Code debugging test method and device and storage medium - Google Patents
Code debugging test method and device and storage medium Download PDFInfo
- Publication number
- CN109739760B CN109739760B CN201811623936.4A CN201811623936A CN109739760B CN 109739760 B CN109739760 B CN 109739760B CN 201811623936 A CN201811623936 A CN 201811623936A CN 109739760 B CN109739760 B CN 109739760B
- Authority
- CN
- China
- Prior art keywords
- test
- interface
- functional
- function
- code
- 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.)
- Active
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention relates to the technical field of software testing, and discloses a code debugging testing method and device and a storage medium. The code debugging test method comprises the following steps: packaging the functional interface module with the coupling meeting the preset condition into a test interface; designing a universal driving layer aiming at different test interfaces; constructing a test case and at least one functional use scene; and calling the test case through the universal driving layer to test under each function use scene. The embodiment of the invention uses a technical method for simulating and constructing test application, package and data and constructing various use scenes of a product, realizes the modularized test of a functional interface and achieves the aim of ensuring the correct function of a module; the function code can be optimally configured in the module testing process, the hierarchy of the code architecture is fully improved, and the correctness and the portability of the function interface module are ensured, so that the project development time is reduced, and the efficiency is improved.
Description
Technical Field
The invention relates to the technical field of software testing, in particular to a code debugging testing method and device and a storage medium.
Background
The existing functional code module testing method mainly aims at different development languages, and carries out certain functional code testing by downloading a third-party testing suite and building or setting testing data so as to achieve the effect of checking the code function.
This test method has the following drawbacks:
1: the test range has a blind area: if too many function modules are subjected to joint debugging, the function test points of a certain module cannot be completely covered, and then the key code part is possibly not tested, and the key bug cannot be found;
2: inaccurate test position: under the influence of multi-module integration, the position of a module cannot be determined for errors occurring in each test, and error points can be found only by debugging functional codes of each module to influence the development cycle of a project;
3: the test method has wider functional modules and can not realize the function robustness test of a single functional module in multiple use scenes;
4: the use of a third-party testing tool has certain limitations on the maintenance and management of the testing tool and the upgrading and development of the testing tool again, which is not beneficial to project management.
In addition, in the process of project function development, if an unexpected situation in the development is met, the situation needs to be exposed as early as possible and solved in time, so that the project quality can be ensured. However, in the actual development process, the code function test is often performed in the later stage of development, which makes it difficult to perform development and test simultaneously, and some logic codes are also difficult to be tested in the later stage of integration test.
Disclosure of Invention
The invention aims to provide a code debugging test method, a code debugging test device and a storage medium, and overcomes the defects that the development and the test are difficult to be carried out at the same time, a test range has blind areas and the like in the integration test of a third-party test suite in the later development period in the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
a code commissioning test method comprising:
packaging the functional interface module with the coupling meeting the preset condition into a test interface;
designing a universal driving layer aiming at different test interfaces;
constructing a test case and at least one functional use scene;
and calling the test case through the universal driving layer to test under each function use scene.
Optionally, the encapsulating the functional interface module with the coupling meeting the preset condition into a test interface includes: respectively analyzing the test factors of each parameter of the functional interface module to obtain an analysis result; checking code coverage of the functional interface module; packaging a test interface according to the analysis result and the code coverage; and judging whether the codes of the functional interface modules are changed or not, and if so, re-packaging the test interface.
Optionally, the designing a common driver layer for different test interfaces includes: and performing function modularization on each test interface, and analyzing the function realization of each test interface to construct the universal driving layer.
Optionally, the constructing a test case includes: and (5) modularizing the test function, analyzing the test data after calling the test data, and constructing a test case according to an analysis result.
Optionally, the building function usage scenario includes: analyzing all parameters and code coverage of the functional interface module, detecting all user service scenes after analysis, arranging and combining, constructing the functional service scene and filling data.
A code commissioning test apparatus comprising:
the test interface packaging unit is used for packaging the functional interface module with the coupling meeting the preset condition into a test interface;
the drive design unit is used for designing a universal drive layer aiming at different test interfaces;
the test case and use scene construction unit is used for constructing a test case and at least one function use scene;
and the test unit is used for calling the test interface through the universal driving layer to test the test case under each function use scene.
Optionally, the test interface packaging unit is specifically configured to: respectively analyzing the test factors of each parameter of the functional interface module to obtain an analysis result; checking code coverage of the functional interface module; and packaging a test interface according to the analysis result and the code coverage.
Optionally, the drive design unit is specifically configured to: and performing function modularization on each test interface, and analyzing the function realization of each test interface to construct the universal driving layer.
Optionally, the test case and use scenario constructing unit is specifically configured to: performing test function modularization, calling test data, analyzing the test data, and constructing a test case according to an analysis result; analyzing all parameters and code coverage of the functional interface module, detecting all user service scenes after analysis, arranging and combining, constructing the functional service scene and filling data.
A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the code commissioning test method as recited in any one of the preceding claims.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
the embodiment of the invention uses a technical method of simulating and constructing test application, package and data and constructing various use scenes of a product to realize the modularized test of the functional interface and achieve the aim of ensuring the correct function of the module; the function code can be optimally configured in the module testing process, the hierarchy of the code architecture is fully improved, and the correctness and the portability of the function interface module are ensured, so that the project development time is reduced, and the efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a flowchart of a code debugging test method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for packaging a test interface according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for designing a generic driver layer according to an embodiment of the present invention;
FIG. 4 is a flowchart of a method for constructing a test case according to an embodiment of the present invention;
fig. 5 is a flowchart of a method for constructing a function usage scenario according to an embodiment of the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The technical scheme of the invention is further explained by the specific implementation mode in combination with the attached drawings.
Example one
Referring to fig. 1, fig. 1 shows a code debugging test method provided by the present embodiment, which includes:
In this step, for some functional codes, the coupling is high, and a certain code functional interface module needs to be packaged into a test interface by taking a function as a unit, so that the module is convenient to provide test use, and the tested functional codes are not required to be changed.
102, designing a general driving layer aiming at different testing interfaces.
Aiming at different test function interfaces, a universal driving layer is designed, and the purposes of flexibly scheduling and using test interfaces of various function and interface modules are achieved.
And 103, constructing a test case and at least one function use scene.
By constructing various function use scenes, the method can adapt to various test execution environments.
And 104, calling the test case through the universal driving layer to test under each function use scene.
Each step will be described in detail below.
Referring to fig. 2, fig. 2 is a packaging method of a test interface provided in the present embodiment, including:
And step 203, packaging the test interface according to the analysis result and the code coverage.
In this process, all parameters and code coverage of the functional interface module need to be analyzed respectively to perform test interface packaging and perform regression detection on the functional code.
Referring to fig. 3, fig. 3 is a method for designing a generic driver layer according to the present embodiment, including:
and 301, performing function modularization on the test interface.
And step 302, analyzing the function of the test interface.
And 303, constructing a universal driving layer according to the analysis result.
And 304, providing a calling interface for the test case so that the test case can correctly call the test interface.
In the process, the universal driving layer mainly plays a role in starting and stopping. The test interface packaged by the functional interface module can be called universally, and the functional interface required by the upper-layer test case can also be provided. The universal driving layer is used as an intermediate layer between the test case and the test interface, so that the modularization of the test interface is achieved, and the test of different test interfaces of different platforms is greatly facilitated.
Referring to fig. 4, fig. 4 is a method for constructing a test case provided in the present embodiment, including:
and step 401, performing test function modularization.
And step 403, analyzing the test data.
And step 404, analyzing the test scene.
And 405, constructing a test case according to the analysis result.
Referring to fig. 5, fig. 5 is a functional usage scenario construction method provided in the present embodiment, which includes:
And step 504, arranging and combining all scene TAGs to construct a functional use scene, and filling data.
In the process of constructing the function use scene, all parameters and code coverage of the function interface module need to be checked respectively, the user service scenes are arranged and combined, the real use scene of the function interface module is constructed, and the use scene is filled with data to complete the construction of the use scene.
In conclusion, the test scheme provided by the invention has the following beneficial effects:
1) the bug problem at the later stage of the project is reduced, and the project engineering quality is improved: the original code function module test is generally concentrated in the integrated test, and by finding problems in time in the early stage, risks brought to the project by bug are reduced in time, and the quality of the project is improved.
2) Eliminating functional module test blind areas: the most ideal project function test is to test the function points and codes in place, and the most ideal test effect is achieved by reducing or even eliminating blind areas.
3) And (3) functional module differentiation management: the functional modules are differentiated, so that the functional modules are developed and tested, the problems of the functional modules are avoided and solved in time, and the functional error of the modules is reduced.
4) The test function portability is high, the test method is suitable for different platforms and different test code function interfaces, and the flexibility and convenience required by project development are met.
Example two
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present invention provides a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in the code debugging test method provided by the embodiment of the present invention. For example, the instructions may perform the steps of:
packaging the functional interface module with the coupling meeting the preset condition into a test interface;
designing a universal driving layer aiming at different test interfaces;
constructing a test case and at least one functional use scene;
and calling the test case through a general driving layer to test under each function use scene.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (7)
1. A code debugging test method is characterized by comprising the following steps:
packaging the functional interface module with the coupling meeting the preset condition into a test interface;
designing a universal driving layer aiming at different test interfaces;
constructing a test case and at least one functional use scene;
calling the test case through the universal driving layer to the test interface, and testing under each function use scene;
aiming at different test interfaces, a universal driving layer is designed, and the method comprises the following steps: performing function modularization on each test interface, and analyzing the function realization of each test interface to construct the universal driving layer;
the test case building method comprises the following steps: and (5) modularizing the test function, analyzing the test data after calling the test data, and constructing a test case according to an analysis result.
2. The code debugging and testing method according to claim 1, wherein said encapsulating the functional interface module whose coupling satisfies a preset condition into a testing interface comprises: respectively analyzing the test factors of each parameter of the functional interface module to obtain an analysis result; checking code coverage of the functional interface module; packaging a test interface according to the analysis result and the code coverage; and judging whether the codes of the functional interface modules are changed or not, and if so, re-packaging the test interface.
3. The code debugging test method according to claim 1, wherein constructing a function usage scenario comprises: analyzing all parameters and code coverage of the functional interface module, detecting all user service scenes after analysis, arranging and combining, constructing the functional service scene and filling data.
4. A code testing apparatus, comprising:
the test interface packaging unit is used for packaging the functional interface module with the coupling meeting the preset condition into a test interface;
the drive design unit is used for designing a universal drive layer aiming at different test interfaces; the drive design unit is specifically configured to: performing function modularization on each test interface, and analyzing the function realization of each test interface to construct the universal driving layer;
the test case and use scene construction unit is used for modularizing the test function, analyzing the test data after calling the test data, and constructing the test case according to the analysis result; and constructing at least one function usage scenario;
and the test unit is used for calling the test interface through the universal driving layer to test the test case under each function use scene.
5. The code debugging test apparatus according to claim 4, wherein the test interface packaging unit is specifically configured to: respectively analyzing the test factors of each parameter of the functional interface module to obtain an analysis result; checking code coverage of the functional interface module; and packaging a test interface according to the analysis result and the code coverage.
6. The code debugging test device according to claim 4, wherein the test case and usage scenario constructing unit is specifically configured to: analyzing all parameters and code coverage of the functional interface module, detecting all user service scenes after analysis, arranging and combining, constructing the functional service scene and filling data.
7. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the code commissioning test method of any one of claims 1 to 3.
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 CN109739760A (en) | 2019-05-10 |
CN109739760B true 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) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111488285B (en) * | 2020-04-15 | 2023-05-12 | 抖音视界有限公司 | Interface testing method, device, electronic equipment and computer readable storage medium |
CN115509518B (en) * | 2022-09-20 | 2024-02-27 | 国科础石(重庆)软件有限公司 | Autopilot function software system, construction method, electronic device and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Family Cites Families (1)
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 |
-
2018
- 2018-12-28 CN CN201811623936.4A patent/CN109739760B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Also Published As
Publication number | Publication date |
---|---|
CN109739760A (en) | 2019-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11281570B2 (en) | Software testing method, system, apparatus, device medium, and computer program product | |
CN103365770B (en) | Mobile terminal software test macro and method for testing software | |
CN111651366B (en) | SDK test method, device, equipment and storage medium | |
CN103150249B (en) | A kind of method and system of automatic test | |
CN104657247A (en) | System and method for realizing universal type fault injection based on JTAG (Joint Test Action Group) debug mode | |
CN103412817B (en) | Automatic test script Off Line Debugging Method and system | |
CN104268079A (en) | POS (Point Of Sale) application program testing method and system | |
CN107329889B (en) | Method for automatically testing C compiler | |
CN109739760B (en) | Code debugging test method and device and storage medium | |
CN104484267A (en) | Testing system and method | |
CN111198811A (en) | Page automatic test method and device, electronic equipment and storage medium | |
Ulewicz et al. | Increasing system test coverage in production automation systems | |
CN110990289B (en) | Method and device for automatically submitting bug, electronic equipment and storage medium | |
CN111159023A (en) | Test method, test device, electronic equipment and computer readable storage medium | |
Barbosa et al. | Verification and validation of (real time) COTS products using fault injection techniques | |
CN110955605A (en) | Method for verifying single step dynamic execution by CPU | |
CN114661615B (en) | FPGA software testing method and device | |
CN115934559A (en) | Testing method of intelligent form testing system | |
CN109976963A (en) | A kind of method and apparatus that the BMC test macro based on general-purpose platform is realized | |
CN115470141A (en) | Fault simulation method, device and related equipment | |
CN112765018B (en) | Instrument and meter debugging system and method | |
Bajer et al. | Embedded software testing in research environment. A practical guide for non-experts | |
US20140047410A1 (en) | Method and system for semiconductor host simulation automation | |
CN113836825A (en) | Application method of key standard and verification chip of neural network processor | |
Sharma et al. | Model-based testing: the new revolution in software testing |
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 |