[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN118057303A - Code auditing method, device, equipment and medium - Google Patents

Code auditing method, device, equipment and medium Download PDF

Info

Publication number
CN118057303A
CN118057303A CN202211455907.8A CN202211455907A CN118057303A CN 118057303 A CN118057303 A CN 118057303A CN 202211455907 A CN202211455907 A CN 202211455907A CN 118057303 A CN118057303 A CN 118057303A
Authority
CN
China
Prior art keywords
code
code file
auditing
audit
audited
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
CN202211455907.8A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202211455907.8A priority Critical patent/CN118057303A/en
Publication of CN118057303A publication Critical patent/CN118057303A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3604Analysis of software for verifying properties of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06311Scheduling, planning or task assignment for a person or group

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Strategic Management (AREA)
  • Quality & Reliability (AREA)
  • Educational Administration (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • Computer Security & Cryptography (AREA)
  • Game Theory and Decision Science (AREA)
  • Development Economics (AREA)
  • Computer Hardware Design (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the application provides a code auditing method, a device, equipment and a medium, wherein the method comprises the following steps: acquiring a code file to be checked, and determining an associated code file corresponding to the code file to be checked according to the service function attribute corresponding to the code file to be checked; determining a management object corresponding to the code file to be checked and a management object corresponding to the associated code file as an audit object corresponding to the code file to be checked; creating an audit prompt message corresponding to the code file to be audited, and sending the audit prompt message to a target group in the instant messaging application; the target group includes audit objects. By implementing the embodiment of the application, the efficiency of code auditing can be improved.

Description

Code auditing method, device, equipment and medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a code auditing method, apparatus, device, and medium.
Background
For a software development project, the number of codes in the software development project is huge, the software development project can be composed of a large number of code modules, and different code modules are mutually matched, so that the corresponding functions of the software can be realized. In the whole software development process, in order to perfect the software function, code files in each code module related to the software are usually required to be adjusted for multiple times, and the code files after each adjustment are required to be subjected to relevant tests after being checked and approved.
In the current code auditing scene, after a developer finishes adjusting a code file, the auditing personnel corresponding to the code file needs to be found, and the adjusted code file is packaged and sent to the auditing personnel. However, when the number of auditors of the code file is multiple, the developer needs to package and send the adjusted code file for multiple times; in addition, as a plurality of auditors corresponding to the code file exist, when the corresponding auditors are searched, the situation of debugging the auditors possibly exists, so that the developer needs to search for the adjusted code file again and check the corresponding auditors one by one, the whole auditing process of the code file is complicated and long, and the efficiency of code auditing is low.
Disclosure of Invention
The embodiment of the application provides a code auditing method, a device, equipment and a medium, which can improve the efficiency of code auditing.
In one aspect, the embodiment of the application provides a code auditing method, which comprises the following steps:
Acquiring a code file to be checked, and determining an associated code file corresponding to the code file to be checked according to the service function attribute corresponding to the code file to be checked;
determining a management object corresponding to the code file to be checked and a management object corresponding to the associated code file as an audit object corresponding to the code file to be checked;
creating an audit prompt message corresponding to the code file to be audited, and sending the audit prompt message to a target group in the instant messaging application; the target group includes audit objects.
In one aspect, an embodiment of the present application provides a code auditing apparatus, including:
The associated code determining module is used for acquiring a code file to be checked, and determining an associated code file corresponding to the code file to be checked according to the service function attribute corresponding to the code file to be checked;
the auditing object determining module is used for determining the management object corresponding to the code file to be audited and the management object corresponding to the associated code file as the auditing object corresponding to the code file to be audited;
The message sending module is used for creating an audit prompt message corresponding to the code file to be audited and sending the audit prompt message to a target group in the instant messaging application; the target group includes audit objects.
Wherein, the association code determining module includes:
The first determining unit is used for acquiring the service application to which the code file to be checked belongs and determining the logic function attribute associated with the service function attribute corresponding to the code file to be checked according to the service logic corresponding to the service application;
And the second determining unit is used for determining the code file corresponding to the logic function attribute as the associated code file corresponding to the code file to be checked.
Wherein the apparatus further comprises:
The page display module is used for receiving a code auditing instruction corresponding to the code file to be audited, displaying an object adding page in the code management platform, wherein the object adding page comprises an object input area and an initial management object of the code file to be audited in the configuration file;
And the management object determining module is used for responding to the input operation aiming at the object input area, determining the target object determined by the input operation as a candidate object, and determining the initial management object and the candidate object as management objects corresponding to the audit code file.
The number of the auditing objects is M, M is an integer greater than 1, and the message sending module comprises:
the generating unit is used for acquiring the priorities of the M auditing objects, determining the auditing sequence of the code files to be audited of the M auditing objects according to the priorities, and generating auditing flows corresponding to the code files to be audited according to the auditing sequence;
the packaging unit is used for acquiring the message data type in the instant messaging application, and packaging the auditing flow corresponding to the code file to be audited into an auditing prompt message conforming to the message data type.
Wherein the apparatus further comprises:
the control adding module is used for determining instant messaging applications with a butting relation with the code management platform, and adding group creation controls aiming at the instant messaging applications in the code management platform;
and the group creation module is used for responding to the triggering operation of the group creation control and creating a target group containing the auditing object in the instant messaging application.
Wherein, the quantity of audit object is M, and M is the integer that is greater than 1, and the device still includes:
The auditing result acquisition module is used for acquiring auditing results of M auditing objects aiming at the code file to be audited;
The code submitting module is used for submitting the code file to be inspected to the code library if the auditing results of the M auditing objects indicate that the auditing is passed;
The message generation module is used for generating a modification prompt message corresponding to the code file to be checked according to the checking results of the M checking objects if the checking results of any checking object indicate that checking is not passed, and sending the modification prompt message to the development object corresponding to the code file to be checked.
Wherein the apparatus further comprises:
The historical code acquisition module is used for acquiring a historical release code file corresponding to the code file to be inspected if the auditing results of the M auditing objects indicate that the auditing is passed;
The updating information determining module is used for determining the code updating information of the code file to be checked according to the code file to be checked and the historical release code file;
and the message creation module is used for creating code description information corresponding to the code file to be checked according to the code update information and the checking results of the M checking objects, and submitting the code description information to the code library.
An aspect of an embodiment of the present application provides a computer device, including a memory and a processor, where the memory is connected to the processor, and the memory is used to store a computer program, and the processor is used to call the computer program, so that the computer device performs the method provided in the foregoing aspect of the embodiment of the present application.
An aspect of an embodiment of the present application provides a computer readable storage medium, in which a computer program is stored, the computer program being adapted to be loaded and executed by a processor, to cause a computer device having a processor to perform the method provided in the above aspect of an embodiment of the present application.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the method provided in the above aspect.
In the embodiment of the application, after the code file to be audited is obtained, the associated code file corresponding to the code file to be audited can be determined according to the service function attribute corresponding to the code file to be audited; then, the management object corresponding to the code file to be checked and the management object corresponding to the associated code file can be determined to be the checking object corresponding to the code file to be checked; and then, an audit prompt message corresponding to the code file to be audited can be created, and the audit prompt message is sent to a target group in the instant messaging application, wherein the target group comprises an audit object. In the embodiment of the application, the auditing objects corresponding to the code files to be audited are from the management objects corresponding to the code files to be audited and the management objects corresponding to the associated code files, and the adaptation degree and the association between the auditing objects corresponding to the code files to be audited and the code files to be audited are high, so that the code auditing time can be reduced, and the code auditing efficiency can be improved; in addition, in the embodiment of the application, the auditing prompt message is sent to the target group containing the auditing objects in the instant messaging application, the auditing objects are informed to process the auditing tasks, each auditing object is not required to be independently informed, and meanwhile, the auditing objects can be informed that the auditing tasks need to be processed at the first time by the informing mode, so that the efficiency of code auditing can be further improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a network architecture according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a code auditing method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an interface for obtaining a management object of a file to be checked according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an interface for creating a target group according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an interface for displaying audit prompt messages in a target group according to an embodiment of the present application;
FIG. 6 is a diagram of code description information provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a code submission flow framework provided by an embodiment of the application;
FIG. 8 is a schematic diagram of another code submission flow framework provided by an embodiment of the application;
FIG. 9 is a schematic diagram of a code auditing apparatus according to an embodiment of the present application;
Fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a network architecture according to an embodiment of the present application. As shown in fig. 1, the network architecture may include a server 101, a terminal device 102a, a terminal device 102b, a terminal device 102c, and the like, and the network architecture may include one or more servers and may further include at least one or more terminal devices, and the number of servers and terminal devices will not be limited herein. As shown in fig. 1, the server 101 may be connected to each terminal device through a network, so that the server 101 may perform data interaction with each terminal device through the network connection.
The server 101 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing a cloud database, a cloud service, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and basic cloud computing services such as big data and an artificial intelligence platform. The terminal cluster (including terminal device 102a, terminal device 102b, terminal device 103c, etc.) may be a smart terminal such as a smart phone, tablet, notebook, desktop, palmtop, mobile internet device (mobile INTERNET DEVICE, MID), wearable device (e.g., smart watch, smart bracelet, etc.), smart computer, smart car, etc. The server 101 may establish communication connection with each terminal device in the terminal cluster, and may also establish communication connection between each terminal device in the terminal cluster. In other words, the server 101 may establish a communication connection with each of the terminal devices 102a, 102b, 103c, and the like, for example, a communication connection may be established between the terminal device 102a and the server 101. A communication connection may be established between the terminal device 102a and the terminal device 102b, and a communication connection may also be established between the terminal device 102a and the terminal device 102 c. The communication connection is not limited to a connection manner, and may be directly or indirectly connected through a wired communication manner, or may be directly or indirectly connected through a wireless communication manner, and the like, and may be specifically determined according to an actual application scenario, which is not limited in the embodiment of the present application.
In the embodiment of the application, a developer can log in a code management platform by using the terminal equipment 102a, update a code file in a code module in one or more projects by using the code management platform, determine the updated code file as a code file to be checked, and initiate a code checking instruction for the code file to be checked. After the server 101 corresponding to the code management platform receives the code auditing instruction and obtains the code file to be audited based on the code auditing instruction, the associated code file corresponding to the code file to be audited can be determined according to the service function attribute (such as login function in the game) corresponding to the code file to be audited; then, determining a management object corresponding to the code file to be checked and a management object corresponding to the associated code file as a checking object corresponding to the code file to be checked; and finally, creating an audit prompt message corresponding to the code file to be audited, and sending the audit prompt message to a target group containing audit objects in the instant messaging application. In the embodiment of the application, the auditing objects corresponding to the code files to be audited are from the management objects corresponding to the code files to be audited and the management objects corresponding to the associated code files, and the adaptation degree and the association between the auditing objects corresponding to the code files to be audited and the code files to be audited are high, so that the code auditing time can be reduced, and the code auditing efficiency can be improved; in addition, in the embodiment of the application, the auditing prompt message is sent to the target group containing the auditing objects in the instant messaging application, the auditing objects are informed to process the auditing tasks, each auditing object is not required to be independently informed, and meanwhile, the auditing objects can be informed that the auditing tasks need to be processed at the first time by the informing mode, so that the efficiency of code auditing can be further improved.
Further, referring to fig. 2, fig. 2 is a flow chart of a code auditing method according to an embodiment of the present application. It will be appreciated that the code auditing method is performed by a computer device, which may be a terminal device (e.g., terminal device 102a, terminal device 102b, or terminal device 102c in the corresponding embodiment of fig. 1), or a server (e.g., server 101 in the corresponding embodiment of fig. 1), or a computer program (including program code). As shown in fig. 2, the code auditing method may include the following steps S101-S103:
step S101: and acquiring the code file to be checked, and determining the associated code file corresponding to the code file to be checked according to the service function attribute corresponding to the code file to be checked.
The code file to be checked can be a code file which is understood to be required to be checked by a related checking object, wherein the code file to be checked can be a code file which is newly written aiming at the requirement of one or more software development projects, or can be a code file obtained after updating the existing code file, and the implementation of the application is not limited to the above. Among them, code Review (CR), also called code review, can be understood as an activity of checking compliance of source codes with coding standards and checking quality of codes by reading code files. The business function attribute may understand the business function type of the code module corresponding to the code file to be checked. It will be appreciated that for a software development project (e.g. a game project, etc.), the amount of code in the software development project is huge, so that a software development project can be subdivided into a plurality of code modules according to different service function attributes, and corresponding functions of the software can be realized through cooperation of different code modules. Taking a game item as an example, the code inside the game item can be subdivided into an initialization level code module, a level running code module, a level passing code module and the like. Each code module can also be determined whether to be subdivided into a plurality of code sub-modules according to actual requirements.
The associated code file may be understood as a code file related to the code to be checked, and may be a code file having the same common code file as the code file to be checked; or may be a code file having an association with a service function attribute of the code file to be checked, for example, taking a game item as an example, the service function attribute corresponding to the code file to be checked is a pause game, and the associated code file may be a code file corresponding to the service function attribute being a resume game, or the like.
Specifically, after the computer device obtains the service application to which the code file to be audited belongs, the logic function attribute associated with the service function attribute corresponding to the code file to be audited can be determined according to the service logic corresponding to the service application; and then determining the code file corresponding to the logic function attribute as the associated code file corresponding to the code file to be checked.
The service application may be understood as an item type corresponding to the code file to be checked, for example, the service application may refer to a payment application, a game application, a shopping application, and the like, which is not limited in the embodiment of the present application. Business logic is understood to mean the rules and procedures that one entity should possess in order to provide services to another entity. In general, the content of business logic may include domain entities, business rules, data integrity, and workflows, among others. Wherein, the domain entity can be understood as an object in the service; business rules can be understood as conditions that need to be met to complete an action; data integrity may be understood as the necessity of certain data; workflow can be understood as an interactive relationship between domain entities. Taking the online shopping sweater of user 1 in shopping application a as an example, the domain entities may be: user 1, funds account, order, sweater and invoice, etc.; the business rules may be: the user 1 clicks to purchase to generate an order, but pays money to send goods, and generates an invoice; the data integrity may be: the shopping application A places an order, needs to log in an account, and cannot be successfully purchased without the account; the workflow may be: searching for "sweater" -finding the appropriate sweater-ordering-payment-receiving; then the corresponding business logic may be: search "sweater" -find the appropriate sweater-order-log-in account-settle-pay-receive. Logical function attributes may be understood as business function types having an association with business function attributes. For example, if the business function attribute of the code file to be checked is "settlement", the logic function attribute may be "login account", "payment", etc., and further the code files corresponding to "login account" and "payment" may be determined as the associated code file.
Step S102: and determining the management object corresponding to the code file to be checked and the management object corresponding to the associated code file as the checking object corresponding to the code file to be checked.
The management object corresponding to the code file to be checked can be understood as a manager of the code file to be checked, and specifically can comprise a code responsible person (owner) of the code file to be checked or other relevant developers and the like; similarly, the management object corresponding to the associated code file may also be understood as a manager of the associated code file, and may specifically include a code responsible person (owner) or other relevant developer of the associated code file. The auditing object corresponding to the code file to be audited can be understood as an auditing (review) person of the code file to be audited, and the code file to be audited is required to be audited. The work of the auditing object in conducting code auditing for the code file to be audited may include, but is not limited to, the following: code specification problems, code structure problems (e.g., duplicate code, improper layering, etc.), tool or framework misuse, implementation problems (e.g., over-complex implementation, poor code readability, poor extensibility, etc.), test problems (e.g., insufficient test coverage, poor testability, etc.), the influence of a pending core code file on itself responsible code modules, the influence of a pending core code file on the business function attributes of its code modules, etc. The management object and the audit object may be one or more, which is not limited in the embodiment of the present application.
As can be seen from the foregoing, for a software development project, there are multiple code modules inside, and the different code modules cooperate with each other, so as to implement the corresponding functions of the software. Then when a developer modifies a code file in a certain code module, it may have an impact on other code modules associated with that code module. For example, in the collaborative development process, codes of a common part may exist between different code modules, and in the process of modifying the code module a, a developer may modify the common part under the condition that other service requirements are unclear, so that service functions of the code module B cannot be implemented. If only the management object corresponding to the code module a is considered in the process of auditing the code file modified in the code module a, the condition that the code file modified in the code module a is audited and passed may occur, and the modified code file is successfully submitted to the code library. However, since the code file in the code module B is affected after the code file of the code module a is changed, the whole project may be run in error when the code is finally released. Therefore, when the embodiment of the application determines the auditing object of the code file to be audited, the management object corresponding to the associated code file is considered in addition to the management object corresponding to the code file to be audited, so that the accuracy of code auditing can be improved, and the production problem caused by modification of codes among different code modules can be avoided.
The specific process of acquiring the management object corresponding to the code file to be checked is described in detail below, the specific process of acquiring the management object corresponding to the associated code file may refer to the specific process of acquiring the management object corresponding to the code file to be checked, and the embodiments of the present application will not be described in detail.
Specifically, after receiving a code auditing instruction corresponding to a code file to be audited, the computer equipment can display an object adding page in the code management platform, wherein the object adding page comprises an object input area and an initial management object of the code file to be audited in a configuration file; the computer device may then determine, in response to an input operation for the object input area, the target object determined by the input operation as a candidate object, and the initial management object and the candidate object as management objects corresponding to the audit code file.
The code auditing instruction is used for indicating to conduct code auditing on the code file to be audited. In one possible implementation manner, when the developer completes modification of the code file, the modified code file is determined to be the code file to be checked, before submitting the code file to be checked, an audit request for the code file to be checked can be actively initiated, and the audit request is generated into a code audit instruction by the computer equipment; in another possible implementation, when the developer completes the modification of the code file, the developer may put the code file to be checked into the temporary storage area (shelve) through a python (a computer programming language) script, and after reaching the checking period, generate a code checking instruction for the code file to be checked stored in the temporary storage area (shelve). The scratch pad (shelve) may be understood as a memory space that may be used to store the code file to be checked.
The code management platform can be understood as a system for managing codes, and can effectively and rapidly manage code files of various items. In an embodiment of the present application, the code management platform may include, but is not limited to: perforce (P4), git, SVN, and the like. A configuration file may be understood as a file containing configuration parameters, initial setup parameters, and annotation information of the code file to be checked. In an embodiment of the present application, the configuration file may include a file for recording an initial management object of the pending code file, for example, an owner info file. In practical applications, the owner. Info file may also have other named files, such as codeowners files, etc. The primary responsibility of the initial management object is to maintain the code files in the corresponding code modules, and manage the influence of the updated code files on the code modules responsible for the code files. For example, the code module to which the code file to be checked belongs is a code module a, the initial management object corresponding to the code module a is an initial management object a, and the initial management object a needs to manage the influence of the code file to be checked on the code module a. In addition, if the modified code file in the code module B has an association with the code file in the code module a, that is, the modified code file in the code module B is an associated code file of the code module a, the initial management object a needs to manage the influence of the modified code file in the code module B on the code module a. In the embodiment of the present application, the number of the initial management objects is not limited, and may be one or more. Optionally, in order to ensure timeliness and accuracy of data in the owner. Info file in the configuration file, the data in the owner. Info file may be updated periodically, for example, 11 points per day may be set to automatically update the initial management object in the owner. Info file through a corresponding tool, and of course, the initial management object in the owner. Info file may also be updated manually. The candidate object does not belong to the initial management object, and the candidate object can be a developer with better understanding of the execution logic and business function attribute of the code file to be audited, or a developer with more abundant code experience, and the like, and the accuracy of code audit can be improved by taking the initial management object and the candidate object together as the management object corresponding to the audit code file.
Referring to fig. 3, fig. 3 is an interface schematic diagram of obtaining a management object corresponding to a code file to be audited according to an embodiment of the present application. It should be noted that the interface shown in fig. 3 is only an illustration, and in practical application, the layout and display content of the interface may be adjusted according to the requirements, which is not limited herein. As shown in fig. 3, a code management platform is installed in the computer device, when the computer device receives a code audit instruction corresponding to a code file to be audited, an object addition page 30 may be displayed in the code management platform, the object addition page includes a auditor-chief audit image input area 37, a developer may auditor-chief audit the image input area 37 to input a main audit object, for example, a small a, and the computer device determines an object determined by the input operation as a main audit object in response to an input operation for the main audit object input area 37, that is, may take the small a as the main audit object. The main audit object can be understood as an audit object needing to manage the overall requirement of the audit code file, and can be a development total responsible person with relatively known overall requirement logic of the code file to be audited or a developer for collaborative development because the main audit object needs to grasp the functional normality of managing the overall requirement. Since the primary audit object is of importance, it cannot be deleted in general. The object addition page 30 may also include an object input area 32 and an initial management object 31 of the code file to be checked in the configuration file. The initial management object 31 in the configuration file needs to manage the influence of the code file to be checked on the code module, and the initial management object 31 generally needs to check the code file to be checked by default. Thus, the initial state of the first selectable control 311 corresponding to the initial management object 31 is selected by default. In addition, since the small a is the main audit object, the small a is set to be undeletable by default, and therefore, the first selectable control corresponding to the small a is in a locked state, that is, the selection state of the first selectable control corresponding to the small a cannot be unchecked. In addition to the initial management object 31, the developer may search for other related developers from the object input area 32 to add them to the management object of the code file to be audited. As shown in fig. 3, in addition to the small a, the small B, and the small C in the initial management object 31, the developer may want to add the small D to the audit object by inputting "small D" in the object input area 32, and the computer device may determine the target object small D determined by the input operation as the candidate object 35 in response to the input operation for the object input area 32; in addition, the developer may select the candidate object in the candidate object selection field 33 in the object addition page 30, specifically, may click on a selection option in the second selectable control 331 corresponding to the candidate object selection field 33, for example, click-select the second selectable control 331 corresponding to the small D, and the computer device determines the target object small D as the candidate object 35 in response to the second selectable control 331 selection operation corresponding to the small D. Then, in response to the triggering operation of the add control 34, the computer device determines the initial management object 31 and the candidate object 35 as management objects corresponding to the audit code file, and generates a management object list 36 (including small a, small B, small C, and small D) of the code file to be audited.
Optionally, in some specific projects, it may not be necessary to audit the code file to be audited by all the initial management objects in the configuration file, at this time, the developer may cancel the selection of the click of the first selectable control corresponding to the initial management object that does not need to be audited in the initial management objects, and does not use the first selectable control as the audit object of the code file to be audited, for example, the small C in the initial management object 31 is the initial management object that does not need to be audited in the code file to be audited, and the developer may cancel the selection of the click of the first selectable control corresponding to the small C, and the computer device deletes the first selectable control from the audit object list 36 in response to the cancellation selection operation.
Step S103: creating an audit prompt message corresponding to the code file to be audited, and sending the audit prompt message to a target group in the instant messaging application; the target group includes audit objects.
The auditing prompt message is used for indicating an auditing object to audit the code file to be audited; the instant messaging application can be understood as an application with a docking relationship of a code management platform, and can be used for providing a communication service for an audit object. In the embodiment of the application, the target group containing the auditing objects can be established in the instant messaging application, and the auditing prompt message is sent to the target group to inform the auditing objects to process the auditing tasks, so that each auditing object is not required to be independently informed, and resources can be saved. Meanwhile, the notification mode can enable the auditing object to know that an auditing task needs to be processed at the first time, so that the efficiency of code auditing can be further improved. In addition, the auditing objects can also discuss the problems in the code file to be audited in the target group, and can strengthen the communication among all auditing objects, thereby accelerating the auditing progress of the code file to be audited and improving the efficiency of code auditing.
In one possible implementation, the target group may be established by: the computer equipment can determine an instant messaging application with a docking relationship with a code management platform, and a group creation control for the instant messaging application is added in the code management platform; and further, responding to the triggering operation of the group creation control, and creating a target group containing the auditing object in the instant messaging application.
In the embodiment of the application, the code management platform can establish a docking relationship with some instant messaging applications, so that some data of both parties can be synchronized, and the convenience of data interaction can be improved. After the docking relationship is established, a group creation control for the instant messaging application may be added to the code management platform, where the group creation control is a mapping of the instant messaging application in the code management platform, and the computer device may respond to a triggering operation for the group creation control to create a target group including an audit object in the instant messaging application. It can be appreciated that by adding the group creation control for the instant messaging application in the code management platform, the creation of the target group including the audit object can be quickly completed in the instant messaging application.
Specifically, referring to fig. 4, fig. 4 is an interface schematic diagram of creating a target group according to an embodiment of the present application. It should be noted that the interface shown in fig. 4 is only an illustration, and in practical application, the layout and display content of the interface may be adjusted according to the requirements, which is not limited herein. When it is determined that the code file corresponds to the audit object, the computer device may display an audit object presentation page 40 in the code management platform, and the audit object tactical page 40 may include a plurality of controls, for example, control 1, control 2, instant messaging application creation group control 45, and so on, wherein the instant messaging application creation group control 45 is a mapping of the instant messaging application to the code management platform. The computer device may display the audit object list 41 and the group creation control 42 in the audit object presentation page 40 in response to a triggering operation of the instant messaging application creation group control 45. As shown in FIG. 4, the audit object list 41 may include four audit objects, small A, small B, small C, and small D. Optionally, the audit object list 41 may further include an identifier 43, where the identifier 43 indicates that the audit object corresponding to the audit object is a auditor-chief audit object, for example, the small a in fig. 4 is a main audit object, and the definition of the main audit object may refer to the foregoing description, which is not repeated herein, and the audit object corresponding to the main audit object may be distinguished from other audit objects by the identifier 43. When a developer initiating a code auditing instruction for a code file to be audited clicks the group creation control 42, the computer equipment can respond to the triggering operation for the group creation control 42 to create a target group containing four auditing objects of small A, small B, small C and small D in instant messaging application, so that all auditing objects can be pulled into the target group by one key, and the efficiency of group creation is improved. After the target group is successfully created, a group success prompt box 44 may be generated on the audit object presentation page 40, for example, "the target group is successfully created, the group members have small a, small B, small C, and small D," and the prompt group is successfully created may be displayed in the group success prompt box 44.
In one possible implementation manner, the number of the audit objects is M, and the audit prompt message corresponding to the code file to be audited can be created by the following method: after the computer equipment acquires the priorities of the M auditing objects, determining auditing sequences of the M auditing objects to the code files to be audited according to the priorities, and generating auditing flows corresponding to the code files to be audited according to the auditing sequences; and further obtaining the message data type in the instant messaging application, and packaging the auditing flow corresponding to the code file to be audited into an auditing prompt message conforming to the message data type.
Wherein M is a positive integer greater than 1, and the value of M can be specifically 2,3,4,5 … …. In the embodiment of the present application, the audit objects may include at least one main audit object and at least one auxiliary audit object, where the determination of auditor-chief audit objects may refer to fig. 3, which is not described herein. The secondary audit objects are objects other than the primary audit objects and generally need to manage the influence of the code files to be audited on the code modules responsible for the secondary audit objects. Optionally, when determining the audit object list, the computer device may display the primary audit object and the secondary audit object in a distinguishing manner on the code management platform, as shown in fig. 4, and distinguish the primary audit object from the secondary audit object through the identifier 43, where the audit object corresponding to the identifier 43 is the primary audit object, and the other audit objects are the secondary audit objects. That is, small a is the main audit subject, and small B, small C, and small D are audit subjects in fig. 4. In one possible implementation, the priority of the primary audit object may be preset to be higher than the secondary audit object. After the audit object list is determined, the priority of the audit object can be determined by determining the primary audit object and the secondary audit object in the audit object list. For example, taking audit objects small a, small B, small C, and small D in fig. 4 as examples, a main audit object is small a, small B, small C, and small D are sub audit objects, and since the priority of the main audit object is higher than that of the sub audit object, the priority may be small a > small b=small c=small D. Of course, the priority of the auditing object may also be determined in other manners, for example, in comparison with small B and small D, the code type and service function attribute of the code file to be audited are known, experience is rich, and the priority may be set as small a > small B > small c=small D.
In the embodiment of the application, the auditing order of the M auditing objects to the auditing code file can be determined according to the priority. For example, the auditing objects with higher priorities can be preset, after the auditing order is more reliable, the auditing objects with lower priorities check whether the code file to be audited has the problems of grammar errors and the like, and influence on the code modules responsible for the auditing objects, and the auditing objects with high priorities manage the functional normality of the overall requirements. For example, if the priority of the auditing object is small a > small b=small c=small D, the auditing order of the code file to be audited may be small b=small c=small D > small a, and the corresponding auditing process may be that after the code file to be audited is audited by small B, small C and small D, the auditing process is audited by small a. And further obtaining the message data type in the instant messaging application, and packaging the auditing flow corresponding to the code file to be audited into an auditing prompt message conforming to the message data type. The message data type conforming to the instant messaging application may be understood as a data type that may be displayed in a target group of the instant messaging application, and specifically includes, but is not limited to, text messages, picture messages, voice messages, video messages, geographic location messages, link messages, and the like. For example, the data type of the resulting audit prompt message may be a text message, a picture message, or a video message, among others.
Referring to fig. 5, fig. 5 is a schematic diagram of an interface for displaying an audit prompt message in a target group according to an embodiment of the present application. It should be noted that the interface shown in fig. 5 is only an illustration, and in practical application, the layout and display content of the interface may be adjusted according to the requirements, which is not limited herein. As shown in fig. 5, after the audit prompt message corresponding to the code file to be audited is successfully created, the audit prompt message may be displayed in a session interface of the instant messaging application. As shown in FIG. 5, the audit prompt message may be issued by a code assistant, which may be a robotic account number associated with the code management platform, that may be used to issue the audit prompt message regarding the code file to be audited to audit objects within the target group. As shown in fig. 5, the message data type of the audit prompt message may be a text message, for example, "please @ be B@, C@, the log-in code management platform completes the audit task," please @ be a, B@, C@, the log-in code management platform completes auditor-chief, etc., and the audit prompt message informs the audit objects of being required to complete the audit task for the code file to be audited, and the corresponding audit process may be that the audit process of being performed by the small a after the small B, the small C, and the small D audit completes the code file to be audited. Optionally, the audit prompt message may further include link information, for example, a link corresponding to the code management platform; or the audit prompt message can also be presented in the target group in the form of a picture message. According to the embodiment of the application, the auditing prompt message is sent to the target group containing the auditing object, so that the auditing object is not required to be independently reminded, resources are saved, the auditing object is informed to audit in time, and the efficiency of code auditing is improved. Meanwhile, the audit prompt message is sent to the target group, and the target group comprises all audit objects needing to carry out audit tasks of the code files to be audited, so that audit tasks can be mutually reminded and supervised to be completed in time among audit objects, and audit efficiency can be further improved.
Optionally, when the auditing object cannot complete the auditing task for the code file to be audited for some reasons, the code auditing platform may be logged in to apply for canceling the auditing task. For example, the audit object B may log in the code audit platform to apply for canceling the audit task because there are other reasons that the audit task needs to be processed or the code type of the code file to be audited is not familiar, and upload a cancellation reason, which may be "the audit task needs to be processed more urgently". And the supervisor of the auditing task decides whether to remove the auditing object small B from the auditing object according to auditing reasons proposed by the auditing object small B. And if the computer equipment receives the removing instruction aiming at the audit object small B, removing the audit object small B from the audit object and updating the audit object. In addition, the small B of the auditing object can be deleted from the target group, and the auditing prompt message can be sent to the target group again. Optionally, the administrator may also add an audit object according to the requirement of the audit task, for example, add the small E to the audit object, and the computer device receives an addition instruction for the small E and adds it to the audit object. In the embodiment of the application, the master person can be the total responsible person of the code file to be checked, for example, the master person can be the small A of the checking object or other relevant developers, and the master person has the main responsibility of managing the addition and deletion of the checking object. Optionally, the audit objects can also include necessary audit objects, and the necessary audit objects can be understood as audit objects which must audit the code files to be audited, so that the overall requirements and logic of the code to be audited are familiar. The necessary audit objects may be determined by the developer of the code file to be audited or may be determined by the supervisor. For example, a master audit object (e.g., audit object small A) may be set as the necessary audit object. In general, in order to improve the quality of code auditing, an auditing object is required to apply for canceling the auditing task, and the application cannot be passed. If the administrator deletes the necessary audit object of the code file to be audited, the code file to be audited fails to be submitted when the code is submitted. Therefore, the defect of a necessary auditing object can be avoided, and the quality of code auditing is influenced.
After the auditing object receives the auditing prompt message in the target group, the auditing object can log in the code management platform to process the auditing task aiming at the code file to be audited. When the auditing object carries out code auditing on the code file to be audited, the auditing object can audit manually, can audit automatically or can audit together. Manual auditing can be understood as that an auditing object checks empirically whether each line of codes has an abnormality or has an influence on the code module corresponding to the auditing object. The automatic auditing can be that an auditing object builds a test script based on a test case to automatically test the code file to be audited, and is mainly used for auditing grammar errors of the code file to be audited and the like. The test case can be understood as a description of a test task for a specific software development project, and the content of the test case includes a test target, a test environment, input data, a test step, an expected result, a test script and the like, so that a document is finally formed. In short, a test case is a set of test inputs, execution conditions, and expected results that are tailored to a particular goal to verify that a particular requirement is met. The test script is a script written for performing automated test, and the test script needs to be written corresponding to the corresponding test case.
In the embodiment of the application, the auditing object can automatically test the code file to be audited by constructing the test script based on the test case so as to audit the grammar and other problems in the code file to be audited, and then the auditing object is combined with the automatic test result to determine whether the code file to be audited affects the code module corresponding to the auditing object. Specifically, the test case corresponding to the code file to be checked may be obtained by: the method comprises the steps that computer equipment obtains a historical release code file corresponding to a code file to be checked; then, code update information of the code file to be checked can be determined according to the code file to be checked and the historical release code file; and further acquiring the test case corresponding to the code file to be audited according to the code updating information.
The historical release code file can be understood as a code file submitted by a version on the code file to be checked; the code update information can be understood as the difference between the code file to be checked and the corresponding historical release code file, and specifically can comprise a change text, a function change and the like, wherein the change text can be understood as statement change between the code file to be checked and the corresponding historical release code file; a functional change may be understood as a change in the functionality of the code file to be checked and its corresponding historical published code file.
Specifically, the computer device may obtain the similarity between the code sentences corresponding to each line of code files in the history release code file corresponding to the code file to be checked, and determine the code sentences with the similarity less than 100% as the change sentences, thereby obtaining the change text in the code update information. In one possible implementation, the differences between the pending code file and the historical published code file may be obtained by a code comparison tool (e.g., swarm website, etc.) to determine the change text. After the change text in the code update information is obtained, the function change corresponding to the code file to be checked can be determined based on the change text. In one possible implementation manner, a data flow analysis method or a control flow analysis method may be adopted to identify a function corresponding to a change text in the code update information, so as to obtain a function change corresponding to the code file to be audited. In another possible implementation manner, the function corresponding to the changed text may be identified based on a natural language processing method, for example, a linear discriminant analysis (LINEAR DISCRIMINANT ANALYSIS, LDA) algorithm is adopted, and the function corresponding to the changed text is identified based on static analysis. That is, the feature of the document title (topic) can be automatically mined by using the LDA algorithm, and the function points can be automatically identified from the code file based on the static analysis technique, whereby the function change corresponding to the code file to be checked can be obtained.
After the computer obtains the code updating information corresponding to the code file to be checked, the computer can obtain the test case corresponding to the code file to be checked according to the code updating information, and further can construct a test script corresponding to the code file to be checked based on the test case to perform automatic test, so as to obtain an automatic test result corresponding to the code file to be checked. The automated test may include at least one of a unit test, an integration test, a validation test, an acceptance test, a regression test, a system test, an Alpha test, and a Beta test, among others. Problems with automated test scanning may include, but are not limited to: possible bugs (bugs), invalid codes, overly complex expressions, duplicate codes, non-optimal codes, etc. The automatic test result can comprise two conditions of passing and failing, when the automatic test result indicates that the code file to be audited passes the test, the automatic test result can be sent to the audit object, then the audit object is combined with the automatic test result to determine whether the code file to be audited affects the code module corresponding to the audit object, if not, the audit result of the code file to be audited is input on the code management platform by the audit object, and the audit result indicates that the audit is passed; if the influence is caused, outputting an audit result indicating that the audit is not passed. If the automatic test result indicates that the code file to be audited fails the test, outputting an audit result indicating that the audit fails.
After M auditing objects exist and each auditing object in the M auditing objects completes the code file to be reviewed, the computer equipment can acquire auditing results of the M auditing objects aiming at the code file to be reviewed; if the auditing results of the M auditing objects indicate that the auditing is passed, submitting the code file to be audited to a code library; if any one audit object in the M audit objects indicates that the audit is not passed, generating a modification prompt message corresponding to the code file to be audited according to the audit results of the M audit objects, and sending the modification prompt message to the development object corresponding to the code file to be audited.
Wherein M is a positive integer greater than 1, and the value of M can be specifically 2,3,4,5 … …. The auditing result may include, but is not limited to, a final quality evaluation result of the code file to be audited, an abnormal statement of the code file to be audited, a corresponding modification opinion thereof, and the like. In the embodiment of the application, when the auditing results of M auditing objects indicate that the auditing is passed, the code file to be audited can be submitted to the corresponding code library. Optionally, when the auditing results of the M auditing objects all indicate that the auditing is passed, the code file to be audited and the main code file may be merged and then submitted to the code library. When the auditing result of any one auditing object in the M auditing objects indicates that the auditing is not passed, the code to be audited cannot be submitted to the code base. At this time, the computer device may generate a modification prompt message corresponding to the code file to be inspected according to the inspection results of the M inspection objects, and send the modification prompt message to the development object corresponding to the code file to be inspected to prompt the development object corresponding to the code file to be inspected, where the code file to be inspected is not inspected and the code to be inspected needs to be modified. Optionally, the modification prompt message may be sent to a development group in the instant messaging application, where the development group includes a development object of the code file to be audited, so that the development object may be timely notified to modify an error occurring in the code file to be audited according to the modification prompt message. After the code file is modified, the code audit needs to be re-requested until the audit results of all audit objects indicate that the audit is passed, and the party can re-submit. In the embodiment of the application, when the auditing results of all auditing objects indicate that the auditing of the code file to be audited is passed, the code file to be audited can be submitted, and if one auditing result of the auditing object indicates that the auditing result is not passed, the code file to be audited can not be submitted.
Optionally, in order to further improve the standardization of code submission, after all the auditing objects audit the code file to be audited, code description information corresponding to the code file to be audited can be created based on the code update information of the code file to be audited and auditing results of the M auditing objects, so that the problem solved by the code file to be audited can be conveniently and quickly located in the later stage.
Specifically, if the auditing results of the M auditing objects all indicate that the auditing is passed, the computer equipment acquires a history release code file corresponding to the code file to be audited; further, code update information of the code file to be checked can be determined according to the code file to be checked and the historical release code file; and finally, creating code description information corresponding to the code file to be checked according to the code update information and the checking results of the M checking objects, and submitting the code description information to a code library.
The definition of the history issue code file and the code update information may refer to the foregoing description, and will not be described herein. The code update information may include the change text and the function text of the code file to be checked. The code description information may be used to record basic information of the code file to be checked, and may specifically include, but is not limited to: code update information, audit objects, audit results, development objects, modification time and the like of the code file to be audited, so that the problem solved by the code file to be audited can be conveniently and quickly positioned through code description information in the later period.
Specifically, referring to fig. 6, fig. 6 is a schematic diagram of code description information provided in an embodiment of the present application. As can be seen from fig. 6, the code description information may include the changed text content of the code file to be checked as compared with the history issue code file, and the business function attribute of the code file to be checked, that is, the function change of the code file to be checked as compared with the history issue code file. As shown in FIG. 6, the function of the code file to be reviewed can be quickly understood from the code description information as a "method of refreshing the interface display newly". In addition, the information such as the auditing object, auditing result, auditing time, development object, modification time and the like corresponding to the code file to be audited can be obtained from the code description information, so that the later inquiry is convenient. In addition, the auditing object in the code description information needs to be consistent with the auditing object list which truly confirms that the auditing is finished, otherwise, the code file to be audited cannot be submitted successfully. When submitting the code file to be checked to the code library, the computer equipment can match the checking objects in the code description information with the checking object lists in the code file to be checked one by one, and the checking objects are all consistent with the checking object lists in the code file to be checked, and the code file to be checked and the code description information can be submitted to the code library, otherwise, the submission fails. Therefore, the code description information can be prevented from being randomly filled, and the code information acquired in the later stage is not perfect. It will be appreciated that, fig. 6 shows code description information created for the code file to be checked, in some specific applications, in order to better query the code information, the code description information corresponding to the code file to be checked may be updated based on the code description information corresponding to the code file to be checked, that is, the code description information corresponding to the code file to be checked may include the code information of the code file to be checked in addition to the code information thereof, so that the code description information may be further improved. Optionally, in order to further improve the normalization of the code description information submitted by the code file to be checked, the brief summary (short summary) in the code description information can be uniformly and fixedly filled into ASCII characters, and the number of effective characters is at least 32, so that the function of the code file to be checked can be quickly positioned through the code description information in the later stage.
The code auditing method provided by the embodiment of the application is further described below with reference to fig. 7 and 8. Fig. 7 is a schematic diagram of a flow frame of code submission under a Windows operating system according to an embodiment of the present application, and fig. 8 is a schematic diagram of a flow frame of code submission under a Linux operating system according to an embodiment of the present application. The code submission flow under the Linux operating system is slightly different from that under the Windows operating system. Under the Linux operating system, commands such as operation storage and the like are needed, a code file to be checked is put into a temporary storage area (shelve) of a code management platform, then the code checking platform of a Windows version is opened, and the subsequent steps are basically consistent. The embodiment of the application is mainly introduced by a Windows operating system. As shown in fig. 7, after the developer completes modification of the code file in a certain code module on the code management platform to obtain the code file to be audited, the code file to be audited may be placed into a temporary storage area (shelve) of the code management platform through a python (a computer programming language) script. Because the operation of the python script depends on the current python environment and the corresponding installation package of the python, in specific application, tools (such as pyinbstall tools and the like) can be used for processing the python script in batch (bat) by one key, and developers can install the python script by one key through the bat one key tool, so that each developer can be prevented from downloading the corresponding python environment and installation package, and the installation efficiency can be improved. It will be appreciated that the use of the python script described above requires authorization, and therefore, the developer using the python script needs to confirm that his own home network proxy is not problematic. After determining the code file to be audited, the developer may trigger the python script in a pending area (pending) of the code management platform to enter a code audit entry, and specifically, may select the code audit entry in a right key of the pending area (pending), and generate a code audit instruction for the code file to be audited stored in the temporary storage area (shelve). After receiving a code auditing instruction for a code file to be audited, the computer equipment displays auditor-chief a check image input area on the code management platform, and after the developer inputs a main auditing object in the auditor-chief check image input area, the computer equipment responds to an input operation for the main auditing object input area and determines the object determined by the input operation as a main auditing object. And then, the computer equipment displays an object adding page in the code management platform, wherein the object adding page comprises an object input area, the code files to be checked and initial management objects of the associated code files in the configuration files, and the initial management objects are automatically pulled from the configuration files corresponding to the code files to be checked and the associated code files without manual filling. In addition to taking the initial management object as an audit object, the developer can search other related developers from the object input area and take the relevant developers as audit objects of the code file to be audited. After determining the auditing object of the code file to be audited, an auditing prompt message corresponding to the code file to be audited can be created, and the auditing prompt message is sent to a target group containing the auditing object in the instant messaging application. After receiving the audit prompt message, the audit object can log in the code management platform to complete the audit task for the code file to be audited, and check the result serve of process. When submitting the code of the code file to be audited, if all auditing results of auditing objects indicate that the auditing is passed, submitting the code file to be audited to a code library; if any auditing result of the auditing objects indicates that the auditing is not passed, submitting the auditing results to fail, generating a modification prompt message corresponding to the code file to be audited according to the auditing results, sending the modification prompt message to a development object corresponding to the code file to be audited, and then auditing the code file after modification according to the flow until all auditing objects pass the auditing, and submitting the code file. Therefore, the accuracy and efficiency of code auditing can be improved, and the error probability of the submitted code file can be reduced.
In the embodiment of the application, after the code file to be audited is obtained, the associated code file corresponding to the code file to be audited can be determined according to the service function attribute corresponding to the code file to be audited; then, the management object corresponding to the code file to be checked and the management object corresponding to the associated code file can be determined to be the checking object corresponding to the code file to be checked; and then, an audit prompt message corresponding to the code file to be audited can be created, and the audit prompt message is sent to a target group in the instant messaging application, wherein the target group comprises an audit object. In the embodiment of the application, the auditing objects corresponding to the code files to be audited are from the management objects corresponding to the code files to be audited and the management objects corresponding to the associated code files, and the adaptation degree and the association between the auditing objects corresponding to the code files to be audited and the code files to be audited are high, so that the code auditing time can be reduced, and the code auditing efficiency can be improved; in addition, in the embodiment of the application, the auditing prompt message is sent to the target group containing the auditing objects in the instant messaging application, the auditing objects are informed to process the auditing tasks, each auditing object is not required to be independently informed, and meanwhile, the auditing objects can be informed that the auditing tasks need to be processed at the first time by the informing mode, so that the efficiency of code auditing can be further improved.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a code auditing apparatus according to an embodiment of the present application. As shown in fig. 9, the code auditing apparatus 1 may include: an association code determination module 11, an audit object determination module 12, and a message transmission module 13, wherein:
The associated code determining module 11 is configured to obtain a code file to be checked, and determine an associated code file corresponding to the code file to be checked according to a service function attribute corresponding to the code file to be checked;
the auditing object determining module 12 is configured to determine a management object corresponding to the code file to be audited and a management object corresponding to the associated code file as an auditing object corresponding to the code file to be audited;
The message sending module 13 is used for creating an audit prompt message corresponding to the code file to be audited and sending the audit prompt message to a target group in the instant messaging application; the target group includes audit objects.
The specific functional implementation manners of the association code determining module 11, the audit object determining module 12 and the message sending module 13 may refer to step S101 to step S103 in the embodiment corresponding to fig. 2, and will not be described herein.
In one or more embodiments, the association code determining module 11 may include a first determining unit 111 and a second determining unit 112, wherein:
A first determining unit 111, configured to obtain a service application to which the code file to be audited belongs, and determine a logic function attribute associated with a service function attribute corresponding to the code file to be audited according to a service logic corresponding to the service application;
The second determining unit 112 is configured to determine a code file corresponding to the logic function attribute as an associated code file corresponding to the code file to be checked.
The specific functional implementation manner of the first determining unit 111 and the second determining unit 112 may refer to step S101 in the embodiment corresponding to fig. 2, and will not be described herein.
In one or more embodiments, the code audit device 1 may further include: a page display module 14 and a management object determination module 15, wherein:
The page display module 14 is configured to receive a code audit instruction corresponding to the code file to be audited, and display an object addition page in the code management platform, where the object addition page includes an object input area and an initial management object of the code file to be audited in the configuration file;
The management object determining module 15 is configured to determine, in response to an input operation for the object input area, a target object determined by the input operation as a candidate object, and determine an initial management object and the candidate object as management objects corresponding to the audit code file.
The specific functional implementation manner of the page display module 14 and the management object determining module 15 may refer to step S102 in the embodiment corresponding to fig. 2, and will not be described herein.
In one or more embodiments, the number of audit objects is M, M being an integer greater than 1, and the message sending module 13 may include: a generating unit 131 and a packaging unit 132, wherein:
The generating unit 131 is configured to obtain priorities of the M auditing objects, determine an auditing order of the M auditing objects for the code file to be audited according to the priorities, and generate an auditing flow corresponding to the code file to be audited according to the auditing order;
the encapsulation unit 132 is configured to obtain a message data type in the instant messaging application, and encapsulate an audit procedure corresponding to the code file to be audited into an audit prompt message conforming to the message data type.
The specific functional implementation manner of the generating unit 131 and the packaging unit 132 may refer to step S103 in the embodiment corresponding to fig. 2, and will not be described herein.
In one or more embodiments, the code audit device 1 may further include: a control addition module 16 and a group creation module 17, wherein:
The control adding module 16 is configured to determine an instant messaging application having a docking relationship with the code management platform, and add a group creation control for the instant messaging application in the code management platform;
the group creation module 17 is configured to create a target group including an audit object in the instant messaging application in response to a triggering operation for the group creation control.
The specific functional implementation manner of the control adding module 16 and the group creating module 17 may refer to step S103 in the embodiment corresponding to fig. 2, and will not be described herein.
In one or more embodiments, the number of auditing objects is M, M being an integer greater than 1, the code auditing apparatus 1 may further include: an audit result acquisition module 18, a code submission module 19 and a message generation module 20, wherein:
The auditing result obtaining module 18 is used for obtaining auditing results of M auditing objects aiming at the code file to be audited;
The code submitting module 19 is configured to submit the code file to be inspected to the code library if the inspection results of the M inspection objects all indicate that the inspection is passed;
The message generating module 20 is configured to generate a modification prompt message corresponding to the code file to be checked according to the audit results of the M audit objects if the audit result of any audit object indicates that the audit is not passed, and send the modification prompt message to the development object corresponding to the code file to be checked.
The specific function implementation manner of the audit result obtaining module 18, the code submitting module 19 and the message generating module 20 may refer to step S103 in the embodiment corresponding to fig. 2, and will not be described herein.
In one or more embodiments, the code audit device 1 may further include: a history code acquisition module 21, an update information determination module 22, and a message creation module 23, wherein:
The history code obtaining module 21 is configured to obtain a history release code file corresponding to the code file to be inspected if the inspection results of the M inspection objects all indicate that the inspection is passed;
An update information determining module 22, configured to determine code update information of the code file to be checked according to the code file to be checked and the historical published code file;
The message creation module 23 is configured to create code description information corresponding to the code file to be checked according to the code update information and the checking results of the M checking objects, and submit the code description information to the code library.
The specific function implementation manner of the history code obtaining module 21, the update information determining module 22 and the message creating module 23 may refer to step S103 in the embodiment corresponding to fig. 2, and will not be described herein.
In the embodiment of the application, after the code file to be audited is obtained, the associated code file corresponding to the code file to be audited can be determined according to the service function attribute corresponding to the code file to be audited; then, the management object corresponding to the code file to be checked and the management object corresponding to the associated code file can be determined to be the checking object corresponding to the code file to be checked; and then, an audit prompt message corresponding to the code file to be audited can be created, and the audit prompt message is sent to a target group in the instant messaging application, wherein the target group comprises an audit object. In the embodiment of the application, the auditing objects corresponding to the code files to be audited are from the management objects corresponding to the code files to be audited and the management objects corresponding to the associated code files, and the adaptation degree and the association between the auditing objects corresponding to the code files to be audited and the code files to be audited are high, so that the code auditing time can be reduced, and the code auditing efficiency can be improved; in addition, in the embodiment of the application, the auditing prompt message is sent to the target group containing the auditing objects in the instant messaging application, the auditing objects are informed to process the auditing tasks, each auditing object is not required to be independently informed, and meanwhile, the auditing objects can be informed that the auditing tasks need to be processed at the first time by the informing mode, so that the efficiency of code auditing can be further improved.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a computer device according to an embodiment of the application. As shown in fig. 10, the computer device 1000 may be a user terminal or a server, which is not limited herein. For ease of understanding, the present application takes a computer device as an example of a user terminal, and the computer device 1000 may include: processor 1001, network interface 1004, and memory 1005, in addition, the computer device 1000 may further comprise: a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may also include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 9, an operating system, a network communication module, a user interface module, and a device control application may be included in a memory 1005, which is one type of computer-readable storage medium.
The network interface 1004 in the computer device 1000 may also provide network communication functions, and the optional user interface 1003 may also include a Display screen (Display) and a Keyboard (Keyboard). In the computer device 1000 shown in FIG. 10, the network interface 1004 may provide network communication functions; while user interface 1003 is primarily used as an interface for providing input to a user; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
Acquiring a code file to be checked, and determining an associated code file corresponding to the code file to be checked according to the service function attribute corresponding to the code file to be checked;
determining a management object corresponding to the code file to be checked and a management object corresponding to the associated code file as an audit object corresponding to the code file to be checked;
creating an audit prompt message corresponding to the code file to be audited, and sending the audit prompt message to a target group in the instant messaging application; the target group includes audit objects.
It should be understood that the computer device 1000 described in the embodiment of the present application may perform the description of the code auditing method in the embodiment corresponding to fig. 2, and may also perform the description of the code auditing apparatus 1 in the embodiment corresponding to fig. 9, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer readable storage medium, in which the aforementioned computer program executed by the code auditing apparatus 1 is stored, and the computer program includes program instructions, when executed by a processor, can execute the description of the code auditing method in the embodiment corresponding to fig. 2, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application. As an example, program instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network, where the multiple computing devices distributed across multiple sites and interconnected by a communication network may constitute a blockchain system.
In addition, it should be noted that: embodiments of the present application also provide a computer program product or computer program that may include computer instructions that may be stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor may execute the computer instructions, so that the computer device performs the description of the code auditing method in the embodiment corresponding to fig. 2, which will not be described herein. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the computer program product or the computer program embodiments according to the present application, reference is made to the description of the method embodiments according to the present application.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of action described, as some steps may be performed in other order or simultaneously according to the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present application.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device of the embodiment of the application can be combined, divided and deleted according to actual needs.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of a computer program stored in a computer-readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.

Claims (10)

1. A code auditing method, comprising:
Acquiring a code file to be checked, and determining an associated code file corresponding to the code file to be checked according to the service function attribute corresponding to the code file to be checked;
Determining a management object corresponding to the code file to be checked and a management object corresponding to the associated code file as checking objects corresponding to the code file to be checked;
Creating an audit prompt message corresponding to the code file to be audited, and sending the audit prompt message to a target group in the instant messaging application; the target group includes the audit object.
2. The method according to claim 1, wherein the determining, according to the service function attribute corresponding to the code file to be checked, the associated code file corresponding to the code file to be checked includes:
acquiring a service application to which the code file to be checked belongs, and determining logic function attributes associated with service function attributes corresponding to the code file to be checked according to service logic corresponding to the service application;
And determining the code file corresponding to the logic function attribute as the associated code file corresponding to the code file to be checked.
3. The method according to claim 1, wherein the method further comprises:
receiving a code auditing instruction corresponding to the code file to be audited, and displaying an object adding page in a code management platform, wherein the object adding page comprises an object input area and an initial management object of the code file to be audited in a configuration file;
and responding to the input operation aiming at the object input area, determining a target object determined by the input operation as a candidate object, and determining the initial management object and the candidate object as management objects corresponding to the audit code file.
4. The method of claim 1, the number of audit objects being M, M being an integer greater than 1;
the creating the audit prompt message corresponding to the code file to be audited comprises the following steps:
Acquiring priorities of M auditing objects, determining auditing sequences of the M auditing objects to the code files to be audited according to the priorities, and generating auditing flows corresponding to the code files to be audited according to the auditing sequences;
and acquiring the message data type in the instant messaging application, and packaging the auditing flow corresponding to the code file to be audited into an auditing prompt message conforming to the message data type.
5. The method according to claim 1, wherein the method further comprises:
Determining an instant messaging application with a docking relationship with a code management platform, and adding a group creation control for the instant messaging application in the code management platform;
And responding to the triggering operation of the group creation control, and creating a target group containing the auditing object in the instant messaging application.
6. The method of claim 1, wherein the number of audit objects is M, M being an integer greater than 1;
The method further comprises the steps of:
obtaining auditing results of M auditing objects aiming at the code file to be audited;
If the auditing results of the M auditing objects indicate that the auditing is passed, submitting the code file to be audited to a code library;
If any one audit object in the M audit objects indicates that the audit is not passed, generating a modification prompt message corresponding to the code file to be audited according to the audit results of the M audit objects, and sending the modification prompt message to a development object corresponding to the code file to be audited.
7. The method of claim 6, wherein the method further comprises:
If the auditing results of the M auditing objects all indicate that the auditing is passed, acquiring a historical release code file corresponding to the code file to be audited;
Determining code update information of the code file to be checked according to the code file to be checked and the historical release code file;
And creating code description information corresponding to the code file to be checked according to the code update information and checking results of M checking objects, and submitting the code description information to the code library.
8. A code auditing apparatus, comprising:
The associated code determining module is used for acquiring a code file to be checked, and determining an associated code file corresponding to the code file to be checked according to the service function attribute corresponding to the code file to be checked;
The auditing object determining module is used for determining the management object corresponding to the code file to be audited and the management object corresponding to the associated code file as the auditing object corresponding to the code file to be audited;
The message sending module is used for creating an audit prompt message corresponding to the code file to be audited and sending the audit prompt message to a target group in the instant messaging application; the target group includes the audit object.
9. A computer device comprising a memory and a processor;
The memory is connected to the processor for storing a computer program, the processor being adapted to invoke the computer program to cause the computer device to perform the method of any of claims 1 to 7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any of claims 1 to 7.
CN202211455907.8A 2022-11-21 2022-11-21 Code auditing method, device, equipment and medium Pending CN118057303A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211455907.8A CN118057303A (en) 2022-11-21 2022-11-21 Code auditing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211455907.8A CN118057303A (en) 2022-11-21 2022-11-21 Code auditing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN118057303A true CN118057303A (en) 2024-05-21

Family

ID=91069169

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211455907.8A Pending CN118057303A (en) 2022-11-21 2022-11-21 Code auditing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN118057303A (en)

Similar Documents

Publication Publication Date Title
US10318412B1 (en) Systems, methods, and apparatus for dynamic software generation and testing
US10127141B2 (en) Electronic technology resource evaluation system
CN108628748B (en) Automatic test management method and automatic test management system
CN110837356B (en) Data processing method and device
CN110727575B (en) Information processing method, system, device and storage medium
CN112488652A (en) Work order auditing method, system, terminal and storage medium
US20150378828A1 (en) Test data management
US12093169B2 (en) Intelligent dynamic web service testing apparatus in a continuous integration and delivery environment
EP4246332A1 (en) System and method for serverless application testing
US20230297496A1 (en) System and method for serverless application testing
US12079112B2 (en) Intelligent dynamic web service testing apparatus in a continuous integration and delivery environment
CN111249743B (en) Method and device for checking and submitting art resources
CN118394642A (en) Verification method and device
KR102111392B1 (en) Test unified administration system and Controlling Method for the Same
CN111767218A (en) Automatic testing method, equipment and storage medium for continuous integration
CN118057303A (en) Code auditing method, device, equipment and medium
CN112015715A (en) Industrial Internet data management service testing method and system
CN115422202A (en) Service model generation method, service data query method, device and equipment
CN115757097A (en) Test case generation method and device, electronic equipment and storage medium
CN112328473A (en) Code automation integration test method and device and electronic equipment
US11475654B1 (en) Technology control evaluation program
CN117149661B (en) Method, apparatus, device and computer readable medium for monitoring business system
US20240013231A1 (en) System and method for data validation rule simulation
CN111444081B (en) Determination, response and generation methods, client, server, device and medium
CN114281831A (en) Data construction method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication