CN105204982A - Code testing method and code testing system - Google Patents

Code testing method and code testing system Download PDF

Info

Publication number
CN105204982A
CN105204982A CN201410265946.0A CN201410265946A CN105204982A CN 105204982 A CN105204982 A CN 105204982A CN 201410265946 A CN201410265946 A CN 201410265946A CN 105204982 A CN105204982 A CN 105204982A
Authority
CN
China
Prior art keywords
code
tested
increment
pitching pile
statement
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
CN201410265946.0A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410265946.0A priority Critical patent/CN105204982A/en
Publication of CN105204982A publication Critical patent/CN105204982A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a code testing method and system. The method comprises the steps that an encoded to-be-tested code is compared with a code before encoding is performed to obtain an increment change code; the to-be-tested code is instrumented, and an instrumentation mark is added in the to-be-tested code to obtain an instrumented to-be-tested code; the instrumented to-be-tested code is tested, and code testing information in the testing process is recorded; the increment covering rate of the to-be-tested code is determined according to the increment change code, the instrumentation mark and the code testing information. According to the scheme of the code testing method and system, the effectiveness of evaluating the code testing effect is improved, and therefore a code testing evaluation result is more precise.

Description

Code test method and code tester system
Technical field
The present invention relates to code tester field, particularly a kind of code test method and a kind of code tester system.
Background technology
In current software application, after developing software, usually need to test software code, software test is mainly used in analyzing software correctness and detecting software vulnerability.When carrying out software test, usually needing to determine the complete situation of the execution of test case, by the execution of test case complete situation, test job being assessed, and then being convenient to adjust test case etc., carrying out perfect to software code on this basis.Code coverage (Codecoverage) is the one tolerance in software test, ratio and degree that in software code, in formula, source code is tested are described, gained ratio is called code coverage, code coverage, usually by the index brought as weighing test quality, is used for even examining test assignment performance.The determination of existing code coverage, all for needing the whole codes carrying out testing to carry out testing and collecting code coverage, and assess based on the performance of code coverage to test job for whole code, can not well to test effect or the execution result Efficient Evaluation of tester.
Summary of the invention
Based on this, for above-mentioned problems of the prior art, the object of the present invention is to provide a kind of code test method, a kind of code tester system, it can improve validity when assessing code tester effect.
For achieving the above object, the embodiment of the present invention by the following technical solutions:
A kind of code test method, comprises step:
Front to code to be tested after coding and coding code is compared, obtains increment change code;
Pitching pile is carried out to described code to be tested, in described code to be tested, adds pitching pile mark, obtain the code to be tested after pitching pile;
Code to be tested after described pitching pile is tested, and records the code tester information in test process;
The increment coverage rate of described code to be tested is determined according to described increment change code, described pitching pile mark, described code tester information.
A kind of code tester system, comprising:
Changing comparing unit, for being compared by front to the code to be tested after coding and coding code, obtaining increment change code;
Pitching pile unit, for carrying out pitching pile to described code to be tested, adding pitching pile mark, obtaining the code to be tested after pitching pile in described code to be tested;
Test cell, for testing the code to be tested after described pitching pile, and records the code tester information in test process;
Increment coverage rate determining unit, for determining the increment coverage rate of described code to be tested according to described increment change code, described pitching pile mark, described code tester information.
According to the scheme of the embodiment of the present invention as above, it is when testing, after the increment change code of code before acquisition code to be tested is relative to coding, treat test code again to carry out pitching pile and carry out test obtaining code tester information, then according to increment change code, pitching pile mark and code tester information determination increment coverage rate.What obtain due to it is increment coverage rate, it is the test execution situation for increment change code, because front code of encoding is all generally the valid code passed through after tested, Efficient Evaluation can be carried out to the test execution effect of code tester better for increment change code determination increment coverage rate, improve validity when code tester effect is assessed, make code tester assessment result more accurate.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of code test method embodiment one of the present invention;
Fig. 2 is the schematic flow sheet of code test method embodiment two of the present invention;
Fig. 3 is the schematic flow sheet of code test method embodiment three of the present invention;
Fig. 4 is the structural representation of code tester system embodiment one of the present invention;
Fig. 5 is the structural representation of code tester system embodiment two of the present invention;
Fig. 6 is the structural representation of code tester system embodiment three of the present invention;
Fig. 7 is the modular structure schematic diagram that can realize the computer system of the embodiment of the present invention in a concrete example.
Embodiment
For making object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is described in further detail.Should be appreciated that embodiment described herein only in order to explain the present invention, do not limit protection scope of the present invention.
The schematic flow sheet of code test method embodiment one of the present invention has been shown in Fig. 1, and as shown in Figure 1, the code test method in the present embodiment comprises step:
Step S101: compared by front to the code to be tested after coding and coding code, obtains increment change code;
Step S102: carry out pitching pile to described code to be tested, adds pitching pile mark, obtains the code to be tested after pitching pile in described code to be tested;
Step S103: the code to be tested after described pitching pile is tested, and record the code tester information in test process;
Step S104: the increment coverage rate determining described code to be tested according to described increment change code, described pitching pile mark, described code tester information.
According to the scheme of the embodiment of the present invention as above, it is when testing, after the increment change code of code before acquisition code to be tested is relative to coding, treat test code again to carry out pitching pile and carry out test obtaining code tester information, then according to increment change code, pitching pile mark and code tester information determination increment coverage rate.What obtain due to it is increment coverage rate, it is the test execution situation for increment change code, because front code of encoding is all generally the valid code passed through after tested, Efficient Evaluation can be carried out to the test execution effect of code tester better for increment change code determination increment coverage rate, improve validity when code tester effect is assessed, make code tester assessment result more accurate.
Above-mentioned obtain increment coverage rate after, just can assess code tester effect according to this increment coverage rate, increment coverage rate is higher, and the effect of description code test execution is better, also illustrate that to a certain extent test effect better.
Wherein, in above-mentioned steps S101, code before the code to be tested after coding and coding is compared, when obtaining increment change code, diff instrument can be adopted to carry out, diff instrument is an implementing procedure, be used for comparing text based documents, it can compare Single document or directory content, and the difference both exporting.
Result due to the output of diff instrument is the line number change of source code, therefore, when determining increment coverage rate in above-mentioned steps S104, can based on the difference of the type of increment coverage rate to be determined, according to the line number in code to be tested and the corresponding relation between code information type, determine corresponding increment coverage rate, such as, when code information type is function, by the corresponding relation of line number function, determine increment of a function coverage rate, when code information type is statement, by the corresponding relation of line number and statement, determine statement increment coverage rate, other code information types are similar, no longer launch to repeat at this.
Treat test code in above-mentioned steps S102 when carrying out pitching pile, for the code of pitching pile, can set according to actual needs.So-called pitching pile, refer to when not destroying the original logic integrality of tested program, the code (being also referred to as probe) being used for pitching pile is inserted in the relevant position of tested program, these probes are the code segment carrying out information acquisition in essence, by the execution of probe and the operation characteristic data of written-out program, thus based on the analysis of these characteristics, disclose internal act and the characteristic of program.
Wherein, above-mentioned treat test code carry out pitching pile time, based on the characteristic of code to be tested, pitching pile can be carried out at the diverse location of code to be tested, thus the increment coverage rate under different situations can be determined accordingly.
Be illustrated below in conjunction with wherein two kinds of modes.
The schematic flow sheet of code test method embodiment two of the present invention has been shown in Fig. 2.In the present embodiment, be mainly with the difference of above-described embodiment one, be carry out pitching pile at function in the present embodiment, thus ask for increment of a function coverage rate.
As shown in Figure 2, the code test method in the present embodiment comprises step:
Step S201: compared by front to the code to be tested after coding and coding code, obtains increment change code;
Step S202: the function in code to be tested adds pitching pile mark, obtains the code to be tested after pitching pile;
Step S203: the code to be tested after pitching pile is tested, and record the code tester information in test process;
Step S204: the number determining the function of tested execution in increment change code according to the pitching pile mark in code tester information;
Step S205: the increment coverage rate determining described code to be tested according to described increment change code, described pitching pile mark, described code tester information.
Wherein in a concrete example, the increment coverage rate that above-mentioned steps S205 determines can be the ratio that the number of function of tested execution in increment change code and increment change the function sum in code.Owing to being by carrying out pitching pile in function in the present embodiment and be determine increment coverage rate based on the test execution situation of function, therefore, the increment coverage rate obtained in the present embodiment can be referred to as increment of a function coverage rate.
Therefore, this increment of a function coverage rate can be determined by following formula:
Increment of a function coverage rate=(in increment change code, the number/increment of the function of tested execution changes the sum of the function in code) * 100%.
As mentioned above, in step s 201 front to the code to be tested after coding and coding code is compared, when obtaining increment change code, diff instrument can be adopted to carry out.Result due to the output of diff instrument is the line number change of source code, therefore, when adopting diff instrument to obtain increment change code, the number of the function of tested execution in above-mentioned increment change code, the corresponding relation that can change line number function in code based on increment is determined, correspondingly, the sum of the function in above-mentioned increment change code, the corresponding relation that also can change line number function in code based on increment is determined.
Because the code inside source code all can have a line number, and function includes function name sum functions body, and function body appears in paired braces, so can determine which row this function is from accordingly, to which row terminates.Therefore, after the line number being obtained change by diff instrument, which function region the row just can knowing this change is in, and which function what determine change is.
The schematic flow sheet of code test method embodiment three of the present invention has been shown in Fig. 3.In the present embodiment, be mainly with the difference of above-described embodiment one, be carry out pitching pile at statement in the present embodiment, thus ask for statement increment coverage rate.
As shown in Figure 3, the code test method in the present embodiment comprises step:
Step S301: compared by front to the code to be tested after coding and coding code, obtains increment change code;
Step S302: the statement in code to be tested adds pitching pile mark, obtains the code to be tested after pitching pile;
Step S303: the code to be tested after pitching pile is tested, and record the code tester information in test process;
Step S304: the number determining the statement of tested execution in increment change code according to the pitching pile mark in code tester information;
Step S305: the increment coverage rate determining described code to be tested according to described increment change code, described pitching pile mark, described code tester information.
Wherein in a concrete example, the increment coverage rate determined in above-mentioned steps S305 can be the ratio that the number of statement of tested execution in increment change code and increment change the statement sum in code.Owing to being by carrying out pitching pile in statement in the present embodiment and be determine increment coverage rate based on the test execution situation of statement, therefore, the increment coverage rate obtained in the present embodiment can be referred to as statement increment coverage rate.
Therefore, this statement increment coverage rate can be determined by following formula:
Statement increment coverage rate=(in increment change code, the number/increment of the statement of tested execution changes the sum of the statement in code) * 100%.
As mentioned above, in step S301, code before the code to be tested after coding and coding is compared, when obtaining increment change code, diff instrument can be adopted to carry out.Result due to the output of diff instrument is the line number change of source code, therefore, when adopting diff instrument to obtain increment change code, the number of the statement of tested execution in above-mentioned increment change code, the corresponding relation that can change line number and statement in code based on increment is determined, correspondingly, the sum of the statement in above-mentioned increment change code, the corresponding relation that also can change line number and statement in code based on increment is determined.
Similar to the above, because the code inside source code all can have a line number, and the statement in source code, such as (), if () statement etc., after this for (), if () statement body, corresponding perform statement can be followed closely, and this perform statement appears in paired braces, so when carrying out pitching pile, pitching pile mark can be all added at the statements such as (), if () and corresponding perform statement, after the line number being obtained change by diff instrument, which statement the row just can knowing this change is.
Based on the thought identical with the code test method of the invention described above, the present invention also provides a kind of code tester system.The structural representation of code tester system embodiment of the present invention has been shown in Fig. 4.
As shown in Figure 4, the code tester system in the present embodiment comprises:
Changing comparing unit 401, for being compared by front to the code to be tested after coding and coding code, obtaining increment change code;
Pitching pile unit 402, for carrying out pitching pile to described code to be tested, adding pitching pile mark, obtaining the code to be tested after pitching pile in described code to be tested;
Test cell 403, for testing the code to be tested after described pitching pile, and records the code tester information in test process;
Increment coverage rate determining unit 404, for determining the increment coverage rate of described code to be tested according to described increment change code, described pitching pile mark, described code tester information.
According to the scheme of the embodiment of the present invention as above, it is when testing, be by change comparing unit 401 obtain code to be tested relative to coding before the increment of code change after code, treat test code by pitching pile unit 402 again and carry out pitching pile, there is test cell 403 to carry out test and obtain code tester information, then change code by increment coverage rate determining unit 404 according to increment, pitching pile marks and code tester information determination increment coverage rate.What obtain due to it is increment coverage rate, it is the test execution situation for increment change code, because front code of encoding is all generally the valid code passed through after tested, Efficient Evaluation can be carried out to the test execution effect of code tester better for increment change code determination increment coverage rate, improve validity when code tester effect is assessed, make code tester assessment result more accurate.
Wherein, front to code to be tested after coding and coding code compares by above-mentioned change comparing unit 401, when obtaining increment change code, diff instrument can be adopted to carry out, diff instrument is an implementing procedure, be used for comparing text based documents, it can compare Single document or directory content, and the difference both exporting.
Result due to the output of diff instrument is the line number change of source code, therefore, when above-mentioned increment coverage rate determining unit 404 determines increment coverage rate, can based on the difference of the type of increment coverage rate to be determined, according to the line number in code to be tested and the corresponding relation between code information type, determine corresponding increment coverage rate, such as, when code information type is function, by the corresponding relation of line number function, determine increment of a function coverage rate, when code information type is statement, by the corresponding relation of line number and statement, determine statement increment coverage rate, other code information types are similar, no longer launch to repeat at this.
Wherein, above-mentioned pitching pile unit 402 treats test code when carrying out pitching pile, for the code of pitching pile, can set according to actual needs.So-called pitching pile, refer to when not destroying the original logic integrality of tested program, the code (being also referred to as probe) being used for pitching pile is inserted in the relevant position of tested program, these probes are the code segment carrying out information acquisition in essence, by the execution of probe and the operation characteristic data of written-out program, thus based on the analysis of these characteristics, disclose internal act and the characteristic of program.
Wherein, above-mentioned treat test code carry out pitching pile time, based on the characteristic of code to be tested, pitching pile can be carried out at the diverse location of code to be tested, thus the increment coverage rate under different situations can be determined accordingly.
Accordingly, wherein in an example, as shown in Figure 5, this pitching pile unit 402 can comprise function pitching pile unit 4021, adds pitching pile mark, obtain the code to be tested after pitching pile for the function in described code to be tested.
Now, the increment coverage rate that above-mentioned increment coverage rate determining unit 404 is determined can be the ratio that the number of function of tested execution in increment change code and described increment change the function sum in code.Owing to being by carrying out pitching pile in function in the present embodiment and be determine increment coverage rate based on the test execution situation of function, therefore, the increment coverage rate obtained in the present embodiment can be referred to as increment of a function coverage rate.
This increment of a function coverage rate can be determined by following formula:
Increment of a function coverage rate=(in increment change code, the number/increment of the function of tested execution changes the sum of the function in code) * 100%.
In the concrete example of another one, as shown in Figure 6, this pitching pile unit 402 can comprise statement pitching pile unit 4022, adds pitching pile mark, obtain the code to be tested after pitching pile for the statement in described code to be tested.
Now, the increment coverage rate that above-mentioned increment coverage rate determining unit 404 is determined can be the ratio that the number of statement of tested execution in increment change code and described increment change the statement sum in code.Owing to being by carrying out pitching pile in statement in the present embodiment and be determine increment coverage rate based on the test execution situation of statement, therefore, the increment coverage rate obtained in the present embodiment can be referred to as statement increment coverage rate.
Therefore, this statement increment coverage rate can be determined by following formula:
Statement increment coverage rate=(in increment change code, the number/increment of the statement of tested execution changes the sum of the statement in code) * 100%.
As mentioned above, change comparing unit 401 and front to the code to be tested after coding and coding code is compared, when obtaining increment change code, diff instrument can be adopted to carry out.Result due to the output of diff instrument is the line number change of source code, therefore, when adopting diff instrument to obtain increment change code, the number of the function (or statement) of tested execution in above-mentioned increment change code, the corresponding relation that can change line number function (or statement) in code based on increment is determined, correspondingly, the sum of the function (or statement) in above-mentioned increment change code, the corresponding relation that also can change line number function (or statement) in code based on increment is determined.
Because the code inside source code all can have a line number, and the function in source code includes function name sum functions body, and function body appears in paired braces, so can determine which row this function is from accordingly, to which row terminates.And the statement in source code, such as (), if () statement etc., after this for (), if () statement body, corresponding perform statement can be followed closely, and this perform statement appears in paired braces, so when carrying out pitching pile, can all add pitching pile mark at the statements such as (), if () and corresponding perform statement.Therefore, after the line number being obtained change by diff instrument, the row just can knowing this change be which function or change be which statement.
It should be noted that, although the step in the present invention arranges with label, but and be not used in and limit the precedence of step, the order of step or the execution of certain step need based on other steps unless expressly stated, otherwise the relative rank of step is adjustable.
Fig. 7 is the modular structure schematic diagram of a computer system 1000 that can realize the embodiment of the present invention in a concrete example.This computer system 1000 is an example being applicable to computer environment of the present invention, can not think to propose any restriction to usable range of the present invention.Computer system 1000 can not be interpreted as the combination needing the one or more parts depending on or have in illustrated exemplary computer system 1000.
Computer system 1000 shown in Fig. 7 is the examples being suitable for computer system of the present invention.Other framework with different sub-systems configuration also can use.The similar devices such as the desktop computer known by masses, notebook, personal digital assistant, intelligent terminal, panel computer are such as had to go for some embodiments of the present invention.But be not limited to above cited equipment.
As shown in Figure 7, computer system 1000 comprises processor 1010, storer 1020 and system bus 1022.The various system components comprising storer 1020 and processor 1010 are connected on system bus 1022.Processor 1010 is the hardware being used for being performed by arithmetic sum logical operation basic in computer system computer program instructions.Storer 1020 be one for storing the physical equipment of calculation procedure or data (such as, program state information) temporarily or permanently.System bus 1020 can be any one in the bus structure of following several types, comprises memory bus or memory controller, peripheral bus and local bus.Processor 1010 and storer 1020 can carry out data communication by system bus 1022.Wherein storer 1020 comprises ROM (read-only memory) (ROM) or flash memory (all not shown in figure), and random access memory (RAM), and RAM typically refers to the primary memory being loaded with operating system and application program.
Computer system 1000 also comprises display interface 1030 (such as, Graphics Processing Unit), display device 1040 (such as, liquid crystal display), audio interface 1050 (such as, sound card) and audio frequency apparatus 1060 (such as, loudspeaker).Display device 1040 and audio frequency apparatus 1060 are the media devices for experiencing content of multimedia.
Computer system 1000 generally comprises a memory device 1070.Memory device 1070 can be selected from multiple computer-readable medium, and computer-readable medium refers to any available medium can accessed by computer system 1000, that comprise movement and fixing two media.Such as, computer-readable medium includes but not limited to, flash memory (miniature SD card), CD-ROM, digital versatile disc (DVD) or other optical disc storage, tape cassete, tape, disk storage or other magnetic storage apparatus, or can be used for storing information needed and other medium any can accessed by computer system 1000.
Computer system 1000 also comprises input media 1080 and input interface 1090 (such as, I/O controller).User can pass through input media 1080, and as the touch panel equipment in keyboard, mouse, display device 1040, input instruction and information are in computer system 1000.Input media 1080 is normally connected on system bus 1022 by input interface 1090, but also can be connected by other interface or bus structure, as USB (universal serial bus) (USB).
Computer system 1000 can be carried out logic with one or more network equipment in a network environment and is connected.The network equipment can be PC, server, router, smart phone, panel computer or other common network node.Computer system 1000 is connected with the network equipment by LAN (Local Area Network) (LAN) interface 1100 or mobile comm unit 1110.LAN (Local Area Network) (LAN) refers in limited area, such as family, school, computer laboratory or use the office building of the network media, the computer network of interconnected composition.WiFi and twisted-pair feeder wiring Ethernet are two kinds of technology of the most frequently used structure LAN (Local Area Network).WiFi is a kind of technology that can make computer system 1000 swapping data or be connected to wireless network by radiowave.Mobile comm unit 1110 can be answered by radio communication diagram while movement and call in a wide geographic area.Except call, mobile comm unit 1110 is also supported in the 2G providing mobile data service, carries out internet access in 3G or 4G cellular communication system.
It should be pointed out that other computer system comprising the subsystem more more or less than computer system 1000 also can be applicable to invention.
As described in detail, be applicable to the assigned operation of computer system 1000 of the present invention energy run time version method of testing above.The form of the software instruction that computer system 1000 is operated in computer-readable medium by processor 1010 performs these operations.These software instructions can be read into storer 1020 from memory device 1070 or by lan interfaces 1100 from another equipment.The software instruction be stored in storer 1020 makes processor 1010 perform above-mentioned code test method.In addition, also the present invention can be realized equally by hardware circuit or hardware circuit in conjunction with software instruction.Therefore, the combination that the present invention is not limited to any specific hardware circuit and software is realized.
The above embodiment only have expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but therefore can not be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.

Claims (14)

1. a code test method, is characterized in that, comprises step:
Front to code to be tested after coding and coding code is compared, obtains increment change code;
Pitching pile is carried out to described code to be tested, in described code to be tested, adds pitching pile mark, obtain the code to be tested after pitching pile;
Code to be tested after described pitching pile is tested, and records the code tester information in test process;
The increment coverage rate of described code to be tested is determined according to described increment change code, described pitching pile mark, described code tester information.
2. code test method according to claim 1, is characterized in that, the function in described code to be tested adds pitching pile mark, obtains the code to be tested after described pitching pile.
3. code test method according to claim 2, is characterized in that, described increment coverage rate is the ratio that the number of function of tested execution in described increment change code and described increment change the function sum in code.
4. code test method according to claim 1, is characterized in that, the statement in described code to be tested adds pitching pile mark, obtains the code to be tested after described pitching pile.
5. code test method according to claim 4, is characterized in that, described increment coverage rate is the ratio that the number of statement of tested execution in described increment change code and described increment change the statement sum in code.
6. code test method according to claim 3, is characterized in that, adopts diff instrument to compare by front to the code to be tested after coding and coding code, obtains described increment change code; The function sum that described increment changes in the number of the function of tested execution in code, described increment change code is determined according to the corresponding relation of line number function in described increment change code.
7. code test method according to claim 5, is characterized in that, adopts diff instrument to compare by front to the code to be tested after coding and coding code, obtains described increment change code; The statement sum that described increment changes in the number of the statement of tested execution in code, described increment change code is determined according to the corresponding relation of line number and statement in described increment change code.
8. a code tester system, is characterized in that, comprising:
Changing comparing unit, for being compared by front to the code to be tested after coding and coding code, obtaining increment change code;
Pitching pile unit, for carrying out pitching pile to described code to be tested, adding pitching pile mark, obtaining the code to be tested after pitching pile in described code to be tested;
Test cell, for testing the code to be tested after described pitching pile, and records the code tester information in test process;
Increment coverage rate determining unit, for determining the increment coverage rate of described code to be tested according to described increment change code, described pitching pile mark, described code tester information.
9. code tester system according to claim 8, is characterized in that:
Described pitching pile unit comprises function pitching pile unit, adds pitching pile mark, obtain the code to be tested after described pitching pile for the function in described code to be tested.
10. code tester system according to claim 9, is characterized in that, described increment coverage rate is the ratio that the number of function of tested execution in described increment change code and described increment change the function sum in code.
11. code tester systems according to claim 8, is characterized in that:
Described pitching pile unit comprises statement pitching pile unit, adds pitching pile mark, obtain the code to be tested after described pitching pile for the statement in described code to be tested.
12. code tester systems according to claim 11, is characterized in that, described increment coverage rate is the ratio that the number of statement of tested execution in described increment change code and described increment change the statement sum in code.
13. code tester systems according to claim 10, is characterized in that:
Described change comparing unit adopts diff instrument to compare by front to the code to be tested after coding and coding code, obtains described increment change code;
Described increment coverage rate determining unit is total according to the function that corresponding relation determines the number of the function of tested execution in described increment change code, described increment changes in code of line number function in described increment change code.
14. code tester systems according to claim 12, is characterized in that:
Described change comparing unit adopts diff instrument to compare by front to the code to be tested after coding and coding code, obtains described increment change code;
According to the corresponding relation of line number and statement in described increment change code, described increment coverage rate determining unit determines that the statement that described increment changes the number of the statement of tested execution in code, described increment changes in code is total.
CN201410265946.0A 2014-06-13 2014-06-13 Code testing method and code testing system Pending CN105204982A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410265946.0A CN105204982A (en) 2014-06-13 2014-06-13 Code testing method and code testing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410265946.0A CN105204982A (en) 2014-06-13 2014-06-13 Code testing method and code testing system

Publications (1)

Publication Number Publication Date
CN105204982A true CN105204982A (en) 2015-12-30

Family

ID=54952676

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410265946.0A Pending CN105204982A (en) 2014-06-13 2014-06-13 Code testing method and code testing system

Country Status (1)

Country Link
CN (1) CN105204982A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608011A (en) * 2016-03-01 2016-05-25 网易(杭州)网络有限公司 Determination method and device for code testing coverage rate statistical results
CN106528411A (en) * 2016-10-24 2017-03-22 网易(杭州)网络有限公司 Method and device for coverage rate detection and equipment
CN110188048A (en) * 2019-06-05 2019-08-30 北京科摩仕捷科技有限公司 A method of realizing accurate monitor code coverage rate
CN110795329A (en) * 2018-08-02 2020-02-14 阿里巴巴集团控股有限公司 Coverage rate testing method and system, processor and storage medium
CN112559337A (en) * 2020-12-10 2021-03-26 平安普惠企业管理有限公司 Code coverage rate testing method and device, electronic equipment and storage medium
CN112631926A (en) * 2020-12-29 2021-04-09 平安银行股份有限公司 Code test coverage rate display method and device, computer equipment and storage medium
CN112699011A (en) * 2019-10-23 2021-04-23 上海哔哩哔哩科技有限公司 Method and device for counting incremental code coverage rate, electronic equipment and storage medium
CN115858354A (en) * 2022-11-29 2023-03-28 广发银行股份有限公司 Test coverage rate calculation method, system, terminal and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1987821A (en) * 2006-11-14 2007-06-27 无敌科技(西安)有限公司 Method and system for realizing unit test
CN102722436A (en) * 2012-05-29 2012-10-10 百度在线网络技术(北京)有限公司 Statistical method and device for incremental coverage information
CN103699385A (en) * 2013-12-23 2014-04-02 国云科技股份有限公司 Continuous code integration method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1987821A (en) * 2006-11-14 2007-06-27 无敌科技(西安)有限公司 Method and system for realizing unit test
CN102722436A (en) * 2012-05-29 2012-10-10 百度在线网络技术(北京)有限公司 Statistical method and device for incremental coverage information
CN103699385A (en) * 2013-12-23 2014-04-02 国云科技股份有限公司 Continuous code integration method

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608011A (en) * 2016-03-01 2016-05-25 网易(杭州)网络有限公司 Determination method and device for code testing coverage rate statistical results
CN106528411A (en) * 2016-10-24 2017-03-22 网易(杭州)网络有限公司 Method and device for coverage rate detection and equipment
CN110795329A (en) * 2018-08-02 2020-02-14 阿里巴巴集团控股有限公司 Coverage rate testing method and system, processor and storage medium
CN110188048A (en) * 2019-06-05 2019-08-30 北京科摩仕捷科技有限公司 A method of realizing accurate monitor code coverage rate
CN112699011A (en) * 2019-10-23 2021-04-23 上海哔哩哔哩科技有限公司 Method and device for counting incremental code coverage rate, electronic equipment and storage medium
CN112559337A (en) * 2020-12-10 2021-03-26 平安普惠企业管理有限公司 Code coverage rate testing method and device, electronic equipment and storage medium
CN112631926A (en) * 2020-12-29 2021-04-09 平安银行股份有限公司 Code test coverage rate display method and device, computer equipment and storage medium
CN115858354A (en) * 2022-11-29 2023-03-28 广发银行股份有限公司 Test coverage rate calculation method, system, terminal and storage medium
CN115858354B (en) * 2022-11-29 2023-08-18 广发银行股份有限公司 Test coverage rate calculation method, system, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN105204982A (en) Code testing method and code testing system
US20130117855A1 (en) Apparatus for automatically inspecting security of applications and method thereof
CN104268472B (en) Reduction is by the method and apparatus of third party's dynamic base Modification growth function address
CN107368418B (en) Traversal test method, device and medium
CN105740122A (en) Method and system for monitoring mobile phone memory leak
US20200136988A1 (en) Resource optimization and update method, server, and device
CN108170600A (en) The coverage rate statistical method of front-end code test, apparatus and system
CN107038120A (en) A kind of method for testing software and equipment
CN110990842A (en) Recurrence method and device of small probability event, storage medium and electronic equipment
CN104809054A (en) Method and system for realizing program testing
CN113742221A (en) Method for generating test case, electronic device and storage medium
CN112133357A (en) eMMC testing method and device
US20140368438A1 (en) Test system and method for testing keys of virtual keypad
CN109408309A (en) The test method and device of multiple terminals
CN107977318A (en) A kind of energy consumption and performance test methods of Android application programs
CN112566005B (en) Audio chip testing method and device, electronic equipment and storage medium
CN107562608B (en) Resource index importance evaluation method and device
TWI426407B (en) Method for predicting and debugging emi characteristics in ic system and related machine-readable medium
JP2007206069A (en) Method and device for formatting data automatically based on best matched test result type
CN105117334A (en) XML-based test requirement description and implementation method thereof
CN103902445A (en) Regression test object determination method and device
CN107678967B (en) Unit test coverage rate generation method and device, readable storage medium and equipment
CN110737900A (en) Webpage function testing method and device, server and computer readable storage medium
CN105528932A (en) Method and device for evaluating user recognized character amount
CN104714879A (en) Picture testing 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20151230