CN115237770A - Unit testing method, device, equipment and medium - Google Patents

Unit testing method, device, equipment and medium Download PDF

Info

Publication number
CN115237770A
CN115237770A CN202210862252.XA CN202210862252A CN115237770A CN 115237770 A CN115237770 A CN 115237770A CN 202210862252 A CN202210862252 A CN 202210862252A CN 115237770 A CN115237770 A CN 115237770A
Authority
CN
China
Prior art keywords
test
test data
unit
data group
case
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
CN202210862252.XA
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 Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet 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 Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202210862252.XA priority Critical patent/CN115237770A/en
Publication of CN115237770A publication Critical patent/CN115237770A/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/3684Test management for test design, e.g. generating new test cases
    • 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/368Test management for test version control, e.g. updating test cases to a new software version

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)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present disclosure relates to a unit testing method, device, equipment and medium, for solving the problems of poor expandability and difficult writing and maintenance of test cases in the related technology, the method includes: receiving at least one test data sent by a test end; dividing the at least one test data into at least one test data group according to the type of each test data; determining a test case corresponding to each test data group; and sending at least one test data group and the test case corresponding to each test data group to a test end so that the test end performs unit testing based on the test cases corresponding to the at least one test data group and each test data group.

Description

Unit testing method, device, equipment and medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a unit testing method, apparatus, device, and medium.
Background
Unit testing refers to checking and verifying the smallest testable unit in software. For the meaning of a unit in a unit test, generally, the specific meaning is determined according to the actual situation, for example, in a computer program language, a unit refers to a function, in a computer program language, a unit refers to a class, in graphical software, a window or a menu, etc. In general, a unit is a defined minimum tested function module. Unit testing is the lowest level of testing activity to be performed during software development, and individual units of software will be tested in isolation from other parts of the program.
As shown in fig. 1, an automation test class is written first, then an automation test method is added, then parameters required for function call are set, then the function is called, and finally the call result is compared with the expectation.
However, with the increase of a large number of automatic test cases, different parameters of the same function represent different functions to be verified, and therefore, the number of the automatic test cases is increased by times by setting fixed function call parameters in the automatic test cases, which causes poor expandability of the test cases and brings great trouble to writing and maintaining of the cases.
Disclosure of Invention
The present disclosure provides a unit testing method, apparatus, device and medium, so as to at least solve the problems of poor expandability of test cases and difficult writing and maintenance in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a unit testing method, including:
receiving at least one piece of test data sent by a test end;
dividing at least one test data into at least one test data group according to the type of each test data;
determining a test case corresponding to each test data group;
and sending the at least one test data group and the test case corresponding to each test data group to a test end so that the test end performs the test on the test data group and the test case execution unit corresponding to each test data group.
In one possible embodiment, the present disclosure provides a method, wherein the method further comprises:
and receiving a test result sent by the test end.
In a possible implementation manner, in the method provided by the present disclosure, after determining the test case corresponding to each test data group, the method further includes:
and adding a test identification to each test data group, and setting the state of each test data group to be not modifiable.
In a possible implementation manner, in the method provided by the present disclosure, after receiving the test result sent by the test end, the method further includes:
determining and recording a test result corresponding to each test data group based on the identification;
and setting the state of each test data group after the test result is recorded to be modifiable.
According to a second aspect of the embodiments of the present disclosure, there is provided a unit testing method, including:
acquiring at least one piece of test data for unit test, and sending the at least one piece of test data to a management end;
receiving at least one test data group sent by a management end and a test case corresponding to each test data group, wherein the test data groups are divided by the management end based on the type of the test data;
and executing unit test on the test data group corresponding to the test case through the test case.
In a possible implementation manner, in the method provided by the present disclosure, after the unit test is performed on the test data group corresponding to the test case through the test case, the method further includes:
and sending the test result to a management end.
According to a third aspect of the embodiments of the present disclosure, there is provided a unit testing device including:
the first receiving unit is configured to execute receiving of at least one piece of test data sent by the test end;
a grouping unit configured to perform grouping of the at least one test data into at least one test data group according to a type of each test data;
the processing unit is configured to execute the test cases corresponding to each test data group;
and the sending unit is configured to execute sending of the at least one test data group and the test case corresponding to each test data group to the test end, so that the test end is tested based on the at least one test data group and the test case execution unit corresponding to each test data group.
In a possible implementation manner, the present disclosure provides an apparatus, wherein the first receiving unit is further configured to perform:
and receiving a test result sent by the test end.
In one possible implementation, the present disclosure provides an apparatus, wherein the processing unit is further configured to perform:
and adding a test identifier for each test data group, and setting the state of each test data group to be not modifiable.
In a possible implementation manner, in the apparatus provided by the present disclosure, after receiving the test result sent by the test end, the processing unit is further configured to perform:
determining and recording a test result corresponding to each test data group based on the identification;
and setting the state of each test data group after the test result is recorded to be modifiable.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a unit testing device including:
the system comprises an acquisition unit, a management terminal and a data processing unit, wherein the acquisition unit is configured to acquire at least one piece of test data for unit test and send the at least one piece of test data to the management terminal;
the second receiving unit is configured to execute at least one test data group sent by the receiving management terminal and a test case corresponding to each test data group, and the test data groups are divided by the management terminal based on the type of the test data;
and the test unit is configured to execute the test of the test data group corresponding to the test case through the test case.
In a possible implementation manner, in an apparatus provided by the present disclosure, after the unit test is performed on the test data group corresponding to the test case through the test case, the test unit is further configured to perform:
and sending the test result to a management end.
According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic apparatus including: a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the unit testing method of any one of the first aspect or the second aspect of the embodiments of the present disclosure.
According to a sixth aspect of the embodiments of the present disclosure, there is provided a storage medium, wherein instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the unit testing method of any one of the first or second aspects of the embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the method comprises the steps of receiving at least one piece of test data sent by a test end, dividing the at least one piece of test data into at least one test data group according to the type of each piece of test data, determining a test case corresponding to each test data group, and sending the at least one test data group and the test case corresponding to each test data group to the test end so that the test end can perform unit testing on the at least one test data group and the test case corresponding to each test data group. Compared with the unit test scheme in the prior art, the method provides a database for uniformly storing test data, enriches test case data and reduces resource loss.
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 present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a schematic diagram illustrating a structure of a conventional cell testing method according to an exemplary embodiment.
FIG. 2 is a block diagram illustrating an existing unit testing method of the same type according to an exemplary embodiment.
FIG. 3 is a flow diagram illustrating a method of unit testing according to an exemplary embodiment.
FIG. 4 is a flow diagram illustrating another method of unit testing according to an exemplary embodiment.
FIG. 5 is a block diagram illustrating a method of testing units of the same type in accordance with an exemplary embodiment.
FIG. 6 is a detailed flow diagram illustrating the flow of a method of unit testing according to an exemplary embodiment.
FIG. 7 is a detailed flow diagram illustrating the flow of a unit testing method according to an exemplary embodiment.
FIG. 8 is a schematic diagram of a unit testing apparatus according to an exemplary embodiment.
Fig. 9 is a schematic structural diagram illustrating another unit test apparatus according to an exemplary embodiment.
FIG. 10 is a schematic diagram illustrating the structure of a unit test apparatus according to an exemplary embodiment.
Fig. 11 is a schematic structural diagram of a terminal to which a unit test method is applied according to an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the disclosure, as detailed in the appended claims.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
Some of the words that appear in the text are explained below:
1. the term "and/or" in the embodiments of the present invention describes an association relationship of associated objects, and indicates that three relationships may exist, for example, a and/or B may indicate: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
2. Unit testing (unit testing) refers to checking and verifying the smallest testable unit in software. Generally, the meaning of the unit in the unit test is determined according to the actual situation, and the graphical software may refer to a window or a menu. In general, the unit represents the smallest function module under test. Unit testing is the lowest level of testing to be performed during software development, and individual units of software will be tested in isolation from other parts of the program.
As shown in fig. 1, an automatic test class is written, an automatic test method is added, parameters required for function call are set, the function is called, and finally, a call result is compared with an expected result.
Generally, unit testing has the following functions:
(1) Code verification: the unit test is the basic operation of checking codes, and although writing the unit test consumes more time, the unit test only needs to be triggered to run in the subsequent verification, so that the method is convenient and fast.
(2) Recording an interface: in unit testing, attention needs to be paid to the public interface, and meanwhile, test cases are written to record the functional characteristics of the public interface.
(3) The positioning problem is as follows: after the code which runs well is repeatedly modified for many times, errors can be introduced with a certain probability; problems can be more easily detected by unit tests that are periodically initiated in an automated fashion.
(4) Repairing the problem: the unit test can reproduce the problem, and quick regression operation can be carried out after the error is repaired.
However, with the increase of a large number of automatic test cases, different parameters of the same function represent different functions to be verified, and therefore, the number of the automatic test cases is increased by times by setting fixed function call parameters in the automatic test cases, which causes poor expandability of the test cases and brings great trouble to writing and maintaining of the cases.
As shown in fig. 2, if there are N test data, and the N test data are all the verifications of the function a, then the above-mentioned method for preparing test data needs to prepare N test cases synchronously, which greatly reduces the writing efficiency of the test cases and doubles the maintenance cost of the test cases.
Meanwhile, the data source of the test template data provider is a local code or a file, although the test data can be operated in batch, so that the test cases can be executed in batch. However, the cost for adding and modifying the local code or file storage data is relatively high, and the code or file needs to be frequently modified; in addition, the readability of the data provided by the local code or file is poor; in addition, after the local code or the file is modified, the historical version cannot be traced back, and an efficient way for solving the problem after modification or solving the problem before tracing is not available; the test data is recorded in the local code or file, and the test case can only be executed in full quantity when triggered, and the test case which needs to be executed in the test cannot be flexibly selected.
Under the background, a unit test scheme is urgently needed, so that the problems of poor expandability of test cases and difficult writing and maintenance in the related technology are solved.
FIG. 3 is a flow chart illustrating a method of unit testing, as shown in FIG. 3, including the following steps, in accordance with an exemplary embodiment.
In step S301, at least one test data sent by the test end is received.
In particular implementations, at least one test data for unit testing is received from a test terminal.
In step S302, at least one test data is divided into at least one test data group according to the type of each test data.
In specific implementation, at least one test data is divided into at least one test data group according to the type of the test data or the function of the test.
Specifically, for a certain type of test data, the test data can be selected and combined into a test data packet, each test data packet has a unique name and a current packet state, and in the execution process, detailed information of the packet can be acquired according to the packet name.
In step S303, a test case corresponding to each test data group is determined.
During specific implementation, according to the test type or function of the test data groups, determining a test case corresponding to each test data group, adding a test identifier to each test data group and modifying the state after the determination, specifically, enabling each test data group to have a unique name, a test identifier ID with sequence and the state of the current group, sequentially acquiring the test data through the test identifier ID, and executing the test according to the sequence; the grouping state comprises editable, non-editable, deleted and the like, and is set as non-editable in the executing process and is restored to be the editable state again after the execution is finished; when the packet state is editable, the test data contained in the packet may be modified, otherwise it may not be modified. As shown in fig. 5, by using a grouping mechanism, one or more corresponding test cases are used for the test data in the same group, so that each test data is prevented from using one test case independently, thereby achieving the effect of saving resources.
In step S304, at least one test data group and a test case corresponding to each test data group are sent to the test end.
During specific implementation, the management terminal sends the test data groups and the test cases corresponding to the test data groups to the test terminal, so that the test terminal performs unit testing on the test data groups and the test cases corresponding to the test data groups.
And after the test of the test end is finished, receiving the test result sent by the test end, then determining the test result corresponding to each test data group based on the identification and recording the test result, and after the recording is finished, setting the state of each test data group with the recorded test result as modifiable.
FIG. 4 is a flow chart illustrating a method of unit testing, as shown in FIG. 4, including the following steps, in accordance with an exemplary embodiment.
In step S401, at least one test data for unit test is acquired, and the at least one test data is transmitted to the management side.
In specific implementation, at least one piece of test data used for unit test is obtained, and the received data is sent to the management end, so that the management end carries out grouping identification, determines test cases and other further operations.
In step S402, at least one test data group sent by the management end and a test case corresponding to each test data group are received.
In specific implementation, the test end receives at least one test data group sent from the management end and a test case corresponding to each test data group, wherein the test data groups are divided by the management end based on the type of the test data.
In step S403, a unit test is performed on the test data group corresponding to the test case through the test case.
In specific implementation, the received test case is used for testing the test data group execution unit corresponding to the test case, and after the test is finished, the test result is sent to the management end so that the management end can record the test result.
As shown in fig. 6, the unit testing method provided by the embodiment of the present disclosure is specifically described in conjunction with the management side and the testing side.
In step S601, the test end obtains at least one test data for unit testing, and sends the at least one test data to the management end.
In specific implementation, the test end acquires at least one test data for unit test, and sends the at least one test data to the management end, so that the management end performs grouping identification, determines test cases and other further operations.
In step S602, the management terminal divides at least one test data into at least one test data group according to the type of each test data.
In specific implementation, after receiving the test data sent by the test end, the management end divides at least one test data into at least one test data group according to the type of the test data or the function of the test. Specifically, for a certain type of test data, the test data can be selected and combined into a test data packet, each test data packet has a unique name and a current packet state, and in the execution process, detailed information of the packet can be acquired according to the packet name.
In step S603, a test case corresponding to each test data group is determined.
During specific implementation, according to the test type or function of the test data groups, determining a test case corresponding to each test data group, adding a test identifier to each test data group and modifying the state after the determination, specifically, enabling each test data group to have a unique name, a test identifier ID with sequence and the state of the current group, sequentially acquiring the test data through the test identifier ID, and executing the test according to the sequence; the grouping state comprises editable, non-editable, deleted and the like, and is set as non-editable in the execution process, and is restored to be an editable state again after the execution is finished; when the packet state is editable, the test data contained in the packet may be modified, otherwise it may not be modified. As shown in fig. 5, by using a grouping mechanism, one or more corresponding test cases are used for the test data in the same group, so that each test data is prevented from using one test case independently, thereby achieving the effect of saving resources.
In step S604, at least one test data group and a test case corresponding to each test data group are sent to the test end.
During specific implementation, the association end sends the determined test data groups and the corresponding test data cases to the test end, so that the test end performs unit testing on the basis of at least one test data group and the test case corresponding to each test data group.
In step S605, the test end executes the unit test on the test data group corresponding to the test case through the test case.
In specific implementation, after receiving at least one test data group sent by the management end and the test case corresponding to each test data group, the test end uses the received test case to perform unit testing on the test data group corresponding to the test case.
In step S606, the test end sends the test result to the management end.
In specific implementation, after the test is finished, the test result is sent to the management end, so that the management end can record the test result.
In step S607, the management terminal records the test result based on the identification.
After receiving the test result sent by the test end, determining the test result corresponding to each test data group based on the identification and recording the test result, and after the recording is completed, setting the state of each test data group after the test result is recorded as modifiable.
The following describes in detail an implementation process of the unit testing method provided by the embodiment of the present disclosure by taking an interaction between the local testing terminal and the management terminal as an example, with reference to fig. 7.
In step S701, the test side acquires test data for the unit test.
In specific implementation, test data for unit testing is acquired.
In step S702, the test data is transmitted to the management side.
In the specific implementation, in the management terminal, the stored test data are sourced by manual input, log information acquisition, interface flow recording and the like, and the diversity of the test data is greatly enriched through the modes; the test data unit stored in the platform mainly comprises the description of the calling interface, interface parameter information, version information of the test data unit and the current state (available or unavailable) of the test data; and editing or deleting the test data from any source in the test data module.
In step S703, the management side confirms the packet to which the test data belongs.
In specific implementation, for a certain type of test data, the test data can be circled and combined into a test data packet, and each test data packet has a unique name, a test data identification ID with sequence and the state of the current packet; in the execution process, the detailed information of the packet is obtained according to the name of the packet, and then the test data is sequentially obtained through the test data identification ID and executed according to the sequence.
In step S704, the state of the packet is set to be non-modifiable.
In specific implementation, the state of the packet is set to be not modifiable so as to determine that the data of the test case is not modifiable during the test of the test case.
In step S705, an execution record is generated for the test data.
In specific implementation, the execution record is set to be in execution at the time of testing.
In step S706, an identifier for identification is added to the test data.
In specific implementation, the identification used for identification is added into the test data, so that the result corresponding to the test data can be accurately found in the test result when the test is finished.
In step S707, the test data of the same packet is transmitted to the test side.
In specific implementation, the test data is utilized to determine the test cases corresponding to the test data in the database, and the test cases are generally determined in a grouping mode, namely similar test data is divided into one group, and the test data of the same group uses one or more corresponding test cases, so that each test data is prevented from using one test case independently, and the effect of saving resources is achieved. The specific grouping may be based on data types or test functions, which is not limited in this disclosure.
In step S708, a unit test is performed on the test side.
In step S709, the test result is sent to the management side.
In step S710, the test result is recorded based on the identification.
In step S711, the status of the test case is recorded as modifiable.
In specific implementation, the execution record comprises an execution record unique identifier, a test data grouping name, a test data identifier ID of execution failure, an execution state (during execution, end of execution and the like), and the like; in the process of executing the test case, the currently executed grouping information is recorded, a unique execution record identifier is generated, the execution state is set to be in execution, the execution result link is recorded after the execution is finished, and the execution state is updated to be the execution end.
FIG. 8 is a block diagram illustrating a unit testing device according to an exemplary embodiment. Referring to fig. 8, the apparatus includes a first receiving unit 801, a grouping unit 802, a processing unit 803, and a transmitting unit 804.
A first receiving unit 801 configured to perform receiving at least one test data sent by a test end;
a grouping unit 802 configured to perform grouping of at least one test data into at least one test data group according to a type of each test data;
the processing unit 803 is configured to execute the test case corresponding to each test data group;
the sending unit 804 is configured to execute sending of the at least one test data group and the test case corresponding to each test data group to the testing end, so that the testing end performs the test based on the at least one test data group and the test case execution unit corresponding to each test data group.
In one possible implementation, the present disclosure provides an apparatus, wherein the first receiving unit 801 is further configured to perform:
and receiving a test result sent by the test end.
In one possible implementation, the present disclosure provides an apparatus, wherein the processing unit 803 is further configured to perform:
and adding a test identifier for each test data group, and setting the state of each test data group to be not modifiable.
In a possible implementation manner, in the apparatus provided by the present disclosure, after receiving the test result sent by the test end, the processing unit 803 is further configured to perform:
determining and recording a test result corresponding to each test data group based on the identification;
and setting the state of each test data group after the test result is recorded to be modifiable.
FIG. 9 is a block diagram illustrating a unit testing device according to an exemplary embodiment. Referring to fig. 9, the apparatus includes an acquisition unit 901, a second receiving unit 902, and a test unit 903.
An acquiring unit 901 configured to perform acquisition of at least one test data for unit testing and send the at least one test data to a management side;
a second receiving unit 902, configured to execute at least one test data group and a test case corresponding to each test data group sent by the receiving management end, where the test data groups are divided by the receiving management end based on the type of the test data;
and the test unit 903 is configured to execute the unit test on the test data group corresponding to the test case through the test case.
In a possible implementation manner, in the apparatus provided by the present disclosure, after the unit test is performed on the test data group corresponding to the test case through the test case, the test unit 903 is further configured to perform:
and sending the test result to a management end.
Fig. 10 is a block diagram of an electronic device 1000 shown in accordance with an example embodiment.
A processor 1010;
a memory 1030 for storing instructions executable by the processor 1010;
wherein the processor 1010 is configured to execute the instructions to implement the unit testing method in the embodiments of the present disclosure.
In an exemplary embodiment, a storage medium comprising instructions, such as memory 1030 comprising instructions executable by processor 1010 of device 1000 to perform the above-described method, is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In the embodiment of the present disclosure, as shown in fig. 11, a terminal 1100 applying the unit testing method provided by the embodiment of the present disclosure includes: radio Frequency (RF) circuit 1110, power source 1130, processor 1130, memory 1140, input unit 1150, display unit 1160, camera 1170, communication interface 1180, and Wireless Fidelity (Wi-Fi) module 1190. Those skilled in the art will appreciate that the configuration of the terminal shown in fig. 11 is not intended to be limiting, and that the terminal provided by the embodiments of the present application may include more or less components than those shown, or some components may be combined, or a different arrangement of components may be provided.
The following describes each component of the terminal 1100 in detail with reference to fig. 11:
the RF circuit 1110 may be used for receiving and transmitting data during a communication or conversation. Specifically, the RF circuit 1110, after receiving downlink data of a base station, sends the downlink data to the processor 1130 for processing; and in addition, sending the uplink data to be sent to the base station. Generally, the RF circuit 1110 includes, but is not limited to, an antenna, at least one Amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
In addition, the RF circuit 1110 can also communicate with a network and other terminals through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), general Packet Radio Service (GPRS), code Division Multiple Access (CDMA), wideband Code Division Multiple Access (WCDMA), long Term Evolution (LTE), email, short Messaging Service (SMS), and the like.
The Wi-Fi technology belongs to a short-distance wireless transmission technology, and the terminal 1100 can be connected with an Access Point (AP) through a Wi-Fi module 1190, thereby realizing Access to a data network. The Wi-Fi module 1190 may be used for receiving and transmitting data during communication.
The terminal 1100 may be physically connected to other terminals through the communication interface 1180. Optionally, the communication interface 1180 is connected to the communication interfaces of the other terminals through a cable, so as to implement data transmission between the terminal 1100 and the other terminals.
In the embodiment of the present application, the terminal 1100 is capable of implementing a communication service and sending information to other contacts, so that the terminal 1100 needs to have a data transmission function, that is, the terminal 1100 needs to include a communication module inside. Although fig. 11 illustrates communication modules such as the RF circuit 1110, the Wi-Fi module 1190, and the communication interface 1180, it is understood that at least one of the above components or other communication modules (e.g., bluetooth module) for implementing communication exists in the terminal 1100 for data transmission.
For example, when the terminal 1100 is a mobile phone, the terminal 1100 may include the RF circuit 1110 and may further include the Wi-Fi module 1190; when the terminal 1100 is a computer, the terminal 1100 may include the communication interface 1180 and may further include the Wi-Fi module 11110; when the terminal 1100 is a tablet computer, the terminal 1100 may include the Wi-Fi module.
The memory 1140 may be used to store software programs and modules. The processor 1130 executes software programs and modules stored in the memory 1140 so as to perform various functional applications and data processing of the terminal 1100, and when the processor 1130 executes the program codes in the memory 1140, part or all of the processes in fig. 11 of the embodiments of the present disclosure can be implemented.
Alternatively, the memory 1140 may mainly include a program storage area and a data storage area. Wherein, the storage program area can store an operating system, various application programs (such as communication application), a popup module and the like; the storage data area may store data (such as various multimedia files like pictures, video files, etc., and pop-up information templates) created according to the use of the terminal, etc.
Further, the memory 1140 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1150 may be used to receive numeric or character information input by a user and generate key signal inputs related to user settings and function control of the terminal 1100.
Alternatively, the input unit 1150 may include a touch panel 1151 and other input devices 1152.
The touch panel 1151, also called a touch screen, can collect touch operations of a user on or near the touch panel 1151 (e.g., operations of a user on or near the touch panel 1151 by using a finger, a stylus, or any other suitable object or accessory), and drive the corresponding connection device according to a preset program. Alternatively, the touch panel 1151 may include two portions, i.e., a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1130, and can receive and execute commands sent by the processor 1130. In addition, the touch panel 1151 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave.
Optionally, the other input devices 1152 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 1160 may be used to display information input by or provided to the user and various menus of the terminal 1100. The display unit 1160 is a display system of the terminal 1100, and is used for presenting an interface and implementing human-computer interaction.
The display unit 1160 may include a display panel 1161. Alternatively, the Display panel 1161 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
Further, the touch panel 1151 can cover the display panel 1161, and when the touch panel 1151 detects a touch operation on or near the touch panel 1151, the touch panel is transmitted to the processor 1130 to determine the type of the touch event, and then the processor 1130 provides a corresponding visual output on the display panel 1161 according to the type of the touch event.
Although in fig. 11, the touch panel 1151 and the display panel 1161 are two separate components to implement the input and output functions of the terminal 1100, in some embodiments, the touch panel 1151 and the display panel 1161 may be integrated to implement the input and output functions of the terminal 1100.
The processor 1130 is a control center of the terminal 1100, connects various components using various interfaces and lines, performs various functions of the terminal 1100 and processes data by operating or executing software programs and/or modules stored in the memory 1140 and calling data stored in the memory 1140, thereby implementing various services based on the terminal.
Optionally, the processor 1130 may include one or more processing units. Optionally, the processor 1130 may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into the processor 1130.
The camera 1170 is configured to implement a shooting function of the terminal 1100, and shoot a picture or a video. The camera 1170 may also be used to implement a scanning function of the terminal 1100, and scan a scanned object (two-dimensional code/barcode).
The terminal 1100 also includes a power supply 1120 (e.g., a battery) for powering the various components. Optionally, the power source 1130 may be logically connected to the processor 1130 through a power management system, so that the power management system may manage functions of charging, discharging, power consumption, and the like.
It is noted that the processor 1130 according to the embodiments of the present disclosure may perform the functions of the processor 1010 in fig. 10, and the memory 1140 stores the contents of the processor 1010.
In addition, in an exemplary embodiment, the present disclosure also provides a storage medium, where when instructions in the storage medium are executed by a processor of the unit testing device, the unit testing device is enabled to implement the unit testing method in the embodiment of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method of unit testing, comprising:
receiving at least one test data sent by a test end;
dividing the at least one test data into at least one test data group according to the type of each test data;
determining a test case corresponding to each test data group;
and sending at least one test data group and the test case corresponding to each test data group to a test end so that the test end performs unit testing based on the test cases corresponding to the at least one test data group and each test data group.
2. The method of claim 1, further comprising:
and receiving the test result sent by the test end.
3. The method of claim 1, wherein after determining the test cases corresponding to each test data set, the method further comprises:
and adding a test identifier for each test data group, and setting the state of each test data group to be not modifiable.
4. The method according to claims 2 and 3, wherein after receiving the test result sent by the test end, the method further comprises:
determining and recording a test result corresponding to each test data group based on the identification;
and setting the state of each test data group after the test result is recorded to be modifiable.
5. A method of unit testing, comprising:
acquiring at least one piece of test data for unit test, and sending the at least one piece of test data to a management end;
receiving at least one test data group sent by the management terminal and a test case corresponding to each test data group, wherein the test data groups are divided by the management terminal based on the type of the test data;
and executing the unit test on the test data group corresponding to the test case through the test case.
6. The method of claim 5, wherein after the unit test is performed on the test data group corresponding to the test case through the test case, the method further comprises:
and sending the test result to the management terminal.
7. A unit testing apparatus, comprising:
the first receiving unit is configured to execute receiving of at least one piece of test data sent by the test end;
a grouping unit configured to perform grouping of the at least one test data into at least one test data group according to a type of each test data;
the processing unit is configured to execute the test cases corresponding to each test data group;
the sending unit is configured to execute sending of at least one test data group and the test case corresponding to each test data group to the test end, so that the test end performs a test based on the test case execution unit corresponding to the at least one test data group and each test data group.
8. A unit testing apparatus, comprising:
the system comprises an acquisition unit, a management terminal and a data processing unit, wherein the acquisition unit is configured to acquire at least one piece of test data for unit test and send the at least one piece of test data to the management terminal;
the second receiving unit is configured to execute and receive at least one test data group and a test case corresponding to each test data group, which are sent by the management terminal, wherein the test data groups are divided by the management terminal based on the type of the test data;
and the test unit is configured to execute the unit test on the test data group corresponding to the test case after the test case is passed.
9. A unit testing electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the unit testing method of any one of claims 1 to 5 or 5 and 6.
10. A storage medium having instructions that, when executed by a processor of a unit test electronic device, enable the unit test electronic device to perform the unit test method of any one of claims 1 to 5 or 5 and 6.
CN202210862252.XA 2022-07-20 2022-07-20 Unit testing method, device, equipment and medium Pending CN115237770A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210862252.XA CN115237770A (en) 2022-07-20 2022-07-20 Unit testing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210862252.XA CN115237770A (en) 2022-07-20 2022-07-20 Unit testing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115237770A true CN115237770A (en) 2022-10-25

Family

ID=83674879

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210862252.XA Pending CN115237770A (en) 2022-07-20 2022-07-20 Unit testing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115237770A (en)

Similar Documents

Publication Publication Date Title
CN108880867B (en) Network equipment data acquisition method and system
US9075716B2 (en) Remote issue logging and reporting of mobile station issues and diagnostic information to manufacturer
CN104516812A (en) Method and device for testing software
CN105404585A (en) Method and apparatus for acquiring code coverage rate
CN108572908B (en) Information feedback method and device
CN104965790A (en) Keyword-driven software testing method and system
CN108073495B (en) Method and device for positioning crash reason of application program
CN109977013B (en) Debugging information acquisition method, system and device
CN113422794A (en) Traffic recording and playback processing method and device and electronic equipment
US20080057914A1 (en) Pseudo-Remote Terminal IOTA Mobile Diagnostics and Electronic Customer Care
CN115527603A (en) Hard disk performance testing method, central control machine and testing machine
CN112749074A (en) Test case recommendation method and device
CN110209557A (en) User's operation records restoring method, device, equipment and readable storage medium storing program for executing
CN111104281B (en) Game performance monitoring method, device, system and storage medium
CN105005529A (en) Application testing method and apparatus
CN102316211B (en) Method and device for realizing key acceleration
CN115237770A (en) Unit testing method, device, equipment and medium
CN110572782A (en) Short message reply method and equipment
CN111176708B (en) SDK file processing method and device, electronic equipment and storage medium
CN110297754A (en) A kind of test information feedback method and system
CN112418835A (en) Method and related device for testing online bank payment process
CN106101095A (en) A kind of mobile terminal data processing method, device and equipment
KR100860125B1 (en) Method and system for remote diagnosing of application on mobile terminal
CN111191998A (en) Item processing method and device
CN110996374B (en) Wireless network control method, device, equipment and medium

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