CN105608011A - Determination method and device for code testing coverage rate statistical results - Google Patents

Determination method and device for code testing coverage rate statistical results Download PDF

Info

Publication number
CN105608011A
CN105608011A CN201610115506.6A CN201610115506A CN105608011A CN 105608011 A CN105608011 A CN 105608011A CN 201610115506 A CN201610115506 A CN 201610115506A CN 105608011 A CN105608011 A CN 105608011A
Authority
CN
China
Prior art keywords
code
coverage rate
file
code file
variance codes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610115506.6A
Other languages
Chinese (zh)
Inventor
付翔
戴俊
刘欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201610115506.6A priority Critical patent/CN105608011A/en
Publication of CN105608011A publication Critical patent/CN105608011A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a determination method and device for code testing coverage rate statistical results. The method comprises the steps that a difference code between a first code file and a second code file is obtained, wherein the generation time of the first version number corresponding to the first code file is earlier than that of the second version number corresponding to the second code file; code testing coverage rate statistics is carried out on the second code file, and the coverage rate statistical results are obtained; according to the difference code and the coverage rate statistical results, some coverage rate statistical results corresponding to the difference code are determined from the coverage rate statistical results. The technical problem that the code testing coverage condition of the difference code existing code files of different versions cannot be obtained in the related technology is solved.

Description

Definite method and the device of code tester coverage rate statistics
Technical field
The present invention relates to computer software fields, in particular to a kind of code tester coverage rate statistics reallyDetermine method and device.
Background technology
In correlation technique, the code coverage in test refers to after operation test case, the code having coveredLine number, and then the lines of code that adopts the lines of code having covered totally to comprise divided by tested object is this surveyThe code coverage of examination. Suppose that tested object is a function, and this function has 100 line codes altogether, works as instituteAfter some test cases are finished, cover 60 line codes, and also had the code of 40 row not to be covered to,The code coverage of this function is 60% so.
It should be noted that, the code line of mentioning in above-mentioned example is only a kind of comparatively conventional metric form.
To severally be introduced for the metric form that represents code coverage degree conventional below:
1) statement covers (StatementCoverage)
The row that is otherwise known as covers (LineCoverage), and section covers (SegmentCoverage), and basic block covers(BasicBlockCoverage), this for the most frequently used be also modal a kind of coverage mode, it is measured in tested codeWhether each executable statement has been performed. Here refer to " executable statement ", therefore, just can not comprise asThe header file statement of C Plus Plus, code annotation, null etc.
The code that this kind of coverage mode only added up to carry out has been performed how many row. It should be noted that separatelyThe brace { } of a line is also usually entered by statistics. Statement covers and is conventionally identified as " the most weak covering ", and it is only negativeDuty covers the execute statement in code, but without the combination of considering various branches. The defect of this statement coverage mode existsIn: expend time in and energy, still, the test effect obtaining not obvious, is difficult to find to exist in code testerProblem.
2) judge and cover (DecisionCoverage)
The branch that is otherwise known as covers (BranchCoverage), and all borders cover (All-EdgesCoverage), itsFor whether tested the completing of branch of each judgement of tolerance program.
3) Condition Coverage Testing (ConditionCoverage)
For measuring each subexpression result true of judgement and whether false is tested completes. For example: statement ifA > 0orb > 0, this is a combination condition, if condition is set up, has both likely met a > 0, also likely meetB > 0, the two is called as the sub-condition of whole conditional statement. In some cases, tester need to clearly know softPart run time version is to complete test because which sub-condition meets actually.
It should be noted that, " Condition Coverage Testing ", compared with " judge and cover ", implementation dynamics is stronger, and its reason is:Condition Coverage Testing need to make the each decision condition in each decision process all obtain two different result of determination; PhaseInstead, judge and cover be more concerned about whether whole condition is set up, and cannot guarantee that each decision condition has all obtained twoDifferent result of determination.
4) path covers (PathCoverage)
Be otherwise known as and assert covering (PredicateCoverage), its for each branch of measuring function whether byComplete, all possible branch is all performed one time. But, in the time having multiple branches nested in execute statement,Need to carry out permutation and combination to multiple branches, easily cause test path along with the quantitative indicator rank of branch increases.
At present, in the time of performance element test operation, code coverage is usually used to as weighing the fine or not index of test;Even, once code coverage had been used as to the important performance assessment criteria of test assignment performance.
In order completing, code coverage to be tested, multiple testing tool to be provided in correlation technique, for example: pythonThe storehouse of the coverage of language, the detection to code coverage all supported in JCov storehouse and the lpc language of java language.
Subversion (referred to as SVN) is the version control system of an open source code. At present, the overwhelming majorityOpen source software all uses SVN as code release management software.
Subversion is as Version of new generation, its with respect to other version managements such as RCS, CVSSoftware, has adopted unique branch management system, thereby in free Version Control service on the internet, occupies leadingStatus.
The version repository of Subversion can be by access to netwoks, thereby user can be carried out on different computersOperation. From to a certain degree, allow user in space separately, to revise and manage same group of data and can promote groupTeam's cooperation. Because amendment is no longer that single line carries out (being serial operation), therefore development progress is also significantly improved. ThisOutward, due to all versioned of all work, also just needn't worry because maloperation affects software development quality, because ofThis, if there is wrong change operation, as long as cancel wrong change operation. In addition, some Version ControlSystem itself is also software configuration administrative system (SCM), and this system, through exquisite design, is used for managing speciallySource code tree, and possess many characteristics relevant with software development, for example: to the support of programming language, provide journeyOrder the build tool. But Subversion is not such system, it is a general-purpose system, can manage and appointThe file set of what type.
Existing coverage rate instrument can only be described the coverage condition to certain file entirety, input need test single orMultiple files, then carry out the judgement test of various conditions, and final output covers result.
And in the process of product maintenance, programming personnel or attendant have conventionally just revised some and have existed veryA part of content of code of a specified duration. For example, need to modify to file A because of function adjustment, suppose file AOriginally comprised 1000 row logical codes, and this amendment is only in file A, to increase by 100 row logical codes, therefore,What this time code tester operation was in fact only paid close attention to is the coverage condition of this 100 row logical code, and is not wholeThe coverage condition of 1100 row logical codes.
The solution of easily expecting in correlation technique is by this 100 row logical code separating treatment from file A, singleSolely be set to file A1, and then file A1 is tested. But true not so simple, its reason is:This 100 row logical code is dispersed in file A in original 1000 row logical codes, not easily separated; Moreover,Just this 100 row logical code can be separated, this 100 row logical code is owing to being not a complete logicUnit, so cannot independently carry out.
For above-mentioned problem, effective solution is not yet proposed at present.
Summary of the invention
The embodiment of the present invention provides a kind of definite method and device of code tester coverage rate statistics, at least to separateCertainly, in correlation technique, the code tester that cannot obtain the variance codes existing between the code file of different editions covers feelingsThe technical problem of condition.
According to the embodiment of the present invention aspect, a kind of definite method of code tester coverage rate statistics is provided,Comprise:
Obtain the variance codes between first code file and second code file, wherein, corresponding with first code fileRise time of first edition this shop early than rise time of the second edition this shop corresponding with second code file; To secondCode file is carried out code tester coverage rate statistics, obtains coverage rate statistics; According to variance codes and coverage rate systemMeter result is determined the part coverage rate statistics corresponding with variance codes from coverage rate statistics.
Further, before the variance codes of obtaining between first code file and second code file, also comprise:Determine to be first code file by initial code file update in the first moment, generate first edition this shop; In the second momentDetermine to be second code file by first code file update, generate second edition this shop, wherein, the second moment was later than theOne moment.
Further, the variance codes of obtaining between first code file and second code file comprises: by version pipeGrooming tool inquiry first edition this shop and second edition this shop; Obtain first code file and according to according to first edition this shopTwo version numbers obtain second code file; Adopt Version that first code file and second code file are carried outComparison, determines variance codes.
Further, adopt Version that first code file and second code file are compared, it is poor to determineDifferent code comprises: by Version, first code file and second code file are compared, obtain differenceThe positional information that code distributes in second code file; Extract difference generation from second code file according to positional informationCode.
Further, determine and variance codes from coverage rate statistics according to variance codes and coverage rate statisticsCorresponding part coverage rate statistics comprises: obtain in variance codes capped according to coverage rate statisticsPart I code and not capped Part II code; By Part I code and/or Part II codeOccupy the ratio-dependent part coverage rate statistics of variance codes.
Further, in the definite and difference generation from coverage rate statistics according to variance codes and coverage rate statisticsAfter the part coverage rate statistics of code correspondence, also comprise: according to coverage rate statistics, code to be shown is enteredRow classification, wherein, code to be shown comprises: the context relation code of variance codes and variance codes, upper and lowerLiterary composition association code comprises: capped Part III code and/or not capped Part IV code; According to dividingClass result is carried out differentiation demonstration to the various piece code comprising in code to be shown.
A kind of definite dress of code tester coverage rate statistics is also provided according to the embodiment of the present invention on the other hand,Put, comprising:
Acquisition module, for obtaining the variance codes between first code file and second code file, wherein, withThe rise time of first edition this shop corresponding to one code file is early than the life of the second edition this shop corresponding with second code fileThe one-tenth time; Statistical module, for second code file being carried out to code tester coverage rate statistics, obtains coverage rate statisticsResult; Determination module, for determining with poor from coverage rate statistics according to variance codes and coverage rate statisticsThe part coverage rate statistics that different code is corresponding.
Further, said apparatus also comprises: the first generation module, and for determining initial code literary composition in the first momentPart is updated to first code file, generates first edition this shop; The second generation module, for determining the in the second momentOne code file update is second code file, generates second edition this shop, and wherein, the second moment was later than for the first moment.
Further, acquisition module comprises: query unit, for inquire about by Version first edition this shop andSecond edition this shop; The first acquiring unit, for obtaining first code file and according to the second edition according to first edition this shopThis shop obtains second code file; The first determining unit, for adopting Version by first code file andTwo code files are compared, and determine variance codes.
Further, the first determining unit comprises: obtain subelement, for by Version by first codeFile and second code file are compared, and obtain the positional information that variance codes distributes in second code file; CarryGet subelement, for extracting variance codes according to positional information from second code file.
Further, determination module comprises: second acquisition unit, and for obtaining in difference according to coverage rate statisticsCapped Part I code and not capped Part II code in code; The second determining unit, usesIn the ratio-dependent part coverage rate statistics knot that occupies variance codes by Part I code and/or Part II codeReally.
Further, said apparatus also comprises: processing module, for according to coverage rate statistics to generation to be shownCode is classified, and wherein, code to be shown comprises: the context relation code of variance codes and variance codes,Context relation code comprises: capped Part III code and/or not capped Part IV code; AobviousShow module, carry out differentiation demonstration for various piece code code to be shown being comprised according to classification results.
In embodiments of the present invention, adopt the side that obtains the variance codes between first code file and second code fileFormula, adds up by second code file being carried out to code tester coverage rate the coverage rate statistics and the difference generation that obtainCode is determined the part coverage rate statistics corresponding with variance codes from coverage rate statistics, has reached and has obtained differenceThe object of the code tester coverage condition of the variance codes existing between the code file of version, thus realize at every turnAfter being upgraded, code file can obtain the code tester coverage rate statistics of variance codes, and without to wholeThe technique effect that the code tester coverage condition of code file is described, and then solved in correlation technique, cannot obtainGet the technical problem of the code tester coverage condition of the variance codes existing between the code file of different editions.
Brief description of the drawings
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms the application's a part, thisBright schematic description and description is used for explaining the present invention, does not form inappropriate limitation of the present invention. At accompanying drawingIn:
Fig. 1 is according to the flow chart of definite method of the code tester coverage rate statistics of the embodiment of the present invention;
Fig. 2 is according to the structured flowchart of the determining device of the code tester coverage rate statistics of the embodiment of the present invention;
Fig. 3 is the structured flowchart of the determining device of code tester coverage rate statistics according to the preferred embodiment of the invention.
Detailed description of the invention
In order to make those skilled in the art person understand better the present invention program, below in conjunction with in the embodiment of the present inventionAccompanying drawing, is clearly and completely described the technical scheme in the embodiment of the present invention, obviously, and described embodimentOnly the embodiment of a part of the present invention, instead of whole embodiment. Based on the embodiment in the present invention, abilityTerritory those of ordinary skill, not making the every other embodiment obtaining under creative work prerequisite, all should belong toThe scope of protection of the invention.
It should be noted that the term " first " in description of the present invention and claims and above-mentioned accompanying drawing, " second "Deng being for distinguishing similar object, and needn't be used for describing specific order or precedence. Should be appreciated that like this and makeWith data suitably in situation, can exchange so that embodiments of the invention described herein can be with except hereOrder beyond those of diagram or description is implemented. In addition, term " comprises " and " having " and their any distortion,Intention is to cover not exclusive comprising, for example, the process that comprised series of steps or unit, method, system,Those steps or unit that product or equipment are not necessarily limited to clearly list, but can comprise clearly do not list orFor these processes, method, product or equipment intrinsic other step or unit.
According to the embodiment of the present invention, provide a kind of method of definite method of code tester coverage rate statistics to implementExample, it should be noted that, can be such as one group of computer executable instructions in the step shown in the flow chart of accompanying drawingIn computer system, carry out, and, although there is shown logical order in flow process, in some cases, canTo carry out shown or described step with the order being different from herein.
Fig. 1 is according to the flow chart of definite method of the code tester coverage rate statistics of the embodiment of the present invention. As figureShown in 1, the method comprises the steps:
Step S102, obtains the variance codes between first code file and second code file, wherein, and with the first generationThe rise time of first edition this shop corresponding to code file is during early than the generation of the second edition this shop corresponding with second code fileBetween;
Step S104, carries out code tester coverage rate statistics to second code file, obtains coverage rate statistics;
Step S106, determines and variance codes from coverage rate statistics according to variance codes and coverage rate statisticsCorresponding part coverage rate statistics.
In correlation technique, the code tester that cannot obtain the variance codes existing between the code file of different editions coversSituation, adopts method as shown in Figure 1, and by second code file is carried out, code tester coverage rate statistics obtainsCoverage rate statistics and obtain first code file and second code file between variance codes determine with difference generationThe part coverage rate statistics that code is corresponding, has reached the variance codes existing between the code file of obtaining different editionsThe object of code coverage situation, can obtain and difference generation thereby realized after code file being upgraded at every turnThe part coverage rate statistics that code is corresponding, and be described without the code tester coverage condition to whole code fileTechnique effect, and then solved in correlation technique, cannot obtain the difference existing between the code file of different editionsThe technical problem of the code tester coverage condition of code.
Alternatively, at step S102, before obtaining the variance codes between first code file and second code file,Can also comprise following operation:
Step S1: determine to be first code file by initial code file update in the first moment, generate first edition this shop;
Step S2: determine to be second code file by first code file update in the second moment, generate second edition this shop,Wherein, the second moment was later than for the first moment.
In a preferred embodiment, for example, by adopting Version Control software (: SVN) to obtain poor between different editionsDifferent information. In SVN management process, after completing revised file, deleted file, newly-increased file at every turn and mentioning, allCan a newly-generated version number. Each newly-generated version number all can be stored in can be for looking in the log recording of vncsion historyAsk. Then, the different information getting is sent to code tester coverage rate statistical tool, to obtain coverage rate statisticsResult.
For example: code maintenance personnel upgraded original source code file A in the T1 moment, confirming to submit to rear lifeOne-tenth version number is A ', and it comprises 1000 line codes altogether, and this code maintenance personnel the T2 moment to file A againUpgrade (for example: in file corresponding to the A ' of version number, increased 100 line codes newly), and the most newborn after submissionThe version number of the file A becoming is B '. Then, the A ' of version number and the B ' of version number can be stored in to Version Management SoftwareThe log recording of vncsion history in can be for inquiry.
Alternatively, in step S102, obtain variance codes between first code file and second code file passableComprise the following steps:
Step S3: inquire about first edition this shop and second edition this shop by Version;
Step S4: obtain first code file and obtain second code literary composition according to second edition this shop according to first edition this shopPart;
Step S5: adopt Version that first code file and second code file are compared, determine differenceCode.
By above-mentioned example, if need to obtain the variance codes between the B ' of version number and the A ' of version number, first needThe B ' of version query this shop and the A ' of version number from the log recording of the vncsion history of Version Management Software; Secondly, obtain respectivelyThe code file corresponding with the B ' of version number and the code file corresponding with the A ' of version number; Then, by will with version numberCode file and the code file corresponding with the A ' of version number that B ' is corresponding are compared the 100 row generations that just can obtain increasing newlyCode. Thereby this time the object of code tester is the variance codes between version B ' and version A ', i.e. this testBasis is 100 line codes that increase newly.
Alternatively, in step S5, adopt Version that first code file and second code file are comparedRight, determine that variance codes can comprise following operation:
Step S51: by Version, first code file and second code file are compared, it is poor to obtainThe positional information that different code distributes in second code file;
Step S52: extract variance codes according to positional information from second code file.
Taking the code segment below as example:
Wherein, ("-" in above-mentioned " 142,10+144,6 " represent a version number 383702Be compared version), the version of the latest document of storage after "+" current amendment submission, 142,10 represent from the 142nd10 row that row starts ,-142,10 represent the 10 row contents since the 142nd row in version numbers' file that is 383702,+ 144,6 represent the 6 row contents of current file since the 144th row; " 142,10+144,6 " represent to work asIn the file that preceding document is 383702 since 6 row contents and the version of the 144th row since 10 row of the 142nd rowThe difference content existing between content.
Alternatively, in step S106, true from coverage rate statistics according to variance codes and coverage rate statisticsThe fixed part coverage rate statistics corresponding with variance codes can comprise following operation:
Step S6: according to coverage rate statistics obtain in variance codes capped Part I code andNot capped Part II code;
Step S7: the ratio-dependent part that occupies variance codes by Part I code and/or Part II code coversRate statistics.
The current version of file cmd/task_mgr_1.c is carried out in the process of code tester coverage rate statistics, onlyNeed to pay close attention in the renewal with respect to the code file of previous version 3 83702 correspondences of code file that current version is correspondingHold.
The coverage rate statistical that need to adopt code tester coverage rate statistical tool configuration herein, (for example: statement coversLid, Condition Coverage Testing, judgement cover) the whole code file of current version is carried out to coverage test. Pass through variance codesThe region distributing is added up respectively in the variance codes comprising in each region and in code tester process, is performedCode account for the ratio of the variance codes that this region comprises, and determine variance codes entirety according to final statisticsCode coverage testing result.
Alternatively, at step S106, determine from coverage rate statistics according to variance codes and coverage rate statisticsAfter the part coverage rate statistics corresponding with variance codes, can also comprise following operation:
Step S8: according to coverage rate statistics, code to be shown is classified, wherein, code packages to be shownDraw together: the context relation code of variance codes and variance codes, context relation code comprises: be cappedPart III code and/or not capped Part IV code;
Step S9: the various piece code comprising in code to be shown is carried out to differentiation demonstration according to classification results.
In the process showing to user, if user need to check the testing result of code coverage, by the present inventionThe technical scheme that embodiment provides can only show the code content of last update more intuitively to user, enterAnd avoid former having or not to revise the unnecessary interference that code causes. In preferred implementation process, code to be shown canFor example, to comprise: capped part variance codes (: have in these 100 row variance codes that obtain after upgrading60 row are capped), not capped part variance codes for example: the 100 row difference generations that this obtains after upgradingIn code, have 40 row not to be capped), capped part context relation code is (for example: for the ease of safeguarding peopleMember understand above-mentioned 100 row variance codes, current simultaneous display again 20 line codes in the source code file not being modified,Wherein, have 10 line codes capped) and not capped part context relation code is (for example: 20In row context relation code, there are 10 row not to be capped). For this reason, can adopt respectively different colors to all kindsCode carry out differential display. For example: adopt in the red code file that represents current version, revised by user butBe the code not but being performed in code tester process, adopt light red to represent in the code file of current versionThe code of not revised by user and not being performed in code tester process, adopts the blue current version that representsCode file in the code having been revised by user and be performed in code tester process, light blueThough be not still but performed in code tester process by user's amendment in the code file of expression current versionCode, grey represents code annotation.
In addition, the technical scheme providing by the embodiment of the present invention can also be mentioned source file code protection effectivelySecurity, by only show the mode of the variance codes existing between different editions source file to user, its with respect toTo the complete source file of user, can reduce the disclosed size of code to user by efficiently and effectively. Certainly, at every turn toRenewal amplitude between the disclosed size of code of user and source file current version and a nearest version is closely related; And,Read variance codes for the ease of user, can be to a certain extent by the current version relevant to variance codes not by moreNew context code also retains in right amount.
Fig. 2 is according to the structured flowchart of the determining device of the code tester coverage rate statistics of the embodiment of the present invention. AsShown in Fig. 2, the determining device of this code tester coverage rate statistics can comprise: acquisition module 10, and for obtainingVariance codes between first code file and second code file, wherein, the first edition corresponding with first code fileThe rise time of this shop is early than the rise time of the second edition this shop corresponding with second code file; Statistical module 20, usesIn second code file being carried out to code tester coverage rate statistics, obtain coverage rate statistics; Determination module 30, usesCover in determine the part corresponding with variance codes from coverage rate statistics with coverage rate statistics according to variance codesLid rate statistics.
Adopt device as shown in Figure 2, add up by second code file being carried out to code tester coverage rate covering of obtainingLid rate statistics and obtain first code file and second code file between variance codes determine and variance codesCorresponding part coverage rate statistics, has reached the variance codes that exists between the code file of obtaining different editionsThe object of code tester coverage condition, thus after code file being upgraded, can obtain and variance codes pair at every turnThe part coverage rate statistics of answering, and be described without the code tester coverage condition to whole code file.
Alternatively, Fig. 3 is the determining device of code tester coverage rate statistics according to the preferred embodiment of the inventionStructured flowchart. As shown in Figure 3, said apparatus can also comprise: the first generation module 40, and for true in the first momentFixed is first code file by initial code file update, generates first edition this shop; The second generation module 50, forIt is second code file by first code file update that the second moment was determined, generates second edition this shop, wherein, and second o'clockBe later than for the first moment quarter.
Alternatively, as shown in Figure 3, acquisition module 10 can comprise: query unit 100, and for by version managementInstrument inquiry first edition this shop and second edition this shop; The first acquiring unit 102, for obtaining according to first edition this shopOne code file and obtain second code file according to second edition this shop; The first determining unit 104, for adopting versionThis management tool is compared first code file and second code file, determines variance codes.
Alternatively, the first determining unit 104 can comprise: obtain subelement (not shown), for passing through versionManagement tool is compared first code file and second code file, obtains variance codes in second code fileThe positional information distributing; Extract subelement (not shown), for carrying from second code file according to positional informationGet variance codes.
Alternatively, as shown in Figure 3, determination module 30 can comprise: second acquisition unit 300, and for according to coveringRate statistics is obtained in variance codes capped Part I code and not capped Part II generationCode; The second determining unit 302, for occupying the ratio of variance codes by Part I code and/or Part II codeExample determining section coverage rate statistics.
Alternatively, as shown in Figure 3, said apparatus can also comprise: processing module 60, and for adding up according to coverage rateResult is classified to code to be shown, and wherein, code to be shown comprises: variance codes and variance codesContext relation code, context relation code comprises: capped Part III code and/or cappedPart IV code; Display module 70, for various piece generation code to be shown being comprised according to classification resultsCode carries out differentiation demonstration.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
In the above embodiment of the present invention, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, do not haveThe part describing in detail, can be referring to the associated description of other embodiment.
In the several embodiment that provide in the application, should be understood that, disclosed technology contents, can pass through otherMode realize. Wherein, device embodiment described above is only schematically, the division of for example described unit,Can be that a kind of logic function is divided, when actual realization, can have other dividing mode, for example multiple unit or assemblyCan in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out. Another point, instituteThe coupling each other showing or discuss or direct-coupling or communication connection can be by some interfaces, unit or mouldThe INDIRECT COUPLING of piece or communication connection can be electrical or other form.
The described unit as separating component explanation can or can not be also physically to separate, aobvious as unitThe parts that show can be or can not be also physical locations, can be positioned at a place, or also can be distributed toOn multiple unit. Can select according to the actual needs some or all of unit wherein to realize the present embodiment schemeObject.
In addition, the each functional unit in each embodiment of the present invention can be integrated in a processing unit, also canBe that the independent physics of unit exists, also can be integrated in a unit two or more unit. Above-mentioned integratedUnit both can adopt hardware form realize, also can adopt SFU software functional unit form realize.
If described integrated unit is realized and during as production marketing independently or use using the form of SFU software functional unit,Can be stored in a computer read/write memory medium. Based on such understanding, technical scheme essence of the present inventionOn the part that in other words prior art contributed or this technical scheme all or part of can be with software productForm embodies, and this computer software product is stored in a storage medium, comprises that some instructions are in order to make onePlatform computer equipment (can be personal computer, server or the network equipment etc.) is carried out each embodiment institute of the present inventionState all or part of step of method. And aforesaid storage medium comprises: USB flash disk, read-only storage (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), portable hard drive, magnetic disc orThe various media that can be program code stored such as CD.
The above is only the preferred embodiment of the present invention, it should be pointed out that the ordinary skill people for the artMember, under the premise without departing from the principles of the invention, can also make some improvements and modifications, these improvement and profitDecorations also should be considered as protection scope of the present invention.

Claims (12)

1. a definite method for code tester coverage rate statistics, is characterized in that, comprising:
Obtain the variance codes between first code file and second code file, wherein, with described first codeThe rise time of the first edition this shop that file is corresponding is early than the second edition this shop corresponding with described second code fileRise time;
Described second code file is carried out to code tester coverage rate statistics, obtain coverage rate statistics;
Determine and institute from described coverage rate statistics according to described variance codes and described coverage rate statisticsState part coverage rate statistics corresponding to variance codes.
2. method according to claim 1, is characterized in that, is obtaining described first code file and described secondBefore described variance codes between code file, also comprise:
Determine to be described first code file by initial code file update in the first moment, generate the described first editionThis shop;
Determine to be described second code file by described first code file update in the second moment, generate described theTwo version numbers, wherein, described the second moment is later than described the first moment.
3. method according to claim 1, is characterized in that, obtains described first code file and the described second generationDescribed variance codes between code file comprises:
Inquire about described first edition this shop and described second edition this shop by Version;
Obtain described first code file and obtain institute according to described second edition this shop according to described first edition this shopState second code file;
Adopt described Version that described first code file and described second code file are compared,Determine described variance codes.
4. method according to claim 3, is characterized in that, adopts described Version by the described first generationCode file and described second code file are compared, and determine that described variance codes comprises:
By described Version, described first code file and described second code file are compared,Obtain the positional information that described variance codes distributes in described second code file;
From described second code file, extract described variance codes according to described positional information.
5. method according to claim 4, is characterized in that, according to described variance codes and described coverage rate statisticsResult is determined the part coverage rate statistics bag corresponding with described variance codes from described coverage rate statisticsDraw together:
Obtain in described variance codes capped Part I code according to described coverage rate statisticsAnd not capped Part II code;
The ratio that occupies described variance codes by described Part I code and/or described Part II code is trueFixed described part coverage rate statistics.
6. method according to claim 5, is characterized in that, is uniting according to described variance codes and described coverage rateMeter result is determined the part coverage rate statistics corresponding with described variance codes from described coverage rate statisticsAfterwards, also comprise:
According to described coverage rate statistics, code to be shown is classified, wherein, described generation to be shownCode comprises: the context relation code of described variance codes and described variance codes, described context relation generationCode comprises: capped Part III code and/or not capped Part IV code;
According to classification results, the various piece code comprising in described code to be shown is carried out to differentiation demonstration.
7. a determining device for code tester coverage rate statistics, is characterized in that, comprising:
Acquisition module, for obtaining the variance codes between first code file and second code file, wherein,The rise time of the first edition this shop corresponding with described first code file is early than corresponding with described second code fileRise time of second edition this shop;
Statistical module, for described second code file is carried out to code tester coverage rate statistics, obtains coverage rateStatistics;
Determination module, for adding up from described coverage rate according to described variance codes and described coverage rate statisticsIn result, determine the part coverage rate statistics corresponding with described variance codes.
8. device according to claim 7, is characterized in that, described device also comprises:
The first generation module, for determining to be described first code literary composition by initial code file update in the first momentPart, generates described first edition this shop;
The second generation module, for determining to be the described second generation by described first code file update in the second momentCode file, generates described second edition this shop, and wherein, described the second moment is later than described the first moment.
9. device according to claim 7, is characterized in that, described acquisition module comprises:
Query unit, for inquiring about described first edition this shop and described second edition this shop by Version;
The first acquiring unit, for obtaining described first code file according to described first edition this shop and according to instituteState second edition this shop and obtain described second code file;
The first determining unit, for adopting described Version by described first code file and described secondCode file is compared, and determines described variance codes.
10. device according to claim 9, is characterized in that, described the first determining unit comprises:
Obtain subelement, for by described Version by described first code file and the described second generationCode file is compared, and obtains the positional information that described variance codes distributes in described second code file;
Extract subelement, for extracting described difference generation according to described positional information from described second code fileCode.
11. devices according to claim 10, is characterized in that, described determination module comprises:
Second acquisition unit, for obtain according to described coverage rate statistics described variance codes byThe Part I code covering and not capped Part II code;
The second determining unit, described in occupying by described Part I code and/or described Part II codePart coverage rate statistics described in the ratio-dependent of variance codes.
12. devices according to claim 11, is characterized in that, described device also comprises:
Processing module, for code to be shown being classified according to described coverage rate statistics, wherein,Described code to be shown comprises: the context relation code of described variance codes and described variance codes, instituteStating context relation code comprises: capped Part III code and/or not capped Part IV generationCode;
Display module, enters for the various piece code described code to be shown being comprised according to classification resultsRow differentiation shows.
CN201610115506.6A 2016-03-01 2016-03-01 Determination method and device for code testing coverage rate statistical results Pending CN105608011A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610115506.6A CN105608011A (en) 2016-03-01 2016-03-01 Determination method and device for code testing coverage rate statistical results

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610115506.6A CN105608011A (en) 2016-03-01 2016-03-01 Determination method and device for code testing coverage rate statistical results

Publications (1)

Publication Number Publication Date
CN105608011A true CN105608011A (en) 2016-05-25

Family

ID=55987963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610115506.6A Pending CN105608011A (en) 2016-03-01 2016-03-01 Determination method and device for code testing coverage rate statistical results

Country Status (1)

Country Link
CN (1) CN105608011A (en)

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106155909A (en) * 2016-07-26 2016-11-23 网易(杭州)网络有限公司 The processing method and processing device of code coverage test result
CN106201863A (en) * 2016-06-22 2016-12-07 广州唯品会信息科技有限公司 A kind of method and apparatus obtaining code coverage
CN106326118A (en) * 2016-08-19 2017-01-11 东软集团股份有限公司 Method and device for determining code test coverage
CN106407115A (en) * 2016-09-20 2017-02-15 网易(杭州)网络有限公司 An art resource file testing method and device
CN106528411A (en) * 2016-10-24 2017-03-22 网易(杭州)网络有限公司 Method and device for coverage rate detection and equipment
CN106547698A (en) * 2016-11-30 2017-03-29 网易(杭州)网络有限公司 The processing method of coverage data, device and server
CN106776296A (en) * 2016-11-30 2017-05-31 网易(杭州)网络有限公司 Startup method, device and starting device that coverage rate is detected
CN106844730A (en) * 2017-02-10 2017-06-13 网易(杭州)网络有限公司 The display methods and device of file content
CN107368313A (en) * 2017-07-18 2017-11-21 腾讯科技(深圳)有限公司 Code detection method, device and electronic equipment
CN107453960A (en) * 2017-09-26 2017-12-08 聚好看科技股份有限公司 A kind of methods, devices and systems that test data is handled in service testing
CN107480066A (en) * 2017-08-18 2017-12-15 网易(杭州)网络有限公司 Code coverage statistical method, device, storage medium, processor and terminal
CN107977309A (en) * 2016-10-25 2018-05-01 腾讯科技(北京)有限公司 A kind of data processing method and its device, system
CN108170610A (en) * 2018-01-17 2018-06-15 北京网信云服信息科技有限公司 The method and apparatus for determining test coverage
CN108563580A (en) * 2017-12-27 2018-09-21 贵阳忆芯科技有限公司 Media Interface Connector controller microcode execution route extracting method
CN108829580A (en) * 2018-05-07 2018-11-16 百度在线网络技术(北京)有限公司 Multi version test data processing method, device, equipment and storage medium
CN109766261A (en) * 2018-12-14 2019-05-17 中国平安财产保险股份有限公司 Coverage test method, device, computer equipment and storage medium
CN110990265A (en) * 2019-11-12 2020-04-10 苏州洞察云信息技术有限公司 Coverage rate determining method and device and storage medium
WO2020244445A1 (en) * 2019-06-03 2020-12-10 深圳前海微众银行股份有限公司 Coverage information obtaining method and device
CN113946515A (en) * 2021-10-19 2022-01-18 平安普惠企业管理有限公司 Code coverage rate testing method and device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722436A (en) * 2012-05-29 2012-10-10 百度在线网络技术(北京)有限公司 Statistical method and device for incremental coverage information
CN104298587A (en) * 2013-07-15 2015-01-21 腾讯科技(深圳)有限公司 Code coverage test method, device and system
CN104714882A (en) * 2013-12-17 2015-06-17 腾讯科技(深圳)有限公司 Code information processing method and device
US20150254165A1 (en) * 2014-03-05 2015-09-10 Concurix Corporation Automated Regression Testing for Software Applications
CN105204982A (en) * 2014-06-13 2015-12-30 腾讯科技(深圳)有限公司 Code testing method and code testing system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722436A (en) * 2012-05-29 2012-10-10 百度在线网络技术(北京)有限公司 Statistical method and device for incremental coverage information
CN104298587A (en) * 2013-07-15 2015-01-21 腾讯科技(深圳)有限公司 Code coverage test method, device and system
CN104714882A (en) * 2013-12-17 2015-06-17 腾讯科技(深圳)有限公司 Code information processing method and device
US20150254165A1 (en) * 2014-03-05 2015-09-10 Concurix Corporation Automated Regression Testing for Software Applications
CN105204982A (en) * 2014-06-13 2015-12-30 腾讯科技(深圳)有限公司 Code testing method and code testing system

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201863A (en) * 2016-06-22 2016-12-07 广州唯品会信息科技有限公司 A kind of method and apparatus obtaining code coverage
CN106155909A (en) * 2016-07-26 2016-11-23 网易(杭州)网络有限公司 The processing method and processing device of code coverage test result
CN106326118A (en) * 2016-08-19 2017-01-11 东软集团股份有限公司 Method and device for determining code test coverage
CN106326118B (en) * 2016-08-19 2019-03-15 东软集团股份有限公司 Code tester coverage rate determines method and apparatus
CN106407115A (en) * 2016-09-20 2017-02-15 网易(杭州)网络有限公司 An art resource file testing method and device
CN106407115B (en) * 2016-09-20 2018-09-18 网易(杭州)网络有限公司 The test method and device of fine arts resource file
CN106528411A (en) * 2016-10-24 2017-03-22 网易(杭州)网络有限公司 Method and device for coverage rate detection and equipment
CN107977309A (en) * 2016-10-25 2018-05-01 腾讯科技(北京)有限公司 A kind of data processing method and its device, system
CN107977309B (en) * 2016-10-25 2021-02-12 腾讯科技(北京)有限公司 Data processing method, device and system
CN106547698A (en) * 2016-11-30 2017-03-29 网易(杭州)网络有限公司 The processing method of coverage data, device and server
CN106776296A (en) * 2016-11-30 2017-05-31 网易(杭州)网络有限公司 Startup method, device and starting device that coverage rate is detected
CN106844730A (en) * 2017-02-10 2017-06-13 网易(杭州)网络有限公司 The display methods and device of file content
CN106844730B (en) * 2017-02-10 2020-05-05 网易(杭州)网络有限公司 Method and device for displaying file content
CN107368313A (en) * 2017-07-18 2017-11-21 腾讯科技(深圳)有限公司 Code detection method, device and electronic equipment
CN107368313B (en) * 2017-07-18 2018-09-11 腾讯科技(深圳)有限公司 Code detection method, device and electronic equipment
CN107480066A (en) * 2017-08-18 2017-12-15 网易(杭州)网络有限公司 Code coverage statistical method, device, storage medium, processor and terminal
CN107480066B (en) * 2017-08-18 2020-10-30 网易(杭州)网络有限公司 Code coverage rate statistical method, device, storage medium, processor and terminal
CN107453960B (en) * 2017-09-26 2020-08-25 青岛聚看云科技有限公司 Method, device and system for processing test data in service test
CN107453960A (en) * 2017-09-26 2017-12-08 聚好看科技股份有限公司 A kind of methods, devices and systems that test data is handled in service testing
CN108563580A (en) * 2017-12-27 2018-09-21 贵阳忆芯科技有限公司 Media Interface Connector controller microcode execution route extracting method
CN108563580B (en) * 2017-12-27 2024-02-23 贵阳忆芯科技有限公司 Method for extracting microcode execution path of medium interface controller
CN108170610A (en) * 2018-01-17 2018-06-15 北京网信云服信息科技有限公司 The method and apparatus for determining test coverage
CN108829580B (en) * 2018-05-07 2022-09-23 百度在线网络技术(北京)有限公司 Multi-version test data processing method, device, equipment and storage medium
CN108829580A (en) * 2018-05-07 2018-11-16 百度在线网络技术(北京)有限公司 Multi version test data processing method, device, equipment and storage medium
CN109766261A (en) * 2018-12-14 2019-05-17 中国平安财产保险股份有限公司 Coverage test method, device, computer equipment and storage medium
WO2020244445A1 (en) * 2019-06-03 2020-12-10 深圳前海微众银行股份有限公司 Coverage information obtaining method and device
CN110990265B (en) * 2019-11-12 2023-10-03 苏州洞察云信息技术有限公司 Coverage rate determining method, coverage rate determining device and storage medium
CN110990265A (en) * 2019-11-12 2020-04-10 苏州洞察云信息技术有限公司 Coverage rate determining method and device and storage medium
CN113946515A (en) * 2021-10-19 2022-01-18 平安普惠企业管理有限公司 Code coverage rate testing method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN105608011A (en) Determination method and device for code testing coverage rate statistical results
US9652513B2 (en) Generating data pattern information
US9558230B2 (en) Data quality assessment
US11714629B2 (en) Software dependency management
CN105279084A (en) Defect localization in software integration tests
US10514890B2 (en) Test case and data selection using a sampling methodology
US20200026512A1 (en) Open-source-license analyzing method and apparatus
JP2015537296A (en) Data profiling using location information
US8577849B2 (en) Guided data repair
US10884703B2 (en) Optimized construction of a sample imprint for selecting a sample dataset for comparison testing
US20120239596A1 (en) Classification of stream-based data using machine learning
DE102021133809A1 (en) METHOD AND DEVICE FOR AUTOMATIC DETECTION OF SOFTWARE ERRORS
US20200074509A1 (en) Business data promotion method, device, terminal and computer-readable storage medium
CN112989990B (en) Medical bill identification method, device, equipment and storage medium
US20160162995A1 (en) Method and system for duplicate invoice entry detection
US10795807B2 (en) Parallel testing and reporting system
US8903754B2 (en) Programmatically identifying branding within assets
CN106991050A (en) A kind of static test null pointer dereference defect false positive recognition methods
US8412732B2 (en) Automatically generating a set of event processing rules for use in a complex event processing system
US8396847B2 (en) System and method to retrieve and analyze data for decision making
EP3486783A1 (en) Test case and data selection using a sampling methodology
US20160292282A1 (en) Detecting and responding to single entity intent queries
CN114168565B (en) Backtracking test method, device and system of business rule model and decision engine
US20160019129A1 (en) Unification of descriptive programming and object repository
US11176022B2 (en) Health diagnostics and analytics for object repositories

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160525

RJ01 Rejection of invention patent application after publication