CN117472724A - Automatic test method, device, storage medium and electronic equipment - Google Patents

Automatic test method, device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117472724A
CN117472724A CN202210864323.XA CN202210864323A CN117472724A CN 117472724 A CN117472724 A CN 117472724A CN 202210864323 A CN202210864323 A CN 202210864323A CN 117472724 A CN117472724 A CN 117472724A
Authority
CN
China
Prior art keywords
code
test
interface
determining
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
CN202210864323.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 Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network 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 Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202210864323.XA priority Critical patent/CN117472724A/en
Publication of CN117472724A publication Critical patent/CN117472724A/en
Pending legal-status Critical Current

Links

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/368Test management for test version control, e.g. updating test cases to a new software version
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses an automatic test method, an automatic test device, a storage medium and electronic equipment. The method comprises the following steps: determining a difference code between the target code and a historical version code under the condition that the target code is acquired; wherein the history version code is a last version code of the object code; determining a test interface to be tested according to the difference code; and obtaining test cases corresponding to the test interfaces from a case library, and testing the target codes by utilizing the test cases. The invention solves the technical problem of low testing efficiency of codes.

Description

Automatic test method, device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of testing, and in particular, to an automatic testing method, an automatic testing device, a storage medium, and an electronic device.
Background
In the prior art, in the process of testing codes, because the project codes have more contents, the test cases related to the test are more, the test is time-consuming and has low efficiency. Especially, the project codes are updated fast, frequent testing is needed, and the efficiency of testing codes is low.
Disclosure of Invention
The embodiment of the invention provides an automatic test method, an automatic test device, a storage medium and electronic equipment, which are used for at least solving the technical problem of low test efficiency of codes.
According to an aspect of an embodiment of the present invention, there is provided an automatic test method including: under the condition that the target code is acquired, determining a difference code between the target code and a historical version code; wherein the history version code is the last version code of the target code; determining a test interface to be tested according to the difference codes; and acquiring test cases corresponding to the test interfaces from a case library, and testing the target codes by using the test cases.
According to another aspect of an embodiment of the present invention, there is provided an automatic test apparatus including: a first determining module, configured to determine a difference code between the target code and a history version code when the target code is acquired; wherein the history version code is the last version code of the target code; the second determining module is used for determining a test interface to be tested according to the difference codes; and the test module is used for acquiring test cases corresponding to the test interfaces from a case library and testing the target codes by utilizing the test cases.
As an optional example, the second determining module includes: the first determining unit is used for determining a first test interface corresponding to the difference code; an acquiring unit, configured to acquire a second test interface associated with the first test interface; and the second determining unit is used for taking the first test interface and the second test interface as test interfaces to be tested.
As an alternative example, the above-described acquisition unit includes: a determining subunit, configured to use an interface belonging to the same web page as the first test interface as the second test interface; and/or the interface called by the first test interface is used as the second test interface; and/or using the interface calling the first test interface as the second test interface.
As an alternative example, the test module includes: the third determining unit is used for determining a current interface in the test interfaces and acquiring an interface mark of the current interface; the current interface is any one of the test interfaces; and the searching unit is used for searching the test case for testing the current interface from the case library according to the interface mark.
As an alternative example, the above apparatus further includes: a third determining module, configured to determine a code template corresponding to a code item before determining a difference code between the target code and the history version code; and the generating module is used for generating test cases for testing the code items according to the code templates.
As an optional example, the generating module includes: the first generation unit is used for generating an initial test case for testing the code items by using the code template; the deleting unit is used for deleting the target code in the initial test case to obtain the test case; wherein the object code comprises at least one of a pre-condition code, a post-condition code, a scene logic code and a data dependent logic code.
As an optional example, the generating module includes: the second generating unit is used for generating an initial test case for testing the code items by using the code template; and generating a version mark corresponding to the initial test case to obtain the test case.
According to yet another aspect of the embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program when executed by a processor performs the above-described automatic test method.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic device including a memory in which a computer program is stored, and a processor configured to execute the automatic test method described above by the computer program.
In the embodiment of the invention, under the condition that the target code is acquired, determining a difference code between the target code and the historical version code; wherein the history version code is the last version code of the target code; determining a test interface to be tested according to the difference codes; the method for obtaining the test cases corresponding to the test interfaces from the case library and testing the target codes by utilizing the test cases comprises the steps of determining the difference codes between the target codes and the historical version codes when the target codes are tested, determining the test interfaces according to the difference codes, and finally obtaining the test cases corresponding to the test interfaces from the case library to finish the test of the target codes. Therefore, the aim of improving the testing efficiency is fulfilled, and the technical problem of low testing efficiency of codes is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
FIG. 1 is a flow chart of an alternative automatic test method according to an embodiment of the present invention;
FIG. 2 is a system diagram of an alternative automatic test method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an alternative automatic test equipment in accordance with an embodiment of the present invention;
fig. 4 is a schematic diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to a first aspect of an embodiment of the present invention, there is provided an automatic test method, optionally, as shown in fig. 1, the method includes:
s102, under the condition that the target code is acquired, determining a difference code between the target code and a historical version code; the historical version code is the last version code of the target code;
s104, determining a test interface to be tested according to the difference code;
s106, acquiring test cases corresponding to the test interfaces from the case library, and testing object codes by utilizing the test cases.
Alternatively, the embodiment can be applied in the process of automatic testing of project codes. In the project development process, code adjustment is involved, and differences exist between different versions of code. In this embodiment, the difference code of the object code compared to the previous version may be acquired. The target code is the developed code, and the code of the last version is the code before the current development.
When the difference code is obtained, the code segment where the newly added code is located, the code segment where the deleted code is located, and the code segment where the modified code is located can be used as the difference code. The code segments refer to segments made up of a predetermined number of code lines.
When determining the test interfaces to be tested, it can be determined according to the difference codes, which interfaces are affected by the change of the codes, namely, the content of the interfaces is changed. Then the affected interface may be used as the test interface to be tested. Each test interface may correspond to one or more use case sets. And testing the test interface in the target code by using the case set to obtain a test result.
According to the embodiment, when the target code is tested, a difference code of the target code compared with the previous version is determined, a test interface to be tested is determined according to the difference code, and the target code is tested by using a test case corresponding to the test interface. Thereby realizing the purpose of improving the test efficiency.
As an alternative example, determining the test interface to be tested according to the difference code includes:
determining a first test interface corresponding to the difference code;
acquiring a second test interface associated with the first test interface;
and taking the first test interface and the second test interface as test interfaces to be tested.
Alternatively, in this embodiment, when determining the test interface to be tested, the first test interface corresponding to the difference code may be determined first, and then the second test interface associated with the first test interface may be determined. When the first test interface is determined, specific content of the difference code can be checked, and according to keywords in the difference code, an interface corresponding to the keywords is determined to be used as the first test interface. And taking the first test interface and the second test interface as test interfaces to be tested.
As an alternative example, acquiring a second test interface associated with the first test interface includes:
taking an interface belonging to the same webpage as the first test interface as a second test interface; and/or
Taking the interface called by the first test interface as a second test interface; and/or
And taking the interface which calls the first test interface as a second test interface.
Optionally, in this embodiment, when determining the second test interface according to the first test interface, the following provides several cases:
1. and taking the interface which belongs to the unified page together with the first test interface as a second test interface.
Alternatively, in this embodiment, if the code of the interface 1 changes, the interface 1 is used as the first test interface. At the same time, the interface 2 and the interface 1 belong to the same interface in one page, and therefore, the interface 2 serves as a second test interface to be tested.
2. And taking the interface called by the first test interface as a second test interface.
Alternatively, in this embodiment, if the code of the interface 1 changes, the interface 1 is used as the first test interface. At the same time, the interface 1 calls the interface 2, and the interface 2 serves as a second test interface to be tested.
3. And taking the interface which calls the first test interface as a second test interface.
Alternatively, in this embodiment, if the code of the interface 1 changes, the interface 1 is used as the first test interface. At the same time, the interface 2 calls the interface 1, and the interface 2 serves as a second test interface to be tested.
As an optional example, obtaining a test case corresponding to the test interface from the case library includes:
determining a current interface in the test interfaces, and acquiring an interface mark of the current interface; the current interface is any test interface;
and searching a test case for testing the current interface from the case library according to the interface mark.
Optionally, in this embodiment, after determining the test interfaces to be tested, the interface identifier of each test interface may be obtained. Since each test interface corresponds to a test case in the case library. Therefore, the test cases of the test interface can be searched from the case library through the interface marks of the test interface.
In this embodiment, each item may correspond to one or more use case libraries, where each use case library includes use cases for testing interfaces. Under the condition that the test case to be tested is determined, if a case library exists, determining the test case from the case library. If there are multiple case libraries, one or more test cases are determined from each of the case libraries.
As an alternative example, before determining the difference code between the object code and the historical version code, the method further comprises:
determining a code template corresponding to the code item;
according to the code template, a test case for testing the code item is generated.
Alternatively, in this embodiment, a plurality of code templates may be preset. When the test cases are generated, the corresponding test cases can be directly generated according to the content filled in one or more code templates.
As an alternative example, generating test cases for testing code items from a code template includes:
generating an initial test case for testing the code item by using the code template;
deleting the target code in the initial test case to obtain the test case; the object code comprises at least one of a pre-condition code, a post-condition code, a scene logic code and a data dependent logic code.
Alternatively, the code template in this embodiment may be a template for generating test cases. Each item may correspond to one or more templates. One or more test cases may be generated for each template for each item. After determining the test interface to be tested of the project, determining one or more test cases in each case library of the project.
When the test case is generated according to the template, the initial test case can be generated according to the template, and then at least one of the pre-condition code, the post-condition code, the scene logic code and the data dependent logic code in the initial test case is deleted to obtain the test case. The pre-condition codes refer to codes required to be called before the current codes are called, and the post-condition codes refer to codes which are called in a correlated way after the current codes are called. The scene logic code refers to a code capable of reflecting the scene where the initial test case is located, such as a code representing which platform where the initial test case is located. Data-dependent logic code refers to code that has a dependency relationship, such as execution of code 1 requires the execution result of code 2 to be relied upon. The dependent code 2 may be deleted.
As an alternative example, generating test cases for testing code items from a code template includes:
and deleting the pre-condition code, the post-condition code, the scene logic code and the data dependent logic code of each test case from the test case.
Alternatively, in this embodiment, the precondition code, the post-condition code, the scene logic code, and the data-dependent logic code in the test case may be deleted from the test case. There are various methods of deletion. For example, after each test case of one case library is generated, the post condition code, the scene logic code and the data dependent logic code of the test case of the case library can be deleted. Or deleting the post condition codes, the scene logic codes and the data dependent logic codes in the test template, and then generating the test case by the test template. The post condition code, scene logic code, and data dependent logic code in the test case are all deleted.
As an alternative example, generating test cases for testing code items from a code template includes:
generating an initial test case for testing the code item by using the code template;
and generating a version mark corresponding to the initial test case to obtain the test case.
Alternatively, the test case in this embodiment may include a version. The versions may be sequential. Differentiated by different version flags. When testing the test interface to be tested, the test interface can be tested by using the test case of the latest version, or the test case of the version matched with the test interface is selected to test the test interface. Fig. 2 is a system schematic diagram of the present embodiment. In FIG. 2, project 1 and project 2 correspond to different one or more templates, each of which may generate a library of use cases. When the object code of the item 1 is to be tested, a test case 1 and a test case 2 are generated by the case library 1 and the case library 2 of the item 1, and test interfaces in the object code are tested by the test case 1 and the test case 2.
In this embodiment, a framework developer edits an automation test code template of an item, a tester generates an automation code based on a test case written by the template, and the written case is uploaded to a system.
According to different projects, flexible output is adapted to corresponding automatic test code templates, and test cases are generated according to the templates. The test case can pre-extract the pre-set condition, the post-set condition, the complex scene logic and the data dependent logic, so that excessive redundant codes are avoided. The uploaded use cases are marked with versions, so that the history of the use cases can be managed conveniently.
After the obtained test case codes are scanned for the change range of the service codes based on an automatic test framework, the interfaces to be tested covered by the change are accurately screened out, the corresponding test cases are used, the test cases are executed in batches, and a unified test report is output.
And calculating all upper interfaces influenced by the modification of the bottom code according to the code modification range and based on an algorithm, and precisely screening out test cases to be executed.
The inquired use cases are aggregated and assembled into an automatic test execution use case set for the automatic test system to execute the use case set, and a test report is returned.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
According to another aspect of the embodiments of the present application, there is also provided an automatic test apparatus, as shown in fig. 3, including:
a first determining module 302, configured to determine a difference code between the target code and the history version code when the target code is acquired; the historical version code is the last version code of the target code;
a second determining module 304, configured to determine a test interface to be tested according to the difference code;
and the test module 306 is used for acquiring test cases corresponding to the test interfaces from the case library and testing object codes by utilizing the test cases.
Alternatively, the embodiment can be applied in the process of automatic testing of project codes. In the project development process, code adjustment is involved, and differences exist between different versions of code. In this embodiment, the difference code of the object code compared to the previous version may be acquired. The target code is the developed code, and the code of the last version is the code before the current development.
When the difference code is obtained, the code segment where the newly added code is located, the code segment where the deleted code is located, and the code segment where the modified code is located can be used as the difference code. The code segments refer to segments made up of a predetermined number of code lines.
When determining the test interfaces to be tested, it can be determined according to the difference codes, which interfaces are affected by the change of the codes, namely, the content of the interfaces is changed. Then the affected interface may be used as the test interface to be tested. Each test interface may correspond to one or more use case sets. And testing the test interface in the target code by using the case set to obtain a test result.
According to the embodiment, when the target code is tested, a difference code of the target code compared with the previous version is determined, a test interface to be tested is determined according to the difference code, and the target code is tested by using a test case corresponding to the test interface. Thereby realizing the purpose of improving the test efficiency.
As an alternative example, the second determining module includes:
the first determining unit is used for determining a first test interface corresponding to the difference code;
an acquisition unit configured to acquire a second test interface associated with the first test interface;
the second determining unit is used for taking the first test interface and the second test interface as test interfaces to be tested.
Alternatively, in this embodiment, when determining the test interface to be tested, the first test interface corresponding to the difference code may be determined first, and then the second test interface associated with the first test interface may be determined. When the first test interface is determined, specific content of the difference code can be checked, and according to keywords in the difference code, an interface corresponding to the keywords is determined to be used as the first test interface. And taking the first test interface and the second test interface as test interfaces to be tested.
As an alternative example, the acquisition unit includes:
the determining subunit is used for taking an interface belonging to the same webpage as the first test interface as a second test interface; and/or taking the interface called by the first test interface as a second test interface; and/or an interface calling the first test interface is used as a second test interface.
Optionally, in this embodiment, when determining the second test interface according to the first test interface, the following provides several cases:
1. and taking the interface which belongs to the unified page together with the first test interface as a second test interface.
Alternatively, in this embodiment, if the code of the interface 1 changes, the interface 1 is used as the first test interface. At the same time, the interface 2 and the interface 1 belong to the same interface in one page, and therefore, the interface 2 serves as a second test interface to be tested.
2. And taking the interface called by the first test interface as a second test interface.
Alternatively, in this embodiment, if the code of the interface 1 changes, the interface 1 is used as the first test interface. At the same time, the interface 1 calls the interface 2, and the interface 2 serves as a second test interface to be tested.
3. And taking the interface which calls the first test interface as a second test interface.
Alternatively, in this embodiment, if the code of the interface 1 changes, the interface 1 is used as the first test interface. At the same time, the interface 2 calls the interface 1, and the interface 2 serves as a second test interface to be tested.
As an alternative example, the test module includes:
the third determining unit is used for determining the current interface in the test interface and acquiring an interface mark of the current interface; the current interface is any test interface;
and the searching unit is used for searching the test case for testing the current interface from the case library according to the interface mark.
Optionally, in this embodiment, after determining the test interfaces to be tested, the interface identifier of each test interface may be obtained. Since each test interface corresponds to a test case in the case library. Therefore, the test cases of the test interface can be searched from the case library through the interface marks of the test interface.
In this embodiment, each item may correspond to one or more use case libraries, where each use case library includes use cases for testing interfaces. Under the condition that the test case to be tested is determined, if a case library exists, determining the test case from the case library. If there are multiple case libraries, one or more test cases are determined from each of the case libraries.
As an alternative example, the apparatus further comprises:
a third determining module, configured to determine a code template corresponding to the code item before determining a difference code between the target code and the history version code;
and the generating module is used for generating test cases for testing the code items according to the code templates.
Alternatively, in this embodiment, a plurality of code templates may be preset. When the test cases are generated, the corresponding test cases can be directly generated according to the content filled in one or more code templates.
As an alternative example, the generating module includes:
the first generation unit is used for generating an initial test case for testing the code item by utilizing the code template;
the deleting unit is used for deleting the target code in the initial test case to obtain the test case; the object code comprises at least one of a pre-condition code, a post-condition code, a scene logic code and a data dependent logic code.
Alternatively, the code template in this embodiment may be a template for generating test cases. Each item may correspond to one or more templates. One or more test cases may be generated for each template for each item. After determining the test interface to be tested of the project, determining one or more test cases in each case library of the project.
When the test case is generated according to the template, the initial test case can be generated according to the template, and then at least one of the pre-condition code, the post-condition code, the scene logic code and the data dependent logic code in the initial test case is deleted to obtain the test case. The pre-condition codes refer to codes required to be called before the current codes are called, and the post-condition codes refer to codes which are called in a correlated way after the current codes are called. The scene logic code refers to a code capable of reflecting the scene where the initial test case is located, such as a code representing which platform where the initial test case is located. Data-dependent logic code refers to code that has a dependency relationship, such as execution of code 1 requires the execution result of code 2 to be relied upon. The dependent code 2 may be deleted.
As an alternative example, the generating module includes:
the second generating unit is used for generating an initial test case for testing the code item by using the code template; and generating a version mark corresponding to the initial test case to obtain the test case.
Alternatively, the test case in this embodiment may include a version. The versions may be sequential. Differentiated by different version flags. When testing the test interface to be tested, the test interface can be tested by using the test case of the latest version, or the test case of the version matched with the test interface is selected to test the test interface.
For other examples of this embodiment, please refer to the above examples, and are not described herein.
Fig. 4 is a block diagram of an alternative electronic device, according to an embodiment of the present application, including a processor 402, a communication interface 404, a memory 406, and a communication bus 408, as shown in fig. 4, wherein the processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408, wherein,
a memory 406 for storing a computer program;
processor 402, when executing a computer program stored on memory 406, performs the following steps:
under the condition that the target code is acquired, acquiring a change code of the target code, which is changed compared with the previous version;
under the condition that the target code is acquired, determining a difference code between the target code and the historical version code; the historical version code is the last version code of the target code;
determining a test interface to be tested according to the difference code;
and acquiring test cases corresponding to the test interfaces from the case library, and testing object codes by utilizing the test cases.
Alternatively, in the present embodiment, the above-described communication bus may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 4, but not only one bus or one type of bus. The communication interface is used for communication between the electronic device and other devices.
The memory may include RAM or may include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
As an example, the memory 406 may include, but is not limited to, the first determination module 302, the second determination module 304, and the test module 306 in the automatic test equipment. In addition, other module units in the processing apparatus of the above request may be included, but are not limited to, and are not described in detail in this example.
The processor may be a general purpose processor and may include, but is not limited to: CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but also DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the structure shown in fig. 4 is only illustrative, and the device implementing the automatic test method may be a terminal device, and the terminal device may be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, a palm computer, a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 4 is not limited to the structure of the electronic device described above. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 4, or have a different configuration than shown in FIG. 4.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program for instructing a terminal device to execute in association with hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, etc.
According to yet another aspect of embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program when executed by a processor performs the steps in the above-described automatic test method.
Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present invention.
In the foregoing embodiments of the present invention, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (10)

1. An automatic test method, comprising:
determining a difference code between the target code and a historical version code under the condition that the target code is acquired; wherein the history version code is a last version code of the object code;
determining a test interface to be tested according to the difference code;
and obtaining test cases corresponding to the test interfaces from a case library, and testing the target codes by utilizing the test cases.
2. The method of claim 1, wherein determining the test interface to be tested based on the difference code comprises:
determining a first test interface corresponding to the difference code;
acquiring a second test interface associated with the first test interface;
and taking the first test interface and the second test interface as test interfaces to be tested.
3. The method of claim 2, wherein the acquiring a second test interface associated with the first test interface comprises:
taking an interface belonging to the same webpage as the first test interface as the second test interface; and/or
Taking the interface called by the first test interface as the second test interface; and/or
And taking the interface which calls the first test interface as the second test interface.
4. The method of claim 1, wherein the obtaining test cases corresponding to the test interface from a case library comprises:
determining a current interface in the test interfaces, and acquiring an interface mark of the current interface; the current interface is any one of the test interfaces;
and searching a test case for testing the current interface from the case library according to the interface mark.
5. The method of claim 1, wherein prior to determining the difference code between the object code and the historical version code, the method further comprises:
determining a code template corresponding to the code item;
and generating a test case for testing the code item according to the code template.
6. The method of claim 5, wherein generating test cases for testing the code items from the code templates comprises:
generating an initial test case for testing the code item by using the code template;
deleting the target code in the initial test case to obtain the test case; the object code comprises at least one of a pre-condition code, a post-condition code, a scene logic code and a data dependent logic code.
7. The method of claim 5, wherein generating test cases for testing the code items from the code templates comprises:
generating an initial test case for testing the code item by using the code template;
and generating a version mark corresponding to the initial test case to obtain the test case.
8. An automatic test equipment, comprising:
the first determining module is used for determining a difference code between the target code and the historical version code under the condition that the target code is acquired; wherein the history version code is a last version code of the object code;
the second determining module is used for determining a test interface to be tested according to the difference code;
and the test module is used for acquiring test cases corresponding to the test interfaces from a case library and testing the target codes by utilizing the test cases.
9. A computer-readable storage medium, having stored thereon a computer program, characterized in that the computer program, when executed by a processor, performs the method of any of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 7 by means of the computer program.
CN202210864323.XA 2022-07-21 2022-07-21 Automatic test method, device, storage medium and electronic equipment Pending CN117472724A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210864323.XA CN117472724A (en) 2022-07-21 2022-07-21 Automatic test method, device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210864323.XA CN117472724A (en) 2022-07-21 2022-07-21 Automatic test method, device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117472724A true CN117472724A (en) 2024-01-30

Family

ID=89622551

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210864323.XA Pending CN117472724A (en) 2022-07-21 2022-07-21 Automatic test method, device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117472724A (en)

Similar Documents

Publication Publication Date Title
CN107896244B (en) Version file distribution method, client and server
CN108459962B (en) Code normalization detection method and device, terminal equipment and storage medium
CN108920359B (en) Application program testing method and device, storage medium and electronic device
CN111522738A (en) Test method and device of micro-service system, storage medium and electronic equipment
CN108829588B (en) Processing method, deployment system and device for testing application program
CN113448862B (en) Software version testing method and device and computer equipment
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN107220066B (en) Method and device for releasing application software in application store
CN110569194A (en) interface testing method and device, electronic equipment and storage medium
CN111651358B (en) Method for generating test case, software test method, device and server
CN111459509A (en) Container mirror image construction method and device and server
CN114237754A (en) Data loading method and device, electronic equipment and storage medium
CN117472724A (en) Automatic test method, device, storage medium and electronic equipment
CN112631931B (en) Version testing method and device, storage medium and electronic equipment
US11347533B2 (en) Enhanced virtual machine image management system
CN112416750A (en) Application program boundary testing method and system
CN115437903A (en) Interface test method, device, apparatus, storage medium, and program
CN112346994A (en) Test information correlation method and device, computer equipment and storage medium
CN111638905A (en) Version number generation method and device, electronic equipment and readable storage medium
CN117493151A (en) Project testing method and device, storage medium and electronic equipment
CN113608996B (en) Mirror image compiling test method, system, device and readable storage medium
CN108628750B (en) Test code processing method and device
CN116431463A (en) Interface automatic test method and device, storage medium and electronic equipment
CN117271309A (en) Service testing method, system, electronic equipment and storage medium
CN113297094A (en) Compatibility testing method and system for mobile phone bank

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