CN114116499A - Method, device, equipment and storage medium for evaluating code quality - Google Patents

Method, device, equipment and storage medium for evaluating code quality Download PDF

Info

Publication number
CN114116499A
CN114116499A CN202111448845.3A CN202111448845A CN114116499A CN 114116499 A CN114116499 A CN 114116499A CN 202111448845 A CN202111448845 A CN 202111448845A CN 114116499 A CN114116499 A CN 114116499A
Authority
CN
China
Prior art keywords
code
target
information
container
evaluation
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
CN202111448845.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.)
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 CN202111448845.3A priority Critical patent/CN114116499A/en
Publication of CN114116499A publication Critical patent/CN114116499A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides a method, a device, equipment and a storage medium for evaluating code quality, and relates to the technical fields of application programs, code evaluation and the like. The specific implementation scheme is as follows: determining a target image corresponding to the target code; installing a target operating system in the container according to the target mirror image, wherein the target operating system is configured with a development environment corresponding to the target code; downloading the object code into a container; and performing quality evaluation on the target code based on the target operating system.

Description

Method, device, equipment and storage medium for evaluating code quality
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the technical fields of application programs, code evaluation, and the like.
Background
In the process of software development, the evaluation of the quality of codes is a very important link for guaranteeing the software quality. The quality of the code can be evaluated according to the effect of the code in running, the code normalization, the redundancy degree, the coverage rate, the dependency relationship, the complexity and the like.
Disclosure of Invention
The present disclosure provides a method, apparatus, device, and storage medium for evaluating code quality.
According to an aspect of the present disclosure, there is provided a method of evaluating code quality, including: determining a target image corresponding to the target code; installing a target operating system in a container according to the target image, wherein the target operating system is configured with a development environment corresponding to the target code; downloading the object code into the container; and performing quality evaluation on the target code based on the target operating system.
According to another aspect of the present disclosure, there is provided an apparatus for evaluating code quality, including: the mirror image determining module is used for determining a target mirror image corresponding to the target code; the installation module is used for installing a target operating system in a container according to the target mirror image, wherein the target operating system is configured with a development environment corresponding to the target code; a download module for downloading the object code into the container; and the evaluation module is used for carrying out quality evaluation on the target code based on the target operating system.
Another aspect of the present disclosure provides 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 method of the embodiments of the present disclosure.
According to another aspect of the disclosed embodiments, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method shown in the disclosed embodiments.
According to another aspect of the embodiments of the present disclosure, there is provided a computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the steps of the method shown in the embodiments of 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 system architecture diagram of a method, apparatus, electronic device, and storage medium for assessing code quality in accordance with an embodiment of the present disclosure;
FIG. 2 schematically shows a flow diagram of a method of evaluating code quality according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow diagram of a method of evaluating code quality according to another embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow diagram of a method of quality assessment of target code according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a flow diagram of a method of quality assessment of target code according to another embodiment of the present disclosure;
FIG. 6 schematically illustrates an evaluation plug-in according to an embodiment of the disclosure;
FIG. 7 schematically illustrates a block diagram of an apparatus for evaluating code quality according to an embodiment of the present disclosure; and
FIG. 8 schematically shows a block diagram of an example electronic device that may be used to implement embodiments 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.
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 system architecture diagram of a method, apparatus, electronic device, and storage medium for evaluating code quality according to an embodiment of the disclosure.
As shown in fig. 1, the system architecture 100 includes a code hosting platform 110, a container management platform 120, a server cluster 130, and a mirror repository 140.
According to embodiments of the present disclosure, the code hosting platform 110 may be used to store code. After the user (e.g., a developer) completes writing the code, the code may be submitted to the code hosting platform 110 for storage. The user may also view the submitted code through the code hosting platform 110.
According to embodiments of the present disclosure, a user (e.g., an evaluator) may trigger an evaluation operation of code quality through the code hosting platform 110. In response to the evaluation operation of the code quality being triggered, the code hosting platform 110 may send code library information corresponding to the code for which the evaluation operation is directed to the container management platform 120. The code library information may include a code library name corresponding to the code to be evaluated, branch information, a commit identifier (e.g., commit id), and the like.
According to an embodiment of the present disclosure, the container management platform 120 may call an API (application program interface) provided by the server cluster 130 to send a create command to the server cluster 130 to instruct the server cluster 130 to create the container. The creation command includes code library information, mirror image information, and the like corresponding to the code to be evaluated.
According to an embodiment of the present disclosure, the server cluster 130, after receiving the creation command, automatically obtains an image corresponding to the code to be evaluated from the image repository 140, wherein the image includes an operating system with a development tool and an IDE (integrated development environment). An operating system is then installed in the container based on the image to create a container with a development tool and an IDE. And simultaneously, injecting the code base information into the environment variable of the container in an environment variable injection mode.
In addition, the container management platform 120 may inform the server cluster 130 of commands/scripts that need to be executed when the container is started. Thus, when the container is started, the start script dynamically reads the code base information in the environment variable, downloads the code of the corresponding version from the code hosting platform 110, and starts the service of the IDE.
According to other embodiments of the present disclosure, the integrated development environment may include, for example, WebIDE, which is an online integrated development environment for programming developers. Based on this, a "WebIDE" button may be provided in code hosting platform 110. After clicking the WebIDE button, a user can trigger the evaluation operation of the code quality, automatically create a container, automatically install WebIDE service in the container, download the code of the current evaluation version, configure the development environment and the like. The user can directly view the code difference information through the review plug-in integrated in the WebIDE and can also assist in evaluation by means of the capability of the WebIDE.
According to embodiments of the present disclosure, after completing the code quality evaluation, the server cluster 130 may delete the container to free up resources.
According to embodiments of the present disclosure, the server cluster 130 may include a plurality of servers. 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 VPS for short). The server may also be a server of a distributed system, or a server incorporating a blockchain. In this embodiment, the server cluster 130 may be a k8s (kubernets) cluster.
In accordance with embodiments of the present disclosure, image repository 140 may be used to store standard images. Development tools (e.g., jdk, go, pip, python, maven, gradle, etc.), IDE installation packages, evaluation plug-ins, etc. required by various development languages may be installed in advance based on the image of the operating system (e.g., centros, ubuntu, etc.), mirrored as a standard development environment, and uploaded to the mirror repository 140. Server cluster 130 may automatically obtain images from image repository 140 and generate a container with development tools, IDE, evaluation plug-ins, etc. components when the container is started. Because the components are carried in the container, the quality evaluation can be carried out without reconfiguring a development environment when the code evaluation is carried out, and the convenience is improved.
It is understood that image repository 140 may also be used to store other images besides standard images, and this disclosure is not limited in this regard.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of the related data such as codes, images, development tools, integrated development environments, evaluation information and the like all conform to the regulations of related laws and regulations and do not violate the good customs of the public order.
FIG. 2 schematically shows a flow diagram of a method of evaluating code quality according to an embodiment of the present disclosure.
As shown in fig. 2, the method 200 of evaluating code quality includes determining a target image corresponding to a target code in operation S210.
According to an embodiment of the present disclosure, the object code may be, for example, code to be evaluated, including, for example, system code, program code, or web page code, among others.
According to embodiments of the present disclosure, the target image may be, for example, an image file of a target operating system. Wherein the target operating system is configured with a development environment corresponding to the target code. The object code may run in a target operating system.
Then, in operation S220, the target operating system is installed in the container according to the target image.
According to the disclosed embodiments, a container is provided with a development environment for target code to run and evaluate by installing a target operating system in the container.
In operation S230, object code is downloaded into a container.
In operation S240, a quality evaluation is performed on the target code based on the target operating system.
According to the embodiment of the disclosure, the operating system configured with the development environment is automatically installed in the container, and the code to be evaluated is downloaded. Then, the code is evaluated based on the operating system, and when the quality of the target code is evaluated, the development environment required by the target code does not need to be configured, so that the convenience for evaluating the quality of the code and the user experience can be improved.
FIG. 3 schematically shows a flow diagram of a method of evaluating code quality according to another embodiment of the present disclosure.
As shown in fig. 3, the method 300 of evaluating code quality includes determining a target image corresponding to a target code in operation S310.
Then, in operation S320, the target operating system is installed in the container according to the target image.
In operation S330, code library information corresponding to the target code is acquired.
In operation S340, the codebase information is injected into the environment variable of the container.
In operation S350, the code base information in the environment variable is read at the time of container start-up.
In operation S360, the object code is downloaded according to the read code library information.
In operation S370, a quality evaluation is performed on the target code based on the target operating system.
According to the embodiment of the present disclosure, for example, reference may be made to the above in operations S310 to S320, and S370, which are not described herein again.
According to an embodiment of the present disclosure, the code library information may be used to indicate a code library in which the target code is located, identification information of the target code in the code library, and the like. Illustratively, in the present embodiment, the code library information may include a code library identifier, branch information, and a commit identifier.
According to the embodiment of the disclosure, the code base information is injected into the environment variable of the container in an environment variable injection mode, so that the code base information in the environment variable can be dynamically read when the container is started, and the code of the corresponding version, namely the target code, is downloaded according to the code base information.
According to an embodiment of the present disclosure, a development environment includes a development tool corresponding to object code and an integrated development environment. The development tool can provide a foundation for the running of the codes, and the integrated development environment has the functions of analysis, test, running, debugging and the like. Therefore, the quality of the code can be evaluated by utilizing various functions provided by the integrated development environment, so that the quality of the code evaluation and the user experience can be improved.
FIG. 4 schematically shows a flow diagram of a method of quality assessment of target code according to an embodiment of the present disclosure.
As shown in fig. 4, the method 440 for evaluating the quality of the object code includes performing object processing on the object code using a development tool and an integrated development environment to obtain a processing result in operation S441.
According to an embodiment of the present disclosure, the target processing includes at least one of analysis, testing, running, and debugging.
Then, in operation S442, a quality evaluation result is determined according to the processing result.
According to the embodiment of the present disclosure, the quality evaluation result can be obtained by automatically analyzing and evaluating according to the processing result. For example, the code may be analyzed for normalization, redundancy, etc., and corresponding analysis results may be given as quality evaluation results. Alternatively, the code may be tested to determine the proportion of code that the test can cover, i.e., the coverage, as a result of the quality assessment. Alternatively, the code may be run to obtain run information as a quality assessment result. Still alternatively, the code may be debugged to determine dependencies, complexity, etc. between modules of the code as a result of the quality assessment.
According to other embodiments of the present disclosure, the processing result may also be presented to a user, and the user may determine the quality evaluation result.
FIG. 5 schematically shows a flow diagram of a method of quality assessment of target code according to another embodiment of the present disclosure.
As shown in fig. 5, the method 540 for evaluating the quality of the object code includes exposing difference information of the object code through an evaluation plug-in the integrated development environment in operation S541.
Then, in operation S542, review information input by the user for the difference information is received.
In operation S543, a quality evaluation result is determined according to the review information.
According to the embodiment of the disclosure, the difference of the code relative to the previous version can be known to the user by showing the difference information (diff), so that the user can conveniently evaluate the code.
According to an embodiment of the present disclosure, review information may include, for example, rating information, review information, and the like. Wherein the scoring information quantifies the quality of the code using a form of score. And the comment information comments the quality of the code using the form of text.
The evaluation plug-in shown above is further described with reference to fig. 6 in connection with a specific embodiment. Those skilled in the art will appreciate that the following example embodiments are only for the understanding of the present disclosure, and the present disclosure is not limited thereto.
Fig. 6 schematically illustrates an evaluation plug-in according to an embodiment of the disclosure.
As shown in FIG. 6, the review plug-in 60 may include, for example, a code presentation area 61, an evaluation list 62, a scoring component 63, and a review component 64.
According to an embodiment of the present disclosure, the code presentation area 61 may be used to present the code 611 to be evaluated. In addition to the code to be evaluated 611, the code presentation area 61 may also be used to present the code 612 for comparison with the code to be evaluated 611 at the same time. By presenting both the code 611 and the code 612, the user may be facilitated to compare the two codes. Illustratively, in this embodiment, the two codes may be automatically compared to determine difference information 613 between the two codes. In addition, the discrepancy information 613 may be presented in a highlighted form for easy viewing by the user.
According to embodiments of the present disclosure, evaluation list 62 may be used to present a file directory of one or more code files. The code presented in the code presentation area 61 can be switched by clicking on the code file in the evaluation list 62.
According to an embodiment of the present disclosure, scoring information for a target code may be received by scoring component 63, and comment information for a target code may be received by comment component 64. Review information can then be determined based on the scoring information and the review information.
Illustratively, the scoring component 63 may include a plurality of buttons, each button representing a score. When the user clicks any one of the plurality of buttons, the code may be scored by the score represented by the button.
Illustratively, the comment component 64 may include an input box. The user can input text information through the input box, and the text information can be used as comment information of the code.
Fig. 7 schematically shows a block diagram of an apparatus for evaluating code quality according to an embodiment of the present disclosure.
As shown in fig. 7, the apparatus 700 for evaluating code quality includes an image determination module 710, an installation module 720, a download module 730, and an evaluation module 740.
And an image determining module 710 for determining an object image corresponding to the object code.
And an installation module 720, configured to install a target operating system in the container according to the target image, where the target operating system is configured with a development environment corresponding to the target code.
A downloading module 730 for downloading the object code into the container.
And the evaluation module 740 is configured to perform quality evaluation on the target code based on the target operating system.
According to an embodiment of the present disclosure, the apparatus may further include an obtaining module and an injecting module. The acquisition module is used for acquiring code library information corresponding to the target code. And the injection module is used for injecting the code base information into the environment variable of the container.
According to an embodiment of the present disclosure, the download module may include a reading sub-module and a download sub-module. And the reading submodule is used for reading the code base information in the environment variable when the container is started. And the downloading submodule is used for downloading the target code according to the read code base information.
According to an embodiment of the present disclosure, the code library information may include a code library identification, branch information, and a commit identification.
According to an embodiment of the present disclosure, the development environment may include a development tool and an integrated development environment corresponding to the object code.
According to an embodiment of the present disclosure, the evaluation module includes a processing sub-module and a first determination sub-module. The processing submodule is configured to perform target processing on the target code by using the development tool and the integrated development environment to obtain a processing result, where the target processing includes at least one of analysis, testing, running, and debugging. And the first determining submodule is used for determining a quality evaluation result according to the processing result.
According to an embodiment of the present disclosure, the integrated development environment is integrated with an evaluation plug-in. The evaluation module may include a presentation sub-module, a receiving sub-module, and a second determination sub-module. And the display submodule is used for displaying the difference information of the target code through the evaluation plug-in the integrated development environment. And the receiving submodule is used for receiving the review information input by the user aiming at the difference information. And the second determining submodule is used for determining a quality evaluation result according to the review information.
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. 8 schematically illustrates a block diagram of an example electronic device 800 that may be used to implement 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. 8, the apparatus 800 includes a computing unit 801 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)802 or a computer program loaded from a storage unit 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The calculation unit 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
A number of components in the device 800 are connected to the I/O interface 805, including: an input unit 806, such as a keyboard, a mouse, or the like; an output unit 807 such as various types of displays, speakers, and the like; a storage unit 808, such as a magnetic disk, optical disk, or the like; and a communication unit 809 such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 801 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 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 the like. The calculation unit 801 executes the respective methods and processes described above, such as a method of evaluating code quality. For example, in some embodiments, the method of evaluating code quality may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and/or installed onto device 800 via ROM 802 and/or communications unit 809. When loaded into RAM 803 and executed by computing unit 801, a computer program may perform one or more of the steps of the method of assessing code quality described above. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the method of evaluating code quality 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), Complex 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 VPS for short). 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, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and the present disclosure is not limited herein.
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 (17)

1. A method of evaluating code quality, comprising:
determining a target image corresponding to the target code;
installing a target operating system in a container according to the target image, wherein the target operating system is configured with a development environment corresponding to the target code;
downloading the object code into the container; and
and performing quality evaluation on the target code based on the target operating system.
2. The method of claim 1, further comprising:
code base information corresponding to the target code is obtained; and
injecting the codebase information into an environment variable of the container.
3. The method of claim 2, wherein said downloading the object code into the container comprises:
reading code base information in the environment variable when the container is started; and
and downloading the target code according to the read code library information.
4. The method of claim 2 or 3, wherein the codebase information comprises a codebase identification, branch information, and a commit identification.
5. The method of claim 1, wherein the development environment comprises a development tool and an integrated development environment corresponding to the object code.
6. The method of claim 5, wherein said quality evaluating said target code based on said target operating system comprises:
performing target processing on the target code by using the development tool and the integrated development environment to obtain a processing result, wherein the target processing comprises at least one of analysis, test, operation and debugging; and
and determining a quality evaluation result according to the processing result.
7. The method of claim 5, wherein the integrated development environment is integrated with an evaluation plug-in; the evaluating the target code based on the target operating system includes:
displaying the difference information of the target code through an evaluation plug-in the integrated development environment;
receiving review information input by a user aiming at the difference information; and
and determining a quality evaluation result according to the evaluation information.
8. An apparatus for evaluating code quality, comprising:
the mirror image determining module is used for determining a target mirror image corresponding to the target code;
the installation module is used for installing a target operating system in a container according to the target mirror image, wherein the target operating system is configured with a development environment corresponding to the target code;
a download module for downloading the object code into the container; and
and the evaluation module is used for carrying out quality evaluation on the target code based on the target operating system.
9. The apparatus of claim 8, further comprising:
the acquisition module is used for acquiring code library information corresponding to the target code; and
and the injection module is used for injecting the code base information into the environment variable of the container.
10. The apparatus of claim 9, wherein the download module comprises:
the reading submodule is used for reading the code base information in the environment variable when the container is started; and
and the downloading submodule is used for downloading the target code according to the read code base information.
11. The apparatus of claim 9 or 10, wherein the codebase information comprises a codebase identification, branch information, and a commit identification.
12. The apparatus of claim 8, wherein the development environment comprises a development tool and an integrated development environment corresponding to the object code.
13. The apparatus of claim 12, wherein the evaluation module comprises:
the processing submodule is used for performing target processing on the target code by utilizing the development tool and the integrated development environment to obtain a processing result, wherein the target processing comprises at least one of analysis, test, operation and debugging; and
and the first determining submodule is used for determining a quality evaluation result according to the processing result.
14. The apparatus of claim 12, wherein the integrated development environment is integrated with an evaluation plug-in; the evaluation module comprises:
the display submodule is used for displaying the difference information of the target code through an evaluation plug-in the integrated development environment;
the receiving submodule is used for receiving review information input by a user aiming at the difference information; and
and the second determining submodule is used for determining a quality evaluation result according to the review information.
15. An electronic device, comprising:
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 method of any one of claims 1-7.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising computer program/instructions, characterized in that the computer program/instructions, when executed by a processor, implement the steps of the method according to any of claims 1-7.
CN202111448845.3A 2021-11-30 2021-11-30 Method, device, equipment and storage medium for evaluating code quality Pending CN114116499A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111448845.3A CN114116499A (en) 2021-11-30 2021-11-30 Method, device, equipment and storage medium for evaluating code quality

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111448845.3A CN114116499A (en) 2021-11-30 2021-11-30 Method, device, equipment and storage medium for evaluating code quality

Publications (1)

Publication Number Publication Date
CN114116499A true CN114116499A (en) 2022-03-01

Family

ID=80368992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111448845.3A Pending CN114116499A (en) 2021-11-30 2021-11-30 Method, device, equipment and storage medium for evaluating code quality

Country Status (1)

Country Link
CN (1) CN114116499A (en)

Similar Documents

Publication Publication Date Title
US11151024B2 (en) Dynamic automation of DevOps pipeline vulnerability detecting and testing
US11169906B2 (en) Extraction of problem diagnostic knowledge from test cases
US8683449B2 (en) Automated parallel software code impact analysis
US9292281B2 (en) Identifying code that exhibits ideal logging behavior
CN110531962A (en) Development process method, equipment and the computer readable storage medium of small routine
CN111522738A (en) Test method and device of micro-service system, storage medium and electronic equipment
CN111654495B (en) Method, apparatus, device and storage medium for determining traffic generation source
CN110609786A (en) Software testing method and device, computer equipment and storage medium
CN112988578A (en) Automatic testing method and device
CN111858302B (en) Method and device for testing small program, electronic equipment and storage medium
CN115757186A (en) Performance test method, device, equipment and medium of software interface
CN112965910B (en) Automatic regression testing method and device, electronic equipment and storage medium
CN114116499A (en) Method, device, equipment and storage medium for evaluating code quality
US10339032B2 (en) System for monitoring and reporting performance and correctness issues across design, compile and runtime
CN115061921A (en) Automatic test method, device, electronic equipment and readable storage medium
US11030087B2 (en) Systems and methods for automated invocation of accessibility validations in accessibility scripts
CN111290870B (en) Method and device for detecting abnormality
CN113377648A (en) Software system diagnosis method and device, electronic equipment and computer readable medium
CN110968519A (en) Game testing method, device, server and storage medium
CN111176718A (en) Script online method and device, storage medium and electronic equipment
CN113946514B (en) Code pre-integration method, device and system
CN111258910B (en) Static link library function verification method and device, electronic equipment and storage medium
CN117435503A (en) Test tool generation method, test device, test equipment and test medium
CN117827624A (en) Function test method, device and storage medium
CN114637671A (en) Automatic testing method and device for user interface interaction

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