CN106776296A - Startup method, device and starting device that coverage rate is detected - Google Patents
Startup method, device and starting device that coverage rate is detected Download PDFInfo
- Publication number
- CN106776296A CN106776296A CN201611083726.1A CN201611083726A CN106776296A CN 106776296 A CN106776296 A CN 106776296A CN 201611083726 A CN201611083726 A CN 201611083726A CN 106776296 A CN106776296 A CN 106776296A
- Authority
- CN
- China
- Prior art keywords
- file
- detected
- data
- coverage rate
- version number
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3676—Test management for coverage analysis
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)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present invention provides a kind of startup method of coverage rate detection, device and starting device, and the method includes:When coverage rate detection enabled instruction is got, the version number to be detected of the file to be detected and file to be detected in enabled instruction is detected according to coverage rate, with the presence or absence of the corresponding data of version number to be detected of file to be detected in the file directory data that detection is locally stored;If not existing, function is obtained according to difference the current directory data of file to be detected in file directory data are updated to the corresponding new catalogue data of version number to be detected, obtain new file directory data;By new file directory data is activation to coverage rate server.Using the method, can avoid when size of code is larger carrying out coverage rate detection every time being required for re-reading complete catalogue and generate corresponding data structure, effectively shorten the startup time, reduce performance consumption.
Description
Technical field
The present invention relates to field of computer technology, more particularly to startup method, device and the startup that a kind of coverage rate is detected
Equipment.
Background technology
Code coverage is tested, be in software test procedure most important method of testing and test performance measures standard it
One, coverage rate refers to being tested the ratio and degree for covering code in source code implementation procedure, generally uses percentage table
Show.
For different programming languages, there is the method for corresponding detection code coverage.For game server
Python code coverages detect during, usually used technical scheme is carried using python
Sys.settrace functions carry out Data Collection and treatment, after collection is stopped, disposably deriving coverage data report.
Due to the requirement of real-time of code coverage detection, as the increase of game scale and the development of project are, it is necessary to the code of test
Amount more and more higher, how preferably to safeguard and store the coverage data of acquisition in coverage rate test becomes asking of must solving
Topic.In general, coverage data, includes file coverage data and catalogue coverage data, the executed of each file
The code line number set crossed, the total executable code line number set of this document etc., and whenever there is new coverage data to arrive,
Some codes of such as certain file are performed, then be accomplished by catalogue where recalculating current file, current file very
As for overall coverage data.The specific mode for obtaining coverage data a kind of at present is using the sys modules of python
Middle offer settrace functions, track the implementation status of code, by coverage data storage to the Stack in Collector.
Whenever collection is started, Collector constantly performs stack-incoming operation, when stopping collection, can be obtained by Pop operations and adopted
The coverage data of collection.
However, starting coverage rate detection every time, it is required for reading the bibliographic structure of all codes, and needs to parse each
The executable lines of codes sum of file, can bring greatly therefore when scale of the project and larger size of code, the step for startup
Performance and time loss, and code, in constantly iterative development, start-up operation is very frequent.
The content of the invention
The embodiment of the present invention provides a kind of startup method of coverage rate detection, device and starting device, for solving every time
Start coverage rate detection, be required for reading the bibliographic structure of all codes, and need to parse the executable code of each file
Row sum, great performance and time loss can be brought therefore when scale of the project and larger size of code, the step for startup
Problem.
First aspect present invention provides a kind of startup method of coverage rate detection, including:
When coverage rate detection enabled instruction is got, the file to be detected in enabled instruction is detected according to the coverage rate
With the presence or absence of described to be checked in the file directory data being locally stored with the version number to be detected of the file to be detected, detection
Survey the corresponding data of version number described to be detected of file;
If not existing, function is obtained by the current mesh of file to be detected described in the file directory data according to difference
Record data are updated to the corresponding new catalogue data of the version number to be detected, obtain new file directory data;
By the new file directory data is activation to coverage rate server.
Optionally, methods described also includes:
If in the presence of by the file directory data is activation to the coverage rate server.
Optionally, methods described also includes:
The file directory data are used to be calculated by coverage rate server the code coverage of the file to be detected.
Optionally, the file to be detected and the file to be detected detected according to the coverage rate in enabled instruction
Version number to be detected, with the presence or absence of the described to be detected of the file to be detected in the file directory data that detection is locally stored
Before the corresponding data of version number, methods described includes:
When locally in the absence of file directory data, file name and directory information according to each file generate tree-like depositing
The file directory data of storage structure;Wherein, include that at least one of which is believed with catalogue under the root node of the Storage Structure of Tree
The child node that breath and file name are successively set up;The catalogue data of each node includes the catalogue data of its lower level of child nodes
Set.
Optionally, it is described that function is obtained by the current mesh of file to be detected described in the file directory data according to difference
Record data are updated to the corresponding new catalogue data of the version number to be detected, obtain new file directory data, including:
Obtain the corresponding catalogue data of the newest version number for once updating of the file to be detected;
The file to be detected according to the version number to be detected and the file directory data it is newest once more
New version number, function is obtained using the difference, obtains the change that the file to be detected occurs;
If the change turns to modification and/or adds, code analysis are carried out to the code for changing, obtain described new
Catalogue data;
If the change turns to deletion, the part being deleted in the file current directory data to be detected is directly deleted,
Obtain the new catalogue data.
Second aspect present invention provides a kind of starter of coverage rate detection, including:
Acquisition module, for getting coverage rate detection enabled instruction;
Processing module, for when the acquisition module gets coverage rate detection enabled instruction, according to the coverage rate
The version number to be detected of file to be detected and the file to be detected in detection enabled instruction, the file that detection is locally stored
With the presence or absence of the corresponding data of version number described to be detected of the file to be detected in catalogue data;
If not existing, the processing module is additionally operable to obtain function by described in the file directory data according to difference
The current directory data of file to be detected are updated to the corresponding new catalogue data of the version number to be detected, obtain new text
Part catalogue data;
Sending module, for by the new file directory data is activation to coverage rate server.
Optionally, the sending module is additionally operable to the presence of the described to be checked of the file to be detected in file directory data
When surveying the corresponding data of version number, by the file directory data is activation to the coverage rate server.
Optionally, the file directory data that the processing module is obtained are used to be calculated institute by coverage rate server
State the code coverage of file to be detected.
Optionally, the processing module is additionally operable to:
When locally in the absence of file directory data, file name and directory information according to each file generate tree-like depositing
The file directory data of storage structure;Wherein, include that at least one of which is believed with catalogue under the root node of the Storage Structure of Tree
The child node that breath and file name are successively set up;The catalogue data of each node includes the catalogue data of its lower level of child nodes
Set.
Optionally, the processing module specifically for:
Obtain the corresponding catalogue data of the newest version number for once updating of the file to be detected;
The file to be detected according to the version number to be detected and the file directory data it is newest once more
New version number, function is obtained using the difference, obtains the change that the file to be detected occurs;
If the change turns to modification and/or adds, code analysis are carried out to the code for changing, obtain described new
Catalogue data;
If the change turns to deletion, the part being deleted in the file current directory data to be detected is directly deleted,
Obtain the new catalogue data.
Third aspect present invention provides a kind of starting device, including:Have program stored therein instruction memory, for controlling journey
Processor and transmitter that sequence instruction is performed;
The processor is used for:
When coverage rate detection enabled instruction is got, the file to be detected in enabled instruction is detected according to the coverage rate
With the presence or absence of described to be checked in the file directory data being locally stored with the version number to be detected of the file to be detected, detection
Survey the corresponding data of version number described to be detected of file;
If not existing, function is obtained by the current mesh of file to be detected described in the file directory data according to difference
Record data are updated to the corresponding new catalogue data of the version number to be detected, obtain new file directory data;
The transmitter is used for the new file directory data is activation to coverage rate server.
The startup method of coverage rate provided in an embodiment of the present invention detection, device and starting device, when getting coverage rate
During detection enabled instruction, the server of operation end detects file to be detected and file to be detected in enabled instruction according to coverage rate
Version number to be detected, with the presence or absence of the version number to be detected of file to be detected in the file directory data that are locally stored of detection
The corresponding data of code, if not existing, function are obtained by the current directory of file to be detected in file directory data according to difference
Data are updated to the corresponding new catalogue data of version number to be detected, obtain new file directory data, by new file mesh
Record data is activation to coverage rate server uses the method, can avoid carrying out coverage rate detection every time when size of code is larger
It is required for re-reading complete catalogue and generates corresponding data structure, effectively shorten the startup time, reduces performance consumption.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are this hairs
Some bright embodiments, for those of ordinary skill in the art, without having to pay creative labor, can be with
Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is the flow chart of the startup embodiment of the method one of coverage rate detection provided in an embodiment of the present invention;
Fig. 2 is the flow chart of the startup embodiment of the method two of coverage rate detection provided in an embodiment of the present invention;
Fig. 3 is the flow chart of the example of startup method one of coverage rate detection provided in an embodiment of the present invention;
The schematic diagram of the Storage Structure of Tree that Fig. 4 is provided for the present invention;
Fig. 5 is the structural representation of the starter embodiment one of coverage rate detection provided in an embodiment of the present invention;
Fig. 6 is the structural representation of starting device embodiment one provided in an embodiment of the present invention.
Specific embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The all other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
In order to solve in the prior art, coverage rate detection is started every time, be required for reading the bibliographic structure of all codes, and
And need to parse the executable lines of codes sum of each file, therefore when scale of the project and larger size of code, start this step
Suddenly the problem of great performance and time loss can be brought.This programme proposes a kind of quick startup side of coverage rate detection process
Method, in runtime server side, detection locally whether there is existing file directory data during startup.If there is no file directory number
According to then carrying out the first subdirectory and generate and be stored as file directory data;If existing file catalogue data, what reading was detected
Whether file directory data, search has the code directory data in current same path.If not existing current code catalogue data,
First time generation is carried out for current code catalogue data;If there is current code catalogue data, according to the version of current code
This number scans in data, checks whether there is the catalogue data of the current version number of current code, if there is also worked as
The data of preceding version number, then directly send to coverage rate server this document catalogue data.If in the absence of current version number
Data, then search in data with existing, takes the data corresponding to the maximum of existing version number as benchmark, applies again current
The catalogue data of the code of version, by new file directory data storage and sends to coverage rate server.Below by several
Specific embodiment is illustrated to the quick start method.
Fig. 1 is the flow chart of the startup embodiment of the method one of coverage rate detection provided in an embodiment of the present invention, such as Fig. 1 institutes
Show, the executive agent of the program is the operation side apparatus of starting device, i.e. configuration processor code, runs the server of side, for example:
Game server, the step that implements of startup method of coverage rate detection is:
Step S101, when coverage rate detection enabled instruction is got, according in coverage rate detection enabled instruction
Whether the version number to be detected of file to be detected and the file to be detected, deposit in the file directory data that detection is locally stored
In the corresponding data of version number described to be detected of the file to be detected.
In the present embodiment, during coverage rate detection is carried out, first have to start the server side in operation code
Detection procedure, each file need not be re-started in this programme catalogue data generation, but getting detection start
After instruction, with the presence or absence of the corresponding catalogue data of current version of the file to be detected in the local file directory data of inspection,
Exist and in the absence of when respectively use different processing modes.
In this programme, the file directory data are used to be calculated the file to be detected by coverage rate server
Code coverage.
Optionally, if starting first, then need first to generate a file directory data, i.e., server is according to local
Can operation code file, carry out the generation of the first subdirectory and obtain file directory data, and store local, subsequently to open again
Inquired about during dynamic.
Step S102, if not existing, function is obtained by text to be detected described in the file directory data according to difference
The current directory data of part are updated to the corresponding new catalogue data of the version number to be detected, obtain new file directory number
According to.
In this step, if there is no the current version number of the file to be detected right in the file directory data being locally stored
In the absence of the catalogue data that the file to be detected is related in the catalogue data answered, or file directory data, then it is right to be needed when
The corresponding catalogue data of the file to be detected is updated, or generates the catalogue data of the file to be detected, alternative document pair
The catalogue data answered is constant, obtains new file directory data.
Step S103, by the new file directory data is activation to coverage rate server.
In this programme, the new file directory data is activation that will be obtained gives coverage rate server, in this scenario, it is not necessary to
Catalogue data to all of file is all generated, and only the catalogue data of the file to be detected to changing is carried out more
Newly.
Step S104, if in the presence of by the file directory data is activation to the coverage rate server.
In this step, it is arranged side by side with above-mentioned steps 102,103, if existing in detecting the file directory data being locally stored
The catalogue data of the file to be detected, and deposit the data of version number to be detected, then need not enter column catalogue in the start-up course
The generation of data, directly can be sent to coverage rate server by local storage file catalogue data.
The startup method of the coverage rate detection that the present embodiment is provided, can avoid being covered every time when size of code is larger
The detection of lid rate is required for re-reading complete catalogue and generates corresponding data structure, effectively shortens the startup time, reduces performance
Consumption.
In the above-described embodiments, if starting coverage rate detection for the first time, i.e., do not exist file directory data locally, then
Server generates the file directory data of Storage Structure of Tree according to the file name and directory information of each file;Its
In, the son section that at least one of which is successively set up with directory information and file name is included under the root node of the Storage Structure of Tree
Point;The catalogue data of each node includes the set of the catalogue data of its lower level of child nodes.It is more square using the Storage Structure of Tree
Just the data to certain file detect, improve treatment effeciency.
Fig. 2 is the flow chart of the startup embodiment of the method two of coverage rate detection provided in an embodiment of the present invention, such as Fig. 2 institutes
Show, on the basis of above-described embodiment, " obtaining function according to difference will treat described in the file directory data in step S102
Detect that the current directory data of file are updated to the corresponding new catalogue data of the version number to be detected, obtain new file
The specific implementation of catalogue data " is:
Step S201, obtains the corresponding catalogue data of the newest version number for once updating of the file to be detected.
In this step, it is necessary to title according to the file to be detected or other identification informations, from the file of storage
The catalogue data for obtaining file last time renewal to be detected is inquired about in catalogue data, that is, obtains the version closest to this version number
This number corresponding catalogue data.
Step S202, the file to be detected according to the version number to be detected and the file directory data is most
The new version number for once updating, function is obtained using the difference, obtains the change that the file to be detected occurs.
In this scenario, once updated on obtaining after the version number of the file to be detected in catalogue data, used
Difference obtains function, is input into this version number to be detected and the version number of last time, obtains file to be detected in itself
The change of generation, for example:Program code increase, modification or deletion etc..
Step S203, if the change turns to modification and/or adds, code analysis is carried out to the code for changing, and is obtained
To the new catalogue data.
In this step, if the program code of the file to be detected is changed or with addition of new code snippet,
Then need code or newly-increased code to changing to parse, update the catalogue data of the file to be detected.
Step S204, if the change turns to deletion, directly deletes and deleted in the file current directory data to be detected
The part removed, obtains the new catalogue data.
If having code in the program code of the file to be detected to be deleted, i.e., it is to delete with the change of original code,
The corresponding data in part that can then current catalogue data Program code be deleted are deleted, and obtain new catalogue data.
New file directory data can be obtained by said process, it is then new by what is obtained according to the mode of embodiment one
File directory data is activation to coverage rate server.
The startup method of the coverage rate detection that the present embodiment is provided, when coverage rate detection enabled instruction is got, operation
The server at end detects the version number to be detected of the file to be detected and file to be detected in enabled instruction, inspection according to coverage rate
With the presence or absence of the corresponding data of version number to be detected of file to be detected in the file directory data that survey is locally stored, if not depositing
Function is then being obtained according to difference the current directory data of file to be detected in file directory data are being updated to version to be detected
The corresponding new catalogue data of number, obtains new file directory data, and new file directory data is activation to coverage rate is taken
Business device uses the method, can avoid when size of code is larger carrying out every time coverage rate detection be required for re-reading it is complete
Catalogue simultaneously generates corresponding data structure, effectively shortens the startup time, reduces performance consumption.
Fig. 3 is the flow chart of the example of startup method one of coverage rate detection provided in an embodiment of the present invention, as shown in figure 3,
The program is illustrated by taking game server and coverage rate server as an example.
The coverage rate detection startup method be broadly divided into file directory data generate completely, catalogue data increment generation,
Three functions of persistent storage.
First, initialized.Initialization procedure is divided into startup coverage data treatment service end (i.e. coverage rate service
Device) and it is embedded in coverage rate collection client to two parts in game server script.
Coverage rate server end is built based on Tornado, and major function is received from by certain by websocket
The data of the client of rule mark, and timing is by the data merging of same game server and processes.Opened in game server
Before dynamic test, coverage rate service end is started first, wait client connection and collect data.
For client, start in game server in the script of different processes, addition is started using thread
The code of websocket connections, it is specific as follows:
Ws=websocket.WebSocket (" ws://websocket_address/")
Thread_ws=threading.Thread (target=ws.run)
thread_ws.start()
The thread is used for after each game server process starts websocket and is connected to coverage rate server, enters
The data is activation of row timing.
Secondly, catalogue data is generated completely
As shown in figure 3 above, when no local data or there is local data, but without corresponding of current code path
During ground data, illustrate that code to be detected never carried out coverage rate detection, therefore need to carry out the complete life of first time catalogue data
Into operation:
First since root, the whole bibliographic structure of grey iterative generation (i.e. file directory data), specific as follows successively:
The schematic diagram of the Storage Structure of Tree that Fig. 4 is provided for the present invention, as shown in figure 4, root node represents root, under it
By the in store all of file directory data of successively node, the data that can be included at the root node have total code line number (by
The data of all child nodes are added and get, for 0), total executed lines of code (is added by the data of all child nodes when initial
Get, for 0) when initial and total coverage data (obtained divided by total code line number by total executed lines of code,
For 0) when initial.
Other nodes are broadly divided into two classes, and a class is file node, represent certain file (the py files of such as Python)
Coverage data, including lines of code that this document had been performed (being 0 when initial), and holding in this document source code
The total line number of line code, and this document covering rate score (when initial be 0).
Another kind of is directory node, comprising be the catalogue under, the respective items of All Files and catalogue coverage data it
(being 0 when initial), i.e., total executed lines of code (being 0 when initial) of All Files and catalogue under the catalogue, and
Total executable code line number, and the covering rate score (being 0 when initial) calculated by this two item data.
I.e. according to file directory, corresponding tree structure is generated, each node is in addition to filename, in addition it is also necessary to store right
The coverage rate primary data (executable row sum of current code etc.) answered.
The data stored at the tree-like storage architecture, root node and each layer of child node, and each node are common
Constitute initial file directory data.
Finally, the change according to file carries out bibliographic structure increment generation.If current local file directory data file
In, there are the corresponding data in current code path, but the legacy version number (being obtained by svn) for only including current path is corresponding
File directory data, then illustrate that the code had performed coverage rate detection, but current version is detection for the first time, then holds
Row following steps.
Maximum version number is r1 in assuming initially that the legacy data of reading, and current code version number is r2, uses order svn
diff-r r1:R2-summarize, obtain the file change between two versions, that is, which file there occurs and change/delete
Except/addition operation.
To the file that modification and addition occur, executable code parsing (removing null, annotation etc.), record are re-started
Executable lines of codes sum.To the file deleted, corresponding node is directly deleted from existing catalogue data.
Obtain the code directory data of increment generation.So as to obtain new overall file directory data.
Finally, it is necessary to the file directory data that will be obtained carry out persistent storage.
This programme takes the pickle to carry out persistent storage, that is, after getting catalogue data, with current code path, version
Number, file directory data are stored as a data, are persisted as local file, first attempt to read when starting
Take.
By such scheme, can effectively solve size of code it is larger when, carry out every time coverage rate detection be required for re-reading
Complete catalogue simultaneously generates corresponding data, causes system start-up time more long, consumes larger problem, effectively shortens when starting
Between, reduce performance consumption.
Fig. 5 is the structural representation of the starter embodiment one of coverage rate detection provided in an embodiment of the present invention, such as Fig. 5
Shown, the starter 10 of the coverage rate detection that the present embodiment is provided includes:
Acquisition module 11, for getting coverage rate detection enabled instruction;
Processing module 12, for when the acquisition module gets coverage rate detection enabled instruction, according to the covering
The version number to be detected of file to be detected and the file to be detected in rate detection enabled instruction, the text that detection is locally stored
With the presence or absence of the corresponding data of version number described to be detected of the file to be detected in part catalogue data;
If not existing, the processing module 12 is additionally operable to obtain function by institute in the file directory data according to difference
The current directory data for stating file to be detected are updated to the corresponding new catalogue data of the version number to be detected, obtain new
File directory data;
Sending module 13, for by the new file directory data is activation to coverage rate server.
The starter of the coverage rate detection that the present embodiment is provided, for performing the method that foregoing any embodiment is provided
Technical scheme, its realization principle is similar with technique effect, will not be repeated here.
It is described on the basis of above-described embodiment one in the embodiment two of the starter of coverage rate of the present invention detection
The version number described to be detected that sending module 13 is additionally operable to exist in file directory data the file to be detected is corresponding
During data, by the file directory data is activation to the coverage rate server.
Optionally, the file directory data that the processing module 12 is obtained are used to be calculated by coverage rate server
The code coverage of the file to be detected.
Optionally, the processing module 12 is additionally operable to:
When locally in the absence of file directory data, file name and directory information according to each file generate tree-like depositing
The file directory data of storage structure;Wherein, include that at least one of which is believed with catalogue under the root node of the Storage Structure of Tree
The child node that breath and file name are successively set up;The catalogue data of each node includes the catalogue data of its lower level of child nodes
Set.
Optionally, the processing module 12 specifically for:
Obtain the corresponding catalogue data of the newest version number for once updating of the file to be detected;
The file to be detected according to the version number to be detected and the file directory data it is newest once more
New version number, function is obtained using the difference, obtains the change that the file to be detected occurs;
If the change turns to modification and/or adds, code analysis are carried out to the code for changing, obtain described new
Catalogue data;
If the change turns to deletion, the part being deleted in the file current directory data to be detected is directly deleted,
Obtain the new catalogue data.
The starter of the coverage rate detection that the present embodiment is provided, for performing the method that foregoing any embodiment is provided
Technical scheme, its realization principle is similar with technique effect, will not be repeated here.
Fig. 6 is the structural representation of starting device embodiment one provided in an embodiment of the present invention, as shown in fig. 6, the startup
Equipment can be embodied in methods that:Have program stored therein instruction memory 21, for control program instruction perform processor 22
And transmitter 23;
The processor 22 is used for:
When coverage rate detection enabled instruction is got, the file to be detected in enabled instruction is detected according to the coverage rate
With the presence or absence of described to be checked in the file directory data being locally stored with the version number to be detected of the file to be detected, detection
Survey the corresponding data of version number described to be detected of file;
If not existing, function is obtained by the current mesh of file to be detected described in the file directory data according to difference
Record data are updated to the corresponding new catalogue data of the version number to be detected, obtain new file directory data;
The transmitter 23 is used for the new file directory data is activation to coverage rate server.
Optionally, the transmitter 23 is additionally operable to the presence of the described to be checked of the file to be detected in file directory data
When surveying the corresponding data of version number, by the file directory data is activation to the coverage rate server.
Optionally, the file directory data that the processor 22 is obtained are used to be calculated institute by coverage rate server
State the code coverage of file to be detected.
Optionally, the processor 22 is additionally operable to:
When locally in the absence of file directory data, file name and directory information according to each file generate tree-like depositing
The file directory data of storage structure;Wherein, include that at least one of which is believed with catalogue under the root node of the Storage Structure of Tree
The child node that breath and file name are successively set up;The catalogue data of each node includes the catalogue data of its lower level of child nodes
Set.
Optionally, the processor 22 specifically for:
Obtain the corresponding catalogue data of the newest version number for once updating of the file to be detected;
The file to be detected according to the version number to be detected and the file directory data it is newest once more
New version number, function is obtained using the difference, obtains the change that the file to be detected occurs;
If the change turns to modification and/or adds, code analysis are carried out to the code for changing, obtain described new
Catalogue data;
If the change turns to deletion, the part being deleted in the file current directory data to be detected is directly deleted,
Obtain the new catalogue data.
The starting device that the present embodiment is provided is used to perform the technical scheme of the method that foregoing any embodiment is provided, in fact
Existing principle is similar with technique effect, will not be repeated here.
In the embodiment of any of the above-described starting device, it should be appreciated that processor can be CPU (English:
Central Processing Unit, referred to as:CPU), can also be other general processors, digital signal processor (English:
Digital Signal Processor, referred to as:DSP), application specific integrated circuit (English:Application Specific
Integrated Circuit, referred to as:ASIC) etc..General processor can be microprocessor or the processor can also be
Any conventional processor etc..The step of method with reference to disclosed in the embodiment of the present invention, can be embodied directly in hardware processor
Completion is performed, or completion is performed with the hardware in processor and software module combination.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The related hardware of programmed instruction is crossed to complete.Foregoing program can be stored in a computer read/write memory medium.The journey
Sequence upon execution, performs the step of including above-mentioned each method embodiment;And foregoing storage medium includes:Read-only storage (English
Text:Read-only memory, abbreviation:ROM), RAM, flash memory, hard disk, solid state hard disc, tape (English:magnetic
Tape), floppy disk (English:Floppy disk), CD (English:Optical disc) and its any combination.
Finally it should be noted that:Various embodiments above is merely illustrative of the technical solution of the present invention, rather than its limitations;To the greatest extent
Pipe has been described in detail with reference to foregoing embodiments to the present invention, it will be understood by those within the art that:Its according to
The technical scheme described in foregoing embodiments can so be modified, or which part or all technical characteristic are entered
Row equivalent;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology
The scope of scheme.
Claims (11)
1. a kind of startup method that coverage rate is detected, it is characterised in that including:
When coverage rate detection enabled instruction is got, file to be detected and the institute in enabled instruction are detected according to the coverage rate
The version number to be detected of file to be detected is stated, with the presence or absence of the text to be detected in the file directory data that detection is locally stored
The corresponding data of version number described to be detected of part;
If not existing, function is obtained by the current directory number of file to be detected described in the file directory data according to difference
According to the corresponding new catalogue data of the version number to be detected is updated to, new file directory data are obtained;
By the new file directory data is activation to coverage rate server.
2. method according to claim 1, it is characterised in that methods described also includes:
If in the presence of by the file directory data is activation to the coverage rate server.
3. method according to claim 1 and 2, it is characterised in that methods described also includes:
The file directory data are used to be calculated by coverage rate server the code coverage of the file to be detected.
4. method according to claim 3, it is characterised in that described that treating in enabled instruction is detected according to the coverage rate
The version number to be detected of detection file and the file to be detected, whether there is in the file directory data that detection is locally stored
Before the corresponding data of version number described to be detected of the file to be detected, methods described includes:
When locally in the absence of file directory data, the tree-like storage knot of file name and directory information generation according to each file
The file directory data of structure;Wherein, under the root node of the Storage Structure of Tree include at least one of which with directory information with
And the child node that file name is successively set up;The catalogue data of each node includes the collection of the catalogue data of its lower level of child nodes
Close.
5. method according to claim 4, it is characterised in that described that function is obtained by the file directory number according to difference
The current directory data of the file to be detected described in are updated to the corresponding new catalogue data of the version number to be detected, obtain
To new file directory data, including:
Obtain the corresponding catalogue data of the newest version number for once updating of the file to be detected;
The newest of according to the version number to be detected and file directory data file to be detected once updates
Version number, function is obtained using the difference, obtains the change that the file to be detected occurs;
If the change turns to modification and/or adds, code analysis are carried out to the code for changing, obtain the new mesh
Record data;
If the change turns to deletion, the part being deleted in the file current directory data to be detected is directly deleted, obtained
The new catalogue data.
6. the starter that a kind of coverage rate is detected, it is characterised in that including:
Acquisition module, for getting coverage rate detection enabled instruction;
Processing module, for when the acquisition module gets coverage rate detection enabled instruction, being detected according to the coverage rate
The version number to be detected of file to be detected and the file to be detected in enabled instruction, the file directory that detection is locally stored
With the presence or absence of the corresponding data of version number described to be detected of the file to be detected in data;
If not existing, the processing module is additionally operable to will be to be checked described in the file directory data according to difference acquisition function
The current directory data for surveying file are updated to the corresponding new catalogue data of the version number to be detected, obtain new file mesh
Record data;
Sending module, for by the new file directory data is activation to coverage rate server.
7. device according to claim 6, it is characterised in that the sending module is additionally operable to be deposited in file directory data
In the corresponding data of the version number described to be detected of the file to be detected, by the file directory data is activation to described
Coverage rate server.
8. the device according to claim 6 or 7, it is characterised in that the file directory number that the processing module is obtained
According to the code coverage for being calculated the file to be detected by coverage rate server.
9. device according to claim 8, it is characterised in that the processing module is additionally operable to:
When locally in the absence of file directory data, the tree-like storage knot of file name and directory information generation according to each file
The file directory data of structure;Wherein, under the root node of the Storage Structure of Tree include at least one of which with directory information with
And the child node that file name is successively set up;The catalogue data of each node includes the collection of the catalogue data of its lower level of child nodes
Close.
10. device according to claim 9, it is characterised in that the processing module specifically for:
Obtain the corresponding catalogue data of the newest version number for once updating of the file to be detected;
The newest of according to the version number to be detected and file directory data file to be detected once updates
Version number, function is obtained using the difference, obtains the change that the file to be detected occurs;
If the change turns to modification and/or adds, code analysis are carried out to the code for changing, obtain the new mesh
Record data;
If the change turns to deletion, the part being deleted in the file current directory data to be detected is directly deleted, obtained
The new catalogue data.
A kind of 11. starting devices, it is characterised in that including:Have program stored therein instruction memory, for control program instruction hold
Capable processor and transmitter;
The processor is used for:
When coverage rate detection enabled instruction is got, file to be detected and the institute in enabled instruction are detected according to the coverage rate
The version number to be detected of file to be detected is stated, with the presence or absence of the text to be detected in the file directory data that detection is locally stored
The corresponding data of version number described to be detected of part;
If not existing, function is obtained by the current directory number of file to be detected described in the file directory data according to difference
According to the corresponding new catalogue data of the version number to be detected is updated to, new file directory data are obtained;
The transmitter is used for the new file directory data is activation to coverage rate server.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611083726.1A CN106776296A (en) | 2016-11-30 | 2016-11-30 | Startup method, device and starting device that coverage rate is detected |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611083726.1A CN106776296A (en) | 2016-11-30 | 2016-11-30 | Startup method, device and starting device that coverage rate is detected |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106776296A true CN106776296A (en) | 2017-05-31 |
Family
ID=58913433
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611083726.1A Pending CN106776296A (en) | 2016-11-30 | 2016-11-30 | Startup method, device and starting device that coverage rate is detected |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106776296A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109359054A (en) * | 2018-12-18 | 2019-02-19 | 浙江诺诺网络科技有限公司 | Generate method, apparatus, equipment and the storage medium of coverage rate statistical report |
CN112632957A (en) * | 2020-12-18 | 2021-04-09 | 湖南特能博世科技有限公司 | Power drawing management method and device, terminal equipment and server |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103294514A (en) * | 2013-06-26 | 2013-09-11 | 深圳Tcl新技术有限公司 | System software release integrated method, compiling server and system |
US20150161028A1 (en) * | 2013-12-09 | 2015-06-11 | International Business Machines Corporation | System and method for determining test coverage |
CN105446884A (en) * | 2015-12-16 | 2016-03-30 | 北京奇虎科技有限公司 | Code coverage rate test method and apparatus |
CN105608011A (en) * | 2016-03-01 | 2016-05-25 | 网易(杭州)网络有限公司 | Determination method and device for code testing coverage rate statistical results |
CN105610878A (en) * | 2014-10-30 | 2016-05-25 | 腾讯科技(深圳)有限公司 | Directory uploading method, data releasing method, terminal and server |
CN106155909A (en) * | 2016-07-26 | 2016-11-23 | 网易(杭州)网络有限公司 | The processing method and processing device of code coverage test result |
-
2016
- 2016-11-30 CN CN201611083726.1A patent/CN106776296A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103294514A (en) * | 2013-06-26 | 2013-09-11 | 深圳Tcl新技术有限公司 | System software release integrated method, compiling server and system |
US20150161028A1 (en) * | 2013-12-09 | 2015-06-11 | International Business Machines Corporation | System and method for determining test coverage |
CN105610878A (en) * | 2014-10-30 | 2016-05-25 | 腾讯科技(深圳)有限公司 | Directory uploading method, data releasing method, terminal and server |
CN105446884A (en) * | 2015-12-16 | 2016-03-30 | 北京奇虎科技有限公司 | Code coverage rate test method and apparatus |
CN105608011A (en) * | 2016-03-01 | 2016-05-25 | 网易(杭州)网络有限公司 | Determination method and device for code testing coverage rate statistical results |
CN106155909A (en) * | 2016-07-26 | 2016-11-23 | 网易(杭州)网络有限公司 | The processing method and processing device of code coverage test result |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109359054A (en) * | 2018-12-18 | 2019-02-19 | 浙江诺诺网络科技有限公司 | Generate method, apparatus, equipment and the storage medium of coverage rate statistical report |
CN112632957A (en) * | 2020-12-18 | 2021-04-09 | 湖南特能博世科技有限公司 | Power drawing management method and device, terminal equipment and server |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7552424B1 (en) | Apparatus and method for identifying a system under test | |
US9575739B2 (en) | Performing unattended software installation | |
US9483390B2 (en) | Three-dimensional GUI object stores in automation test tools | |
US10621211B2 (en) | Language tag management on international data storage | |
US8904351B2 (en) | Maintenance of a subroutine repository for an application under test based on subroutine usage information | |
US8972936B2 (en) | Version labeling in a version control system | |
CN107710215A (en) | The method and apparatus of mobile computing device safety in test facilities | |
US10572371B2 (en) | Generating valid use cases from a parsed configuration file describing use case options | |
US10013250B2 (en) | Parallel development of a software system | |
CN103678487A (en) | Method and device for generating web page snapshot | |
US20150154226A1 (en) | File link migration | |
CN108369503A (en) | Automatic system response to external field replaceable units (FRU) process | |
CN115576600A (en) | Code change-based difference processing method and device, terminal and storage medium | |
CN105512276A (en) | Method and device for constructing junk file and electronic equipment | |
US8239403B2 (en) | Enhancing soft file system links | |
CN114281653A (en) | Application program monitoring method and device and computing equipment | |
CN106776296A (en) | Startup method, device and starting device that coverage rate is detected | |
US10031745B2 (en) | System and method for automatic API candidate generation | |
US11120005B2 (en) | Reliable workflow system provenance tracking at runtime | |
US20140365877A1 (en) | File History Tagging | |
CN109582347B (en) | Method and device for acquiring front-end codes | |
CN106557572A (en) | A kind of extracting method and system of Android application program file | |
US20130103636A1 (en) | Rule correlation to rules input attributes according to disparate distribution analysis | |
CN107193881A (en) | Method, device and equipment for uploading file to distributed file system | |
CN113467941A (en) | Method and device for sharing information |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170531 |