CN104714882B - The method and device of code information processing - Google Patents
The method and device of code information processing Download PDFInfo
- Publication number
- CN104714882B CN104714882B CN201310695847.1A CN201310695847A CN104714882B CN 104714882 B CN104714882 B CN 104714882B CN 201310695847 A CN201310695847 A CN 201310695847A CN 104714882 B CN104714882 B CN 104714882B
- Authority
- CN
- China
- Prior art keywords
- code
- information
- file
- changed
- row
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000010365 information processing Effects 0.000 title claims abstract description 34
- 238000012986 modification Methods 0.000 claims abstract description 45
- 230000004048 modification Effects 0.000 claims abstract description 45
- 238000000605 extraction Methods 0.000 claims abstract description 26
- 238000001514 detection method Methods 0.000 abstract description 5
- 238000003672 processing method Methods 0.000 abstract description 5
- 238000012545 processing Methods 0.000 abstract description 2
- 238000012360 testing method Methods 0.000 description 18
- 239000000284 extract Substances 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 2
- 238000009434 installation Methods 0.000 description 2
- 238000004321 preservation Methods 0.000 description 2
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of code information processing method and device, be related to data processing field, be able to solve it is low for the code coverage detection efficiency of variance codes solve the problems, such as, the method includes:Code modification information is extracted from code information file, changed lines of code and the code content of change in file name that the code modification information is used to describe to change, file;Object code rate coverage information is obtained from code coverage information, the object code coverage rate information is used to describe to change and meet in the code coverage information information of default cover type;The coverage rate of the code changed in the object code coverage rate information is determined according to the code modification information of extraction.Present invention is mainly applied to during software test.
Description
Technical field
The present invention relates to the method and devices that data processing field more particularly to a kind of code information are handled.
Background technique
Code coverage (Code coverage) is one of software test measurement, and it is tested to describe source code in formula
Ratio and degree, gained ratio is known as code coverage.The existing method for generating code coverage is the covering work based on GCC
Have (multi-platform compiler (GNU Compiler Collection, abbreviation GCC) Coverage, abbreviation GCOV) to combine based on LTP
Coverage rate tool (linux testing engineering (Linux Test Project, abbreviation LTP) GCOV, abbreviation LCOV) method.Its
In, GCOV is the tool of a test code coverage, is issued with GCC, and cooperation GCC realizes the language to C/C++ file jointly
Sentence covering and branch's coverage test, can be used for counting the execution frequency of every line code, position the lines of code actually executed.
LCOV is to export the patterned front end tool of GCOV based on HTML, and generate a complete HTML tree, can be generated three
The view of rank:Catalog views, file view, source code view.The combination of above-mentioned two tool produces visual code and covers
Lid rate file, for detecting actual test to the coverage area and level of enforcement of code.
During stating code information processing in realization, at least there are the following problems in the prior art for inventor's discovery:
Due to counting and showing that code coverage is a kind of code coverage test method of full dose level by GCOV and LCOV, it is
To the method that the code coverage of whole codes is tested, therefore it not can accurately reflect the coverage condition of code update part,
The code coverage in incremental layer face is not can accurately reflect.For updating the data of iteration daily, pass through the code of full dose level
Coverage rate test accurately can not carry out independent test by the code coverage to variance codes (newly-increased code), cause for difference
The code coverage detection efficiency of different code is low.
Summary of the invention
The embodiment of the present invention provides a kind of method and device of code information processing, for solving for variance codes
Code coverage detection efficiency is low to be solved the problems, such as.
On the one hand, the present invention provides a kind of code information processing method, the method includes:
Code modification information is extracted from code information file, the code modification information is used for the text for describing to change
Changed lines of code and the code content of change in part title, file;
Object code rate coverage information is obtained from code coverage information, the object code coverage rate information is for retouching
State the information that default cover type is changed and met in the code coverage information;
The coverage rate of the code changed in the object code coverage rate information is determined according to the code modification information of extraction.
On the other hand, the present invention also provides a kind of device of code information processing, described device includes:
Extraction unit, for extracting code modification information from code information file, the code modification information is for retouching
State the file name changed, changed lines of code and the code content of change in file;
Acquiring unit, for obtaining object code rate coverage information from code coverage information, the object code covers
Lid rate information is used to describe to change and meet in the code coverage information information of default cover type;
Determination unit, the code modification information for being extracted according to the extraction unit determine what the acquiring unit obtained
The coverage rate of the code changed in the object code coverage rate information.
The method and device of code information processing provided by the invention, can extract code change from code information file
Information, changed lines of code and change in file name that the code modification information is used to describe to change, file
Code content more;Object code rate coverage information, the object code coverage rate information are obtained from code coverage information
For the information of default cover type to be described to change and met in the code coverage information;Become according to the code of extraction
More information determines the coverage rate of the code changed in the object code coverage rate information.The prior art is directed to whole codes
Information, the code comprising update and the code not updated, therefore the data for updating iteration, are covered by the code of full dose level
The test of lid rate accurately can not carry out independent test by the code coverage to variance codes (newly-increased code), cause for difference
The code coverage detection efficiency of code is low.The mesh for updating part can be extracted in the present invention from whole code coverage information
Code coverage information is marked, and object code coverage rate information is adjusted according to code update information, finally obtains update
The coverage rate of code improves the accuracy in code coverage.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is the schematic diagram of a generation code coverage message file in the embodiment of the present invention;
Fig. 2 is the flow chart of the method for first code information processing in the embodiment of the present invention;
Fig. 3 is the flow chart of the method for second code information processing in the embodiment of the present invention;
Fig. 4 is the flow chart of the method for third code information processing in the embodiment of the present invention;
Fig. 5 is the flow chart of the method for the 4th code information processing in the embodiment of the present invention;
Fig. 6 is the flow chart of the method for the 5th code information processing in the embodiment of the present invention;
Fig. 7 is the structural schematic diagram of the device of code information processing in the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention provides a kind of methods of code information processing, and the method is applied in server, described
Server is used for statistics codes coverage rate, as shown in Figure 1, the method includes:
Step 101 extracts code modification information from code information file, and code modification information is changed for describing
File name, changed lines of code and the code content of change in file.
By the diff order of python language, comparison is gone to from Version (subversion, abbreviation SVN) drawing
The code information file of version, the variance codes information include file name where the code that changes, change code institute
File name, change code where the code content be expert at and changed, and the code that does not change are expert at and are changed
Code content.In general, code information file is stored with text formatting.Code information file is ordered in the embodiment of the present invention
Entitled diffo.txt, to facilitate subsequent descriptions.In this step, extracted in diffo.txt the file name that changes with,
The line number of the starting line number and change that change.The code modification information that will be extracted, line by line storage to code change letter
It ceases in file.In the embodiment of the present invention by preserve code modification information code modification information file designation be diffi.txt,
So as to subsequent descriptions.
Step 102 obtains object code rate coverage information, object code coverage rate letter from code coverage message file
Breath is for changing and meeting the information of default cover type in coded description coverage rate information.
The generating process of code coverage message file is as shown in Fig. 2, server generates code coverage information by compiling
Installation kit, while in the server save include corresponding document code and all codes code information file,
Such as gcno file.Tester generates gcda file after running to the installation kit, and gcda file is covered for coded description
Lid rate situation is combined the gcno file saved in server and gcda file by LCOV tool, and obtaining suffix is info's
Code coverage message file, the code coverage message file are used to describe the coverage rate information of whole codes.The present invention is real
It applies in example, code coverage message file is named as test.info to facilitate subsequent descriptions.
Since i.e. the code coverage information comprising changing includes not change again in code coverage information
Code coverage information, therefore first extract the code coverage information changed, the file of extraction is saved in
In test2.info, further according to preset cover type, from extraction mesh in the code coverage information (test2.info) of change
Code coverage information is marked, by object code coverage rate information preservation into test3.info.
Specifically, step 102a, the code coverage information that acquisition is changed from code coverage message file.
102b, in the code coverage information changed, determine that object code covers according to the corresponding identifier of default cover type
Lid rate information, preset cover type be it is following any one:Row covering, function covering.
Step 103 determines covering for the code changed in object code coverage rate information according to the code modification information of extraction
Lid rate.
Code modification information (diffi.txt) describes the file name changed and file content specifically becomes
Line number more.Whole code coverages of the file changed are preserved in object code coverage rate information (test3.info)
Information, wherein still including the code coverage information not changed.Therefore, mesh is determined according to the code modification information of extraction
The coverage rate of the code changed in mark code coverage information.
The method of code information processing provided in an embodiment of the present invention, can extract code change from code information file
Information, changed lines of code and change in file name that the code modification information is used to describe to change, file
Code content more;Object code rate coverage information, the object code coverage rate information are obtained from code coverage information
For the information of default cover type to be described to change and met in the code coverage information;Become according to the code of extraction
More information determines the coverage rate of the code changed in the object code coverage rate information.The prior art is directed to whole codes
Information, the code comprising update and the code not updated, therefore the data for updating iteration, are covered by the code of full dose level
The test of lid rate accurately can not carry out independent test by the code coverage to variance codes (newly-increased code), cause for difference
The code coverage detection efficiency of code is low.The mesh for updating part can be extracted in the present invention from whole code coverage information
Code coverage information is marked, and object code coverage rate information is adjusted according to code update information, finally obtains update
The coverage rate of code improves the accuracy in code coverage.
The embodiment of the invention also provides a kind of code information processing method, as to method shown in Fig. 1 specifically
Bright, step 101 extracts code modification information from code information file, can be implemented by following manner:
Step 101a, the file name changed is extracted according to variation file mark bit in code information file.
In code information file (diffo.txt), the beginning of every a line has a flag bit, is currently used in for indicating
The object of description.If the filename for the file that current line is used to describe to change, the flag bit of the row is variation file
Flag bit " Index ".
Step 101b, the row information that there is change in the file changed is searched according to variance codes flag bit, it is described
Row information includes the line number amount for originating line number and changing.
If current line is used for the row information for describing to change, flag bit is variance codes flag bitHair
The line number amount that record has changed starting line number and changes in the row information for changing.
Step 101c, cut-off line number is determined according to the starting line number and the line number amount changed.
The line number changed, which is added, with starting line number measures cut-off line number.
Below by flow chart shown in Fig. 3, above-mentioned steps are specifically described.
Step 300, initialization, i are equal to zero.
Step 301, the i-th row for reading diffo.txt execute step 302.
Whether step 302 judges current line with " Index " beginning, if it is thening follow the steps 302a, if not then holding
Row step 302b.
Step 302a, the file name changed is extracted, this document title is written in diffi.txt, executes step
304。
Step 302b, judge current line whether withBeginning, if it is thening follow the steps 303, if not then executing
Step 305.
The row information that step 303, extraction are changed, executes step 304.
Step 304, write-in diffi.txt, i add 1, execute step 306.
Step 305 reads next line, executes step 302.
Step 306 judges whether to read the full content in diffo.txt, if it is terminate;If not then executing
Step 301.
The embodiment of the present invention can be judged by two kinds, obtained changed file in diffo.txt file and be somebody's turn to do
The row information changed in file, and by the information preservation of extraction into diffi.txt.
The embodiment of the invention also provides a kind of code information processing method, as to method shown in Fig. 1 specifically
It is bright, step 102a, from code coverage message file obtain change code coverage information the step of, under can passing through
The mode of stating is implemented:
1) the code coverage message file is read by row;
2) if the flag bit of current line is file identification position, and has terminal operating flag bit, and the code information
With the content of same file title in file, then the current line is determined as the code coverage information changed.
Below by flow chart shown in Fig. 4, above-mentioned steps are specifically described.In embodiments of the present invention, with
The row of " SF " beginning represents file name and file location information.P is printing flag bit, and p=0 expression allows to print row information, p
=1 indicates not printing the row information.Q is the flag bit that slips a line, and file location information is read in q=0 expression line by line, and q is not that 0 expression exists
The q row that jumps on the basis of current line number reads file location information.
Step 400, initialization, q=0, p=0.
Step 401, the i-th row for reading test.info execute step 402.
Whether step 402 judges current line with " SF " beginning, if it is thening follow the steps 402a, if not then executing
Step 402b.
Step 402a, prototype operation is judged whether it is, specifically, terminal operating flag bit is judged whether there is, if there is then
Step 403 is executed, if not thening follow the steps 404.
Step 402b, for printing current line into test2.info, i adds 1, executes step 410.
Step 403, in diffi.txt, read file name line by line, execute step 405.
Step 404 sets 1 for p, continues to read next line, executes step 406.
Step 405, judge in test.info with the presence or absence of with what is recorded in diffi.txt identical file name, if
402b is thened follow the steps, if not thening follow the steps 404.
Step 406 judges whether to read and finishes, and if it is terminates, if not thening follow the steps 407.
Step 407 judges whether with " SF " beginning, if it is thening follow the steps 408, if not thening follow the steps 409.
Step 408, q add 1, setting i to be i+q, execute step 400.
Step 409, q add 1, execute step 404.
Step 410 judges whether to read and finishes, and if it is terminates, if not thening follow the steps 400.
In step 402a, since the operation of data is divided into the operation of the virtual machine in server and terminal operating two parts, because
This only believes the code coverage with terminal operating flag bit to handle the code coverage information really run
Breath is printed.
If the i-th row is with " SF " beginning, file location information and file name where current line indicates code.Reading should
File name and file location information judge whether it is the file (whether having terminal operating flag bit) of prototype operation.If
It is the file of prototype operation, then traverses, searched whether identical as this document title and file location information in diffi.txt
File print current row information into test2.info if can find, i=i+1, read test.info i-th+
1 row information;If not the file of prototype operation, then p=1 does not print current line, continues the next line letter for reading test.info
Breath, q=q+1, until finding the row started with " SF " again, the value of q will also continue plus 1 at this time, read test.info i-th+
Q row.
If read i-th it is capable be not with " SF " beginning, p=0 prints the row information into file test2.info,
Continue to read i+1 row.
The method of code information processing provided in an embodiment of the present invention, can extract changed from test.info
The corresponding code coverage information of file.
The embodiment of the invention also provides a kind of methods of code information processing, as specifically retouching to method shown in Fig. 1
It states, step 102b, in the code coverage information changed, is determined according to the corresponding identifier of default cover type
The step of object code coverage rate information, including:
1) the code coverage information changed is read by row;
2) if the flag bit of current line is flag bit related with row information, current line is determined as object code and is covered
Lid rate information.
Below by flow chart shown in fig. 5, above-mentioned steps are specifically described.With row covering in the embodiment of the present invention
For type, step 102b is specifically described.In test2.info, the row of " SF " beginning represents file name and file
Location information;Row the first bit digital representative code of " DA " beginning is expert at, and second digit represents the number that the row is performed;
The row sum that the expression row covering of " LF " beginning is related to;The row sum that the expression of " LH " beginning was actually executed.Above-mentioned mark
The corresponding information in position is used to Statistics Bar coverage rate information.
Step 500, initialization, i are equal to 0.
Step 501, the i-th row for reading test2.info line by line, execute step 502.
Step 502 judges whether to start with " SF " or " DA " or " LF " or " LH ", if it is thening follow the steps 503, if
It is not, 1 is added to i and executes step 501.
Step 503, the i-th row of printing, to i plus 1, execute step 501 into test3.info.
The method of code information processing provided in an embodiment of the present invention can be from test2.info according to row cover type
Extract code coverage information related with row coverage information.
The embodiment of the invention also provides a kind of code information processing method, as to method shown in Fig. 1 specifically
It is bright, step 104, the covering that the code changed in the object code coverage rate information is determined according to the code modification information of extraction
The step of rate, can be implemented by following manner:
Step 104a, the object code coverage rate information is read by row.
If step 104b, the flag bit of current line is file identification position, searched in the code modification information of extraction
Code modification information with same file title.
Step 104c, according to the code modification information of lookup, the starting line number changed and cut-off line number are determined.
Step 104d, retain the starting line number and the cut-off line number and the starting line number and the cut-off line number
Between row code coverage information.
Step 104e, the row sum and covering sum in the object code coverage rate information are modified.
Step 104f, the coverage rate of code is determined according to the row sum and the covering sum.
Below by flow chart shown in fig. 6, above-mentioned steps are specifically described.In file test3.info, " SF "
The row of beginning represents file name and file directory information;Row the first bit digital representative code of " DA " beginning is expert at, and second
A number represents the number that the row is performed;The row sum that the expression row covering of " LF " beginning is related to;The expression of " LH " beginning is real
The row sum that border was performed;The code information that " end_of_record " indicates that file above is included terminates, next behavior
New file starts.Above- mentioned information are used to Statistics Bar coverage rate.
Step 600, initialization, i are equal to 0.
The i-th row in step 601, reading test3.info, executes step 602.
Whether step 602 judges current line with " SF " beginning, if it is thening follow the steps 602a, if not then adding to i
1, execute step 602b.
Step 602a, the file name in current line is extracted, step 603 is executed.
Step 602b, judge whether to read and finish, if it is terminate, if not thening follow the steps 601.
Step 603 judges identical this document title whether can be found in diffi.txt file, if can if hold
Row step 604, if cannot if report an error and terminate.
The starting line number and cut-off line number recorded under this document title in step 604, statistics diffi.txt, executes step
605。
Generation in step 605, the corresponding file of deletion this document title in addition to the starting line number and other than ending line number
Code coverage rate information, executes step 606.
Step 606, the total line number of the corresponding code of modification this document title and the total line number of covering, execute step 607.
Step 607 prints to the total line number of modified code and covering total line number in test_change.info.
The i-th row is read, judges whether if it is with " SF " beginning, then to extract the file name in the row with " SF " beginning,
Information identical with this document title is searched in diffi.txt, after finding, determines that this document title issues the generation changed more
The starting line number and cut-off line number of code;Data-printing between starting line number under this document title and cut-off line number is arrived
In test_change.info.Specifically, printing " LF in test_change.info:" and total line number;In test_
" LH is printed in change.info:" and the total line number of covering.Further, finally printing ending identifier " end_of_
record”。
It should be noted that each file name as mentioned in the embodiments of the present invention is a kind of citing of name, other
Naming method data protection scope of the present invention.
The method of code information processing provided in an embodiment of the present invention, can be in conjunction with the content pair in diffi.txt
Data in test3.info are further screened, and then obtain the code coverage information for describing change part.
The embodiment of the invention also provides a kind of devices of code information processing, and as described in Figure 7, described device 71 includes:
Extraction unit 711, for extracting code modification information from code information file, the code modification information is used for
The file name changed, changed lines of code and the code content of change in file are described;
Acquiring unit 712, for obtaining object code rate coverage information, the object code from code coverage information
Coverage rate information is used to describe to change and meet in the code coverage information information of default cover type;
Determination unit 713, the code modification information for being extracted according to the extraction unit 711 determine the acquiring unit
The coverage rate of the code changed in the 712 object code coverage rate information obtained.
Further, the extraction unit 711 is also used to:
The code coverage information changed is obtained from code coverage message file;
In the code coverage information changed, target is determined according to the corresponding identifier of default cover type
Code coverage information, the default cover type be it is following any one:Row covering, function covering.
Further, the acquiring unit 712 is also used to:
The file name changed is extracted according to variation file mark bit in code information file;
The row information that there is change in the file changed is searched according to variance codes flag bit, the row information includes
Starting line number and the line number amount changed;
Cut-off line number is determined according to the starting line number and the line number amount changed.
Further, the acquiring unit 712 is also used to:
The code coverage message file is read by row;
If the flag bit of current line is file identification position, and has terminal operating flag bit, and code information text
With the content of same file title in part, then the current line is determined as the code coverage information changed.
Further, the acquiring unit 712 is also used to:
The code coverage information changed is read by row;
If the flag bit of current line is flag bit related with row information, current line is determined as object code covering
Rate information.
Further, the determination unit 713 is also used to:
The object code coverage rate information is read by row;
If the flag bit of current line is file identification position, searching in the code modification information of extraction has phase identical text
The code modification information of part title;
According to the code modification information of lookup, the starting line number changed and cut-off line number are determined;
Retain the row between the starting line number and the cut-off line number and the starting line number and the cut-off line number
Code coverage information;
Modify the row sum and covering sum in the object code coverage rate information;
The coverage rate of code is determined according to the row sum and the covering sum.
It is apparent to those skilled in the art that for convenience and simplicity of description, only with above-mentioned each function
The division progress of module can according to need and for example, in practical application by above-mentioned function distribution by different function moulds
Block is completed, i.e., the internal structure of device is divided into different functional modules, to complete all or part of function described above
Energy.The specific work process of the system, apparatus, and unit of foregoing description, can be with reference to corresponding in preceding method embodiment
Journey, details are not described herein.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. a kind of method of code information processing, which is characterized in that the method includes:
Code modification information is extracted from code information file, the code modification information is used for the filename for describing to change
Claim, changed lines of code and the code content of change in file;
Object code coverage rate information is obtained from code coverage information, the object code coverage rate information is for describing institute
State the information that default cover type is changed and met in code coverage information;
The coverage rate of the code changed in the object code coverage rate information is determined according to the code modification information of extraction;
The code modification information according to extraction determines the coverage rate of the code changed in the object code coverage rate information
The step of, including:
The object code coverage rate information is read by row;
If the flag bit of current line is file identification position, searching in the code modification information of extraction has same file name
The code modification information of title;
According to the code modification information of lookup, the starting line number changed and cut-off line number are determined;
Retain the generation of the row between the starting line number and the cut-off line number and the starting line number and the cut-off line number
Code coverage rate information;
Modify the row sum and covering sum in the object code coverage rate information;
The coverage rate of code is determined according to the row sum and the covering sum.
2. the method for code information processing according to claim 1, which is characterized in that described from code coverage information
The step of obtaining object code rate coverage information, including:
The code coverage information changed is obtained from code coverage message file;
In the code coverage information changed, object code is determined according to the corresponding identifier of default cover type
Coverage rate information, the default cover type be it is following any one:Row covering, function covering.
3. the method for code information processing according to claim 1 or 2, which is characterized in that described from code information file
The step of middle extraction code modification information, including:
The file name changed is extracted according to variation file mark bit in code information file;
The row information that there is change in the file changed is searched according to variance codes flag bit, the row information includes starting
Line number and the line number amount changed;
Cut-off line number is determined according to the starting line number and the line number amount changed.
4. the method for code information processing according to claim 2, which is characterized in that described from code coverage information text
The step of code coverage information changed is obtained in part, including:
The code coverage message file is read by row;
If the flag bit of current line is file identification position, and has terminal operating flag bit, and in the code information file
The current line is then determined as the code coverage information changed by the content with same file title.
5. the method for code information processing according to claim 2, which is characterized in that described in the generation changed
In code coverage rate information, the step of object code coverage rate information is determined according to default cover type corresponding identifier, including:
The code coverage information changed is read by row;
If the flag bit of current line is flag bit related with row information, current line is determined as object code coverage rate letter
Breath.
6. a kind of device of code information processing, which is characterized in that described device includes:
Extraction unit, for extracting code modification information from code information file, the code modification information is for describing hair
Change file name more, changed lines of code and the code content of change in file;
Acquiring unit, for obtaining object code coverage rate information, the object code coverage rate from code coverage information
Information is used to describe to change and meet in the code coverage information information of default cover type;
Determination unit, the code modification information for being extracted according to the extraction unit determine described in the acquiring unit acquisition
The coverage rate of the code changed in object code coverage rate information;
The determination unit, is also used to:
The object code coverage rate information is read by row;
If the flag bit of current line is file identification position, searching in the code modification information of extraction has same file name
The code modification information of title;
According to the code modification information of lookup, the starting line number changed and cut-off line number are determined;
Retain the generation of the row between the starting line number and the cut-off line number and the starting line number and the cut-off line number
Code coverage rate information;
Modify the row sum and covering sum in the object code coverage rate information;
The coverage rate of code is determined according to the row sum and the covering sum.
7. the device of code information processing according to claim 6, which is characterized in that the acquiring unit is also used to:
The code coverage information changed is obtained from code coverage message file;
In the code coverage information changed, object code is determined according to the corresponding identifier of default cover type
Coverage rate information, the default cover type be it is following any one:Row covering, function covering.
8. the device of code information processing according to claim 6 or 7, which is characterized in that the extraction unit is also used to:
The file name changed is extracted according to variation file mark bit in code information file;
The row information that there is change in the file changed is searched according to variance codes flag bit, the row information includes starting
Line number and the line number amount changed;
Cut-off line number is determined according to the starting line number and the line number amount changed.
9. the device of code information processing according to claim 6, which is characterized in that the acquiring unit is also used to:
The code coverage message file is read by row;
If the flag bit of current line is file identification position, and has terminal operating flag bit, and in the code information file
The current line is then determined as the code coverage information changed by the content with same file title.
10. the device of code information processing according to claim 6, which is characterized in that the acquiring unit is also used to:
The code coverage information changed is read by row;
If the flag bit of current line is flag bit related with row information, current line is determined as object code coverage rate letter
Breath.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310695847.1A CN104714882B (en) | 2013-12-17 | 2013-12-17 | The method and device of code information processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310695847.1A CN104714882B (en) | 2013-12-17 | 2013-12-17 | The method and device of code information processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104714882A CN104714882A (en) | 2015-06-17 |
CN104714882B true CN104714882B (en) | 2018-11-23 |
Family
ID=53414241
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310695847.1A Active CN104714882B (en) | 2013-12-17 | 2013-12-17 | The method and device of code information processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104714882B (en) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106547680A (en) * | 2015-09-17 | 2017-03-29 | 腾讯科技(深圳)有限公司 | Data processing method and device in coverage rate test |
CN105608011A (en) * | 2016-03-01 | 2016-05-25 | 网易(杭州)网络有限公司 | Determination method and device for code testing coverage rate statistical results |
CN106201863A (en) * | 2016-06-22 | 2016-12-07 | 广州唯品会信息科技有限公司 | A kind of method and apparatus obtaining code coverage |
CN106126430A (en) * | 2016-08-19 | 2016-11-16 | 浪潮(北京)电子信息产业有限公司 | The method of testing of a kind of code coverage and device |
CN106528411A (en) * | 2016-10-24 | 2017-03-22 | 网易(杭州)网络有限公司 | Method and device for coverage rate detection and equipment |
CN110471829B (en) * | 2018-05-09 | 2023-07-18 | 阿里巴巴集团控股有限公司 | Method and device for checking software code test coverage rate |
CN110928776A (en) * | 2019-11-15 | 2020-03-27 | 武汉极意网络科技有限公司 | Detection method, device and equipment for realizing incremental code coverage rate based on lcov |
CN111026665B (en) * | 2019-12-09 | 2023-02-28 | 建信金融科技有限责任公司 | Test range analysis method, device and equipment |
CN114647570B (en) * | 2020-12-21 | 2024-08-20 | 顺丰科技有限公司 | Code increment coverage statistics method, device, computer equipment and storage medium |
CN115203004A (en) * | 2021-04-08 | 2022-10-18 | 北京字节跳动网络技术有限公司 | Code coverage test method, device, storage medium and electronic device |
CN113190448B (en) * | 2021-05-06 | 2022-11-04 | 网易(杭州)网络有限公司 | Test code updating method and device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101464829A (en) * | 2007-12-18 | 2009-06-24 | 珠海金山软件股份有限公司 | Method and test device for confirming code coverage rate |
CN102722436A (en) * | 2012-05-29 | 2012-10-10 | 百度在线网络技术(北京)有限公司 | Statistical method and device for incremental coverage information |
CN103019933A (en) * | 2012-11-27 | 2013-04-03 | 网宿科技股份有限公司 | Automatic test case coverage identification method and device |
CN103246600A (en) * | 2012-02-10 | 2013-08-14 | 广州博纳信息技术有限公司 | Fast verification method for software testing and evaluation |
CN103425573A (en) * | 2012-05-24 | 2013-12-04 | 腾讯科技(深圳)有限公司 | Code testing information collecting method and system |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6748584B1 (en) * | 1999-12-29 | 2004-06-08 | Veritas Operating Corporation | Method for determining the degree to which changed code has been exercised |
US20100146340A1 (en) * | 2008-12-09 | 2010-06-10 | International Business Machines Corporation | Analyzing Coverage of Code Changes |
-
2013
- 2013-12-17 CN CN201310695847.1A patent/CN104714882B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101464829A (en) * | 2007-12-18 | 2009-06-24 | 珠海金山软件股份有限公司 | Method and test device for confirming code coverage rate |
CN103246600A (en) * | 2012-02-10 | 2013-08-14 | 广州博纳信息技术有限公司 | Fast verification method for software testing and evaluation |
CN103425573A (en) * | 2012-05-24 | 2013-12-04 | 腾讯科技(深圳)有限公司 | Code testing information collecting method and system |
CN102722436A (en) * | 2012-05-29 | 2012-10-10 | 百度在线网络技术(北京)有限公司 | Statistical method and device for incremental coverage information |
CN103019933A (en) * | 2012-11-27 | 2013-04-03 | 网宿科技股份有限公司 | Automatic test case coverage identification method and device |
Also Published As
Publication number | Publication date |
---|---|
CN104714882A (en) | 2015-06-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104714882B (en) | The method and device of code information processing | |
CN111756575B (en) | Performance analysis method and device of storage server and electronic equipment | |
CN106330593B (en) | Protocol detection method and device | |
CN105868171B (en) | A kind of method of calibration and device of Excel file | |
CN101799506B (en) | Chip testing method, device and system based on script control | |
ATE375556T1 (en) | METHOD AND DEVICE FOR CATALOGING SYMBOLIC DATA FOR USE IN PERFORMANCE ANALYSIS OF COMPUTER PROGRAMS | |
CN105117341B (en) | A kind of distributed automated test case generation method performed based on dynamic symbol | |
CN110209568A (en) | Coverage rate test method, apparatus and storage equipment | |
CN105426278A (en) | Client equipment performance test method and system | |
CN110321142A (en) | A kind of interface document update method, device, electronic equipment and storage medium | |
Case et al. | Dynamic recreation of kernel data structures for live forensics | |
CN105808417A (en) | Automated testing method and proxy server | |
CN106502901A (en) | Coverage rate detection method, device and equipment | |
CN102968369B (en) | Method and system for automatically generating dynamic breakpoints | |
CN109240917A (en) | A kind of blog management method and relevant apparatus | |
CN110493085A (en) | Statistical method, system, electronic equipment and the medium of IPv6 active users | |
CN117556388A (en) | Dynamic taint analysis method and system for firmware full-system simulation | |
CN106919501A (en) | Static Analysis Method and instrument based on defect mode | |
CN106341684A (en) | Method and system for automatically generating Android TV test script | |
CN103593429B (en) | Commodity template failure detection method and device | |
CN111782443B (en) | Data processing method and device and electronic equipment | |
CN109144563A (en) | Application component constructs packaging method, device and computer storage medium | |
CN116962077B (en) | Data encryption, decryption method and data transmission system based on data capacity | |
CN103186551B (en) | Exception analysis method and analogue system based on web application platform | |
CN109508204B (en) | Front-end code quality detection method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |