CN110647466B - Program quality supervision method and device based on DevOps - Google Patents

Program quality supervision method and device based on DevOps Download PDF

Info

Publication number
CN110647466B
CN110647466B CN201910897960.5A CN201910897960A CN110647466B CN 110647466 B CN110647466 B CN 110647466B CN 201910897960 A CN201910897960 A CN 201910897960A CN 110647466 B CN110647466 B CN 110647466B
Authority
CN
China
Prior art keywords
program
source code
quality analysis
coverage rate
program source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910897960.5A
Other languages
Chinese (zh)
Other versions
CN110647466A (en
Inventor
雷志亮
张旭峰
张伟
李辉辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201910897960.5A priority Critical patent/CN110647466B/en
Publication of CN110647466A publication Critical patent/CN110647466A/en
Application granted granted Critical
Publication of CN110647466B publication Critical patent/CN110647466B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Abstract

According to the program quality supervision method and device based on the DevOps, the program quality can be effectively improved under the condition of not increasing the whole labor cost by comprehensively counting the four indexes including the program coverage rate, the total branch coverage rate, the single program branch coverage rate and the single program branch coverage rate in an incremental mode, manual intervention is not needed in the process, UTDD practice is promoted, and release efficiency of a Devops version is improved.

Description

Program quality supervision method and device based on DevOps
Technical Field
The invention relates to the field of program supervision, in particular to a program quality supervision method and device based on DevOps.
Background
In the current quick version release process under the Devops and agile iteration trend, how to better develop UTDD and make quality guarantee of submitted programs are basic requirements for ensuring stable operation of production. The common practice of UTDD at present is to write unit test cases, write codes and adjust the general flow of the unit test cases to carry out work, and after the program is submitted, a developer is forced to further perfect an automatic case and program by monitoring coverage rate conditions by a special person, and branch coverage rate data is improved.
Disclosure of Invention
In order to solve the above-mentioned shortcomings, the present application provides a program quality supervision method based on DevOps, including:
acquiring program source codes to be put in storage; the program source code is the initial source code of the program or the update source code for modifying the initial source code;
performing static code detection on the program source codes to obtain data values of a plurality of indexes; the index comprises program coverage rate, total branch coverage rate, single program branch coverage rate and program coverage increment rate;
generating a quality analysis result of the program source code according to the data values of the multiple indexes;
and determining whether to put the program source code in storage according to the quality analysis result.
In some embodiments, generating a quality analysis result of the program source code from the data values of the plurality of metrics comprises:
and inputting the data values of the multiple indexes into a preset quality analysis model so that the quality analysis model outputs a quality analysis result of the program source code.
In some embodiments, the generating the quality analysis result of the program source code according to the data values of the plurality of indicators includes:
calculating the difference between the total branch coverage rate and a preset total branch coverage rate reaching a target value, and the difference between the single program branch coverage rate and a preset single program coverage rate reaching a target value;
calculating the difference value of the total branch coverage rate and the last total branch coverage rate of the program source code and the difference value of the single program branch coverage rate and the last single program branch coverage rate of the program source code;
calculating a difference value between a set upper limit of the program coverage increment rate and the program coverage rate of the program source code;
generating an upper limit weight according to the set upper limit of the program coverage increasing rate;
and generating a quality analysis result of the program source code according to the difference value and the upper limit weight.
In certain embodiments, further comprising:
establishing the quality analysis model; and
and training the quality analysis model through different types of calibrated program source codes.
In some embodiments, the training the quality analysis model with different types of calibrated program source code includes:
calibrating a program source code type and generating type weights according to the program source code type;
acquiring a data value of each index from the program source code;
mapping each index data value obtained from each program source code into a one-dimensional vector to obtain a vector sequence corresponding to each program source code; wherein each vector sequence corresponds to a marked result sequence;
inputting the vector sequence and the result sequence as a group of training samples to the quality analysis model so that the quality analysis model forms a corresponding relation between the vector sequence and the result sequence;
and calibrating whether the program source code can be put in storage according to the result sequence, so that the quality analysis model forms a corresponding relation between the result sequence and whether the program source code can be put in storage.
The application also provides a program quality supervision device based on the DevOps, which comprises:
the program source code acquisition module acquires program source codes to be put in storage; the program source code is the initial source code of the program or the update source code for modifying the initial source code;
the static code detection module is used for detecting the static code of the program source code and acquiring data values of a plurality of indexes; the index comprises program coverage rate, total branch coverage rate, single program branch coverage rate and program coverage increment rate;
the quality analysis result generation module is used for generating a quality analysis result of the program source code according to the data values of the multiple indexes;
and the warehousing module is used for determining whether to warehouse the program source code according to the quality analysis result.
In some embodiments, the quality analysis result generation module inputs the data values of the plurality of indexes to a preset quality analysis model, so that the quality analysis model outputs the quality analysis result of the program source code.
In certain embodiments, the mass analysis result generation module comprises:
a first calculation unit for calculating the difference between the total branch coverage rate and a preset total branch coverage rate reaching a target value, and the difference between the single program branch coverage rate and a preset single program coverage rate reaching a target value;
the second calculation unit is used for calculating the difference value of the total branch coverage rate and the last total branch coverage rate of the program source code and the difference value of the single program branch coverage rate and the last single program branch coverage rate of the program source code;
a third calculation unit that calculates a difference between a set upper limit of the program coverage increment rate and a program coverage rate of the program source code;
an upper limit weight calculation unit that generates an upper limit weight according to a set upper limit of the program coverage increasing rate;
and a quality analysis result generating unit for generating a quality analysis result of the program source code according to the difference value and the upper limit weight.
In certain embodiments, further comprising:
the model building module is used for building the quality analysis model; and
and the model training module is used for training the quality analysis model through different types of calibrated program source codes.
In certain embodiments, the model training module comprises:
the type calibration unit is used for calibrating the type of the program source code and generating type weights according to the type of the program source code;
an index obtaining unit for obtaining the data value of each index from the program source code;
the mapping unit maps each index data value obtained from each program source code into a one-dimensional vector to obtain a vector sequence corresponding to each program source code; wherein each vector sequence corresponds to a marked result sequence;
the training unit is used for inputting the vector sequence and the result sequence as a group of training samples to the quality analysis model so that the quality analysis model forms a corresponding relation between the vector sequence and the result sequence;
and the warehousing calibration unit is used for calibrating whether the program source code can be warehoused according to the result sequence, so that the quality analysis model forms a corresponding relation between the result sequence and whether the program source code is warehoused.
The present application also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, which processor implements the steps of the method as described above when executing the program.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method as described above.
The invention has the following beneficial effects:
according to the program quality supervision method and device based on the DevOps, the program quality can be effectively improved under the condition of not increasing the whole labor cost by comprehensively counting the four indexes including the program coverage rate, the total branch coverage rate, the single program branch coverage rate and the single program branch coverage rate in an incremental mode, manual intervention is not needed in the process, UTDD practice is promoted, and release efficiency of a Devops version is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention 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 invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a flow chart of a program quality supervision method based on DevOps provided in the present application.
Fig. 2 shows a schematic structural diagram of a program quality supervision device based on DevOps provided in the present application.
Fig. 3 shows a schematic structural diagram of a computer device suitable for use in implementing embodiments of the present application.
Detailed Description
The following description of the embodiments of the present invention 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 invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The current common practice of UTDD is that the test coverage rate condition of a unit is unified after the program is submitted by a post-tracking mode, (1) the program is informed of the condition of the coverage rate of the unit, and the corresponding developer is informed of the substandard program, and the developer optimizes the program and the case after receiving the program, so that the management cost is high and the quality cannot be effectively ensured; (2) the modification program which reaches the standard in the earlier stage cannot ensure that the modification point is effectively covered; (3) the existing program supervision method can only carry out full-quantity scanning each time, and cannot carry out unit test coverage supervision on incremental modification points alone; (4) white list programs (such as framework-like programs) are currently not identifiable.
In view of this, the present application proposes a program quality supervision method based on DevOps, as shown in fig. 1, including:
s1: acquiring program source codes to be put in storage; the program source code is the initial source code of the program or the update source code for modifying the initial source code;
s2: performing static code detection on the program source codes to obtain data values of a plurality of indexes; the index comprises program coverage rate, total branch coverage rate, single program branch coverage rate and program coverage increment rate;
s3: generating a quality analysis result of the program source code according to the data values of the multiple indexes;
s4: and determining whether to put the program source code in storage according to the quality analysis result.
According to the program quality supervision method based on the DevOps, through comprehensive statistics of four indexes including the program coverage rate, the total branch coverage rate, the single program branch coverage rate and the single program branch coverage rate increment, the program quality can be effectively improved without increasing the overall labor cost, manual intervention is not needed in the process, UTDD practice is promoted, and the release efficiency of a Devops version is improved.
It will be understood that, in this application, some of the generic terms are given below:
devops: the integrated development, operation and maintenance, a series of processes, methods, tools and systems with the aim of rapidly and accurately delivering service value, make the construction, test and release of software products faster, more frequent and reliable through an automatic flow.
UTDD: the unit test drive is developed, firstly writing a unit test case, and then realizing codes until the unit test passes.
Static code inspection: the grammar, interface, etc. of the source program are statically analyzed and checked to check the correctness of the program.
Total branch coverage: the overall branch coverage of the program in the project, i.e. the total number of covered branches/total number of branches of all programs in the project.
Single program branch coverage: in the program list submitted at this time, the number of covered branches per program/the total number of branches per program.
Program coverage rate of increase: in the program list submitted at this time, the coverage rate data of each program at this time is compared with the change condition of the coverage rate data of the program before modification.
In certain embodiments, step S3 specifically includes:
calculating the difference between the total branch coverage rate and a preset total branch coverage rate reaching a target value, and the difference between the single program branch coverage rate and a preset single program coverage rate reaching a target value;
calculating the difference value of the total branch coverage rate and the last total branch coverage rate of the program source code and the difference value of the single program branch coverage rate and the last single program branch coverage rate of the program source code;
calculating a difference value between a set upper limit of the program coverage increment rate and the program coverage rate of the program source code;
generating an upper limit weight according to the set upper limit of the program coverage increasing rate;
and generating a quality analysis result of the program source code according to the difference value and the upper limit weight.
In some embodiments, where different types of program source code weights are different, the quality analysis results may be determined using a formula such as the following:
z= (branch coverage gap + change amount x 2+ increment upper limit gap x upper limit weight) program type weight
Z <1 is up to standard, and the smaller the Z value is, the higher the self-test degree is. Wherein, each index supplement is described as follows:
branch coverage reaching the standard gap = coverage index-this coverage, negative number 0;
the variation = last coverage-current coverage, negative number 0;
upper limit gap = increment upper limit-this coverage, negative number 0;
upper limit weight = 1-increasing upper limit;
program type weight: whitelist=0, regular program=5, kernel program=10.
In this embodiment, each weight coefficient may be dynamically adjusted according to the actual situation.
For example, in some embodiments, except for the static code checking program being problem-free, the program needs to be modified to have been covered by unit test cases, so the program coverage should be 100% to ensure that the code submitted to the tester verification has been self-tested; the branch coverage rate of the full-quantity program of the version library is more than 60%, the branch coverage rate of a single program is more than 50%, and through full practice, the branch coverage rate of 50-60% can smoothly complete program research and development under the condition that the coding progress of a developer is not affected excessively, and meanwhile, the program quality can be effectively ensured; if the content is too high, a developer needs to input a large amount of energy to finish the index, and if the content is too low, the program quality cannot be effectively ensured; the program coverage rate is increased, the requirement and the upper limit are set, the quality comparison with the original statistical rule before modification and the quality comparison with the excellent standard are supplemented, and the quality and the change condition are measured together by the multi-dimensional statistics.
In some embodiments, the above formula may be updated with a set frequency, which is not described herein.
Further, the present application may incorporate machine learning techniques, and in some embodiments, step S3 specifically includes:
and inputting the data values of the multiple indexes into a preset quality analysis model so that the quality analysis model outputs a quality analysis result of the program source code.
In this embodiment, the mass analysis model may be built online or offline, i.e. the present application may use only a trained mass analysis model, or may obtain the mass analysis model by online build-training.
In certain embodiments, the method steps in the present application further comprise:
s01: establishing the quality analysis model; and
s02: and training the quality analysis model through different types of calibrated program source codes.
In specific implementation, step S02 specifically includes:
s021: calibrating a program source code type and generating type weights according to the program source code type;
s022: acquiring a data value of each index from the program source code;
s023: mapping each index data value obtained from each program source code into a one-dimensional vector to obtain a vector sequence corresponding to each program source code; wherein each vector sequence corresponds to a marked result sequence;
s024: inputting the vector sequence and the result sequence as a group of training samples to the quality analysis model so that the quality analysis model forms a corresponding relation between the vector sequence and the result sequence;
s025: and calibrating whether the program source code can be put in storage according to the result sequence, so that the quality analysis model forms a corresponding relation between the result sequence and whether the program source code can be put in storage.
In the embodiment, the quality analysis model is built based on an LSTM neural network, input data are generated into an input sequence, the neural network model is trained through input and output calibration, and the trained quality analysis model has a corresponding relation between a vector sequence and a result sequence and a corresponding relation between the result sequence and whether the result sequence is put in storage or not.
Since the index data value belongs to the numerical data, it can be mapped directly to the corresponding vector element, for example, 90% mapped to 0.9 (equivalent mapping) or 90% mapped to 7.1 (non-equivalent mapping).
It will be appreciated that the non-equivalent map is generated based on index weights, the weights of each index being different and may be set as desired.
It can be appreciated that in this embodiment, by combining with the machine learning model, the quality analysis of the program source code can be continuously updated, so that the most accurate quality analysis result can be obtained, and the program source code can be accurately guided to be put in storage.
At the virtual device level, based on the same inventive concept as the present application, fig. 2 shows a DevOps-based program quality supervision device, comprising:
the program source code acquisition module 1 acquires program source codes to be put in storage; the program source code is the initial source code of the program or the update source code for modifying the initial source code;
the static code detection module 2 is used for carrying out static code detection on the program source codes and obtaining data values of a plurality of indexes; the index comprises program coverage rate, total branch coverage rate, single program branch coverage rate and program coverage increment rate;
a quality analysis result generation module 3 for generating a quality analysis result of the program source code according to the data values of the plurality of indexes;
and the warehousing module 4 is used for determining whether to warehouse the program source codes according to the quality analysis result.
It can be understood that the program quality supervision device based on the DevOps provided by the invention can effectively improve the program quality without increasing the whole labor cost by comprehensively counting four indexes including the program coverage rate, the total branch coverage rate, the single program branch coverage rate and the single program branch coverage rate, and the program quality supervision device based on the DevOps does not need manual intervention in the process, promotes the implementation of UTDD practice and improves the release efficiency of the Devops version.
Based on the same inventive concept, in an embodiment, the quality analysis result generation module inputs the data values of the plurality of indexes to a preset quality analysis model, so that the quality analysis model outputs the quality analysis result of the program source code.
Based on the same inventive concept, in an embodiment, the mass analysis result generation module includes:
a first calculation unit for calculating the difference between the total branch coverage rate and a preset total branch coverage rate reaching a target value, and the difference between the single program branch coverage rate and a preset single program coverage rate reaching a target value;
the second calculation unit is used for calculating the difference value of the total branch coverage rate and the last total branch coverage rate of the program source code and the difference value of the single program branch coverage rate and the last single program branch coverage rate of the program source code;
a third calculation unit that calculates a difference between a set upper limit of the program coverage increment rate and a program coverage rate of the program source code;
an upper limit weight calculation unit that generates an upper limit weight according to a set upper limit of the program coverage increasing rate;
and a quality analysis result generating unit for generating a quality analysis result of the program source code according to the difference value and the upper limit weight.
Based on the same inventive concept, in an embodiment, the supervision apparatus further comprises:
the model building module is used for building the quality analysis model; and
and the model training module is used for training the quality analysis model through different types of calibrated program source codes.
Based on the same inventive concept, in an embodiment, the model training module includes:
the type calibration unit is used for calibrating the type of the program source code and generating type weights according to the type of the program source code;
an index obtaining unit for obtaining the data value of each index from the program source code;
the mapping unit maps each index data value obtained from each program source code into a one-dimensional vector to obtain a vector sequence corresponding to each program source code; wherein each vector sequence corresponds to a marked result sequence;
the training unit is used for inputting the vector sequence and the result sequence as a group of training samples to the quality analysis model so that the quality analysis model forms a corresponding relation between the vector sequence and the result sequence;
and the warehousing calibration unit is used for calibrating whether the program source code can be warehoused according to the result sequence, so that the quality analysis model forms a corresponding relation between the result sequence and whether the program source code is warehoused.
It can be appreciated that in this embodiment, by combining with the machine learning model, the quality analysis of the program source code can be continuously updated, so that the most accurate quality analysis result can be obtained, and the program source code can be accurately guided to be put in storage.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer device, which may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
In a typical example, the computer apparatus includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the program to implement a method performed by a client as described above, or where the processor executes the program to implement a method performed by a server as described above.
Reference is now made to FIG. 3, which illustrates a schematic diagram of a computer device suitable for use in implementing embodiments of the present application.
As shown in fig. 3, the computer device includes a Central Processing Unit (CPU) 601, which can perform various appropriate works and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM)) 603. In the RAM603, various programs and data required for system operation are also stored. The CPU601, ROM602, and RAM603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, mouse, etc.; an output portion 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on drive 610 as needed, so that a computer program read therefrom is mounted as needed as storage section 608.
In particular, according to embodiments of the present invention, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (10)

1. A program quality supervision method based on DevOps, comprising:
acquiring program source codes to be put in storage; the program source code is the initial source code of the program or the update source code for modifying the initial source code;
performing static code detection on the program source codes to obtain data values of a plurality of indexes; the index comprises program coverage rate, total branch coverage rate, single program branch coverage rate and program coverage increment rate;
generating a quality analysis result of the program source code according to the data values of the multiple indexes; wherein the generating the quality analysis result of the program source code according to the data values of the plurality of indexes includes: calculating the difference between the total branch coverage rate and a preset total branch coverage rate reaching a target value, and the difference between the single program branch coverage rate and a preset single program coverage rate reaching a target value; calculating the difference value of the total branch coverage rate and the last total branch coverage rate of the program source code and the difference value of the single program branch coverage rate and the last single program branch coverage rate of the program source code; calculating a difference value between a set upper limit of the program coverage increment rate and the program coverage rate of the program source code; generating an upper limit weight according to the set upper limit of the program coverage increasing rate; generating a quality analysis result of the program source code according to the difference value and the upper limit weight;
and determining whether to put the program source code in storage according to the quality analysis result.
2. The program quality supervision method according to claim 1, wherein generating the quality analysis result of the program source code from the data values of the plurality of indexes includes:
and inputting the data values of the multiple indexes into a preset quality analysis model so that the quality analysis model outputs a quality analysis result of the program source code.
3. The program quality supervision method according to claim 2, further comprising:
establishing the quality analysis model; and
and training the quality analysis model through different types of calibrated program source codes.
4. A program quality supervision method according to claim 3, wherein the training of the quality analysis model by different types of calibrated program source code comprises:
calibrating a program source code type and generating type weights according to the program source code type;
acquiring a data value of each index from the program source code;
mapping each index data value obtained from each program source code into a one-dimensional vector to obtain a vector sequence corresponding to each program source code; wherein each vector sequence corresponds to a marked result sequence;
inputting the vector sequence and the result sequence as a group of training samples to the quality analysis model so that the quality analysis model forms a corresponding relation between the vector sequence and the result sequence;
and calibrating whether the program source code can be put in storage according to the result sequence, so that the quality analysis model forms a corresponding relation between the result sequence and whether the program source code can be put in storage.
5. A DevOps-based program quality supervision device, comprising:
the program source code acquisition module acquires program source codes to be put in storage; the program source code is the initial source code of the program or the update source code for modifying the initial source code;
the static code detection module is used for detecting the static code of the program source code and acquiring data values of a plurality of indexes; the index comprises program coverage rate, total branch coverage rate, single program branch coverage rate and program coverage increment rate;
the quality analysis result generation module is used for generating a quality analysis result of the program source code according to the data values of the multiple indexes; wherein, the quality analysis result generation module comprises: a first calculation unit for calculating the difference between the total branch coverage rate and a preset total branch coverage rate reaching a target value, and the difference between the single program branch coverage rate and a preset single program coverage rate reaching a target value; the second calculation unit is used for calculating the difference value of the total branch coverage rate and the last total branch coverage rate of the program source code and the difference value of the single program branch coverage rate and the last single program branch coverage rate of the program source code; a third calculation unit that calculates a difference between a set upper limit of the program coverage increment rate and a program coverage rate of the program source code; an upper limit weight calculation unit that generates an upper limit weight according to a set upper limit of the program coverage increasing rate; a quality analysis result generating unit for generating a quality analysis result of the program source code according to the difference value and the upper limit weight;
and the warehousing module is used for determining whether to warehouse the program source code according to the quality analysis result.
6. The program quality supervision device according to claim 5, wherein the quality analysis result generation module inputs the data values of the plurality of indexes to a preset quality analysis model to cause the quality analysis model to output the quality analysis result of the program source code.
7. The program quality supervision device according to claim 6, further comprising:
the model building module is used for building the quality analysis model; and
and the model training module is used for training the quality analysis model through different types of calibrated program source codes.
8. The program quality supervision device according to claim 7, wherein the model training module comprises:
the type calibration unit is used for calibrating the type of the program source code and generating type weights according to the type of the program source code;
an index obtaining unit for obtaining the data value of each index from the program source code;
the mapping unit maps each index data value obtained from each program source code into a one-dimensional vector to obtain a vector sequence corresponding to each program source code; wherein each vector sequence corresponds to a marked result sequence;
the training unit is used for inputting the vector sequence and the result sequence as a group of training samples to the quality analysis model so that the quality analysis model forms a corresponding relation between the vector sequence and the result sequence;
and the warehousing calibration unit is used for calibrating whether the program source code can be warehoused according to the result sequence, so that the quality analysis model forms a corresponding relation between the result sequence and whether the program source code is warehoused.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1 to 4 when executing the program.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method of any of claims 1 to 4.
CN201910897960.5A 2019-09-23 2019-09-23 Program quality supervision method and device based on DevOps Active CN110647466B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910897960.5A CN110647466B (en) 2019-09-23 2019-09-23 Program quality supervision method and device based on DevOps

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910897960.5A CN110647466B (en) 2019-09-23 2019-09-23 Program quality supervision method and device based on DevOps

Publications (2)

Publication Number Publication Date
CN110647466A CN110647466A (en) 2020-01-03
CN110647466B true CN110647466B (en) 2023-08-04

Family

ID=68992294

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910897960.5A Active CN110647466B (en) 2019-09-23 2019-09-23 Program quality supervision method and device based on DevOps

Country Status (1)

Country Link
CN (1) CN110647466B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918294A (en) * 2019-01-29 2019-06-21 刘建鹏 A kind of autonomous controllability detection method of mixed source software and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103793315B (en) * 2012-10-29 2018-12-21 Sap欧洲公司 Monitoring and improvement software development quality method, system and computer-readable medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918294A (en) * 2019-01-29 2019-06-21 刘建鹏 A kind of autonomous controllability detection method of mixed source software and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于覆盖测试的嵌入式软件自动裁剪;蔡虹等;计算机工程;第36卷(第36期);第73-75页 *

Also Published As

Publication number Publication date
CN110647466A (en) 2020-01-03

Similar Documents

Publication Publication Date Title
CN109543906B (en) Atmospheric visibility prediction method and equipment
CN109451532B (en) Method and device for checking position of base station
US20190018753A1 (en) Software program fault localization
CN109976998B (en) Software defect prediction method and device and electronic equipment
CN111294730B (en) Method and device for processing network problem complaint information
CN111881058B (en) Software engineering quality prediction method
CN116166513A (en) Evaluation method, device and storage medium for database performance test
CN110647466B (en) Program quality supervision method and device based on DevOps
KR101478935B1 (en) Risk-profile generation device
CN114968821A (en) Test data generation method and device based on reinforcement learning
CN115587017A (en) Data processing method and device, electronic equipment and storage medium
CN112346995B (en) Banking industry-based test risk prediction model construction method and device
CN112561171B (en) Landslide prediction method, device, equipment and storage medium
CN110298690B (en) Object class purpose period judging method, device, server and readable storage medium
CN113191599A (en) Pipeline risk level evaluation method and device based on support vector machine
CN112966971A (en) Project workload assessment method and device
CN113052509A (en) Model evaluation method, model evaluation apparatus, electronic device, and storage medium
CN113919609A (en) Power distribution network model quality comprehensive evaluation method and system
CN113159537A (en) Evaluation method and device for new technical project of power grid and computer equipment
CN110287272A (en) A kind of configurable real-time feature extraction method, apparatus and system
CN109614328B (en) Method and apparatus for processing test data
CN111768021A (en) Order price adjustment method, device, server and storage medium
CN103455689B (en) Based on the interval model modification method of Taylor series expansion
CN113780353B (en) Satellite navigation automatic interpretation method based on machine learning
US20230228893A1 (en) Method, device and system for in-situ calibration of fixed radiation dose rate instrument

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant