CN109002395A - A kind of code coverage management method and device - Google Patents

A kind of code coverage management method and device Download PDF

Info

Publication number
CN109002395A
CN109002395A CN201810736153.0A CN201810736153A CN109002395A CN 109002395 A CN109002395 A CN 109002395A CN 201810736153 A CN201810736153 A CN 201810736153A CN 109002395 A CN109002395 A CN 109002395A
Authority
CN
China
Prior art keywords
code coverage
file
newest
incremental
latest edition
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.)
Granted
Application number
CN201810736153.0A
Other languages
Chinese (zh)
Other versions
CN109002395B (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.)
JD Digital Technology Holdings Co Ltd
Jingdong Technology Holding Co Ltd
Original Assignee
Beijing Jingdong Financial Technology Holding Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Financial Technology Holding Co Ltd filed Critical Beijing Jingdong Financial Technology Holding Co Ltd
Priority to CN201810736153.0A priority Critical patent/CN109002395B/en
Publication of CN109002395A publication Critical patent/CN109002395A/en
Application granted granted Critical
Publication of CN109002395B publication Critical patent/CN109002395B/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/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)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of code coverage management method and devices, are related to field of computer technology.One specific embodiment of this method includes: to receive user instructions, and instruction instruction, which executes, operates the selected code coverage using indicated release;When code coverage operation is that code coverage obtains operation: obtaining the incremental code coverage rate file of the latest edition of selected application from application system server end;According to the incremental code coverage rate file of latest edition and old version, the newest full dose code coverage file of selected application is generated;According to the incremental code coverage rate file of latest edition, newest full dose code coverage file, obtains the newest code coverage data of selected application and return to user terminal.The embodiment can obtain and record the code coverage between any two or more version, and batch obtains, empties code coverage in batches, improves the efficiency of management, summarize displaying from various dimensions, and user is made to understand the trend of application system code coverage.

Description

A kind of code coverage management method and device
Technical field
The present invention relates to field of computer technology more particularly to a kind of code coverage management method and devices.
Background technique
In software test procedure, it is the one of test validity that code coverage, which is a means for measuring test completeness, A measurement reduces the omission in test process to further increase Software Delivery quality, reduces accident on line, surveys to software The coverage rate of examination has new requirement, and how accurately to measure the coverage of software test is the problem of numerous testers encounter.
Currently, using jenkins, (a kind of continuous integrating tool based on Java exploitation, is used for when statistics codes coverage rate Monitor continue duplicate work) or sonarQube (for the Open Source Platform of code quality management, for managing source code Quality) Jacoco (Java code covers library) plug-in unit is integrated to realize, according to building version, actively triggering or timed task To obtain service code coverage rate.Operation system is huge, business is many and diverse, code is submitted frequently, version iteration fast speed Under scene, existing scheme can not meet actual demand well.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery:
The code coverage of multiple application systems can not be obtained in batches;Application system current version can only be recorded when storage Code coverage can not record the code coverage between different editions;It cannot achieve the function that batch empties;Can not be to application System history coverage rate statistics summarizes displaying, to understand the trend of application system code coverage.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of code coverage management method and device, can be realized flexible Code coverage securing mechanism, user can obtain the code coverage between application system any two or multiple versions, be quality Control provides more accurate reference frame, and the code coverage realized batch acquisition, empty multiple application systems in batches improves generation The code coverage rate efficiency of management, saves the time, and can recorde the code coverage between different editions, and corresponding from various dimensions It is carried out summarizing displaying with System History code coverage, user is made to understand code coverage curve in system iterative process in real time, To understand the trend of application system code coverage.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of code coverage manager is provided Method.
A kind of code coverage management method, comprising: receive user instructions, the user instruction instruction, which is executed, answers selected The code coverage of indicated release operates, and the selected application includes one or more application;When the code coverage When operation is that code coverage obtains operation, executes: obtaining the latest edition of the selected application from application system server end Incremental code coverage rate file;According to the incremental code coverage rate file of the latest edition of the selected application and one Or the incremental code coverage rate file of multiple old versions, generate the newest full dose code coverage file of the selected application; According to the incremental code coverage rate file of the latest edition, the newest full dose code coverage file, obtain described selected The newest code coverage data of application;The newest code coverage data of the selected application are returned into user terminal.
Optionally, it when code coverage operation is code coverage storage operation, executes: will be selected described in caching Surely the incremental code coverage rate file applied is saved in database, and obtains the selected application from application system server end The incremental code coverage rate file of latest edition;According to the incremental code coverage rate file of the latest edition of the selected application, And the incremental code coverage rate file of one or more of old versions, generate the newest full dose code of the selected application Coverage rate file;According to the incremental code coverage rate file of the latest edition, the newest full dose code coverage file, obtain To the newest code coverage data of the selected application;By the incremental code coverage rate file of the latest edition and it is described most Fresh code coverage data is saved in the database.
Optionally, the incremental code coverage rate text of the latest edition of the selected application is obtained from application system server end The step of part, comprising: script file is generated according to the corresponding configuration information of the selected application;By executing the script text Part obtains the incremental code coverage rate file of the latest edition of the selected application from application system server end.
Optionally, according to the incremental code coverage rate file of the latest edition, the newest full dose code coverage text Part, the step of obtaining the newest code coverage data of the selected application, comprising: according to the incremental code of the latest edition Coverage rate file, the newest full dose code coverage file, generate the increment generation of the latest edition of the selected application respectively The report of code coverage rate, the report of newest full dose code coverage;The incremental code coverage rate for parsing the latest edition is reported, is newest Full dose code coverage report, to generate the newest code coverage data of the selected application.
Optionally, it when code coverage operation is code coverage clear operation, executes: deleting described in caching All incremental code coverage rate files, full dose code coverage file and the code coverage data of selected application.
Optionally, it when code coverage operation is code coverage statistical operation, executes: being answered according to described select Code coverage data have been deposited with indicated release, have generated statistical data according to default dimension, and show the statistical data.
According to another aspect of an embodiment of the present invention, a kind of code coverage managing device is provided.
A kind of code coverage managing device, comprising: receiving module, for receiving user instructions, the user instruction refers to Show to execute and the code coverage of the indicated release of selected application is operated, the selected application includes one or more application;It holds Row module, for executing: from application system server end when code coverage operation is that code coverage obtains operation Obtain the incremental code coverage rate file of the latest edition of the selected application;According to the increasing of the latest edition of the selected application Code coverage file, and the incremental code coverage rate file of one or more old versions are measured, the selected application is generated Newest full dose code coverage file;According to the incremental code coverage rate file of the latest edition, the newest full dose generation Code coverage rate file, obtains the newest code coverage data of the selected application;The newest code of the selected application is covered Lid rate data return to user terminal.
Optionally, the execution module is also used to: when code coverage operation is code coverage storage operation, It executes: the incremental code coverage rate file for selecting application described in caching is saved in database, and from application system server End obtains the incremental code coverage rate file of the latest edition of the selected application;According to the latest edition of the selected application The incremental code coverage rate file of incremental code coverage rate file and one or more of old versions, generates the choosing Surely the newest full dose code coverage file applied;According to the incremental code coverage rate file of the latest edition, described newest Full dose code coverage file obtains the newest code coverage data of the selected application;By the increment of the latest edition Code coverage file and the newest code coverage data are saved in the database.
Optionally, the execution module includes incremental code coverage rate file acquisition submodule, is used for: according to described selected Script file is generated using corresponding configuration information;By executing the script file, institute is obtained from application system server end State the incremental code coverage rate file of the latest edition of selected application.
Optionally, the execution module includes that code coverage data generate submodule, is used for: according to the latest edition Incremental code coverage rate file, the newest full dose code coverage file, generate the latest edition of the selected application respectively This report of incremental code coverage rate, the report of newest full dose code coverage;Parse the incremental code covering of the latest edition Rate report, the report of newest full dose code coverage, to generate the newest code coverage data of the selected application.
Optionally, the execution module is also used to: when code coverage operation is code coverage clear operation, It executes: deleting all incremental code coverage rate files, full dose code coverage file and the code for selecting application described in caching Coverage data.
Optionally, the execution module is also used to: when code coverage operation is code coverage statistical operation, Execute: according to it is described it is selected deposited code coverage data using indicated release, according to default dimension generate statistical data, And show the statistical data.
Another aspect according to an embodiment of the present invention, provides a kind of electronic equipment.
A kind of electronic equipment, comprising: one or more processors;Memory works as institute for storing one or more programs When stating one or more programs and being executed by one or more of processors, so that one or more of processors realize this hair The code coverage management method of bright offer.
Another aspect according to an embodiment of the present invention, provides a kind of computer-readable medium.
A kind of computer-readable medium is stored thereon with computer program, realizes this when described program is executed by processor The code coverage management method provided is provided.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that covers when user instruction instruction executes code It when lid rate obtains operation, executes: obtaining the incremental code coverage rate of the latest edition of selected application from application system server end File;According to the incremental code coverage rate file of the latest edition of selected application, and the increment of one or more old versions Code coverage file generates the newest full dose code coverage file of selected application;It is covered according to the incremental code of latest edition Lid rate file, newest full dose code coverage file obtain the newest code coverage data of selected application and return the data Return user terminal.It can be realized flexible code coverage securing mechanism, user can obtain application system any two or multiple versions This code coverage provides more accurate reference frame for quality control, and realizes that batch obtains.When user instruction indicates When executing code coverage clear operation, it is able to achieve the code coverage that batch empties multiple application systems, improves code coverage The rate efficiency of management, saves the time.When user instruction indicates to execute code coverage storage operation, can recorde between different editions Code coverage, and, when user instruction indicate execute code coverage statistical operation when, can be from various dimensions to application System History code coverage carries out summarizing displaying, and user is made to understand code coverage curve in system iterative process in real time, from And understand the trend of application system code coverage.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the key step schematic diagram of code coverage management method according to an embodiment of the present invention;
Fig. 2 is the signal according to an embodiment of the present invention daily counted to all application system code coverage update times Figure;
Fig. 3 is the signal according to an embodiment of the present invention counted to all application code coverage rate update times by service line Figure;
Fig. 4 is the main modular schematic diagram of code coverage managing device according to an embodiment of the present invention;
Fig. 5 is code coverage management system configuration diagram according to an embodiment of the present invention;
Fig. 6 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 7 is adapted for the structural schematic diagram for the computer system for realizing the server of the embodiment of the present invention.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Fig. 1 is the key step schematic diagram of code coverage management method according to an embodiment of the present invention.
As shown in Figure 1, the code coverage management method of the embodiment of the present invention mainly includes the following steps, namely S101 to step Rapid S102.
Step S101: receiving user instructions, and user instruction instruction executes the code coverage to the indicated release of selected application Rate operation, selecting application includes one or more application.
Code coverage is the ratio that code has been executed in software test procedure.
Before step S101, Jacocoagent is deployed to application system server end in advance, and modify using JVM (Java Virtual Machine) start-up parameter, can specifically increase following parameter:
- javaagent:/export/server/jacoco/lib/jacocoagent.jar=outp ut= Tcpserver, port=8053, address=*, append=true, includes=com.* "
Wherein, different values is arranged according to different application for port (port) parameter.The rear Jacocoagent of starting application can be with The code coverage of automatic monitoring application system.
Jacocoagent is Jacoco open source jar packet.Jacoco is a free Java code covering library.
Step S102: it when code coverage operation is that code coverage obtains operation, executes:
The incremental code coverage rate file of the latest edition of selected application is obtained from application system server end;
According to the incremental code coverage rate file of the latest edition of selected application, and the increasing of one or more old versions Code coverage file is measured, the newest full dose code coverage file of selected application is generated;
According to the incremental code coverage rate file of latest edition, newest full dose code coverage file, selected application is obtained Newest code coverage data;
The newest code coverage data of selected application are returned into user terminal.
Wherein, before the newest code coverage data of selected application being returned to user terminal, the selected of generation can be saved The newest code coverage data of the newest full dose code coverage file of application and selected application.
Step S102 can also include: to execute when code coverage operation is code coverage storage operation:
The incremental code coverage rate file that application is selected in caching is saved in database, and from application system server end Obtain the incremental code coverage rate file of the latest edition of selected application;
According to the incremental code coverage rate file of the latest edition of selected application, and the increasing of one or more old versions Code coverage file is measured, the newest full dose code coverage file of selected application is generated;
According to the incremental code coverage rate file of latest edition, newest full dose code coverage file, selected application is obtained Newest code coverage data;
The incremental code coverage rate file of latest edition and newest code coverage data are saved in the database.
Wherein, said one or multiple old versions are the version in indicated release.
The step of the incremental code coverage rate file of the above-mentioned latest edition that selected application is obtained from application system server end Suddenly, it can specifically include:
Script file is generated according to the corresponding configuration information of selected application;
By perform script file, the incremental code for obtaining the latest edition of selected application from application system server end covers Lid rate file.
Each application corresponds to respective configuration information, and configuration information may include: application name, the port IP, source code path etc. Information can also include the ID of application system, using information such as affiliated traffic IDs.
Using Jacoco ant task, remotely obtains and answer by TCPserver (TCP (transmission control protocol) service) mode Specifically it can call Jacocoagent's with the incremental code coverage rate file jacoco.exec of system server terminal Dump method (method for downloading code coverage for Jacoco), it is long-range to obtain the current code coverage of application system.Wherein, Jacoco ant task is the subsidiary Ant task of JaCoCo, can star the java applet for executing record, and from the data of record Create coverage rate report.
Multiple versions can be generated in system iterative process, user can according to need multiple triggering, and real-time update is currently surveyed Code coverage is tried, the code coverage of corresponding each version is known as incremental code coverage rate, correspondingly, from application system service The current code coverage file that device end is got is known as incremental code coverage rate file.
When application successive ignition, when user triggers acquisition or saves code coverage, i.e. user instruction instruction executes generation Code coverage rate obtain operation and code coverage storage operation when, can also call Jacocoagent merge method (for The method of Jacoco merging code coverage file), all increment coverage rate file mergencess that will be got before user generate New code coverage file merge.exec, and save, the code coverage in the code coverage file records any two All code coverage summations, referred to as full dose code coverage between a or multiple versions, it is all by what is got before user Increment coverage rate file mergences and the new code coverage file merge.exec that generates is full dose code coverage file.
The code section Exactly-once of retest is calculated in full dose code coverage, full dose code coverage body Show and has amounted to the ratio that the code being tested accounts for tested code total amount when executing test to the tested code of each version.In conjunction with tool Body scene, such as new demand exploitation is carried out, version is completed from first tested version to a last test, centre can iteration Many versions are issued, if each version can only see the generation currently tested according to common code coverage acquisition modes Code coverage rate, and each iteration version, may only test sub-fraction therein, such user can not understand since demand The test coverage all to a last version, full dose code coverage of the invention make the demand since test to survey Examination terminates, and total code coverage is shown, so that user will be seen that the code for whether having omission does not have when testing completion Have tested.
The above-mentioned incremental code coverage rate file according to latest edition, newest full dose code coverage file, are selected It the step of newest code coverage data of application, can specifically include:
According to the incremental code coverage rate file of latest edition, newest full dose code coverage file, generate respectively selected The report of incremental code coverage rate, the report of newest full dose code coverage of the latest edition of application;
Parse the report of incremental code coverage rate, the report of newest full dose code coverage of latest edition, the result packet of parsing The incremental code coverage rate for selecting the latest edition applied, newest full dose code coverage are included, and selected using latest edition The selected application of indicated release is merged the code tested in the code and user instruction being tested, and the result of parsing is made For the newest code coverage data of selected application.
The incremental code coverage rate file and full dose code coverage file of each version are .exec file, can not be direct Parsing, increasing income method by jacoco can be corresponding according to incremental code coverage rate file, full dose code coverage file generated The report of incremental code coverage rate and the report of full dose code coverage of the HTML form of version, cover from the incremental code of HTML form The report of lid rate and the report of full dose code coverage can parse to obtain code coverage data.
Step S102 can also include: to execute when code coverage operation is code coverage clear operation:
All incremental code coverage rate files, full dose code coverage file and the code selected and applied in caching is deleted to cover Lid rate data.
Step S102 can also include: to execute when code coverage operation is code coverage statistical operation:
Code coverage data have been deposited using indicated release according to selected, have generated statistical data according to default dimension, And show statistical data.
Default dimension may include one or more dimensions such as time dimension, business dimension, application system dimension.
Perfect code coverage Statistic Management Function may be implemented in the embodiment of the present invention, will obtain code coverage every time Record be stored in database, handle data as needed, classification is shown in front end.For example, can be shown according to time dimension Each application system code coverage historical record;The code coverage that can according to need preservation each version of application system is reported in detail It accuses;It can be from the time, using affiliated service line dimension to counting using system code coverage rate triggering times, wherein can be with It include: to be ranked up, code coverage acquisition total degree and each application code coverage rate statistics number to all application systems System code coverage update times daily count (as shown in Figure 2), press service line to all application code coverage rate update times Count (as shown in Figure 3) etc..
The code coverage management method of the embodiment of the present invention may be implemented mass simultaneous acquisition, batch updating and empty The code coverage of multiple applications, when user selectes multiple in application, the embodiment of the present invention can obtain phase according to Apply Names It should configure, generate script file, concurrently execute, get the code coverage of each application, improve management code coverage rate efficiency, The time is saved, and allows user from different dimensions understanding code coverage service condition and the generation of same system different editions Code coverage rate, understands code coverage curve in system iterative process in real time.
Fig. 4 is the main modular schematic diagram of code coverage managing device according to an embodiment of the present invention.
The code coverage managing device 400 of the embodiment of the present invention specifically includes that receiving module 401, execution module 402.
For receiving module 401 for receiving user instructions, user instruction instruction executes the generation to the indicated release of selected application Code coverage rate operation, selecting application includes one or more application.
Execution module 402 is used to execute when code coverage operation is that code coverage obtains operation:
The incremental code coverage rate file of the latest edition of selected application is obtained from application system server end;
According to the incremental code coverage rate file of the latest edition of selected application, and the increasing of one or more old versions Code coverage file is measured, the newest full dose code coverage file of selected application is generated;
According to the incremental code coverage rate file of latest edition, newest full dose code coverage file, selected application is obtained Newest code coverage data;
The newest code coverage data of selected application are returned into user terminal.
Execution module 402 specifically can be also used for:
When code coverage operation is code coverage storage operation, execute:
The incremental code coverage rate file that application is selected in caching is saved in database, and from application system server end Obtain the incremental code coverage rate file of the latest edition of selected application;
According to the incremental code coverage rate file of the latest edition of selected application, and the increasing of one or more old versions Code coverage file is measured, the newest full dose code coverage file of selected application is generated;
According to the incremental code coverage rate file of latest edition, newest full dose code coverage file, selected application is obtained Newest code coverage data;
The incremental code coverage rate file of latest edition and newest code coverage data are saved in the database.
Said one or multiple old versions are the version in indicated release.
Execution module 402 may include incremental code coverage rate file acquisition submodule, be used for:
Script file is generated according to the corresponding configuration information of the selected application;
By executing the script file, the increasing of the latest edition of the selected application is obtained from application system server end Measure code coverage file.
Execution module 402 can also include that code coverage data generate submodule, be used for:
According to the incremental code coverage rate file of the latest edition, newest full dose code coverage file, generate respectively The report of incremental code coverage rate, the report of newest full dose code coverage of the latest edition of selected application;
Parse the report of incremental code coverage rate, the report of newest full dose code coverage of latest edition, the result packet of parsing The incremental code coverage rate for selecting the latest edition applied, newest full dose code coverage are included, and selected using latest edition The selected application of indicated release is merged the code tested in the code and user instruction being tested, and the result of parsing is made For the newest code coverage data of selected application.
Execution module specifically can be also used for:
When code coverage operation is code coverage clear operation, execute:
All incremental code coverage rate files, full dose code coverage file and the code selected and applied in caching is deleted to cover Lid rate data.
Execution module 402 specifically can be also used for:
When code coverage operation is code coverage statistical operation, execute:
Code coverage data have been deposited using indicated release according to selected, have generated statistical data according to default dimension, And show statistical data.
Fig. 5 is code coverage management system configuration diagram according to an embodiment of the present invention
As shown in figure 5, the code coverage management system framework of the embodiment of the present invention includes user terminal, code coverage pipe Platform, application system server end.Wherein, user terminal includes that (user 1, and user 2, user for multiple subscriber terminal equipments 3 ...) user interface that platform, is managed by the accessible code coverage of subscriber terminal equipment, checks generation from different dimensions Code coverage rate statistical result, and the operation for being updated (acquisition), emptying, save, checking code coverage report.Code coverage Each function of code coverage managing device 400 may be implemented in rate management platform, such as is analyzed and processed code coverage text Part generates code coverage report, parsing code coverage report, and record personal code work coverage rate updates operation note (code coverage file/report/data including each version), and the operations such as statistics displaying are carried out by different dimensions.Using system Server end of uniting includes multiple application system servers (application system 1,2 application system 3 of application system, application system 4 ...).
The buttons such as " update ", " emptying ", " preservation " are set in user interface, when user clicks " update ", that is, issues and executes Code coverage obtains the user instruction of operation, and triggering obtains the operation of newest code coverage data.User clicks " emptying " When, that is, the user instruction for executing code coverage clear operation is issued, triggering empties all incremental codes covering of selected application The operation of rate file, full dose code coverage file and code coverage data.When user clicks " preservation ", that is, issues and execute generation The user instruction of code coverage rate storage operation, is triggered the incremental code coverage rate file and newest code coverage of latest edition Data are saved in the operation of database, and specifically, code coverage management platform can first obtain newest code coverage, then The relevant folder that code coverage file merge.exec and corresponding report are backed up to server, is named with report name, User, which passes through, checks that " historical report " project checks the code coverage report saved.User interface additionally provides user to generation Code coverage rate statistical query entrance, user can since any one version statistics application system code coverage rate.This hair The code coverage of bright embodiment manages platform, as long as user does not trigger " emptying " operation, will add up always subsequent all versions This code coverage, until meeting user demand, user selects " preservation ", can save detailed code coverage report and arrive In historical report record, for subsequent reference;User selects " emptying ", deletes all code coverage files, and restart to count Code coverage is calculated, is recycled with this.
In addition, the specific implementation content of code coverage managing device in embodiments of the present invention, code described above It has been described in detail in coverage rate management method, therefore has no longer illustrated in this duplicate contents.
Fig. 6 shows the code coverage management method or code coverage managing device that can apply the embodiment of the present invention Exemplary system architecture 600.
As shown in fig. 6, system architecture 600 may include terminal device 601,602,603, network 604 and server 605. Network 604 between terminal device 601,602,603 and server 605 to provide the medium of communication link.Network 604 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 601,602,603 and be interacted by network 604 with server 605, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 601,602,603 The application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 601,602,603 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 605 can be to provide the server of various services, such as utilize terminal device 601,602,603 to user The shopping class website browsed provides the back-stage management server supported.Back-stage management server can look into the information received It askes the data such as request to carry out the processing such as analyzing, and processing result (such as code coverage data) is fed back into terminal device.
It should be noted that code coverage management method provided by the embodiment of the present invention is generally held by server 605 Row, correspondingly, code coverage managing device is generally positioned in server 605.
It should be understood that the number of terminal device, network and server in Fig. 6 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Below with reference to Fig. 7, it illustrates the computer systems 700 for the server for being suitable for being used to realize the embodiment of the present application Structural schematic diagram.Server shown in Fig. 7 is only an example, should not function and use scope band to the embodiment of the present application Carry out any restrictions.
As shown in fig. 7, computer system 700 includes central processing unit (CPU) 701, it can be read-only according to being stored in Program in memory (ROM) 702 or be loaded into the program in random access storage device (RAM) 703 from storage section 708 and Execute various movements appropriate and processing.In RAM 703, also it is stored with system 700 and operates required various programs and data. CPU 701, ROM 702 and RAM 703 are connected with each other by bus 704.Input/output (I/O) interface 705 is also connected to always Line 704.
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 708 including hard disk etc.; And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because The network of spy's net executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to read from thereon Computer program be mounted into storage section 708 as needed.
Particularly, disclosed embodiment according to the present invention, can be by above with reference to the process of key step schematic diagram description It is embodied as computer software programs.For example, embodiment disclosed by the invention includes a kind of computer program product comprising carrying Computer program on a computer-readable medium, the computer program include for executing side shown in key step schematic diagram The program code of method.In such embodiments, the computer program can be downloaded from network by communications portion 709 and Installation, and/or be mounted from detachable media 711.When the computer program is executed by central processing unit (CPU) 701, hold The above-mentioned function of being limited in the system of row the application.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In this application, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In application, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Key step schematic diagram and block diagram in attached drawing, illustrate according to the system of the various embodiments of the application, method and The architecture, function and operation in the cards of computer program product.In this regard, in key step schematic diagram or block diagram Each box can represent a part of a module, program segment or code, one of above-mentioned module, program segment or code Subpackage is containing one or more executable instructions for implementing the specified logical function.It should also be noted that at some as replacement Realization in, function marked in the box can also occur in a different order than that indicated in the drawings.For example, two in succession The box that ground indicates can actually be basically executed in parallel, they can also be executed in the opposite order sometimes, this is according to involved And function depending on.It is also noted that each box and block diagram or key step in block diagram or key step schematic diagram The combination of box in schematic diagram, can the dedicated hardware based systems of the functions or operations as defined in executing realize, Or it can realize using a combination of dedicated hardware and computer instructions.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet Include receiving module 401, execution module 402.Wherein, the title of these modules is not constituted to the module itself under certain conditions Restriction, for example, receiving module 401 is also described as " for receiving user instructions module ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: to receive user instructions, and the user instruction instruction executes the code coverage to the indicated release of selected application Rate operation, the selected application includes one or more application;When code coverage operation is that code coverage obtains behaviour When making, executes: obtaining the incremental code coverage rate file of the latest edition of the selected application from application system server end;Root According to the incremental code coverage rate file of the latest edition of the selected application, and the incremental code of one or more old versions Coverage rate file generates the newest full dose code coverage file of the selected application,;According to the increment generation of the latest edition Code coverage rate file, the newest full dose code coverage file, obtain the newest code coverage data of the selected application; The newest code coverage data of the selected application are returned into user terminal.
Technical solution according to an embodiment of the present invention is held when user instruction indicates that executing code coverage obtains operation Row: the incremental code coverage rate file of the latest edition of selected application is obtained from application system server end;According to selected application Latest edition incremental code coverage rate file, and the incremental code coverage rate file of one or more old version is raw At the newest full dose code coverage file of selected application;According to the incremental code coverage rate file of latest edition, newest full dose Code coverage file obtains the newest code coverage data of selected application and the data is returned to user terminal.It can be realized Flexible code coverage securing mechanism, user can obtain the code coverage between application system any two or multiple versions, More accurate reference frame is provided for quality control, and realizes that batch obtains.When user instruction indicates that execution code coverage is clear It when except operation, is able to achieve batch and empties the code coverages of multiple application systems, improve the code coverage efficiency of management, when saving Between.When user instruction indicates to execute code coverage storage operation, the code coverage between different editions can recorde, with And when user instruction indicates to execute code coverage statistical operation, it can be covered from various dimensions to using System History code Lid rate carries out summarizing displaying, so that user is understood code coverage curve in system iterative process in real time, to understand application system The trend of code coverage.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (14)

1. a kind of code coverage management method characterized by comprising
It receives user instructions, the user instruction instruction, which executes, operates the code coverage of the indicated release of selected application, institute Stating selected application includes one or more application;
When code coverage operation is that code coverage obtains operation, execute:
The incremental code coverage rate file of the latest edition of the selected application is obtained from application system server end;
According to the incremental code coverage rate file of the latest edition of the selected application, and the increasing of one or more old versions Code coverage file is measured, the newest full dose code coverage file of the selected application is generated;
According to the incremental code coverage rate file of the latest edition, the newest full dose code coverage file, obtain described The newest code coverage data of selected application;
The newest code coverage data of the selected application are returned into user terminal.
2. the method according to claim 1, wherein when code coverage operation is that code coverage stores When operation, execute:
The incremental code coverage rate file that application is selected described in caching is saved in database, and from application system server end Obtain the incremental code coverage rate file of the latest edition of the selected application;
According to the incremental code coverage rate file and one or more of old versions of the latest edition of the selected application Incremental code coverage rate file, generate the newest full dose code coverage file of the selected application;
According to the incremental code coverage rate file of the latest edition, the newest full dose code coverage file, obtain described The newest code coverage data of selected application;
The incremental code coverage rate file of the latest edition and the newest code coverage data are saved in the data Library.
3. method according to claim 1 or 2, which is characterized in that obtain described select from application system server end and answer The step of incremental code coverage rate file of latest edition, comprising:
Script file is generated according to the corresponding configuration information of the selected application;
By executing the script file, the increment generation of the latest edition of the selected application is obtained from application system server end Code coverage rate file.
4. method according to claim 1 or 2, which is characterized in that according to the incremental code coverage rate of the latest edition File, the newest full dose code coverage file, the step of obtaining the newest code coverage data of the selected application, packet It includes:
According to the incremental code coverage rate file of the latest edition, the newest full dose code coverage file, generate respectively The report of incremental code coverage rate, the report of newest full dose code coverage of the latest edition of the selected application;
The report of incremental code coverage rate, the report of newest full dose code coverage of the latest edition are parsed, to generate the choosing Surely the newest code coverage data applied.
5. the method according to claim 1, wherein when code coverage operation is that code coverage is removed When operation, execute:
All incremental code coverage rate files, full dose code coverage file and the code selected and applied described in caching is deleted to cover Lid rate data.
6. the method according to claim 1, wherein when code coverage operation is that code coverage counts When operation, execute:
According to it is described it is selected deposited code coverage data using indicated release, according to default dimension generate statistical data, And show the statistical data.
7. a kind of code coverage managing device characterized by comprising
Receiving module, for receiving user instructions, the user instruction instruction executes the code to the indicated release of selected application Coverage rate operation, the selected application includes one or more application;
Execution module, for executing when code coverage operation is that code coverage obtains operation:
The incremental code coverage rate file of the latest edition of the selected application is obtained from application system server end;
According to the incremental code coverage rate file of the latest edition of the selected application, and the increasing of one or more old versions Code coverage file is measured, the newest full dose code coverage file of the selected application is generated;
According to the incremental code coverage rate file of the latest edition, the newest full dose code coverage file, obtain described The newest code coverage data of selected application;
The newest code coverage data of the selected application are returned into user terminal.
8. device according to claim 7, which is characterized in that the execution module is also used to:
When code coverage operation is code coverage storage operation, execute:
The incremental code coverage rate file that application is selected described in caching is saved in database, and from application system server end Obtain the incremental code coverage rate file of the latest edition of the selected application;
According to the incremental code coverage rate file and one or more of old versions of the latest edition of the selected application Incremental code coverage rate file, generate the newest full dose code coverage file of the selected application;
According to the incremental code coverage rate file of the latest edition, the newest full dose code coverage file, obtain described The newest code coverage data of selected application;
The incremental code coverage rate file of the latest edition and the newest code coverage data are saved in the data Library.
9. device according to claim 7 or 8, which is characterized in that the execution module includes incremental code coverage rate text Part acquisition submodule, is used for:
Script file is generated according to the corresponding configuration information of the selected application;
By executing the script file, the increment generation of the latest edition of the selected application is obtained from application system server end Code coverage rate file.
10. device according to claim 7 or 8, which is characterized in that the execution module includes that code coverage data are raw At submodule, it is used for:
According to the incremental code coverage rate file of the latest edition, the newest full dose code coverage file, generate respectively The report of incremental code coverage rate, the report of newest full dose code coverage of the latest edition of the selected application;
The report of incremental code coverage rate, the report of newest full dose code coverage of the latest edition are parsed, to generate the choosing Surely the newest code coverage data applied.
11. device according to claim 7, which is characterized in that the execution module is also used to:
When code coverage operation is code coverage clear operation, execute:
All incremental code coverage rate files, full dose code coverage file and the code selected and applied described in caching is deleted to cover Lid rate data.
12. device according to claim 7, which is characterized in that the execution module is also used to:
When code coverage operation is code coverage statistical operation, execute:
According to it is described it is selected deposited code coverage data using indicated release, according to default dimension generate statistical data, And show the statistical data.
13. a kind of electronic equipment characterized by comprising
One or more processors;
Memory, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors Realize such as method as claimed in any one of claims 1 to 6.
14. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method as claimed in any one of claims 1 to 6 is realized when row.
CN201810736153.0A 2018-07-06 2018-07-06 Code coverage rate management method and device Active CN109002395B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810736153.0A CN109002395B (en) 2018-07-06 2018-07-06 Code coverage rate management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810736153.0A CN109002395B (en) 2018-07-06 2018-07-06 Code coverage rate management method and device

Publications (2)

Publication Number Publication Date
CN109002395A true CN109002395A (en) 2018-12-14
CN109002395B CN109002395B (en) 2020-11-24

Family

ID=64598749

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810736153.0A Active CN109002395B (en) 2018-07-06 2018-07-06 Code coverage rate management method and device

Country Status (1)

Country Link
CN (1) CN109002395B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109684221A (en) * 2018-12-27 2019-04-26 江苏满运软件科技有限公司 Test code coverage acquisition method, system, equipment and medium
CN109684226A (en) * 2018-12-29 2019-04-26 携程计算机技术(上海)有限公司 Java code coverage rate statistical system
CN110413733A (en) * 2019-07-23 2019-11-05 上海易点时空网络有限公司 Code statistical method and device
CN110597710A (en) * 2019-08-13 2019-12-20 平安证券股份有限公司 Test coverage rate statistical method and device, computer equipment and storage medium
CN111858367A (en) * 2020-07-24 2020-10-30 北京达佳互联信息技术有限公司 Code coverage rate testing method, system, device, electronic equipment and storage medium
CN112069066A (en) * 2020-09-01 2020-12-11 招商银行股份有限公司 Code coverage rate statistical method, device, equipment and computer readable storage medium
CN112559348A (en) * 2020-12-15 2021-03-26 广州云从鼎望科技有限公司 Test analysis method, system, equipment and medium based on jacoco
CN113806227A (en) * 2021-09-26 2021-12-17 五八同城信息技术有限公司 Information processing method and device, electronic equipment and storage medium
CN114003513A (en) * 2021-12-30 2022-02-01 云账户技术(天津)有限公司 Code coverage rate processing method and device, electronic equipment and readable storage medium
CN116701182A (en) * 2023-05-10 2023-09-05 合芯科技有限公司 Coverage rate mark file updating method, coverage rate mark file updating device, coverage rate mark file updating equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6182245B1 (en) * 1998-08-31 2001-01-30 Lsi Logic Corporation Software test case client/server system and method
CN105608000A (en) * 2015-12-16 2016-05-25 北京奇虎科技有限公司 Method and device for obtaining code coverage rate data
CN105630671A (en) * 2015-12-16 2016-06-01 北京奇虎科技有限公司 Code coverage rate report generation method and device
CN105988926A (en) * 2015-02-13 2016-10-05 腾讯科技(深圳)有限公司 Method and device for processing multi-version test data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6182245B1 (en) * 1998-08-31 2001-01-30 Lsi Logic Corporation Software test case client/server system and method
CN105988926A (en) * 2015-02-13 2016-10-05 腾讯科技(深圳)有限公司 Method and device for processing multi-version test data
CN105608000A (en) * 2015-12-16 2016-05-25 北京奇虎科技有限公司 Method and device for obtaining code coverage rate data
CN105630671A (en) * 2015-12-16 2016-06-01 北京奇虎科技有限公司 Code coverage rate report generation method and device

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109684221A (en) * 2018-12-27 2019-04-26 江苏满运软件科技有限公司 Test code coverage acquisition method, system, equipment and medium
CN109684226A (en) * 2018-12-29 2019-04-26 携程计算机技术(上海)有限公司 Java code coverage rate statistical system
CN110413733A (en) * 2019-07-23 2019-11-05 上海易点时空网络有限公司 Code statistical method and device
CN110597710B (en) * 2019-08-13 2024-04-05 平安证券股份有限公司 Test coverage rate statistical method, device, computer equipment and storage medium
CN110597710A (en) * 2019-08-13 2019-12-20 平安证券股份有限公司 Test coverage rate statistical method and device, computer equipment and storage medium
CN111858367A (en) * 2020-07-24 2020-10-30 北京达佳互联信息技术有限公司 Code coverage rate testing method, system, device, electronic equipment and storage medium
CN112069066A (en) * 2020-09-01 2020-12-11 招商银行股份有限公司 Code coverage rate statistical method, device, equipment and computer readable storage medium
CN112069066B (en) * 2020-09-01 2024-05-07 招商银行股份有限公司 Code coverage rate statistical method, device, equipment and computer readable storage medium
CN112559348A (en) * 2020-12-15 2021-03-26 广州云从鼎望科技有限公司 Test analysis method, system, equipment and medium based on jacoco
CN112559348B (en) * 2020-12-15 2021-09-14 广州云从鼎望科技有限公司 Test analysis method, system, equipment and medium based on jacoco
CN113806227B (en) * 2021-09-26 2023-12-12 五八同城信息技术有限公司 Information processing method, device, electronic equipment and storage medium
CN113806227A (en) * 2021-09-26 2021-12-17 五八同城信息技术有限公司 Information processing method and device, electronic equipment and storage medium
CN114003513A (en) * 2021-12-30 2022-02-01 云账户技术(天津)有限公司 Code coverage rate processing method and device, electronic equipment and readable storage medium
CN116701182A (en) * 2023-05-10 2023-09-05 合芯科技有限公司 Coverage rate mark file updating method, coverage rate mark file updating device, coverage rate mark file updating equipment and storage medium
CN116701182B (en) * 2023-05-10 2024-06-04 合芯科技有限公司 Coverage rate mark file updating method, coverage rate mark file updating device, coverage rate mark file updating equipment and storage medium

Also Published As

Publication number Publication date
CN109002395B (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN109002395A (en) A kind of code coverage management method and device
USRE49486E1 (en) System and method for tracking web interactions with real time analytics
CN106302445B (en) Method and apparatus for handling request
CN112040429B (en) Short message management system and method based on distributed storage
EP1386240A2 (en) Synthetic transaction monitor
WO2002079909A2 (en) Synthetic transaction monitor
KR20100066468A (en) Method and apparatus for propagating accelerated events in a network management system
CN111476015B (en) Document processing method and device, electronic equipment and storage medium
KR101396547B1 (en) Mobile application statistical analysis system
CN110427304A (en) O&M method, apparatus, electronic equipment and medium for banking system
CN109039817A (en) A kind of information processing method and device for traffic monitoring
CN109347921A (en) A kind for the treatment of method and apparatus of digital certificate business
CN113760722A (en) Test system and test method
US10775751B2 (en) Automatic generation of regular expression based on log line data
CN109949064A (en) A kind of open interface calls charging method and device
CN110083457A (en) A kind of data capture method, device and data analysing method, device
CN112631879A (en) Data acquisition method and device, computer readable medium and electronic equipment
CN109002389A (en) The method and apparatus of page automatic test
CN110083501A (en) Interface calls method of counting and device
CN108875355A (en) A kind of control method and device of access authority
CN109522202A (en) A kind of method and apparatus of software test
CN115496544A (en) Data processing method and device
CN115952050A (en) Reporting method and device for organization service buried point data
CN110244975A (en) A kind of generation method and device of static resource version number
CN109788010A (en) A kind of method and apparatus of data localization access

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
CB02 Change of applicant information

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Applicant after: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Applicant before: BEIJING JINGDONG FINANCIAL TECHNOLOGY HOLDING Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee after: Jingdong Technology Holding Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee before: Jingdong Digital Technology Holding Co.,Ltd.

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Patentee before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

CP01 Change in the name or title of a patent holder