CN115292165A - Test method and device, electronic device and storage medium - Google Patents

Test method and device, electronic device and storage medium Download PDF

Info

Publication number
CN115292165A
CN115292165A CN202210821241.7A CN202210821241A CN115292165A CN 115292165 A CN115292165 A CN 115292165A CN 202210821241 A CN202210821241 A CN 202210821241A CN 115292165 A CN115292165 A CN 115292165A
Authority
CN
China
Prior art keywords
test
interface
target
test case
functional
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
CN202210821241.7A
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.)
Beijing Shareit Information Technology Co Ltd
Original Assignee
Beijing Shareit Information 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 Beijing Shareit Information Technology Co Ltd filed Critical Beijing Shareit Information Technology Co Ltd
Priority to CN202210821241.7A priority Critical patent/CN115292165A/en
Publication of CN115292165A publication Critical patent/CN115292165A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

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 embodiment of the disclosure provides a test method and a test device, electronic equipment and a storage medium, wherein the test method comprises the following steps: determining a target component to be tested based on the test request information of the functional test; testing the target component by using the functional test case to obtain a functional test result; determining a target interface associated with the target component according to a mapping rule between a test case identifier and an interface of the functional test; testing the target interface by using the interface test case to obtain an interface test result; and outputting a response result of the test request information according to the function test result and the interface test result. Thus, starting from the functional test case, the target interface associated with the functional test case is mapped. The method can cover the existing interface test cases of the target interface and the functional cases of the service logic of the functional layer, and realizes the coverage of the case scene to the maximum extent.

Description

Test method and device, electronic device and storage medium
Technical Field
The present disclosure relates to the field of software testing technologies, and in particular, to a testing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
Testing is the process of operating a program under specified conditions to discover bugs, to measure software quality, and to evaluate whether it can meet design requirements.
In the existing testing method, manual testing requires testers to execute the testing step by step according to test cases, so that the testing cost is high and the coverage is low. The traditional automated test generally guarantees the core link at most, so the coverage rate is difficult to guarantee. The gray scale test has low test efficiency due to small flow and lack of an effective problem finding mechanism.
Disclosure of Invention
In view of the above, the present disclosure provides a testing method and apparatus, an electronic device, and a storage medium.
In a first aspect, the present application provides a testing method, which may include:
determining a target component to be tested based on the test request information of the functional test;
testing the target assembly by using the functional test case to obtain a functional test result;
determining a target interface associated with the target component according to a mapping rule between a test case identifier and an interface of the functional test;
testing the target interface by using the interface test case to obtain an interface test result;
and outputting a response result of the test request information according to the function test result and the interface test result.
In some possible embodiments, before determining the target component to be tested based on the test request information of the functional test, the method further includes:
acquiring test case identifications of a plurality of functional test cases;
binding the functional test case with one or more interfaces in an associated manner based on the test case identification; one interface is associated with at least one functional test case and is bound;
and obtaining a mapping rule between the test case identifier and the interface according to the association binding relationship.
In some possible embodiments, outputting a response result of the test request information according to the functional test result and the interface test result includes:
determining the coverage rate of the functional test according to the functional test result;
determining the coverage rate of the interface test according to the interface test result;
determining interval information between the coverage rate of the function test result and the coverage rate of the interface test result;
interval information is included in the response result output.
In some possible embodiments, using the interface test case, the testing the target interface to obtain an interface test result, including:
acquiring an interface test case set corresponding to a target interface;
acquiring parameter values of operating parameters of a target interface associated with a target component in the execution process of a plurality of functional test cases;
and inputting the parameter values into the corresponding target interfaces, respectively executing each interface test case in the test case set, and performing functional test on the target interfaces to obtain the corresponding response result of each interface test case at the target interfaces.
In some possible embodiments, inputting the parameter value into the corresponding target interface and executing each interface test case in the test case set respectively, and performing a functional test on the target interface, including:
selecting a target test case which does not participate in the interface test from the interface test case set based on a preset test case execution sequence;
inputting the parameter values into a target interface, and sequentially executing target test cases;
respectively performing function test on all to-be-tested function points of the target interface according to the target test case to obtain a response result corresponding to each to-be-tested function point of the target interface and the target test case;
and the response results of the target test case at the target interface comprise the response results of all the functional points to be tested of the target interface and the response results corresponding to the target test case.
In a second aspect, the present application provides a test apparatus comprising:
the first determining module is used for determining a target component to be tested based on the test request information of the functional test;
the first testing module is used for testing the target assembly by using the functional test case to obtain a functional test result;
the second determining module is used for determining a target interface associated with the target component according to a mapping rule between the test case identifier of the functional test and the interface;
the second test module is used for testing the target interface by using the interface test case to obtain an interface test result;
and the output module is used for outputting a response result of the test request information according to the function test result and the interface test result.
In some possible embodiments, the apparatus further comprises:
the first acquisition module is used for acquiring test case identifications of a plurality of functional test cases;
the association module is used for associating and binding the functional test case with one or more interfaces based on the test case identification; one interface is associated and bound with at least one functional test case;
and the obtaining module is used for obtaining the mapping rule between the test case identifier and the interface according to the association binding relationship.
In some possible embodiments, the output module is specifically configured to:
determining the coverage rate of the functional test according to the functional test result;
determining the coverage rate of the interface test according to the interface test result;
determining interval information between the coverage rate of the function test result and the coverage rate of the interface test result;
interval information is included in the response result output.
In some possible embodiments, the second test module comprises:
the second acquisition module is used for acquiring an interface test case set corresponding to the target interface;
the third acquisition module is used for acquiring parameter values of the operating parameters of the target interfaces associated with the target components in the execution process of the multiple functional test cases;
and the second testing module is specifically used for inputting the parameter values into the corresponding target interfaces, respectively executing each interface testing case in the testing case set, and performing functional testing on the target interfaces to obtain the corresponding response result of each interface testing case at the target interface.
In some possible embodiments, the second test module is specifically configured to select, from the interface test case set, a target test case that does not participate in the interface test based on a preset test case execution sequence; inputting parameter values into a target interface, and sequentially executing target test cases; respectively performing function test on all to-be-tested function points of the target interface according to the target test case to obtain a response result corresponding to each to-be-tested function point of the target interface and the target test case;
and the response results of the target test case at the target interface comprise the response results of all the to-be-tested function points of the target interface and the target test case.
In a third aspect, the present application further provides an electronic device, including:
a memory for storing processor-executable instructions;
a processor; wherein the processor is configured to: for executing executable instructions, to implement a method as the first aspect and possible embodiments thereof.
In a fourth aspect, the present application provides a computer readable storage medium storing an executable program, wherein the executable program, when executed by a processor, implements a method as in the first aspect and possible embodiments thereof.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the beneficial effects that:
in the application, a target component to be tested is determined based on test request information of a functional test; testing the target assembly by using the functional test case to obtain a functional test result; determining a target interface associated with the target component according to a mapping rule between a test case identifier and an interface of the functional test; testing the target interface by using the interface test case to obtain an interface test result; and outputting a response result of the test request information according to the function test result and the interface test result. Thus, starting from the functional test case, the target interface associated with the functional test case is mapped. In the execution process of a test case, the method can cover the existing interface test case of a target interface and also can cover the functional test case of the service logic of a functional layer, thereby realizing the coverage of a case scene to the maximum extent.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a schematic flowchart of an embodiment of a testing method in the embodiment of the present application.
Fig. 2 is a schematic structural diagram of a test method in the embodiment of the present application.
Fig. 3 is a schematic structural diagram of inputting each operating parameter into a corresponding target interface in the embodiment of the present application.
Fig. 4 is a schematic structural diagram of a response result of outputting test request information according to a function test result and an interface test result in the embodiment of the present application.
Fig. 5 is a schematic structural diagram of a testing apparatus in an embodiment of the present application.
Fig. 6 is a schematic structural diagram of an electronic device in this embodiment of the application.
Detailed Description
In the following description, reference is made to the accompanying drawings which form a part hereof and which show by way of illustration specific aspects of embodiments of the application or which may be used in the practice of the embodiments of the application. It should be understood that embodiments of the present application may be used in other ways and may include structural or logical changes not depicted in the drawings. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present application is defined by the appended claims. For example, it should be understood that the disclosure in connection with the described methods may equally apply to the corresponding apparatus or device for performing the methods, and vice versa. For example, if one or more particular method steps are described, the corresponding apparatus may comprise one or more units, such as functional units, to perform the described one or more method steps (e.g., a unit performs one or more steps, or multiple units, each of which performs one or more of the multiple steps), even if such one or more units are not explicitly described or illustrated in the figures. On the other hand, for example, if a particular apparatus is described based on one or more units, such as functional units, the corresponding method may comprise one step to perform the functionality of the one or more units (e.g., one step performs the functionality of the one or more units, or multiple steps, each of which performs the functionality of one or more of the plurality of units), even if such one or more steps are not explicitly described or illustrated in the figures. Further, it should be understood that features of the various exemplary embodiments and/or aspects described herein may be combined with each other, unless explicitly stated otherwise.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments 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.
Fig. 1 is a schematic flowchart of an embodiment of a testing method in an embodiment of the present application, and referring to fig. 1, the method may include:
s101, determining a target component to be tested based on the test request information of the functional test;
s102, testing the target component by using the functional test case to obtain a functional test result;
s103, determining a target interface associated with the target component according to a mapping rule between the test case identifier and the interface of the functional test;
s104, testing the target interface by using the interface test case to obtain an interface test result;
and S105, outputting a response result of the test request information according to the function test result and the interface test result.
It can be understood that the functional test is to verify the functions corresponding to each target component to be tested included in the product, and test item by item according to the functional test case to check whether the product meets the functions required by the user.
The functional test case is a set of test input, execution conditions and expected results compiled for verifying a function corresponding to a target component to be tested so as to test whether the function meets requirements. Based on the test requirements of each function, a corresponding function test case can be compiled in advance. Each target component to be tested can correspond to a plurality of functional test cases. The functional test result is whether the actual execution result of the comparative functional test case is consistent with the expected result.
In this embodiment, the test request may specify to perform a function test on a certain target component, or may also perform a test on each function included in a product to be tested.
For example, in some cases, a single function needs to be verified, and when performing a test of functional verification, at this time, the test request of functional test may be to specify that a functional test is performed on a target component corresponding to the function. Or in the daily test process, each function needs to be tested, and in this case, the test request of the function test may be to perform the function test on each target component included in the product.
In the testing field, generally, a functional test and an interface test are two independent testing branches, each testing mode is respectively tested based on respective testing requirements, and no correlation exists between the testing modes. In the embodiment of the present application, by pre-establishing the mapping relationship between each functional test case and each interface, the interface test of the associated interface is executed while the functional test is performed, and the interface test case of the target interface and the functional test case of the service logic of the functional layer are covered at the same time.
Based on this, before performing the step S101, the method further includes:
acquiring test case identifiers of a plurality of functional test cases;
binding the functional test case with one or more interfaces in an associated manner based on the test case identification; one interface is associated and bound with at least one functional test case;
and obtaining a mapping rule between the test case identifier and the interface according to the association binding relationship.
The test case identifier of the functional test may be a scene characteristic of the functional test case.
The method can be divided into different use scenes of the function module according to different states or different conditions of the same function module. The scene features are used for reflecting the characteristics of the scene, and can be used for distinguishing different use scenes, and the same scene has the same scene features. According to different scene characteristics, various scenes can be classified to obtain different scene types, and various scenes of the same scene type have the same or similar scene characteristics. Different functional modules can be classified into different scene categories. For example, in a system login scenario, for a login module of the system, the scenario categories may be divided into a scenario in which a user has logged in and a scenario in which the user has not logged in. Or under the condition of using the ATM to withdraw money, the classes of the withdrawing module can be divided into successful withdrawing money, insufficient cash in the ATM, wrong password input and the like.
Specifically, the scene characteristics may be scene characteristic marks added in the process of compiling the functional test cases, and the functional test cases with the same scene marks are divided into the same scene category. Alternatively, scene features can be extracted from the functional test case according to a semantic recognition technology. The functional test cases comprise descriptive sentences, scene features corresponding to the same scene may describe sentences which are not completely the same but have similar meanings, the scene features corresponding to the functional test cases are obtained through recognition of the descriptive sentences of the functional test cases, and the test cases are divided into corresponding scene categories according to the scene features.
In one embodiment, the associating and binding the functional test case and one or more interfaces based on the test case identification may be based on the divided scene categories, and binding the functional test case of the same scene category and the corresponding interface.
Interface testing is a test that tests an interface between components of a system. The method is mainly used for detecting interaction points between external systems and between internal subsystems. The key point of the test is to check the exchange of data, transfer and control management processes, mutual logic dependency relationship between systems and the like.
Fig. 2 is a schematic structural diagram of a testing method in the embodiment of the present application, and referring to fig. 2, an automated dual-engine testing platform is provided in the embodiment of the present application. The test method can be executed by the test platform, wherein the dual engines are respectively referred to as a functional test engine and an interface test engine. The functional test engine comprises the mapping relation between the functional test cases and the interfaces and is used for mapping the target interfaces corresponding to the functional test cases. The interface test engine is used for acquiring parameter values of actual operation parameters of a target interface associated with the target component in the execution process of the functional test case, and storing the acquired parameter values in a storage space of the test platform.
It will be appreciated that the product development process may include multiple stages. For example, four stages of a commonly used development process may include demand analysis, design, development, testing. The contents of the embodiment of the present application are the test method applied to the test stage. Product development may go through iterations of multiple versions based on an increase in user demand. For example, the initial version of the product development may contain some basic main functions, and after the product is deployed online, each functional module may be added and/or modified on the basis of the current product based on the requirements of customers and modification opinions, and the like, so as to perform iterative upgrade of the product. The testing process in the embodiment of the application may be performed at each iteration version in the product development process. In the testing process, the testing result of each time of the function test and/or the interface test can be used as the initial value of the next iteration version of the function test and/or the interface test.
The test platform comprises components such as test management, case library management, case execution units and the like. And performing functional test and interface test in the development process of the product.
In the functional test process, the test platform executes the functional test based on the test request, the functional test engine indicates each target interface associated with each functional test case, and the functional engine issues the card points to indicate the test points in the functional test process.
Illustratively, in a system login scenario, the test points of the login function include an input box function, an interface layout, whether the use of the shortcut key is normal, and the like. Wherein the input box functions may include: inputting a legal user name and a password, and successfully logging in; inputting a legal user name and an illegal password, failing to log in, and giving a reasonable prompt; inputting an illegal user name and a legal password, failing to log in, and giving a reasonable prompt; and inputting an illegal user name and an illegal password, failing to log in, giving a reasonable prompt and the like. Whether the use of the shortcut key is normal may include: whether the keyboard tabulation positioning key (Tab) is used correctly, whether the up-down left-right switching key and the like are used normally, and the like. The interface layout may include: whether the interface layout is consistent with the design drawing, whether the interface layout is reasonable, and the like.
In the interface testing process, the interface testing is executed based on the target interface indicated by the functional testing engine, and the interface testing engine acquires the parameter values of the actual operating parameters of the target interface corresponding to the execution of each functional testing case in the functional testing process and correspondingly stores each parameter value in the storage space of the testing platform. And the interface test case is used for inputting each parameter into the corresponding target interface when executing the interface test case in the interface test process.
The interface engine issues checkpoints to indicate test points in the interface test process. For example, in the same payment system, the target interface may include a recharge interface, a purchase interface, and the like. Wherein, the test point of the recharging interface can include: identity verification, balance verification, payment mode verification and the like. The identity verification can be carried out by receiving identity authentication parameters to carry out real-name authentication, and age information is obtained through the identity authentication parameters of the real-name authentication to determine whether the current user is a minor adult or not; the payment method check can be to verify which payment channels are supported by the payment system, or can also be to verify whether each payment channel can be successfully invoked. For example, the payment channel may include WeChat, payment Bao, unionpay card, and the like. The balance check may be to verify whether the balance of the currently selected payment channel is sufficient. The test point for purchasing the interface may include: amount spent on purchase verification, purchase quantity verification, remaining inventory verification, and the like.
In the embodiment of the application, the continuous test driven by the double engines of the functional test engine and the interface test engine is used for simultaneously executing the functional test and the interface test of the interface associated with the target component, and the two test modes are used for simultaneously executing mutual verification to improve the test efficiency and the coverage of the depth and the breadth of the test case.
In one embodiment, after the target interface to be tested is obtained based on the functional test case identifier, the interface test case test target interface corresponding to the target interface is executed. Based on this, the step S104 may further include:
acquiring an interface test case set corresponding to a target interface;
acquiring parameter values of operating parameters of a target interface associated with a target component in the execution process of a plurality of functional test cases;
and inputting the parameter values into the corresponding target interfaces, respectively executing each interface test case in the test case set, and performing functional test on the target interfaces to obtain the corresponding response result of each interface test case at the target interfaces.
In one embodiment, a plurality of interface test case sets corresponding to each target interface can be correspondingly stored by creating an interface test case document file in advance. The tester can input the corresponding test case into the document file in a mode of designing and editing each test case in each test case set in the document file. The document file may be, but is not limited to, a Word document, an Excel table document, and the like.
In the embodiment of the application, the actual operation parameters of each interface are input into the corresponding target interface according to the corresponding relationship between the functional test case identification and the interface, and the interface test case corresponding to the target interface is executed to perform the functional test on the target interface.
It will be appreciated that a function in a test system may involve the co-operation of multiple interfaces. For example, when a login operation is performed once, execution of a plurality of applications such as account information acquisition, authentication, and login needs to be performed. Fig. 3 is a schematic structural diagram of inputting each operation parameter into a corresponding target interface in the embodiment of the present application, and referring to fig. 3, an operation required by a user request is executed by three applications, namely, application a, application B, and application C, together. Request 1 is not a user request for performing a test, and request 2 is a request for performing a test. The unit a is each application cluster that needs to execute corresponding operations when a user requests to actually execute in the system. The unit B is each application cluster which carries out corresponding operation under the test environment in the process of executing the interface test case.
When each application cluster executes the operation corresponding to the request 2, the interface test engine in the target interface of each application cluster acquires the parameter value of the actual operation parameter of the corresponding target interface, and correspondingly stores each parameter value in the storage space of the test platform, and when the interface test case is executed, each parameter stored in the storage space is input into the corresponding interface and the interface test case is executed.
Optionally, inputting the obtained parameter values into a corresponding target interface and executing each interface test case in the test case set respectively, and performing a functional test on the target interface, including:
selecting a target test case which does not participate in the interface test from the interface test case set based on a preset test case execution sequence;
inputting parameter values into a target interface, and sequentially executing target test cases;
respectively performing function test on all to-be-tested function points of the target interface according to the target test case to obtain a response result corresponding to each to-be-tested function point of the target interface and the target test case;
and the response results of the target test case at the target interface comprise the response results of all the to-be-tested function points of the target interface and the target test case.
The execution sequence of each test case in each test case set may be a preset sequence. For example, the preset sequence may be a recording sequence of each test case in the corresponding test case set, or may also be a numerical value order of data capacity of each test case in the corresponding test case set. The preset test sequence of each test case set can be the same or different.
After selecting a target test case from at least one test case which is not involved in the interface test at present and is included in the target test case set each time, inputting the parameter values into the target interface, and controlling the target interface to perform the function test on all to-be-tested function points of the target to-be-tested interface according to the parameter values to obtain an actual output result, corresponding to the target test case, of each to-be-tested function point of the target to-be-tested interface.
Fig. 4 is a schematic structural diagram of a response result of outputting test request information according to a functional test result and an interface test result in an embodiment of the present application, and is shown in fig. 4, where each functional test case includes a verification rule of functional logic and a functional test case engine rule when writing the functional test case. The functional logic verification rules are used for indicating how each functional test case is verified, and respectively comprise single-point logic verification rules, statistical verification rules and mapping logic verification rules. The function case engine rule is used for indicating function test case description and mapping the interface associated with the function test case, and comprises function description, logic detail, verification hierarchy and interface mapping.
And each interface has a corresponding interface test case set, and the interface test case corresponding to the target interface is executed in the process of carrying out the function test case. The method comprises the steps of designing a management function test and an interface test through a design function management architecture, wherein the design of the function management architecture comprises a test plan, participating testers, various modules influenced by the test, data statistics and the like.
The coverage rate of the functional test can be determined according to the functional test result when the functional test is carried out;
the interface test can be carried out, so that the coverage rate of the interface test can be determined according to the interface test result;
the coverage rate of the function test and the interval information between the coverage rates of the interface test are the test result information of the functional module which needs to be optimized and is determined by the test method provided by the embodiment of the application.
It will be appreciated that coverage is a measure of the effectiveness of a software testing technique to measure test integrity. The interval information between the functional test coverage and the interface test coverage may be a difference between a coverage of a functional test case executed in the functional test process and a coverage of an interface test case executed in the interface test process performed by the corresponding target interface.
In the embodiment of the application, the functional test is based on the business logic of a single function in a functional layer, and whether the actual execution result of the corresponding function is consistent with the expected result under various execution conditions is verified as much as possible through the execution of the functional test case. The interface test verifies the target interface associated with the functional test case based on the functional test. And determining and outputting test result information jointly according to the function test result and the interface test result. Thus, starting from the functional test case, the target interface associated with the functional test case is mapped. The method can cover the existing interface test case of the target interface and the functional test case of the service logic of the functional layer, thereby realizing the case coverage to the maximum extent.
Based on the same inventive concept, the embodiment of the present application provides a testing apparatus, which includes several functional units for implementing the above-mentioned testing method.
Fig. 5 is a schematic structural diagram of a testing apparatus in an embodiment of the present application, and referring to fig. 5, the testing apparatus 500 may include:
a first determining module 501, configured to determine a target component to be tested based on test request information of a functional test;
the first test module 502 is configured to test a target component by using a functional test case to obtain a functional test result;
a second determining module 503, configured to determine a target interface associated with the target component according to a mapping rule between a test case identifier of the functional test and the interface;
the second test module 504 is configured to test the target interface to obtain an interface test result by using the interface test case;
and an output module 505, configured to output a response result of the test request information according to the function test result and the interface test result.
In some possible embodiments, the apparatus further comprises:
the first acquisition module is used for acquiring test case identifications of a plurality of functional test cases;
the association module is used for associating and binding the functional test case with one or more interfaces based on the test case identification; one interface is associated and bound with at least one functional test case;
and the obtaining module is used for obtaining the mapping rule between the test case identifier and the interface according to the association binding relationship.
In some possible embodiments, the output module 505 is specifically configured to:
determining the coverage rate of the functional test according to the functional test result;
determining the coverage rate of the interface test according to the interface test result;
determining interval information between the coverage rate of the function test result and the coverage rate of the interface test result;
interval information is included in the response result output.
In some possible embodiments, the second testing module 504 includes:
the second acquisition module is used for acquiring an interface test case set corresponding to the target interface;
the third acquisition module is used for acquiring parameter values of the operating parameters of the target interfaces associated with the target components in the execution process of the multiple functional test cases;
and the second testing module is specifically used for inputting the parameter values into the corresponding target interfaces, respectively executing each interface testing case in the testing case set, and performing functional testing on the target interfaces to obtain the corresponding response result of each interface testing case at the target interfaces.
In some possible embodiments, the second testing module 504 is specifically configured to select, based on a preset test case execution sequence, a target test case that does not participate in the interface test from the interface test case set; inputting the parameter values into a target interface, and sequentially executing target test cases; respectively performing function test on all to-be-tested function points of the target interface according to the target test case to obtain a response result corresponding to each to-be-tested function point of the target interface and the target test case;
and the response results of the target test case at the target interface comprise the response results of all the to-be-tested function points of the target interface and the target test case.
It should be noted that, for details of the implementation processes of the first determining module 501, the first testing module 502, the second determining module 503, the second testing module 504, and the output module 505, reference may be made to the detailed descriptions of the embodiments in fig. 1 to fig. 4, and for brevity of the description, details are not repeated here.
Based on the same inventive concept, the embodiments of the present application provide an electronic device, which may be consistent with the test method described in one or more of the embodiments above. Fig. 6 is a schematic structural diagram of an electronic device in an embodiment of the present application, and referring to fig. 6, an electronic device 600 may adopt general computer hardware, and includes a processor 601 and a memory 602.
In some possible implementations, the at least one processor may constitute any physical device having circuitry to perform logical operations on one or more inputs. For example, at least one processor may include one or more Integrated Circuits (ICs) including an Application Specific Integrated Circuit (ASIC), a microchip, a microcontroller, a microprocessor, all or a portion of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or other circuitry suitable for executing instructions or performing logical operations. The instructions executed by the at least one processor may be preloaded into a memory integrated with or embedded in the controller, for example, or may be stored in a separate memory. The memory may include Random Access Memory (RAM), read Only Memory (ROM), hard disk, optical disk, magnetic media, flash memory, other persistent, fixed, or volatile memory, or any other mechanism capable of storing instructions. In some embodiments, the at least one processor may comprise more than one processor. Each processor may have a similar structure, or the processors may have different configurations that are electrically connected or disconnected from each other. For example, the processor may be a separate circuit or integrated in a single circuit. When more than one processor is used, the processors may be configured to operate independently or cooperatively. The processors may be coupled electrically, magnetically, optically, acoustically, mechanically or by other means allowing them to interact.
Based on the same inventive concept, the present application provides a computer storage medium storing computer-executable instructions, which are executed by a processor, and can implement the testing method according to one or more embodiments.
It should be understood by those skilled in the art that the sequence numbers of the steps in the foregoing embodiments do not imply an order of execution, and the order of execution of the processes should be determined by their functions and internal logics, and should not limit the implementation process of the embodiments of the present invention in any way.
The above description is only an exemplary embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. A method of testing, the method comprising:
determining a target component to be tested based on the test request information of the functional test;
testing the target assembly by using the functional test case to obtain a functional test result;
determining a target interface associated with the target component according to a mapping rule between the test case identifier and the interface of the functional test;
testing the target interface by using an interface test case to obtain an interface test result;
and outputting a response result of the test request information according to the function test result and the interface test result.
2. The method of claim 1, wherein before determining the target component to be tested based on the test request information of the functional test, the method further comprises:
acquiring test case identifications of a plurality of functional test cases;
the functional test case is associated and bound with one or more interfaces based on the test case identification; wherein one interface is associated and bound with at least one functional test case;
and obtaining the mapping rule between the test case identifier and the interface according to the association binding relationship.
3. The method of claim 1, wherein outputting a response result of the test request information according to the functional test result and the interface test result comprises:
determining the coverage rate of the functional test according to the functional test result;
determining the coverage rate of the interface test according to the interface test result;
determining interval information between the coverage rate of the function test result and the coverage rate of the interface test result;
and including the interval information in the response result output.
4. The method of claim 1, wherein the testing the target interface with the interface test case to obtain an interface test result comprises:
acquiring an interface test case set corresponding to the target interface;
acquiring parameter values of the operating parameters of the target interface associated with the target component in the execution process of the functional test cases;
and inputting the parameter values into the corresponding target interfaces, respectively executing each interface test case in the test case set, and performing functional test on the target interfaces to obtain the corresponding response result of each interface test case at the target interfaces.
5. The method according to claim 4, wherein the inputting the parameter values into the corresponding target interfaces and respectively executing each interface test case in the test case set to perform the functional test on the target interfaces comprises:
selecting a target test case which does not participate in the interface test from the interface test case set based on a preset test case execution sequence;
inputting the parameter values into the target interface, and sequentially executing the target test cases;
respectively performing function test on all to-be-tested function points of the target interface according to the target test case to obtain a response result corresponding to each to-be-tested function point of the target interface and the target test case;
and the response result of the target test case at the target interface comprises the response results of all to-be-tested functional points of the target interface and the target test case.
6. A test apparatus, the apparatus comprising:
the first determining module is used for determining a target component to be tested based on the test request information of the functional test;
the first testing module is used for testing the target assembly by using the functional test case to obtain a functional test result;
the second determining module is used for determining a target interface associated with the target component according to a mapping rule between a test case identifier and an interface of the functional test;
the second testing module is used for testing the target interface by using the interface testing case to obtain an interface testing result;
and the output module is used for outputting a response result of the test request information according to the function test result and the interface test result.
7. The apparatus of claim 6, further comprising:
the first acquisition module is used for acquiring test case identifications of the plurality of functional test cases;
the association module is used for associating and binding the functional test case with one or more interfaces based on the test case identification; wherein one interface is associated and bound with at least one functional test case;
and the obtaining module is used for obtaining the mapping rule between the test case identifier and the interface according to the association binding relationship.
8. The apparatus of claim 6, wherein the output module is specifically configured to:
determining the coverage rate of the functional test according to the functional test result;
determining the coverage rate of the interface test according to the interface test result;
determining interval information between the coverage rate of the function test result and the coverage rate of the interface test result;
and including the interval information in the response result output.
9. The apparatus of claim 6, wherein the second testing module comprises:
the second obtaining module is used for obtaining an interface test case set corresponding to the target interface;
a third obtaining module, configured to obtain parameter values of operating parameters of the target interface associated with the target component in an execution process of the multiple functional test cases;
the second testing module is specifically configured to input the parameter value into the corresponding target interface, execute each interface test case in the test case set, and perform a functional test on the target interface to obtain a response result corresponding to each interface test case at the target interface.
10. The apparatus according to claim 9, wherein the second testing module is specifically configured to select, based on a preset test case execution sequence, a target test case that does not participate in the interface test from the interface test case set; inputting the parameter values into the target interface, and sequentially executing the target test cases; respectively performing function test on all to-be-tested function points of the target interface according to the target test case to obtain a response result corresponding to each to-be-tested function point of the target interface and the target test case;
and the response result of the target test case at the target interface comprises the response results of all the functional points to be tested of the target interface and the target test case.
11. An electronic device, comprising:
a memory for storing processor-executable instructions;
a processor coupled to the memory;
wherein the processor is configured to perform a testing method as provided in any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement the testing method provided in any one of claims 1 to 5.
CN202210821241.7A 2022-07-12 2022-07-12 Test method and device, electronic device and storage medium Pending CN115292165A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210821241.7A CN115292165A (en) 2022-07-12 2022-07-12 Test method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210821241.7A CN115292165A (en) 2022-07-12 2022-07-12 Test method and device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN115292165A true CN115292165A (en) 2022-11-04

Family

ID=83821429

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210821241.7A Pending CN115292165A (en) 2022-07-12 2022-07-12 Test method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115292165A (en)

Similar Documents

Publication Publication Date Title
CN106940428B (en) Chip verification method, device and system
US8019586B2 (en) Hole query for functional coverage analysis
US7587690B1 (en) Method and system for global coverage analysis
CN107943694B (en) Test data generation method and device
US7844929B2 (en) Optimizing test code generation for verification environment
CN112417798B (en) Time sequence testing method and device, electronic equipment and storage medium
US6707313B1 (en) Systems and methods for testing integrated circuits
CN107850641A (en) The whole-system verification of on-chip system (SoC)
CN114417563A (en) Multi-core mechanism simulation method and device and electronic equipment
CN103365772B (en) Software test automatic evaluation device and method
CN112395182A (en) Automatic testing method, device, equipment and computer readable storage medium
CN110399304A (en) A kind of test method and system of script
CN105446869B (en) The method and system that app application is audited
CN117495544A (en) Sandbox-based wind control evaluation method, sandbox-based wind control evaluation system, sandbox-based wind control evaluation terminal and storage medium
CN112632882A (en) Device and method for verifying arbiter based on formal verification
CN115292165A (en) Test method and device, electronic device and storage medium
CN116776786A (en) Chip verification method and device and related equipment
CN115061924A (en) Automatic test case generation method and generation device
CN109374038B (en) Change test method of nuclear security level instrument control product based on application prototype
CN108334313A (en) Continuous integrating method, apparatus and code management system for large-scale SOC research and development
CN116048952A (en) Instantiation module simulation verification method and device based on tailorable IP
CN113868046A (en) Function verification method and system of PAD control unit and related components
CN102236729B (en) The method of a kind of test function covering and device
CN107885925B (en) Register testing method in EDA (electronic design automation) verification stage
CN107766231A (en) A kind of automated testing method and device

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