CN113760765B - Code testing method and device, electronic equipment and storage medium - Google Patents

Code testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113760765B
CN113760765B CN202111058908.4A CN202111058908A CN113760765B CN 113760765 B CN113760765 B CN 113760765B CN 202111058908 A CN202111058908 A CN 202111058908A CN 113760765 B CN113760765 B CN 113760765B
Authority
CN
China
Prior art keywords
file
identifier
code
version code
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111058908.4A
Other languages
Chinese (zh)
Other versions
CN113760765A (en
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111058908.4A priority Critical patent/CN113760765B/en
Publication of CN113760765A publication Critical patent/CN113760765A/en
Application granted granted Critical
Publication of CN113760765B publication Critical patent/CN113760765B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/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/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The disclosure provides a code testing method, a code testing device, electronic equipment and a storage medium, and relates to the technical field of computers, in particular to the field of code testing and the field of deep learning. The specific implementation scheme of the code testing method is as follows: determining a first identifier for a first package file, wherein the first package file is a package file of a first version code; determining a second identifier for a second packaged file, wherein the second packaged file is a packaged file of a second version code; and performing performance test on the second version code under the condition that the first identifier is inconsistent with the second identifier, wherein the second version code is used for updating the first version code under the condition that the second version code passes the test.

Description

Code testing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly to the field of code testing and the field of deep learning; and more particularly, to a code testing method, apparatus, electronic device, and storage medium.
Background
With the development of computer technology, a code framework for realizing various functions is generated in order to facilitate the realization of various application functions. In the case of modifying the code framework according to the business requirement, in order to avoid performance degradation caused by the modification of the code framework, a systematic test including a performance test is required to be performed on the code framework after the modification of the code framework.
Disclosure of Invention
Based on this, the present disclosure provides a code testing method, apparatus, electronic device, and storage medium that improve testing efficiency.
According to an aspect of the present disclosure, there is provided a code testing method including: determining a first identifier for a first package file, wherein the first package file is a package file of a first version code; determining a second identifier for a second packaged file, wherein the second packaged file is a packaged file of a second version code; and performing performance testing on the second version code if the first identifier is inconsistent with the second identifier, wherein the second version code is used to update the first version code if the second version code passes the testing.
According to another aspect of the present disclosure, there is provided a code testing apparatus including: the first identifier determining module is used for determining a first identifier aiming at a first packing file, wherein the first packing file is a packing file of a first version code; a second identifier determining module, configured to determine a second identifier for a second packaged file, where the second packaged file is a packaged file of a second version code; and the first testing module is used for carrying out performance testing on the second version code under the condition that the first identifier is inconsistent with the second identifier, wherein the second version code is used for updating the first version code under the condition that the second version code passes the testing.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the code testing method provided by the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform a code testing method provided by the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the code testing method provided by the present disclosure.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram of an application scenario of a code testing method, apparatus, electronic device and storage medium according to an embodiment of the present disclosure;
FIG. 2 is a flow diagram of a code testing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a code testing method according to an embodiment of the present disclosure;
FIG. 4 is a flow diagram of a code testing method according to another embodiment of the present disclosure;
FIG. 5 is a block diagram of a code testing apparatus according to an embodiment of the present disclosure; and
FIG. 6 is a block diagram of an electronic device for implementing the code testing method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The present disclosure provides a code testing method including an identification determination phase and a performance testing phase. In an identifier determination phase, a first identifier for a first packaged file is determined, and a second identifier for a second packaged file is determined. The second packed file is a packed file of the second version code, and the second packed file is a packed file of the second version code. And under the condition that the first identifier is inconsistent with the second identifier, entering a performance test stage, and carrying out performance test on the second version code. Wherein the second version code is used to update the first version code in the event that the second version code passes the test.
An application scenario of the method and apparatus provided by the present disclosure will be described below with reference to fig. 1.
Fig. 1 is a schematic diagram of an application scenario of a code testing method and apparatus according to an embodiment of the present disclosure.
As shown in fig. 1, the scenario 100 of this embodiment includes a first terminal device 110 and a server 120. The first terminal device 110 may be communicatively coupled to the server 120 via a network. The network may include wired or wireless communication links.
The service person may, for example, modify the code framework providing the service through the first terminal device 110 and upload the modified code 130 to the server 120, so that the server 120 tests the modified code.
The server 120, upon receiving the modified code 130, may retrieve the on-line code 150 providing the service and test the modified code 130 by comparing the on-line code 150 to the modified code 130. The online code 150 may be run on the second terminal device 140, for example, to provide services to the user. It will be appreciated that the inline code 150 may be the basis for modification of the modified code. The online code 150 is the old version code and the modified code 130 is the new version code to be tested.
The second terminal device 140 may also communicate with the server 120 via a network, for example. The second terminal device 140 may be a smartphone, a tablet, a laptop or desktop computer, or the like. Various client applications may be installed in the second terminal device 140, including but not limited to an image processing application, a voice recognition application, a target tracking application, and the like. The server 120 may be a background management server or the like providing support for client applications running in the second terminal device 140.
Where testing modified code 130 may include functional testing, such as comparing whether the functionality provided by modified code 130 is the same as the functionality provided by online code 150. The testing of the modified code 130 may also include performance testing to determine whether a performance metric (e.g., throughput or speed-up ratio, etc.) of the services provided by the modified code 130 meets the demand. Testing of the modified code 130 may also include performing static analysis on the code, etc.
After the test is completed, the server 120 may feed back the test result 160 to the first terminal device 110, so that the service person knows the test result 160. In this manner, the service personnel can determine whether the modified code needs to be adjusted according to the test result 160 until the test is passed.
It should be noted that the code testing method provided in the present disclosure may be generally executed by the server 120, and may also be executed by any other server communicatively connected to the server 120. The code testing apparatus provided in the present disclosure may be provided in the server 120, or may be provided in any other server communicatively connected to the server 120.
It should be understood that the number and types of the first terminal device, the server and the second terminal device in fig. 1 are merely illustrative. There may be any number and type of first terminal device, server, and second terminal device, as desired for implementation.
The code testing method provided by the present disclosure will be described in detail by the following fig. 2 to 4 in conjunction with fig. 1.
As shown in FIG. 2, the code testing method 200 of this embodiment may include operations S210 through S230.
In operation S210, a first identifier for a first package file, which is a package file of a first version code, is determined.
According to an embodiment of the present disclosure, the first version code may be, for example, the aforementioned on-line code. The inline code may be retrieved by switching the execution environment to the original branch. If the online code is issued on the Master branch, the original branch is the Master. If the code on the line is released on the development branch, the original branch is Defelop.
For example, the first version code may be, for example, a code of a deep learning framework, or a code of providing a flight inquiry service or any other service, which is not limited in this disclosure.
For example, the type of the first package file corresponds to the programming language used by the first version of code. If the first version code is java code, the first package file is a jar package or a war package and the like. If the first version code is a python code, the first package file is an whl file, an exe file, or the like. The embodiment can adopt a packing tool existing in the related art to pack the first version code after determining the first version code running on the line, so as to obtain the first packing file.
For example, the first identifier may be a digital fingerprint of the first packaged file, where the digital fingerprint may be an encrypted value of a file calculated by using a message digest algorithm, or may be any identifier uniquely characterizing the first packaged file. The first identifier may be located at a predetermined identifier position of the first package file, and the embodiment may obtain the first identifier by parsing the first package file.
In operation S220, a second identifier for a second packaged file, which is a packaged file of a second version code, is determined.
According to an embodiment of the present disclosure, the second version code may be, for example, a modified code uploaded by the aforementioned service staff. The modification basis for modifying the second version code may be the aforementioned first version code. According to the second version code, the obtaining manner is similar to that of the first package file, and the obtaining manner of the second identifier is similar to that of the first identifier, which is not described herein again.
In operation S230, in case the first identifier is not consistent with the second identifier, a performance test is performed on the second version code.
According to the embodiment of the disclosure, after the first identifier and the second identifier are obtained, consistency comparison can be performed on the first identifier and the second identifier. If the two identifiers are consistent, it may be determined that the modification of the first version code does not affect the modification of the package file, for example, the modification may be performed on an annotation of the first version code, a script configuration of the first version code, or a unit test of the first version code. These modifications do not affect the performance of the functions implemented by the code, i.e., do not affect the body logic of the figures. Therefore, for the second version code with the second identifier consistent with the first identifier, performance test can be omitted, and test efficiency is improved. And if the two identifications are not consistent, modifying the first version code can affect the packed file, and performing performance test on a second version code obtained by modifying the first version code.
The performance test may be used, for example, to test whether a performance index of a service provided by the second version code is attenuated relative to the first version code. Or testing whether the performance index of the service provided by the second version code meets the requirement. The method of performance testing is similar to the related art and will not be described in detail herein.
For example, if the first version code and the second version code are both codes of a deep learning framework, the performance testing method may be: configuring the same software environment and hardware environment for the first version code and the second version code, operating the first version code and the second version code based on the set size of Batch, and determining the performance indexes of the two version codes according to the operation result. The performance indicators may include, for example, the aforementioned throughput rates and speed-up ratios. The throughput rate is the most intuitive evaluation index of the deep learning framework for processing the training data, and can be the number of samples processed by the deep learning framework per second. The speed-up ratio is the most intuitive evaluation index for the distributed expansion capability of the deep learning framework, and can be obtained by dividing the throughput rate of the multi-card parallel operation by the throughput rate of the single-card operation.
By the code testing method, the embodiment can perform performance testing on only modified codes which may affect the performance of the codes, and does not need performance testing on modified codes which do not affect the performance of the codes. Since the performance test process usually consumes most hardware resources compared with other tests in the whole test process of the code, the test period is also longest. Therefore, by adopting the code testing method, hardware resources and testing time consumption can be effectively saved on the basis of ensuring the testing accuracy. Therefore, iterative updating of codes is facilitated, and better service is provided for users.
FIG. 3 is a schematic diagram of a code testing method according to an embodiment of the present disclosure.
According to an embodiment of the present disclosure, the first identifier may be an identifier of each file in the first package file, instead of the identifier of the first package file. The second identifier may be an identifier of each file in the second packaged file, but not an identifier of the second packaged file. In this way, the situation that the first identifier is inconsistent with the second identifier due to the fact that the files in the first packaged file are consistent with the files in the second packaged file but the generation time of the first packaged file is different from that of the second packaged file under the condition that the identifier of the packaged file contains the timestamp can be avoided. Therefore, unnecessary performance tests can be reduced, and hardware resources and test time can be further saved.
According to the embodiment of the disclosure, the first package file may be decompressed first to obtain each file in the first package file. Then, each file is analyzed, and the identification of each file is determined. The identifier of each file may be, for example, an encrypted value of the file obtained by using a message digest algorithm. Similarly, the identity of each file in the second packaged file may be obtained. The decompression of the first and second packaged files may be implemented by a decompression tool in the related art, which is not limited in this disclosure.
For example, the Message Digest Algorithm may be an MD5(Message Digest 5) Algorithm, a Secure Hash (Secure Hash Algorithm) Algorithm, or the like. In the case that the first version code and the second version code are python codes, decompressing the package file of python codes can obtain a RECORD file in which MD5 values of all files in the package file are recorded.
Thus, as shown in fig. 3, in this embodiment 300, the first version code 311 may be compiled first, and a first package file 312 of the first version code 311 is generated. At the same time, the second version code 321 may be compiled to generate a second packaged file 322. Taking python code as an example, whl 1 packages and whl 2 packages can be obtained by compiling two version codes respectively as a first package file and a second package file, respectively. Subsequently, by decompressing the first and second packaged files 312 and 322, respectively, each of the first and second packaged files 312 and 322 can be obtained, respectively. Subsequently, the first object file 313 in which each file identifier is recorded may be selected from each file in the first package file 312, and the second object file 323 in which each file identifier is recorded may be selected from each file in the second package file. Taking python code as an example, the first target file 313 and the second target file 323 are RECORD files, and the identifier of each file is an MD5 value. The identifiers in the first target file 313 (i.e., the first identifiers 314) may then be compared with the identifiers in the second target file 323 (i.e., the second identifiers 324) one by one to determine whether the identifiers in the first target file 313 are completely consistent with the identifiers in the second target file, thereby obtaining a comparison result 330. If there is an inconsistency, a performance test is performed on the second version code 321.
Wherein, for any file, whether it be an executable, an image file, a temporary file, or any other type of file, and regardless of the amount of space occupied by the file, there is and only one unique value of MD5 for the file. If the file is modified, the value of MD5 for the file is also modified. Therefore, this embodiment may use the MD5 value of the file calculated using the MD5 algorithm as the file identifier.
For python code, its whl file may contain a py file and may also contain a compiled pyd file. Where the py file is the source file and the pyd file is a python library written in a language other than the python language. The whl file can enable a program written by python codes to select a proper python environment to realize the installation of the program under the condition that a compiling environment is not available.
It is verified that the code test using the principle described in this embodiment 300 can prune about 20% of performance tests, and can effectively save hardware resources and time consumption of performance tests compared with the related art.
FIG. 4 is a flowchart illustrating a code testing method according to another embodiment of the disclosure.
According to the embodiment of the disclosure, in the case that the first identifier is consistent with the second identifier, other tests besides the performance test can be performed on the second version code. This is because in the case where the identifications are consistent, there is a case where the second version code is obtained by modifying the comment, code example, or unit test of the first version code. By the execution of this other test, the integrity and accuracy of the test can be guaranteed.
For example, other tests may include any tests other than performance tests, such as unit tests, static checking of code, and so forth, and the present disclosure is not limited thereto.
Illustratively, as shown in fig. 4, the embodiment 400 may implement the test of the code through operations S410 to S450. Operation S410 and operation S420 may be executed in parallel, or may be executed sequentially in any order.
In operation S410, a first identification for a first packed file is determined. The operation S410 is similar to the operation S210 described above, and is not described herein again.
In operation S420, a second identification for the second package file is determined. The operation S420 is similar to the operation S220 described above, and is not described herein again.
After the first identifier and the second identifier are obtained, operation S430 is performed to determine whether the first identifier and the second identifier are consistent. If the first identifier is not consistent with the second identifier, operation S440 is performed, otherwise, operation S450 is performed.
In operation S440, a performance test is performed on the second version code. The operation S440 is similar to the operation S230 described above, and is not described herein again.
In operation S450, other tests such as static checking are performed on the second version code. The specific implementation of this other test is similar to the corresponding test performed on the code providing the service in the related art, and this disclosure will not be described in detail here.
Based on the code testing method provided by the disclosure, the disclosure also provides a code testing device. The apparatus will be described in detail below with reference to fig. 5.
Fig. 5 is a block diagram of a code testing apparatus according to an embodiment of the present disclosure.
As shown in fig. 5, the code testing apparatus 500 of this embodiment includes a first identification determination module 510, a second identification determination module 520, and a first testing module 530.
The first identifier determining module 510 is configured to determine a first identifier for a first package file, where the first package file is a package file of a first version code. In an embodiment, the first identifier determining module 510 may be configured to perform the operation S210 described above, which is not described herein again.
The second identifier determining module 520 is configured to determine a second identifier for a second packaged file, where the second packaged file is a packaged file of a second version code. Wherein the second version code may be used to update the first version code in the event that the second version code passes the test. In an embodiment, the second identifier determining module 520 may be configured to perform the operation S220 described above, which is not described herein again.
The first testing module 530 is configured to perform a performance test on the second version code if the first identifier is inconsistent with the second identifier. In an embodiment, the first testing module 530 may be configured to perform the operation S230 described above, which is not described herein again.
According to an embodiment of the present disclosure, the first identifier determining module 510 may be configured to determine an identifier of each file in the first package file, and use the identifier as the first identifier. The second identifier determining module 520 may be configured to determine identifiers of the files in the second packaged file, and use the identifiers as second identifiers.
According to an embodiment of the present disclosure, the first identifier determining module 510 may include a first decompressing sub-module and a first identifier determining sub-module. The first decompression submodule is used for decompressing the first packed file to obtain a first target file recording each file identifier in the first packed file. The first identification determining submodule is used for determining that the identification recorded in the first target file is the first identification.
According to an embodiment of the present disclosure, the second identifier determining module 520 may include a second decompressing sub-module and a second identifier determining sub-module. The second decompression submodule is used for decompressing the second packed file to obtain a second target file for recording each file identifier in the second packed file. The second identification determining submodule is used for determining that the identification recorded in the second target file is the second identification.
According to an embodiment of the present disclosure, at least one of the first identifier and the second identifier includes: and obtaining the encrypted value of the file by adopting a preset message digest algorithm. The first version code and the second version code may be both codes of a deep learning framework.
According to an embodiment of the present disclosure, the code testing apparatus 500 may further include a second testing module, configured to perform other tests except the performance test on the second version code when the first identifier is identical to the second identifier. The second testing module may be configured to perform the operation S450 described above, for example, and is not described herein again.
In the technical scheme of the present disclosure, the processes of acquiring, collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the related user all conform to the regulations of related laws and regulations, and do not violate the good custom of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 6 illustrates a schematic block diagram of an example electronic device 600 that may be used to implement the code testing methods of embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the device 600 comprises a computing unit 601, which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM)602 or loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the device 600 can also be stored. The calculation unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, or the like; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 601 performs the respective methods and processes described above, such as a code test method. For example, in some embodiments, the code testing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the code testing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the code testing method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a 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 that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code 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 this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable 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. 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 a computer 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) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end 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 back-end, 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), and the Internet.
The computer system may include clients and servers. A client and server are generally 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 may be a cloud Server, which is also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service extensibility in a traditional physical host and a VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (13)

1. A code testing method, comprising:
determining a first identifier for a first package file, wherein the first package file is a package file of a first version code;
determining a second identifier for a second packaged file, wherein the second packaged file is a packaged file of a second version code; and
performing a performance test on the second version code in the event that the first identity is not consistent with the second identity,
wherein the second version code is used to update the first version code in the event that the second version code passes the test,
the first identification comprises an encrypted value of each file in the first packed file obtained by adopting a preset message digest algorithm; the second identification comprises an encrypted value of each file in the second packed file obtained by adopting a preset message digest algorithm;
wherein the first package file is generated by compiling the first version code, and the second package file is generated by compiling the second version code.
2. The method of claim 1, wherein the determining an identity of each file in the first bundled files as the first identity comprises:
decompressing the first packing file to obtain a first target file recording each file identifier in the first packing file; and
and determining the identifier recorded in the first target file as the first identifier.
3. The method of claim 1, wherein said determining an identity of each file in the second packaged file as a second identity comprises:
decompressing the second packed file to obtain a second target file recording each file identifier in the second packed file; and
and determining the identifier recorded in the second target file as the second identifier.
4. The method of claim 1, wherein:
the first version code and the second version code are both codes of a deep learning framework.
5. The method of claim 1, further comprising:
and under the condition that the first identifier is consistent with the second identifier, performing other tests except the performance test on the second version code.
6. A code testing apparatus comprising:
the first identifier determining module is used for determining a first identifier aiming at a first package file, wherein the first package file is a package file of a first version code;
a second identifier determining module, configured to determine a second identifier for a second packaged file, where the second packaged file is a packaged file of a second version code; and
a first testing module for testing the performance of the second version code under the condition that the first identifier is inconsistent with the second identifier,
wherein the second version code is used to update the first version code in the event that the second version code passes the test,
the first identification comprises an encrypted value of each file in the first packed file obtained by adopting a preset message digest algorithm; the second identification comprises an encrypted value of each file in the second packed file obtained by adopting a preset message digest algorithm;
wherein the first package file is generated by compiling the first version code, and the second package file is generated by compiling the second version code.
7. The apparatus of claim 6, wherein the first identity determination module comprises:
the first decompression submodule is used for decompressing the first packing file to obtain a first target file for recording each file identifier in the first packing file; and
and the first identification determining submodule is used for determining that the identification recorded in the first target file is the first identification.
8. The apparatus of claim 6, wherein the second identity determination module comprises:
the second decompression submodule is used for decompressing the second packed file to obtain a second target file for recording each file identifier in the second packed file; and
and the second identification determining submodule is used for determining that the identification recorded in the second target file is the second identification.
9. The apparatus of claim 6, wherein:
the first version code and the second version code are both codes of a deep learning framework.
10. The apparatus of claim 6, further comprising:
and the second testing module is used for testing the second version code except the performance test under the condition that the first identifier is consistent with the second identifier.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements a method according to any one of claims 1 to 5.
CN202111058908.4A 2021-09-09 2021-09-09 Code testing method and device, electronic equipment and storage medium Active CN113760765B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111058908.4A CN113760765B (en) 2021-09-09 2021-09-09 Code testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111058908.4A CN113760765B (en) 2021-09-09 2021-09-09 Code testing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113760765A CN113760765A (en) 2021-12-07
CN113760765B true CN113760765B (en) 2022-07-19

Family

ID=78794588

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111058908.4A Active CN113760765B (en) 2021-09-09 2021-09-09 Code testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113760765B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315687A (en) * 2017-06-29 2017-11-03 环球智达科技(北京)有限公司 Code method for automatically releasing
CN111752633A (en) * 2020-06-18 2020-10-09 支付宝(杭州)信息技术有限公司 Code loading method, device and equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9207933B2 (en) * 2006-10-10 2015-12-08 International Business Machines Corporation Identifying authors of changes between multiple versions of a file
CN109298880B (en) * 2018-08-09 2022-02-18 恒生电子股份有限公司 Multi-version code generation method and device and electronic device
CN110147317A (en) * 2019-04-19 2019-08-20 平安普惠企业管理有限公司 Code test method and device, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107315687A (en) * 2017-06-29 2017-11-03 环球智达科技(北京)有限公司 Code method for automatically releasing
CN111752633A (en) * 2020-06-18 2020-10-09 支付宝(杭州)信息技术有限公司 Code loading method, device and equipment

Also Published As

Publication number Publication date
CN113760765A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
CN113342345A (en) Operator fusion method and device of deep learning framework
US10698800B2 (en) Indicating a readiness of a change for implementation into a computer program
US9542461B2 (en) Enhancing performance of extract, transform, and load (ETL) jobs
CN113312072A (en) Configuration file updating method and device, electronic equipment and medium
CN113760769A (en) Test case processing method and device, electronic equipment and storage medium
CN112363814A (en) Task scheduling method and device, computer equipment and storage medium
CN113760765B (en) Code testing method and device, electronic equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN113590447B (en) Buried point processing method and device
CN113127357B (en) Unit test method, apparatus, device, storage medium, and program product
CN115269431A (en) Interface testing method and device, electronic equipment and storage medium
CN115061921A (en) Automatic test method, device, electronic equipment and readable storage medium
CN114003497A (en) Method, device and equipment for testing service system and storage medium
CN114218313A (en) Data management method, device, electronic equipment, storage medium and product
CN114021642A (en) Data processing method and device, electronic equipment and storage medium
CN114218166A (en) Data processing method and device, electronic equipment and readable storage medium
CN113778849A (en) Method, apparatus, device and storage medium for testing code
CN109669668B (en) Method and device for realizing simulated transaction execution in system performance test
CN112988583A (en) Method and device for testing syntax compatibility of database
CN113326038A (en) Method, apparatus, device, storage medium and program product for providing service
CN108628909B (en) Information pushing method and device
CN110688295A (en) Data testing method and device
CN113626332B (en) Debugging method, device, equipment, storage medium and computer program product
CN116483735B (en) Method, device, storage medium and equipment for analyzing influence of code change
CN114217873A (en) Plug-in determining 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
GR01 Patent grant
GR01 Patent grant