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

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

Info

Publication number
CN116881156A
CN116881156A CN202310919686.3A CN202310919686A CN116881156A CN 116881156 A CN116881156 A CN 116881156A CN 202310919686 A CN202310919686 A CN 202310919686A CN 116881156 A CN116881156 A CN 116881156A
Authority
CN
China
Prior art keywords
code
version
data structure
difference file
tree data
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
CN202310919686.3A
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.)
Nanjing Leading Technology Co Ltd
Original Assignee
Nanjing Leading 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 Nanjing Leading Technology Co Ltd filed Critical Nanjing Leading Technology Co Ltd
Priority to CN202310919686.3A priority Critical patent/CN116881156A/en
Publication of CN116881156A publication Critical patent/CN116881156A/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/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/3688Test management for test execution, e.g. scheduling of test suites
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses an automatic test method, an automatic test device, automatic test equipment and a storage medium. The method comprises the steps of acquiring a new version code and an old version code in the process of releasing service; comparing the new version code with the old version code to determine a difference file; the difference file comprises change information and service link information matched with the change information; according to the difference file, at least one target baseline version is obtained from a preset baseline version library; and acquiring a target automation test case according to the at least one target baseline version, and testing the difference file by using the target automation test case. The technical scheme of the invention effectively improves the comprehensive identification of the change information and the affected upstream and downstream service links, realizes the full test and improves the stability of the release service.

Description

Automatic test method, device, equipment and storage medium
Technical Field
The present invention relates to the field of testing technologies, and in particular, to an automated testing method, apparatus, device, and storage medium.
Background
In the release process of the new version of the system, since there are code changes, and the code changes may involve more upstream and downstream links, it is necessary to determine the code that has changed, and all the upstream and downstream links affected by the changed code. At present, the problems of insufficient test influence on the stability of the release system and the like in the release process of the new version of the system are caused by the fact that the change codes and all the affected upstream and downstream links cannot be comprehensively identified.
Disclosure of Invention
The invention provides an automatic testing method, an automatic testing device, automatic testing equipment and a storage medium, which are used for effectively improving the comprehensive identification of change information and affected upstream and downstream service links, realizing full testing and improving the stability of release service.
According to an aspect of the present invention, there is provided an automated test method comprising:
in the process of releasing service, acquiring a new version code and an old version code;
comparing the new version code with the old version code to determine a difference file; the difference file comprises change information and service link information matched with the change information;
according to the difference file, at least one target baseline version is obtained from a preset baseline version library;
and acquiring a target automation test case according to the at least one target baseline version, and testing the difference file by using the target automation test case.
According to another aspect of the present invention, there is provided an automated testing apparatus comprising:
the code acquisition module is used for acquiring a new version code and an old version code in the process of releasing the service;
the difference file determining module is used for comparing the new version code with the old version code to determine a difference file; the difference file comprises change information and service link information matched with the change information;
the baseline version acquisition module is used for acquiring at least one target baseline version from a preset baseline version library according to the difference file;
and the testing module is used for acquiring a target automatic testing case according to the at least one target baseline version, and testing the difference file by utilizing the target automatic testing case.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the automated test method of any of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute an automated test method according to any of the embodiments of the present invention.
According to the technical scheme, the new version code and the old version code are obtained in the service release process; comparing the new version code with the old version code to determine a difference file; the difference file comprises change information and service link information matched with the change information; according to the difference file, at least one target baseline version is obtained from a preset baseline version library; according to the technical means that the target automatic test case is used for testing the difference file, the problems that in the prior art, a change code and all affected upstream and downstream links cannot be comprehensively identified, and the stability of a release system is affected due to insufficient testing in the release process of a new version of the system are solved, the comprehensive identification of change information and the affected upstream and downstream service links is effectively improved, the full testing is realized, and the stability of release service is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an automated testing method according to a first embodiment of the present invention;
FIG. 2a is a flow chart of another automated testing method according to a second embodiment of the present invention;
FIG. 2b is a schematic diagram of a complete application of an automated test according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an automatic testing device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing an automated test method according to an embodiment of the present 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.
Example 1
Fig. 1 is a flowchart of an automatic testing method according to a first embodiment of the present invention, where the method may be performed by an automatic testing device, and the automatic testing device may be implemented in hardware and/or software, and the automatic testing device may be configured in a server publishing system. As shown in fig. 1, the method includes:
s110, acquiring a new version code and an old version code in the service release process.
Optionally, in the process of releasing the service, acquiring the new version code and the old version code may include: determining code parameter information according to a user instruction; the code parameter information comprises a service name, a service branch and a warehouse address; and acquiring the new version code and the old version code according to the code parameter information.
The user instruction may be an instruction issued by the user through the issuing system, and the user instruction may refer to parameter information input by the user through the issuing system, such as a service name, a service branch, and a repository address (for example, a Git address).
In this embodiment, in the process of issuing a service, by inputting dynamic parameters such as a service name, a service branch, a Git address, etc. into the issuing system, the new version of branch/tag code and the old version of branch/tag code are downloaded to the server and stored in two different directories respectively.
S120, comparing the new version code with the old version code to determine a difference file; the difference file includes change information and service link information matched with the change information.
Wherein the difference file may reflect a code change range of the new version code as compared to the old version code. The change information may refer to a change code, and the service link information may refer to upstream and downstream link information of a service affected by the change code.
In this embodiment, after the new version code and the old version code are acquired, the code modification range and the judgment of the associated link may be dynamically triggered. In the judging process, the code change range between the new version and the old version is determined by technical means such as difference comparison, all affected services are identified by technical means such as code metadata information and dependency analysis, a service dependency tree is formed, and meanwhile, the information of all upstream links and downstream links is obtained by analyzing and calculating the service dependency relationship.
In an alternative embodiment, comparing the new version code with the old version code, determining the difference file may include: forming a first hash tree data structure by the new version codes according to the code file catalogue, and forming a second hash tree data structure by the old version codes according to the code file catalogue; in the first hash tree data structure and the second hash tree data structure, leaf nodes are code files, and non-leaf nodes are catalogues of the code files; comparing leaf nodes of the same level in the first hash tree data structure and the second hash tree data structure to obtain a comparison result; determining service link information according to the comparison result; and determining a difference file according to the comparison result and the service link information.
Specifically, the downloaded branch/tag codes of the new version and the old version may be formed into a data structure of a hash tree according to the directory of the code file, that is, the new version corresponds to a data structure of the hash tree (that is, a first hash tree data structure), and the old version corresponds to a data structure of the hash tree (that is, a second hash tree data structure). In the two hash tree data structures, leaf nodes are Java files (namely code files), non-leaf nodes are directories where Java files correspond to, the data structures of the two hash trees are compared, leaf nodes of the same level are compared specifically, a comparison result of a code change range is obtained, and service link information of service affected by code change is determined according to the comparison result; and determining a difference file according to the comparison result and the service link information.
Based on the above optional embodiment, comparing leaf nodes of the same level in the first hash tree data structure and the second hash tree data structure to obtain a comparison result may include: if the names of leaf nodes of the same level in the first hash tree data structure and the second hash tree data structure are the same, the MD5 values of the files are different, and a modification class code is determined according to the current code file corresponding to the current leaf node of the first hash tree data structure; if the leaf node of the first hash tree data structure does not exist in the second hash tree data structure, determining a new class code according to the current code file corresponding to the current leaf node.
Specifically, if the leaf node names are the same, but the file MD5 values are different, the class is described as a modified class; if the leaf node of the new version code branch does not exist in the old version code branch, the class is described as a new class; if the leaf node of the old version code branch does not exist in the new version code branch, the class is the deletion class, and the code deleting the call cannot count the coverage rate, so that the class is ignored. Thus, the comparison result after the comparison is the modified class code and the newly added class code.
Further, determining the modified class code according to the current code file corresponding to the current leaf node of the first hash tree data structure may include: analyzing a current code file corresponding to the first hash tree data structure to obtain each first type of method and MD5 values of each first type of method; analyzing a current code file corresponding to the second hash tree data structure to obtain each second class method and MD5 values of each second class method; if the first type method is the same as the second type method and the MD5 value is different, determining the current first type method as a modification type method; if the first type of method does not have the corresponding second type of method, determining the current first type of method as a new type of method.
Specifically, all methods and corresponding MD5 values can be resolved for the modification class, all methods of the modification class and the MD5 values thereof in the old code are sequentially compared, and all newly added methods, modified methods and deleted methods (the deleted methods cannot be directly ignored in statistics) in the modification class are obtained, and all methods are newly added methods for the newly added class. At this time, the comparison result is a modified class code, a newly added class code, a modified class method, and a newly added class method.
Further, on the basis of the comparison result, determining service link information according to the comparison result may include: and analyzing the service dependency relationship corresponding to the modified class code, the newly added class code, the modified class method and the newly added class method, and determining service link information.
Further, all new added classes, modified classes and information of new added methods and modified methods are stored in a database, a difference file between a new version and an old version is generated and stored, and all service and link information related in the difference file is classified and recorded according to the dimensions of functional points, service components and the like.
S130, acquiring at least one target baseline version from a preset baseline version library according to the difference file.
The target baseline version may refer to a baseline version matched with the difference file in a preset baseline version library. The baseline version is a code version subjected to perfect test, verification and version management and can be used as a released reference version so as to improve the stability and reliability of the system.
S140, acquiring a target automation test case according to at least one target baseline version, and testing the difference file by using the target automation test case.
In this embodiment, for at least one target baseline version, a corresponding target automation test case may be automatically generated, and the difference file may be further tested by using the target automation test case.
According to the technical scheme, the new version code and the old version code are obtained in the service release process; comparing the new version code with the old version code to determine a difference file; the difference file comprises change information and service link information matched with the change information; according to the difference file, at least one target baseline version is obtained from a preset baseline version library; according to the technical means that the target automatic test case is used for testing the difference file, the problems that in the prior art, a change code and all affected upstream and downstream links cannot be comprehensively identified, and the stability of a release system is affected due to insufficient testing in the release process of a new version of the system are solved, the comprehensive identification of change information and the affected upstream and downstream service links is effectively improved, the full testing is realized, and the stability of release service is improved.
Example two
Fig. 2a is a flowchart of another automatic testing method according to the second embodiment of the present invention, where based on the foregoing embodiment, at least one target baseline version is obtained from a preset baseline version library according to a difference file to refine the difference file, and after the difference file is tested by using a target automatic test case, the operation is further added. As shown in fig. 2a, the method comprises:
s210, acquiring a new version code and an old version code in the service release process.
S220, comparing the new version code with the old version code to determine a difference file; the difference file includes change information and service link information matched with the change information.
S230, respectively acquiring attribute description information of change information and service link information; the attribute description information includes type information and scale information.
The attribute description information of the change information may refer to the type and scale of the change code. The attribute description information of the service link information may refer to the type and size of the upstream and downstream links.
S240, according to the attribute description information, determining the matching degree of the change information and the service link information with each baseline version in the preset baseline version library respectively.
In this embodiment, for example, the type information and the scale information in the attribute description information may be weighted, and the degree of matching between the change information and the service link information and each baseline version may be determined.
S250, acquiring at least one target baseline version from a preset baseline version library according to the matching degree.
In this embodiment, one or more target baseline versions of the most suitable difference file may be obtained from a preset baseline version library according to the matching degree.
S260, acquiring a target automation test case according to at least one target baseline version, and testing the difference file by utilizing the target automation test case to acquire a test result.
Optionally, the difference file may be tested by using the target automation test case, which may be testing the change information and the service link information matched with the change information.
For example, the parameter a in the old version code is modified to the parameter a in the new version code, and the service link information of the parameter a in the new version code is b→a→c, that is, a depends on B, and C depends on a, so that the service link information of b→a→c needs to be tested in addition to the test of a by using the target automation test case.
In this embodiment, for at least one target baseline version, a corresponding target automation test case may be automatically generated. The target automatic test case is a representative test case automatically generated according to the code changing requirement and the functional point requirement. The target automation test case can test the modified code to ensure that the potential problem is resolved. Meanwhile, the target automation test case can also ensure the stability and compatibility of codes. And for the automatically generated target automatic test cases, testing by using an automatic test tool. And in the test process, the function and compatibility of the changed code can be tested, so that the problem after release is avoided. After the test is completed, a test result is obtained, and the test result can be compared with the change information and the service link information in the difference file to ensure that the test result meets the expectations.
S270, analyzing the test result to obtain the automatic coverage rate and the smoking result.
And S280, generating a test report according to the automatic coverage rate and the smoking result and displaying the test report to a user.
In this embodiment, after the target automation test case test in S260 is performed, an algorithm model may be invoked to dynamically analyze the test result, obtain a statistical analysis result of the automation coverage rate and the smoking result, generate a test report, and display the test report to the user. In the test report, the analysis result of coverage, problem statistics, solution descriptions, and the like may be included. And analyzing the test result and the existing problems according to the test report, and determining the release service version. Based on the result of automatic test and the test report, the test case can be adjusted, the test system is continuously perfected, and the test precision and efficiency are improved.
Fig. 2b is a schematic diagram of a complete application of an automated test according to a second embodiment of the present invention. In the process of releasing service, the code variation range (namely changing information) and the content of all affected service links (namely service link information) are obtained, so that a difference file is generated, a test case is obtained based on the difference file for testing, and the coverage rate and the smoking result are calculated according to the test result.
According to the technical scheme, the new version code and the old version code are obtained in the service release process; comparing the new version code with the old version code to determine a difference file; the difference file comprises change information and service link information matched with the change information; respectively acquiring attribute description information of change information and service link information; the attribute description information includes type information and scale information; determining the matching degree of the change information and the service link information with each baseline version in a preset baseline version library according to the attribute description information; according to the matching degree, at least one target baseline version is obtained from a preset baseline version library; acquiring a target automatic test case according to at least one target baseline version, and testing the difference file by utilizing the target automatic test case to acquire a test result; analyzing the test result to obtain an automatic coverage rate and a smoking result; the method solves the problem that the stability of the release system is affected due to insufficient test in the release process of the new version of the system, effectively improves the comprehensive identification of the change information and the affected upstream and downstream service links, realizes the full test and improves the stability of the release service.
Example III
Fig. 3 is a schematic structural diagram of an automatic testing device according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes: a code acquisition module 310, a difference file determination module 320, a baseline version acquisition module 330, and a test module 340. Wherein:
a code obtaining module 310, configured to obtain a new version code and an old version code in a service release process;
a difference file determining module 320, configured to compare the new version code and the old version code, and determine a difference file; the difference file comprises change information and service link information matched with the change information;
the baseline version obtaining module 330 is configured to obtain at least one target baseline version from a preset baseline version library according to the difference file;
and the testing module 340 is configured to obtain a target automation test case according to the at least one target baseline version, and test the difference file by using the target automation test case.
According to the technical scheme, the new version code and the old version code are obtained in the service release process; comparing the new version code with the old version code to determine a difference file; the difference file comprises change information and service link information matched with the change information; according to the difference file, at least one target baseline version is obtained from a preset baseline version library; according to the technical means that the target automatic test case is used for testing the difference file, the problems that in the prior art, a change code and all affected upstream and downstream links cannot be comprehensively identified, and the stability of a release system is affected due to insufficient testing in the release process of a new version of the system are solved, the comprehensive identification of change information and the affected upstream and downstream service links is effectively improved, the full testing is realized, and the stability of release service is improved.
Optionally, the code obtaining module 310 may specifically be configured to:
determining code parameter information according to a user instruction; the code parameter information comprises a service name, a service branch and a warehouse address;
and acquiring the new version code and the old version code according to the code parameter information.
Optionally, the difference file determining module 320 may include:
the hash tree data structure composing unit is used for composing the new version code into a first hash tree data structure according to a code file directory, and composing the old version code into a second hash tree data structure according to a code file directory;
in the first hash tree data structure and the second hash tree data structure, leaf nodes are code files, and non-leaf nodes are catalogues of the code files;
the comparison result acquisition unit is used for comparing leaf nodes of the same level in the first hash tree data structure and the second hash tree data structure to acquire a comparison result;
a service link information determining unit configured to determine the service link information according to the comparison result;
and the difference file determining unit is used for determining the difference file according to the comparison result and the service link information.
Optionally, the comparison result obtaining unit includes:
a modified class code determining subunit, configured to determine, if the leaf node names of the same level in the first hash tree data structure and the second hash tree data structure are the same, the file MD5 values are different, and determine a modified class code according to a current code file corresponding to a current leaf node of the first hash tree data structure;
and the newly added class code determining subunit is used for determining the newly added class code according to the current code file corresponding to the current leaf node if the leaf node of the first hash tree data structure does not exist in the second hash tree data structure.
Optionally, the modification class code determination subunit may be specifically configured to:
analyzing the current code file corresponding to the first hash tree data structure to obtain each first type of method and MD5 values of each first type of method;
analyzing the current code file corresponding to the second hash tree data structure to obtain each second type of method and MD5 value of each second type of method;
if the first type method is the same as the second type method and the MD5 value is different, determining the current first type method as a modification type method;
if the first type of method does not have the corresponding second type of method, determining the current first type of method as a new type of method.
Optionally, the service link information determining unit may specifically be configured to:
and analyzing the service dependency relationship corresponding to the modification class code, the new class code, the modification class method and the new class method, and determining the service link information.
Optionally, the baseline version obtaining module 330 may specifically be configured to:
respectively acquiring the change information and the attribute description information of the service link information; the attribute description information comprises type information and scale information;
determining the matching degree of the change information and the service link information with each baseline version in a preset baseline version library according to the attribute description information;
and according to the matching degree, acquiring at least one target baseline version from a preset baseline version library.
Optionally, the automated testing device further includes a test report display module, configured to, after testing the difference file with the target automated test case:
obtaining a test result;
analyzing the test result to obtain an automatic coverage rate and a smoking result;
and generating a test report according to the automatic coverage rate and the smoking result and displaying the test report to a user.
The automatic testing device provided by the embodiment of the invention can execute the automatic testing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 shows a schematic diagram of an electronic device 400 that may be used to implement an embodiment of the invention. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 400 includes at least one processor 401, and a memory communicatively connected to the at least one processor 401, such as a Read Only Memory (ROM) 402, a Random Access Memory (RAM) 403, etc., in which the memory stores a computer program executable by the at least one processor, and the processor 401 may perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 402 or the computer program loaded from the storage unit 408 into the Random Access Memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 may also be stored. The processor 401, the ROM 402, and the RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Various components in electronic device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, etc.; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408, such as a magnetic disk, optical disk, etc.; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the electronic device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Processor 401 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 401 performs the various methods and processes described above, such as automated testing methods.
In some embodiments, the automated test method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 400 via the ROM 402 and/or the communication unit 409. When a computer program is loaded into RAM 403 and executed by processor 401, one or more steps of the automated test method described above may be performed. Alternatively, in other embodiments, the processor 401 may be configured to perform the automated test method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (11)

1. An automated testing method, comprising:
in the process of releasing service, acquiring a new version code and an old version code;
comparing the new version code with the old version code to determine a difference file; the difference file comprises change information and service link information matched with the change information;
according to the difference file, at least one target baseline version is obtained from a preset baseline version library;
and acquiring a target automation test case according to the at least one target baseline version, and testing the difference file by using the target automation test case.
2. The method of claim 1, wherein acquiring the new version code and the old version code during the release of the service comprises:
determining code parameter information according to a user instruction; the code parameter information comprises a service name, a service branch and a warehouse address;
and acquiring the new version code and the old version code according to the code parameter information.
3. The method of claim 1, wherein comparing the new version code and the old version code, determining a difference file, comprises:
forming a first hash tree data structure by the new version codes according to the code file catalogue, and forming a second hash tree data structure by the old version codes according to the code file catalogue;
in the first hash tree data structure and the second hash tree data structure, leaf nodes are code files, and non-leaf nodes are catalogues of the code files;
comparing leaf nodes of the same level in the first hash tree data structure and the second hash tree data structure to obtain a comparison result;
determining the service link information according to the comparison result;
and determining the difference file according to the comparison result and the service link information.
4. A method according to claim 3, wherein comparing leaf nodes of the same level in the first hash tree data structure and the second hash tree data structure to obtain a comparison result comprises:
if the names of leaf nodes of the same level in the first hash tree data structure and the second hash tree data structure are the same, the MD5 values of the files are different, and a modified class code is determined according to the current code file corresponding to the current leaf node of the first hash tree data structure;
and if the leaf node of the first hash tree data structure does not exist in the second hash tree data structure, determining a new class code according to the current code file corresponding to the current leaf node.
5. The method of claim 4, wherein determining a modified class code from a current code file corresponding to a current leaf node of the first hash tree data structure comprises:
analyzing the current code file corresponding to the first hash tree data structure to obtain each first type of method and MD5 values of each first type of method;
analyzing the current code file corresponding to the second hash tree data structure to obtain each second type of method and MD5 value of each second type of method;
if the first type method is the same as the second type method and the MD5 value is different, determining the current first type method as a modification type method;
if the first type of method does not have the corresponding second type of method, determining the current first type of method as a new type of method.
6. The method of claim 5, wherein determining the service link information based on the comparison result comprises:
and analyzing the service dependency relationship corresponding to the modification class code, the new class code, the modification class method and the new class method, and determining the service link information.
7. The method of claim 1, wherein obtaining at least one target baseline version from a preset baseline version library based on the difference file comprises:
respectively acquiring the change information and the attribute description information of the service link information; the attribute description information comprises type information and scale information;
determining the matching degree of the change information and the service link information with each baseline version in a preset baseline version library according to the attribute description information;
and according to the matching degree, acquiring at least one target baseline version from a preset baseline version library.
8. The method of claim 1, further comprising, after testing the difference file with the target automated test case:
obtaining a test result;
analyzing the test result to obtain an automatic coverage rate and a smoking result;
and generating a test report according to the automatic coverage rate and the smoking result and displaying the test report to a user.
9. An automated test equipment, comprising:
the code acquisition module is used for acquiring a new version code and an old version code in the process of releasing the service;
the difference file determining module is used for comparing the new version code with the old version code to determine a difference file; the difference file comprises change information and service link information matched with the change information;
the baseline version acquisition module is used for acquiring at least one target baseline version from a preset baseline version library according to the difference file;
and the testing module is used for acquiring a target automatic testing case according to the at least one target baseline version, and testing the difference file by utilizing the target automatic testing case.
10. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the automated test method of any of claims 1-8.
11. A computer readable storage medium storing computer instructions for causing a processor to implement the automated test method of any of claims 1-8 when executed.
CN202310919686.3A 2023-07-25 2023-07-25 Automatic test method, device, equipment and storage medium Pending CN116881156A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310919686.3A CN116881156A (en) 2023-07-25 2023-07-25 Automatic test method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310919686.3A CN116881156A (en) 2023-07-25 2023-07-25 Automatic test method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116881156A true CN116881156A (en) 2023-10-13

Family

ID=88256656

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310919686.3A Pending CN116881156A (en) 2023-07-25 2023-07-25 Automatic test method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116881156A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117215965A (en) * 2023-11-09 2023-12-12 恒生电子股份有限公司 Test case identification-based test method and device, electronic equipment and medium
CN117435243A (en) * 2023-12-14 2024-01-23 南京掌控网络科技有限公司 Automatic package combination and deployment method and system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117215965A (en) * 2023-11-09 2023-12-12 恒生电子股份有限公司 Test case identification-based test method and device, electronic equipment and medium
CN117215965B (en) * 2023-11-09 2024-02-27 恒生电子股份有限公司 Test case identification-based test method and device, electronic equipment and medium
CN117435243A (en) * 2023-12-14 2024-01-23 南京掌控网络科技有限公司 Automatic package combination and deployment method and system
CN117435243B (en) * 2023-12-14 2024-04-09 南京掌控网络科技有限公司 Automatic package combination and deployment method and system

Similar Documents

Publication Publication Date Title
CN116881156A (en) Automatic test method, device, equipment and storage medium
CN112328499A (en) Test data generation method, device, equipment and medium
CN115576828A (en) Test case generation method, device, equipment and storage medium
CN116303013A (en) Source code analysis method, device, electronic equipment and storage medium
CN115576831A (en) Test case recommendation method, device, equipment and storage medium
CN115328736A (en) Probe deployment method, device, equipment and storage medium
CN114722401A (en) Equipment safety testing method, device, equipment and storage medium
CN115017047A (en) Test method, system, equipment and medium based on B/S architecture
CN114546799A (en) Point burying log checking method and device, electronic equipment, storage medium and product
CN117150215B (en) Assessment result determining method and device, electronic equipment and storage medium
CN116483735B (en) Method, device, storage medium and equipment for analyzing influence of code change
CN116955504B (en) Data processing method and device, electronic equipment and storage medium
CN116974856B (en) Method, device, equipment and medium for automatically acquiring log file
CN116166501B (en) Log verification method and device, electronic equipment and storage medium
CN115757928A (en) Data query method and device, electronic equipment and storage medium
CN115858367A (en) Test case screening method, device, equipment and medium
CN117093582A (en) Service test data checking method and device, electronic equipment and storage medium
CN115756575A (en) Submission record acquisition method, device, equipment and storage medium
CN117670128A (en) Data processing method and device
CN117667704A (en) Configuration parameter detection method and device, electronic equipment and storage medium
CN118152356A (en) Log acquisition system, method and device and storage medium
CN117609625A (en) Data processing method, device, electronic equipment and storage medium
CN117395145A (en) SDH transmission network data processing method, device, equipment and storage medium of CMDB
CN115794609A (en) Script sharing method and device, electronic equipment and storage medium
CN117609064A (en) Unit test method and device, electronic equipment and storage 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