CN115203038A - Coverage rate detection method and device, electronic equipment and computer readable storage medium - Google Patents

Coverage rate detection method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN115203038A
CN115203038A CN202210832984.4A CN202210832984A CN115203038A CN 115203038 A CN115203038 A CN 115203038A CN 202210832984 A CN202210832984 A CN 202210832984A CN 115203038 A CN115203038 A CN 115203038A
Authority
CN
China
Prior art keywords
pipeline
assembly line
interface
key value
preset
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
CN202210832984.4A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210832984.4A priority Critical patent/CN115203038A/en
Publication of CN115203038A publication Critical patent/CN115203038A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to an artificial intelligence technology, and discloses a coverage rate detection method, which comprises the following steps: acquiring an integral assembly line signal and a local assembly line, and taking a difference set of the integral assembly line and the local assembly line as an assembly line difference set; acquiring a pipeline name and a pipeline key value; screening the pipeline name of the first pipeline to obtain a standard pipeline, and taking a union of the standard pipeline and the pipeline difference set to obtain an unconfigured pipeline; screening the assembly line with the assembly line key value meeting a preset threshold interval in the second assembly line as an unexecuted assembly line; and generating a coverage rate detection tool, and performing timing detection by using the coverage rate detection tool. In addition, the invention also relates to a block chain technology, and the data list can be stored in the node of the block chain. The invention also provides a coverage rate detection device, electronic equipment and a storage medium. The invention can improve the efficiency of coverage rate detection.

Description

Coverage rate detection method and device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of artificial intelligence technologies, and in particular, to a coverage rate detection method and apparatus, an electronic device, and a computer-readable storage medium.
Background
Test coverage is an important indicator in software quality testing, since errors that are common in software can lead to catastrophic events, such as: the luggage case at the hitachi airport in 2008 became the primary event without the article. By testing the coverage rate, the software quality can be improved. Test coverage is defined as a test specification that indicates whether our test cases really completely cover the possibilities in the application code and how much code was executed when running the test cases.
Generally, a software test engineer is responsible for testing, when a single test is unqualified, a development engineer is required to add a single test code, a production line is re-issued after the completion (the coverage rate of the single test is re-detected), so a test engineer needs to perform secondary or multiple manual inspections, meanwhile, because some products are based on a micro-service architecture, each service needs to establish a production line, multiple production lines are involved in issuing, the inspection workload of the single test coverage rate is multiplied along with the increasing popularity of micro-services, the online time of the product is increased, and due to the manual inspections, when the production lines are many, some production lines may be missed to detect, so that a program error is caused. Therefore, how to improve the coverage detection efficiency becomes a problem to be solved urgently.
Disclosure of Invention
The invention provides a coverage rate detection method, a coverage rate detection device and a computer readable storage medium, and mainly aims to solve the problem of low efficiency in coverage rate detection.
In order to achieve the above object, the present invention provides a coverage rate detection method, including:
acquiring a first access authorization of a first interface and acquiring a second access authorization of a second interface;
obtaining an integral assembly line according to the first access authorization, screening a local assembly line containing a preset single-test frame from the integral assembly line according to the second access authority, and taking a difference set of the integral assembly line and the local assembly line as an assembly line difference set;
decoding the local pipeline information to obtain a pipeline name and a pipeline key value;
collecting a production line with the production line key value equal to None as a first production line, screening the production line name of the first production line by using a preset name screening rule to obtain a standard production line, and taking a union of the standard production line and the production line difference set to obtain an unconfigured production line;
collecting the assembly line with the assembly line key value not equal to None as a second assembly line, and screening out the assembly line with the assembly line key value in the second assembly line conforming to a preset threshold interval as an unexecuted assembly line;
and obtaining a coverage rate detection tool according to the unconfigured pipeline and the unexecuted pipeline, performing timing detection on all the pipelines by using the coverage rate detection tool, and generating a coverage rate report when the pipelines are detected to have the unconventional coverage rates.
Optionally, the screening out the assembly line in which the assembly line key value in the second assembly line meets the preset threshold interval is an unexecuted assembly line, including:
comparing the size of the pipeline key value with a first preset threshold value, and when the pipeline key value is greater than or equal to the first preset threshold value, determining that the pipeline corresponding to the pipeline key value is a compliance pipeline;
when the pipeline key value is smaller than the first preset threshold, comparing the pipeline key value with a second preset threshold;
when the pipeline key value is larger than the second preset threshold value, determining that the pipeline corresponding to the pipeline key value is an unconventional pipeline;
when the pipeline key value is equal to the second preset threshold value, determining that the pipeline corresponding to the pipeline key value is an unchanged pipeline, and generating an unexecuted pipeline according to the unconventional pipeline and the unchanged pipeline.
Optionally, the obtaining a first access authorization of the first interface includes:
receiving an authority verification request sent by an application system through the first interface when the application system obtains a service request, wherein the authority verification request carries an interface key and a user identifier;
performing authentication of interface calling authority according to the interface identifier corresponding to the first interface and the interface key;
when the authentication is passed, determining a corresponding role identifier according to the user identifier;
and inquiring interface operation authority according to the role identification to obtain a first access authorization of the first interface.
Optionally, the obtaining the entire pipeline according to the first access authorization includes:
acquiring the calling times corresponding to the first interface in a preset time period;
when the calling times are larger than or equal to the preset calling times, refusing to respond to the access request of the first interface;
when the calling times are smaller than the preset calling times, acquiring all pipeline information in the preset time period according to the first access authorization;
and acquiring time marks of all the assembly line information, and selecting the assembly line information corresponding to the latest time as an integral assembly line according to the time marks.
Optionally, the decoding the local pipeline information to obtain a pipeline name and a pipeline key value includes:
performing character cutting on the local pipeline information to obtain a pipeline character;
screening the pipeline characters by using a preset index to obtain a pipeline name;
and assigning the pipeline name by using a preset assignment algorithm to obtain a pipeline key value.
Optionally, the screening the pipeline name of the first pipeline by using a preset name screening rule to obtain a standard pipeline, including:
performing character string conversion on the pipeline name of the first pipeline to obtain a pipeline character string;
generating a keyword character string of a pipeline to be filtered, and calculating the matching degree of the pipeline character string and the keyword character string to obtain a character string matching value;
and screening the character string matching values according to a preset character weight set to obtain a target character string, and obtaining a standard production line according to the target character string.
Optionally, the obtaining a first access authorization of the first interface includes:
receiving an access request for accessing the first interface, and acquiring an interface protocol in the access request;
converting the access information and the access information in the interface protocol according to a preset description mode to obtain first interface access information;
and obtaining the access authorization of the first interface according to the first interface access information.
In order to solve the above problem, the present invention also provides a coverage detection apparatus, including:
the access authorization module is used for acquiring first access authorization of the first interface and acquiring second access authorization of the second interface;
the acquisition pipeline module is used for acquiring an overall pipeline according to the first access authorization, screening a local pipeline containing a preset single-test frame from the overall pipeline according to the second access authorization, and taking a difference set of the overall pipeline and the local pipeline as a pipeline difference set;
the pipeline decoding module is used for decoding the local pipeline information to obtain a pipeline name and a pipeline key value;
the assembly line screening module is used for collecting an assembly line with the assembly line key value equal to None as a first assembly line, screening the assembly line name of the first assembly line by using a preset name screening rule to obtain a standard assembly line, and taking a union of the standard assembly line and the assembly line difference set to obtain an unconfigured assembly line;
the assembly line partitioning module is used for collecting the assembly line with the assembly line key value not equal to None as a second assembly line and screening the assembly line with the assembly line key value in the second assembly line meeting a preset threshold interval as an unexecuted assembly line;
and the report generation module is used for obtaining a coverage rate detection tool according to the unconfigured pipeline and the unexecuted pipeline, carrying out timing detection on all the pipelines by using the coverage rate detection tool, and generating a coverage rate report when the coverage rate of the unconfigured pipeline is detected.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the coverage detection method described above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the coverage rate detection method described above.
According to the embodiment of the invention, access authorization of two different interfaces is obtained to obtain an integral assembly line and a local assembly line configured with a preset single-detection frame, a difference set of the integral assembly line and the local assembly line is selected to screen out the partial assembly line not configured with the preset single-detection frame, meanwhile, whether a key value of the local assembly line is equal to None or not is judged, when the key value of the local assembly line is equal to None, an assembly line configured with the preset single-detection frame at the database end and the front end is obtained, secondary branch judgment is carried out when the key value of the local assembly line is not equal to None, an assembly line which has code change but is not executed and an assembly line with unqualified coverage rate are obtained, missing detection of manual detection is avoided through the processes, meanwhile, when codes are continuously modified, artificial repeated detection is avoided, a detection result can be obtained only within several seconds when a coverage rate detection tool executes execution time, the working efficiency is greatly improved, and timing detection is carried out by utilizing the coverage rate detection tool, and an unqualified assembly line which is not qualified can be detected in time. Therefore, the coverage rate detection method, the coverage rate detection device, the electronic equipment and the computer readable storage medium are provided by the invention, and the problem of low coverage rate detection efficiency can be solved.
Drawings
Fig. 1 is a schematic flow chart of a coverage detection method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of obtaining access authorization according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a screening pipeline according to an embodiment of the present invention;
FIG. 4 is a functional block diagram of a coverage detection apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing the coverage detection method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a coverage rate detection method. The execution subject of the coverage rate detection method includes, but is not limited to, at least one of electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiments of the present application. In other words, the coverage detection method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Fig. 1 is a schematic flow chart of a coverage rate detection method according to an embodiment of the present invention. In this embodiment, the coverage rate detection method includes:
s1, obtaining first access authorization of a first interface and obtaining second access authorization of a second interface.
In the embodiment of the invention, the required pipeline information is obtained according to the first access authorization and the second access authorization.
In this embodiment of the present invention, the obtaining the first access authorization of the first interface includes: receiving an access request for accessing the first interface, and acquiring an interface protocol in the access request; converting the access information and the exit information in the interface protocol according to a preset description mode to obtain first interface access information; and obtaining the access authorization of the first interface according to the access information of the first interface.
In detail, the access request may refer to an http request, and may be implemented by combining http and url lib, acquiring a response after sending the request, reading response information of the response, and acquiring specified header information, a list of response header tuples, a bottom socket file descriptor, and acquisition header content according to the response information to form an acquired header http version.
In detail, the first interface and the second interface are different in whether a single-test framework is configured by an interface parameter, so that the obtained pipeline information is different in a form.
In this embodiment of the present invention, the acquiring the first access authorization of the first interface includes:
s21, receiving an authority verification request sent by an application system through the first interface when the application system obtains a service request, wherein the authority verification request carries an interface key and a user identifier;
s22, authenticating the interface calling authority according to the interface identifier corresponding to the first interface and the interface key;
s23, when the authentication is passed, determining a corresponding role identifier according to the user identifier;
and S24, inquiring interface operation authority according to the role identification to obtain a first access authorization of the first interface.
In detail, the pre-configured node operation tree and the organization tree may be used to query the interface operation authority to obtain the first access authorization of the first interface.
In detail, the querying the interface operation authority by using the preconfigured node operation tree and the organization tree to obtain the first access authorization of the first interface includes: inquiring a node identifier corresponding to the role identifier from a preconfigured node operation tree, and determining an operation authority corresponding to the node identifier; inquiring organization identification corresponding to the role identification from a pre-configured organization tree, and determining data authority corresponding to the user identification according to an organization label corresponding to the organization identification or the position of the organization identification in the organization tree; and obtaining a first access authorization of a first interface corresponding to the user identification according to the operation authority and the data authority.
In detail, the step of configuring the node operation tree includes: constructing a node tree comprising at least one node; acquiring an operation item to be configured, and associating the operation item with the node to obtain an operation authority corresponding to the node; establishing a corresponding relation between the node and the role identifier to be configured; and configuring according to the node tree, and the operation authority and the role identifier corresponding to each node in the node tree to obtain the node operation tree.
In detail, the interface key is used for signing the request parameters according to a specified rule when the interface is called, and the server performs signature verification when receiving the request, so that the identity can be defined, and malicious tampering of the request data through some means can be prevented.
S2, obtaining an overall assembly line according to the first access authorization, screening a local assembly line containing a preset single-test frame from the overall assembly line according to the second access authorization, and taking a difference set of the overall assembly line and the local assembly line as an assembly line difference set.
In the embodiment of the present invention, the obtained pipeline difference set may represent a part of the pipeline where the single-test framework is not configured, and is also a pipeline for reporting the need of printing. And acquiring all pipeline information (including executed and non-executed) under a certain version according to the first access authorization, and acquiring all pipeline information configured with Junit according to the second access authorization, so that tedious selection operation through a page by hand can be avoided.
In this embodiment of the present invention, the obtaining an entire pipeline according to the first access authorization includes: acquiring the calling times corresponding to the first interface in a preset time period; when the calling times are larger than or equal to the preset calling times, refusing to respond to the access request of the first interface; when the calling times are smaller than the preset calling times, acquiring all pipeline information in the preset time period according to the first access authorization; and acquiring time identifications of all the assembly line information, and selecting the assembly line information corresponding to the latest time as an integral assembly line according to the time identifications.
And S3, decoding the local pipeline information to obtain a pipeline name and a pipeline key value.
In the embodiment of the invention, the pipeline name and the pipeline key value are obtained according to the local pipeline information, so that convenience is brought to subsequent pipeline identification.
In detail, the pipeline name may be represented by a key, and the pipeline key may be taken from 0 to 100, or may be displayed as None, for example: "xxx-web" is None, "db-xxx" is None, "auth" is 0, and "system" is 99.
In this embodiment of the present invention, the decoding the local pipeline information to obtain a pipeline name and a pipeline key value includes: performing character cutting on the local pipeline information to obtain a pipeline character; screening the pipeline characters by using a preset index to obtain a pipeline name; and assigning the pipeline name by using a preset assignment algorithm to obtain a pipeline key value.
In detail, the character segmentation is to segment a sentence to obtain a phrase or a number, for example: the score of Xiaoming research is 410 minutes, the score can be cut into Xiaoming/research/score/is/410/minutes, characters obtained after cutting are screened to obtain the name of Xiaoming, the name of the assembly line can be Xiaoming, xiaohua or Xiaoliang, the Xiaoming is assigned according to the score of the Xiaoming 410 to obtain a key value.
And S4, collecting the assembly line with the assembly line key value equal to None as a first assembly line, screening the assembly line name of the first assembly line by using a preset name screening rule to obtain a standard assembly line, and taking a union set of the standard assembly line and the assembly line difference set to obtain an unconfigured assembly line.
In the embodiment of the present invention, the pipeline collecting the pipeline key value equal to None is the first pipeline and can be determined by using the pipeline key value.
In detail, the name filtering rule may set names of some systems, programs, and software, with which the pipeline name is filtered.
In this embodiment of the present invention, the screening the pipeline name of the first pipeline by using a preset name screening rule to obtain a standard pipeline includes:
s31, converting the character string of the pipeline name of the first pipeline to obtain a pipeline character string;
s32, generating a keyword character string of the pipeline to be filtered, and calculating the matching degree of the pipeline character string and the keyword character string to obtain a character string matching value;
s33, screening the character string matching values according to a preset character weight set to obtain a target character string, and obtaining a standard assembly line according to the target character string.
In detail, the string translation method depends on the pipeline name, for example: converting millisecond values to date, date to millisecond values, 16 to 10, bytes to hexadecimal strings, numeric strings to ASCII strings, and the like.
And S5, collecting the assembly line with the assembly line key value not equal to None as a second assembly line, and screening the assembly line with the assembly line key value in the second assembly line which accords with a preset threshold interval as an unexecuted assembly line.
In the embodiment of the invention, the pipelines which are screened out according to the preset threshold interval are pipelines which indicate that the single-test change coverage rate does not reach the standard and pipelines which have changes in codes but do not have unit tests in a change row.
In this embodiment of the present invention, the screening that a pipeline in the second pipeline whose pipeline key value meets a preset threshold interval is an unexecuted pipeline includes: comparing the size of the pipeline key value with a first preset threshold value, and when the pipeline key value is greater than or equal to the first preset threshold value, determining that the pipeline corresponding to the pipeline key value is a compliant pipeline; when the pipeline key value is smaller than the first preset threshold value, comparing the pipeline key value with a second preset threshold value; when the pipeline key value is larger than the second preset threshold value, determining that a pipeline corresponding to the pipeline key value is an unconventional pipeline; when the pipeline key value is equal to the second preset threshold value, determining that the pipeline corresponding to the pipeline key value is an unchanged pipeline, and generating an unexecuted pipeline according to the unconventional pipeline and the unchanged pipeline.
In detail, the operation that the selected assembly line in the second assembly line whose assembly line key value meets the preset threshold interval is an unexecuted assembly line can be as follows: when value is not equal to None, the value is judged, and the method is divided into three branch logics: the value is more than or equal to 12, the single measurement change coverage rate reaches the standard, and the pipeline name is printed greatly; the value is less than 12, which indicates that the single measurement change coverage rate does not reach the standard, and the pipeline name needs to be printed; value is equal to 0, indicating that the code has changed, but the change line has not been tested for units, i.e., has no code coverage for single test, and the pipeline name needs to be printed.
And S6, obtaining a coverage rate detection tool according to the unconfigured production line and the unexecuted production line, carrying out timing detection on all the production lines by using the coverage rate detection tool, and generating a coverage rate report when the fact that the production lines have the coverage rates which are not in compliance is detected.
In the embodiment of the invention, the coverage rate detection tool is a detection tool for regularly judging the coverage rate according to the previous steps, so that missing detection in manual inspection is avoided, and the detection efficiency is improved.
In detail, the timing detection of all pipelines by the coverage rate detection tool can be based on setting a timing task, for example, using crontab to set an operator, a command is composed of time plus actions, the time is divided into minutes, hours, days, months and weeks, and the operator has all numbers in a value range, "/" too many and too few numbers, "-" from X to Z, and the like; a thread method can also be established, the thread method is enabled to run in while circulation all the time, and then the effect of timing tasks is achieved through a sleep method; timerTask can also be used, by implementing specific tasks in the run () method, when the constructor of Timer is called, it creates a thread that can be used to schedule tasks.
In detail, the coverage report may be output as a table, with the left column specifying the non-compliance item, the right column specifying the pipeline, and the printed non-compliance item may include three types, for example: the single test change coverage rate does not reach the standard value of 12 percent, the code change exists, but the change line has no unit test code coverage and no unit test change coverage rate is configured, and the pipelines respectively corresponding to the unit test change coverage rate are as follows: system-service:9.7%, apas-notice-service: 0% and Appas-default-service.
The embodiment of the invention obtains the whole assembly line and the local assembly line configured with the preset single-testing frame by obtaining the access authorization of two different interfaces, selects a difference set of the two to screen out the partial assembly line not configured with the preset single-testing frame, meanwhile, obtains the assembly line configured with the preset single-testing frame at the database end and the front end by judging whether the key value of the local assembly line is equal to None or not and obtaining the assembly line with code change but not executed and the assembly line with unqualified coverage rate by judging whether the key value of the local assembly line is equal to None or not, avoids the missed detection of manual inspection by the above flow, and simultaneously avoids the manual repeated inspection when the code is continuously modified, the detection result can be obtained only by executing the coverage rate detection tool for a few seconds, thereby greatly improving the working efficiency, and the irregular assembly line can be detected in time by utilizing the coverage rate detection tool to carry out timing detection. Therefore, the coverage rate detection method provided by the invention can solve the problem of low coverage rate detection efficiency.
Fig. 4 is a functional block diagram of a coverage rate detection apparatus according to an embodiment of the present invention.
The coverage rate detecting apparatus 100 of the present invention may be installed in an electronic device. According to the implemented functions, the coverage rate detection apparatus 100 may include an access authorization module 101, an acquisition pipeline module 102, a pipeline decoding module 103, a pipeline screening module 104, a pipeline partitioning module 105, and a report generation module 106. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the access authorization module is used for acquiring first access authorization of the first interface and acquiring second access authorization of the second interface;
the acquisition pipeline module is used for acquiring an overall pipeline according to the first access authorization, screening a local pipeline containing a preset single-test frame from the overall pipeline according to the second access authorization, and taking a difference set of the overall pipeline and the local pipeline as a pipeline difference set;
the pipeline decoding module is used for decoding the local pipeline information to obtain a pipeline name and a pipeline key value;
the assembly line screening module is used for collecting an assembly line with the assembly line key value equal to None as a first assembly line, screening the assembly line name of the first assembly line by using a preset name screening rule to obtain a standard assembly line, and taking a union of the standard assembly line and the assembly line difference set to obtain an unconfigured assembly line;
the assembly line partitioning module is used for collecting the assembly line with the assembly line key value not equal to None as a second assembly line and screening the assembly line with the assembly line key value in the second assembly line meeting a preset threshold interval as an unexecuted assembly line;
and the report generation module is used for obtaining a coverage rate detection tool according to the unconfigured pipeline and the unexecuted pipeline, carrying out timing detection on all pipelines by using the coverage rate detection tool, and generating a coverage rate report when the coverage rate of the pipelines which is not in compliance is detected.
Fig. 5 is a schematic structural diagram of an electronic device implementing a coverage detection method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a coverage detection program, stored in the memory 11 and operable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (for example, executing a coverage detection program and the like) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, and the like. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of a coverage detection program, but also to temporarily store data that has been output or is to be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are commonly used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Only electronic devices having components are shown, and those skilled in the art will appreciate that the structures shown in the figures do not constitute limitations on the electronic devices, and may include fewer or more components than shown, or some components in combination, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The coverage detection program stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, which when executed in the processor 10, can implement:
acquiring a first access authorization of a first interface and acquiring a second access authorization of a second interface;
acquiring an integral assembly line according to the first access authorization, screening a local assembly line containing a preset single-test frame from the integral assembly line according to the second access authority, and taking a difference set of the integral assembly line and the local assembly line as an assembly line difference set;
decoding the local pipeline information to obtain a pipeline name and a pipeline key value;
collecting a production line with the production line key value equal to None as a first production line, screening the production line name of the first production line by using a preset name screening rule to obtain a standard production line, and taking a union of the standard production line and the production line difference set to obtain an unconfigured production line;
collecting the assembly line with the assembly line key value not equal to None as a second assembly line, and screening the assembly line with the assembly line key value in the second assembly line conforming to a preset threshold interval as an unexecuted assembly line;
and obtaining a coverage rate detection tool according to the unconfigured pipeline and the unexecuted pipeline, performing timing detection on all the pipelines by using the coverage rate detection tool, and generating a coverage rate report when the pipelines are detected to have the unconventional coverage rates.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to the drawing, and is not repeated here.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a first access authorization of a first interface and acquiring a second access authorization of a second interface;
obtaining an integral assembly line according to the first access authorization, screening a local assembly line containing a preset single-test frame from the integral assembly line according to the second access authority, and taking a difference set of the integral assembly line and the local assembly line as an assembly line difference set;
decoding the local pipeline information to obtain a pipeline name and a pipeline key value;
collecting a production line with the production line key value equal to None as a first production line, screening the production line name of the first production line by using a preset name screening rule to obtain a standard production line, and taking a union of the standard production line and the production line difference set to obtain an unconfigured production line;
collecting the assembly line with the assembly line key value not equal to None as a second assembly line, and screening out the assembly line with the assembly line key value in the second assembly line conforming to a preset threshold interval as an unexecuted assembly line;
and obtaining a coverage rate detection tool according to the unconfigured pipeline and the unexecuted pipeline, performing timing detection on all the pipelines by using the coverage rate detection tool, and generating a coverage rate report when the pipelines are detected to have the unconventional coverage rates.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A method for coverage detection, the method comprising:
acquiring a first access authorization of a first interface and acquiring a second access authorization of a second interface;
obtaining an integral assembly line according to the first access authorization, screening a local assembly line containing a preset single-test frame from the integral assembly line according to the second access authority, and taking a difference set of the integral assembly line and the local assembly line as an assembly line difference set;
decoding the local pipeline information to obtain a pipeline name and a pipeline key value;
collecting a production line with the production line key value equal to None as a first production line, screening the production line name of the first production line by using a preset name screening rule to obtain a standard production line, and taking a union of the standard production line and the production line difference set to obtain an unconfigured production line;
collecting the assembly line with the assembly line key value not equal to None as a second assembly line, and screening the assembly line with the assembly line key value in the second assembly line conforming to a preset threshold interval as an unexecuted assembly line;
and obtaining a coverage rate detection tool according to the unconfigured pipeline and the unexecuted pipeline, performing timing detection on all the pipelines by using the coverage rate detection tool, and generating a coverage rate report when the pipelines are detected to have the unconventional coverage rates.
2. The method of claim 1, wherein the screening of the pipelines in the second pipeline for which pipeline key values meet a preset threshold interval is an unexecuted pipeline, and comprises:
comparing the size of the pipeline key value with a first preset threshold value, and when the pipeline key value is greater than or equal to the first preset threshold value, determining that the pipeline corresponding to the pipeline key value is a compliant pipeline;
when the pipeline key value is smaller than the first preset threshold, comparing the pipeline key value with a second preset threshold;
when the pipeline key value is larger than the second preset threshold value, determining that the pipeline corresponding to the pipeline key value is an unconventional pipeline;
when the pipeline key value is equal to the second preset threshold value, determining that the pipeline corresponding to the pipeline key value is an unchanged pipeline, and generating an unexecuted pipeline according to the unconventional pipeline and the unchanged pipeline.
3. The coverage detection method of claim 1, wherein said obtaining a first access authorization for a first interface comprises:
receiving an authority verification request sent by an application system through the first interface when the application system obtains a service request, wherein the authority verification request carries an interface key and a user identifier;
performing interface calling authority authentication according to the interface identifier corresponding to the first interface and the interface key;
when the authentication is passed, determining a corresponding role identifier according to the user identifier;
and inquiring interface operation authority according to the role identification to obtain first access authorization of the first interface.
4. The coverage detection method of claim 1, wherein said obtaining the overall pipeline based on the first access grant comprises:
acquiring the calling times corresponding to the first interface in a preset time period;
when the calling times are larger than or equal to the preset calling times, refusing to respond to the access request of the first interface;
when the calling times are smaller than the preset calling times, acquiring all pipeline information in the preset time period according to the first access authorization;
and acquiring time marks of all the assembly line information, and selecting the assembly line information corresponding to the latest time as an integral assembly line according to the time marks.
5. The coverage detection method of claim 1, wherein said decoding the local pipeline information to obtain a pipeline name and a pipeline key value comprises:
performing character cutting on the local pipeline information to obtain a pipeline character;
screening the pipeline characters by using a preset index to obtain a pipeline name;
and assigning the pipeline name by using a preset assignment algorithm to obtain a pipeline key value.
6. The coverage detection method of claim 1, wherein the filtering the pipeline name of the first pipeline by using a preset name filtering rule to obtain a standard pipeline comprises:
performing character string conversion on the pipeline name of the first pipeline to obtain a pipeline character string;
generating a keyword character string of a pipeline to be filtered, and calculating the matching degree of the pipeline character string and the keyword character string to obtain a character string matching value;
and screening the character string matching values according to a preset character weight set to obtain a target character string, and obtaining a standard production line according to the target character string.
7. The coverage detection method of any one of claims 1 to 6, wherein said obtaining a first access authorization for a first interface comprises:
receiving an access request for accessing the first interface, and acquiring an interface protocol in the access request;
converting the access information and the exit information in the interface protocol according to a preset description mode to obtain first interface access information;
and obtaining the access authorization of the first interface according to the access information of the first interface.
8. A coverage detection apparatus, the apparatus comprising:
the access authorization module is used for acquiring first access authorization of the first interface and acquiring second access authorization of the second interface;
the acquisition pipeline module is used for acquiring an overall pipeline according to the first access authorization, screening a local pipeline containing a preset single-test frame from the overall pipeline according to the second access authorization, and taking a difference set of the overall pipeline and the local pipeline as a pipeline difference set;
the pipeline decoding module is used for decoding the local pipeline information to obtain a pipeline name and a pipeline key value;
the assembly line screening module is used for collecting an assembly line with the assembly line key value equal to None as a first assembly line, screening the assembly line name of the first assembly line by using a preset name screening rule to obtain a standard assembly line, and taking a union of the standard assembly line and the assembly line difference set to obtain an unconfigured assembly line;
the assembly line partitioning module is used for collecting the assembly line with the assembly line key value not equal to None as a second assembly line and screening the assembly line with the assembly line key value in the second assembly line meeting a preset threshold interval as an unexecuted assembly line;
and the report generation module is used for obtaining a coverage rate detection tool according to the unconfigured pipeline and the unexecuted pipeline, carrying out timing detection on all pipelines by using the coverage rate detection tool, and generating a coverage rate report when the coverage rate of the unconformity of the pipelines is detected.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the coverage detection method of any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the coverage detection method according to any one of claims 1 to 7.
CN202210832984.4A 2022-07-14 2022-07-14 Coverage rate detection method and device, electronic equipment and computer readable storage medium Pending CN115203038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210832984.4A CN115203038A (en) 2022-07-14 2022-07-14 Coverage rate detection method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210832984.4A CN115203038A (en) 2022-07-14 2022-07-14 Coverage rate detection method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115203038A true CN115203038A (en) 2022-10-18

Family

ID=83582032

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210832984.4A Pending CN115203038A (en) 2022-07-14 2022-07-14 Coverage rate detection method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115203038A (en)

Similar Documents

Publication Publication Date Title
CN112134739B (en) Link state tracking method and device, electronic equipment and computer storage medium
CN113138929A (en) Distributed interface testing method and device, electronic equipment and storage medium
EP3616066A1 (en) Human-readable, language-independent stack trace summary generation
CN112115145A (en) Data acquisition method and device, electronic equipment and storage medium
CN112527664A (en) Method and device for generating test case, electronic equipment and storage medium
CN115081016A (en) Log desensitization method and device, electronic equipment and storage medium
CN113986924A (en) Intelligent data filling method, device, equipment and storage medium
CN114691782A (en) Database table increment synchronization method and device and storage medium
CN113434542A (en) Data relation identification method and device, electronic equipment and storage medium
CN113240351A (en) Business data consistency checking method and device, electronic equipment and medium
CN112685384A (en) Data migration method and device, electronic equipment and storage medium
CN112541688A (en) Service data checking method and device, electronic equipment and computer storage medium
CN112486957A (en) Database migration detection method, device, equipment and storage medium
CN115145870A (en) Method and device for positioning reason of failed task, electronic equipment and storage medium
CN115203038A (en) Coverage rate detection method and device, electronic equipment and computer readable storage medium
CN113434397B (en) Task system testing method and device, electronic equipment and storage medium
CN113469649A (en) Project progress analysis method and device, electronic equipment and storage medium
CN114968816A (en) Data simulation-based strategy testing method, device, equipment and storage medium
CN115102770A (en) Resource access method, device and equipment based on user permission and storage medium
CN114510400A (en) Task execution method and device, electronic equipment and storage medium
CN113723813A (en) Performance ranking method and device, electronic equipment and readable storage medium
CN110348984B (en) Automatic credit card data input method and related equipment under different transaction channels
CN113254446A (en) Data fusion method and device, electronic equipment and medium
CN112667244A (en) Data verification method and device, electronic equipment and computer readable storage medium
CN111651167A (en) Method and device for identifying dependency relationship of scheduling task and computer readable storage medium

Legal Events

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