CN103761184B - Code segment method of testing, device and the system of program - Google Patents

Code segment method of testing, device and the system of program Download PDF

Info

Publication number
CN103761184B
CN103761184B CN201310752450.1A CN201310752450A CN103761184B CN 103761184 B CN103761184 B CN 103761184B CN 201310752450 A CN201310752450 A CN 201310752450A CN 103761184 B CN103761184 B CN 103761184B
Authority
CN
China
Prior art keywords
tested
program
test
code section
code
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.)
Expired - Fee Related
Application number
CN201310752450.1A
Other languages
Chinese (zh)
Other versions
CN103761184A (en
Inventor
冯蛟
麻先盛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chongqing Hanyuan Machinery Co ltd
Guangdong Gaohang Intellectual Property Operation Co ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310752450.1A priority Critical patent/CN103761184B/en
Publication of CN103761184A publication Critical patent/CN103761184A/en
Application granted granted Critical
Publication of CN103761184B publication Critical patent/CN103761184B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

This application discloses code segment method of testing, device and the system of program, the code segment method of testing of its Program includes: when testing tested program, calls the position of tested code section in tested program, arranges breakpoint/redirect processing unit;Running described tested program, when tested program performs to when calling tested code fragment position, breakpoint/redirect processing unit interrupts the execution flow process of tested code section, and the execution of tested program is jumped to testing process;In performing testing process, testing results code segment, and obtain test result.The application controls the program belonging to tested code section by a test program and performs so that it is enters testing process after interruption and carrys out the test of completion code section;Owing to the application need not Embedded test module in tested program, thus also avoid the interference to former tested program thus brought.

Description

Code segment method of testing, device and the system of program
Technical field
The invention belongs to computer program field, particularly relate to the code segment method of testing of program, device and System.
Background technology
Along with the complexity of current software system improves constantly, make the importance of software test have also been obtained into The embodiment of one step.
In prior art, include in the mode that binary program image is tested, in program Portion's Embedded test module, i.e. carry out program test by running specific code segment.
Inventor finds through research, above-mentioned program test mode of the prior art, needs to increase new Test module, such that the complexity of the logic of program improves further, and then is possible to introduce New defect;So, when defect occurs, being just difficult to position defect is test object on earth, i.e. quilt The problem of test code segment self still causes due to the addition of test module, i.e. of the prior art Program test mode can make the complexity of calling program increase, owing to test module the most likely introduces volume Outer defect, thus original program is interfered.
Summary of the invention
In view of this, the invention provides code segment method of testing and the device of program, to reduce original The interference purpose of program.
First aspect, the invention provides the code segment method of testing of a kind of program, including:
When tested program is tested, described tested program is called the position of tested code section, Breakpoint/redirect processing unit is set;
Run described tested program, when described tested program performs to calling described tested code fragment position Time, described breakpoint/redirect processing unit interrupts the execution flow process of described tested code section, and by described quilt The execution of ranging sequence jumps to testing process;
In performing described testing process, testing results code segment, and obtain test result.
In the first possible implementation of first aspect, the type of code of described tested code section Including:
Binary program is videoed.
In conjunction with the first possible implementation of first aspect, in the implementation that the second is possible, Described tested program includes:
Operating system program or application program.
In conjunction with in the implementation that the second of first aspect is possible, in the implementation that the third is possible, Described breakpoint/redirect processing unit includes:
By arranging breakpoint, probe, dynamically amendment code segment or virtual executory one or combination in any Realize.
In the 4th kind of possible implementation of first aspect, after described acquisition test result, also include:
After testing process terminates, recover the execution of described tested program.
In conjunction with the 4th kind of possible implementation of first aspect, in the 5th kind of possible implementation, Described testing process includes:
Structure and inspection test environment;
Call described tested code section;
After described tested code section is finished, carry out inspection and the record of described test environment result.
In conjunction with the 4th kind of possible implementation of first aspect, in the 6th kind of possible implementation, Described testing process includes:
Structure and inspection test environment;
Call the copy of described tested code section;
After the copy of described tested code section is finished, carry out described test environment result inspection and Record.
In conjunction with the 5th kind or the 6th kind of possible implementation of first aspect, in the 7th kind of implementation, Also include:
Before the execution of the described tested program that recovery is interrupted, clear up described test environment.
In conjunction with the 6th kind of possible implementation of first aspect, in the 8th kind of possible implementation, Before described structure and inspection test environment, also include:
When described tested code section copy not in the presence of, create the copy of described tested code section.
In conjunction with the 8th kind of possible implementation of first aspect, in the 9th kind of possible implementation, The copy of described tested code section includes:
Code segment with the equivalence of described tested code section logic function.
Second aspect, the present invention provides the code segment test device of a kind of program, including:
Breakpoint setup unit, for when testing tested program, calls in described tested program The position of tested code section, arranges breakpoint/redirect processing unit;
Described breakpoint/redirect processing unit, for performing to calling described tested generation when described tested program During code fragment position, described breakpoint/redirect processing unit interrupts the execution flow process of described tested code section, and The execution of described tested program is jumped to testing process;
Test cell, is used in performing described testing process, testing results code segment, and obtains test Result.
In the first possible implementation of second aspect, the type of code of described tested code section Including:
Binary program is videoed.
In conjunction with the first possible implementation of second aspect, in the implementation that the second is possible, Described tested program includes:
Operating system program or application program.
In conjunction with the implementation that the second of second aspect is possible, in the implementation that the third is possible, Described breakpoint/redirect processing unit includes:
Breakpoint, probe, dynamically amendment code segment or virtual executory one or combination in any.
In the 4th kind of possible implementation of second aspect, also include:
Recovery unit, for by described breakpoint/redirect processing unit, recovering the execution of described tested program.
In conjunction with the 4th kind of possible implementation of second aspect, in the 5th kind of possible implementation, Described test cell, including:
Test environment constructing module, is used for constructing and checking test environment;
Code segment calling module, is used for calling described tested code section;
Test result acquisition module, for after described tested code section is finished, carries out described survey The inspection of examination environmental consequences and record.
In conjunction with the 4th kind of possible implementation of second aspect, in the 6th kind of possible implementation, Described test cell, including:
Test environment constructing module, is used for constructing and checking test environment;
Code segment calling module, for calling the copy of described tested code section;
Test result acquisition module, after the copy of described tested code section is finished, carries out institute State inspection and the record of test environment result.
In conjunction with the 5th kind or the 6th kind of possible implementation of second aspect, in the 7th kind of implementation Described test cell, also includes:
Test environment cleaning module, before the execution of the described tested program being interrupted in recovery, cleaning Described test environment.
In conjunction with the 6th kind of possible implementation of second aspect, in the 8th kind of possible implementation, Described test cell, also includes:
Copy creating module, for before described structure and inspection test environment, when described tested code Section copy not in the presence of, create the copy of described tested code section.
In conjunction with the 8th kind of possible implementation of second aspect, in the 9th kind of possible implementation, The copy of described tested code section includes:
Code segment with the equivalence of described tested code section logic function.
The third aspect, the present invention provides the code segment test system of a kind of program, including the code segment of program Test device;Described code segment test device includes:
Breakpoint setup unit, for when testing tested program, calls in described tested program The position of tested code section, arranges breakpoint/redirect processing unit;
Described breakpoint/redirect processing unit, for performing to calling described tested generation when described tested program During code fragment position, described breakpoint/redirect processing unit interrupts the execution flow process of described tested code section, and The execution of described tested program is jumped to testing process;
Test cell, is used in performing described testing process, testing results code segment, and obtains test Result.
From above-mentioned technical scheme it can be seen that the present invention test for code segment be no longer as existing In technology like that, use the mode of hard coded, need the internal build in tested program to test module;And Can be by a test program and perform to control tested program so that it is run tested program to calling The position of tested code section is interrupted, and jumps to testing process carry out the survey of completion code section by performing flow process Examination;Owing to the technical scheme in the present invention is not provided with test module, so will not carry in tested program The complexity of high tested program logic, also would not introduce new defect to tested program, and then by this Invention, it is possible to avoid cause original tested program is interfered due to the new defect of introducing.
Accompanying drawing explanation
In order to be illustrated more clearly that the present invention or technical scheme of the prior art, below will to embodiment or In description of the prior art, the required accompanying drawing used is briefly described, it should be apparent that, in describing below Accompanying drawing be only some embodiments of the present invention, for those of ordinary skill in the art, do not paying On the premise of going out creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of code segment method of testing described herein;
Fig. 2 is the schematic flow sheet of testing process described herein;
Fig. 3 is the another schematic flow sheet of code segment method of testing described herein;
Fig. 4 is the another schematic flow sheet of testing process described herein;
Fig. 5 is the another schematic flow sheet of code segment method of testing described herein;
Fig. 6 is the structural representation of code segment described herein test device;
Fig. 7 is that in the application, the hardware of code segment test device constitutes schematic diagram.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out Clearly and completely describe, it is clear that described embodiment is only a part of embodiment of the present invention, and It is not all, of embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art are not making Go out the every other embodiment obtained under creative work premise, broadly fall into the scope of protection of the invention.
In order to realize reducing the purpose of the interference to original program, in one aspect of the invention, it is provided that one The code segment method of testing of the program of kind, as it is shown in figure 1, include step:
S11, when tested program is tested, tested program is called the position of tested code section, Breakpoint/redirect processing unit is set.
In the present invention, the code segment in program is tested, can be realized by a test program, For the ease of understanding and distinguishing, in the present invention, the program belonging to tested code section is referred to as by ranging Sequence, is referred to as test program by the program testing tested code section.
In order to test the code segment set in tested program, first test program is in tested code The calling station of section is provided with breakpoint/redirect processing unit, to facilitate the control for tested program.
S12, run tested program, when tested program performs to when calling the position of described tested code section, Breakpoint/redirect processing unit interrupts the execution flow process of tested code section, and the execution of tested program is redirected Testing process to tested code section.
When carrying out the test of code segment, first run tested program, when tested program runs to need to adjust During with the position of tested code section, breakpoint/redirect processing unit will the calling of adapter tested code section Process;And tested program is redirected to the testing process of test program, the tune of adapter tested code section Use process.Specifically can include, first interrupt the execution flow process of tested code section, then, by tested The execution of program jumps to the testing process of tested code section.
S13, performing in described testing process, testing results code segment, and obtaining test result.
After the execution of tested program jumps to the testing process of tested code section, test program can be held The testing process that row is corresponding, and then test result can be obtained.
In actual applications, test code segment can be the tested code self of modulation, it is also possible to be The copy of test code segment.Such that it is able to tested code is surveyed by the operation of test code segment Examination.
In the present invention, the test for code segment is no longer as in the prior art, using hard coded Mode, needs to test module in the internal build of tested program, and can be by a test program Control the execution route of tested code section corresponding programme so that it is enter testing process after interruption and complete generation The test of code section;So, the complexity of logic in the program belonging to tested code section would not be improved, from And avoid the interference to original program.
Preferably, in the present invention, for performing the type of code of the tested code section of test, permissible Being binary code segment program image, such as, operating system program is videoed, owing to kernel program runs Time be difficult to control and itself be the ISP of bottom, so cannot directly apply existing, as The testing tools such as Xunit, so by the test mode in the present invention, can not change kernel binary system Under mirror image scene, it is tested.So, kernel arrange redirect/breakpoint processing unit is triggered After, programming jump to testing process performs.Testing process can be provided with test code, test code A binary image file can be compiled in, it would however also be possible to employ dynamic-form loads with tested code. So, in the present invention, by redirecting/breakpoint technique, solve and do not change kernel binary image scene Under the problem of kernel test difficulty, thus improve debugging and the testing efficiency of kernel development.
In the test process realizing code segment, test code modulation tested code, can be by jumping Turn/breakpoint trigger and test the coordinating of code logic, or the side by generation tested code equivalent copy Formula, prevents tested code to be again triggered, thus avoid the occurrence of redirect/breakpoint processing unit is with tested Occurring endless loop between code, final realization tests the code section encapsulation function to tested code.
In actual applications, breakpoint/redirect processing unit can be specifically by breakpoint, probe, dynamically repair Change code segment or virtual executory one or more arrange be implemented in combination in.
Further, in the present invention, in order to not affect the execution of tested program, or, can continue Carry out the test of other follow-up code segments, after the test result obtaining tested code section, it is also possible to The execution flow process of test code segment is jumped to tested program;So, after testing process terminates, so that it may To recover the execution of tested program.
In actual applications, the step of testing process can be as in figure 2 it is shown, include:
S21, construct and check test environment;
S22, call described tested code section;
After S23, described tested code section are finished, carry out inspection and the note of described test environment result Record.
As it is shown on figure 3, when using the testing process described in step S21 to S23, carry out code segment The overall flow of test be:
When tested program normally performs the position to tested code section, test program is by being positioned at herein The invoked procedure of breakpoint/redirect processing unit adapter tested program, i.e. interrupt the execution of tested code section Flow process, is then relocated to test by jump instruction by the execution of the program belonging to tested code section and flows Journey.
In testing process, first construct and check test environment, additionally, call at test process tested Before code, test program also to forbid redirecting/breakpoint processing logic in the repeating of jump instruction.
Then, test program can call tested code section, makes tested code section perform it and runs;
After the operation of tested code section is finished, perform inspection and the record of test environment result, That is, test result is generated;
Then, the execution flow process of test code segment is jumped to tested program, such that it is able to recover by ranging The subsequent execution of sequence.
Preferably, before the execution flow process of test code segment is jumped to tested program, it is also possible to include Step: cleaning test environment, thus carry out environment cleaning work.
In actual applications, the step of testing process can also as shown in Figure 4, including:
S31, construct and check test environment;
S32, call the copy of described tested code section;
After S33, described tested code section are finished, carry out inspection and the note of described test environment result Record.
As it is shown in figure 5, when using the testing process described in step S31 to S33, carry out code segment The overall flow of test be:
When tested program normally performs the position to tested code section, test program is by being positioned at herein The invoked procedure of breakpoint/redirect processing unit adapter tested program, i.e. interrupt the execution of tested code section Flow process, is then relocated to test by jump instruction by the execution of the program belonging to tested code section and flows Journey.
In testing process, first construct and check test environment.
Then, test program can call the copy of tested code section, and runs tested code section Copy;Concrete, in the present invention, the copy of tested code section can be complete with tested code section It is identical, additionally, the copy of tested code section can also be with the equivalence of tested code section logic function Code segment.
After the operation of the copy of tested code section is finished, return the inspection performing test environment result Look into and record, i.e. generate test result;
Then, the execution flow process of test code segment is jumped to tested program, such that it is able to recover by ranging The subsequent execution of sequence.
Preferably, before the execution flow process of test code segment is jumped to tested program, it is also possible to include Step: cleaning test environment, thus carry out environment cleaning work.
Preferably, before the above-mentioned copy calling tested code section, when tested code section copy not In the presence of, it is also possible to create the step of the copy of tested code section.
Corresponding to the code segment method of testing embodiment of program illustrated in fig. 1, the opposing party of the application Face, additionally provide a kind of program code segment test device, as shown in Figure 6, including:
Breakpoint setup unit 01, for breakpoint setup unit, is used for when testing tested program, In described tested program, call the position of tested code section, breakpoint/redirect processing unit is set;
Breakpoint/redirect processing unit 02, for described breakpoint/redirect processing unit, for when described by ranging Sequence performs to when calling described tested code fragment position, and described breakpoint/redirect processing unit interrupts described quilt The execution flow process of test code segment, and the execution of described tested program is jumped to testing process;
Test cell 03, is used in performing described testing process, testing results code segment, and obtains survey Test result.
In the present invention, the code segment test device testing the code segment in program, can be one The test program realized by software, for the ease of understanding and distinguishing, in the present invention, by tested Program belonging to code segment is referred to as tested program, is referred to as surveying by the program testing tested code section Examination program.
In order to test the code segment set in tested program, first breakpoint setup unit 01 is tested The calling station of examination code segment is provided with breakpoint/redirect processing unit, so, in the test carrying out code segment Time, first run tested program, when tested program runs to the position needing to call tested code section, Breakpoint/redirect processing unit 02 will the invoked procedure of adapter tested code section;And tested program is reset To the testing process to test program, the invoked procedure of adapter tested code section specifically includes, first in The execution flow process of disconnected tested code section, then, jumps to tested code section by the execution of tested program Testing process.
After the execution of tested program jumps to the testing process of tested code section, test cell 03 can open The execution of dynamic testing process, and then with testing results code segment, and test result can be obtained.
In the present invention, the test for code segment is no longer as in the prior art, using hard coded Mode, needs to test module in the internal build of tested program, and can be by a test program Control the execution route of tested code section corresponding programme so that it is enter testing process after interruption and complete generation The test of code section;So, the complexity of logic in the program belonging to tested code section would not be improved, from And avoid the interference to original program.
Preferably, in the present invention, for performing the type of code of the tested code section of test, permissible Being binary code segment program image, such as, operating system program is videoed, owing to kernel program runs Time be difficult to control and itself be the ISP of bottom, so cannot directly apply existing, as The testing tools such as Xunit, so by the test mode in the present invention, can not change kernel binary system Under mirror image scene, it is tested.So, kernel arrange redirect/breakpoint processing unit is triggered After, programming jump to testing process performs.Testing process can be provided with test code, test code A binary image file can be compiled in, it would however also be possible to employ dynamic-form loads with tested code. So, in the present invention, by redirecting/breakpoint technique, solve and do not change kernel binary image scene Under the problem of kernel test difficulty, thus improve debugging and the testing efficiency of kernel development.
In the test process realizing code segment, test code modulation tested code, can be by jumping Turn/breakpoint trigger and test the coordinating of code logic, or the side by generation tested code equivalent copy Formula, prevents tested code to be again triggered, thus avoid the occurrence of redirect/breakpoint processing unit is with tested Occurring endless loop between code, final realization tests the code section encapsulation function to tested code.
In actual applications, breakpoint/redirect processing unit can be specifically by breakpoint, probe, dynamically repair Change code segment or virtual executory one or more arrange be implemented in combination in.
Further, in the present invention, in order to not affect the execution of tested program, or, can continue Carry out the test of other follow-up code segments, after the test result obtaining tested code section, it is also possible to Including recovery unit, so, by recovery unit, the execution flow process of test code segment is jumped to by ranging Sequence;So that, after testing process terminates, it is possible to recover the execution of tested program.
In actual applications, test cell 03 specifically can also include:
Test environment constructing module, is used for constructing and checking test environment;
Code segment calling module, for calling the copy of described tested code section;
Test result acquisition module, after tested code section is finished, carries out described test environment The inspection of result and record.
As it is shown on figure 3, using test cell 03 to include that above-mentioned test environment constructing module, code segment are adjusted During with module and test result acquisition module, the overall flow of the test carrying out code segment can be:
When tested program normally performs the position to tested code section, it is positioned at breakpoint herein/redirect process The invoked procedure of unit 02 adapter tested program, i.e. interrupt the execution flow process of tested code section, then By jump instruction, the execution of the program belonging to tested code section is relocated to testing process.
In testing process, first test environment constructing module structure and inspection test environment.
Then, code segment calling module test program can call the copy of tested code section, and runs The copy of tested code section;Concrete, in the present invention, the copy of tested code section can be with quilt Test code segment is identical, additionally, the copy of tested code section can also be and tested code section logic The code segment of function equivalent.
After the operation of the copy of tested code section is finished, test result acquisition module returns and performs The inspection of test environment result and record, i.e. generate test result;
Then, the execution flow process of test code segment is jumped to tested program by recovery unit, such that it is able to extensive The subsequent execution of multiple tested program.
Preferably, the test cell in the application, it is also possible to include that test environment clears up module, test wrapper Cleaning module in border is for before jumping to tested program by the execution flow process of test code segment, and cleaning is tested Environment, thus carry out environment cleaning work.
Preferably, the test cell 03 in the present invention can also include copy creating module, copy creating mould Block for before the above-mentioned copy calling tested code section, when tested code section copy not in the presence of, Create the copy of tested code section.
In the another aspect of the application, additionally provide the code segment test system of another kind of program, this code Section test system includes the code segment test device in an embodiment, due to the code in the present embodiment Code segment test device in section test system and the code segment in a upper embodiment test the structure phase of device With, operation principle is identical and beneficial effect is identical, so just repeating no more at this.
Further, the embodiment of the present invention additionally provides the hardware composition of code segment test device.Can include At least one processor (such as CPU), and at least one memorizer.Processor is used for performing in memorizer The executable module of storage, such as computer program.Memorizer may comprise high-speed random access memory (RAM:Random Access Memory), it is also possible to also include non-labile memorizer (non-volatile memory), for example, at least one disk memory.By at least one network interface (can be wired or wireless) realizes the communication link between this system gateway and at least one other network element Connect, it is possible to use the Internet, wide area network, LAN, Metropolitan Area Network (MAN) etc..
Seeing Fig. 7, in some embodiments, store programmed instruction in memorizer, programmed instruction is permissible Being executed by processor, wherein, programmed instruction includes breakpoint setup unit 01, breakpoint/redirect processing unit 02 With test cell 03, each unit implement the corresponding units that can be found in disclosed in Fig. 6.
The present invention program can retouch in the general context of computer executable instructions State, such as program unit.Usually, program unit includes performing particular task or realizing specific abstract number According to the routine of type, program, object, assembly, data structure etc..Can also be at Distributed Calculation ring Border is put into practice the present invention program, in these distributed computing environment, is connected by by communication network Remote processing devices perform task.In a distributed computing environment, program unit may be located at and includes Storage device is in interior local and remote computer-readable storage medium.
Each embodiment in this specification all uses the mode gone forward one by one to describe, identical between each embodiment Similar part sees mutually, and what each embodiment stressed is different from other embodiments Part.For device embodiment, owing to it is substantially similar to embodiment of the method, so retouching Stating fairly simple, relevant part sees the part of embodiment of the method and illustrates.Dress described above Putting embodiment is only schematically, and the wherein said unit that illustrates as separating component can be or also Can not be physically separate, the parts shown as unit can be or may not be physics list Unit, i.e. may be located at a place, or can also be distributed on multiple NE.Can be according to reality The needing of border selects some or all of module therein to realize the purpose of the present embodiment scheme.This area Those of ordinary skill, in the case of not paying creative work, is i.e. appreciated that and implements.
Being described in detail the embodiment of the present invention above, detailed description of the invention used herein is to this Invention is set forth, and the explanation of above example is only intended to help to understand the method and apparatus of the present invention; Simultaneously for one of ordinary skill in the art, according to the thought of the present invention, in detailed description of the invention and All will change in range of application, in sum, this specification content should not be construed as the present invention Restriction.

Claims (21)

1. the code segment method of testing of a program, it is characterised in that including:
When tested program is tested, described tested program is called the position of tested code section, Breakpoint/redirect processing unit is set;
Run described tested program, when described tested program performs to calling described tested code fragment position Time, described breakpoint/redirect processing unit interrupts the execution flow process of described tested code section, and by described quilt The execution of ranging sequence jumps to testing process;
In performing described testing process, testing results code segment, and obtain test result.
2. according to the method described in claim 1, it is characterised in that the generation of described tested code section Code type includes:
Binary program is videoed.
3. according to the method described in claim 2, it is characterised in that described tested program includes:
Operating system program or application program.
4. according to the method described in claim 3, it is characterised in that described breakpoint/redirect processing unit Including:
By arranging breakpoint, probe, dynamically amendment code segment or virtual executory one or combination in any Realize.
5. according to the method described in claim 1, it is characterised in that after described acquisition test result, Also include:
After testing process terminates, recover the execution of described tested program.
6. according to the method described in claim 5, it is characterised in that described testing process includes:
Structure and inspection test environment;
Call described tested code section;
After described tested code section is finished, carry out inspection and the record of described test environment result.
7. according to the method described in claim 5, it is characterised in that described testing process includes:
Structure and inspection test environment;
Call the copy of described tested code section;
After the copy of described tested code section is finished, carry out described test environment result inspection and Record.
8. according to described method arbitrary in claim 6 or 7, it is characterised in that also include:
Before the execution of the described tested program that recovery is interrupted, clear up described test environment.
9. according to the method described in claim 7, it is characterised in that also include:
Described structure and checking before test environment, when described tested code section copy not in the presence of, wound Build the copy of described tested code section.
10. according to the method described in claim 9, it is characterised in that described tested code section Copy includes:
Code segment with the equivalence of described tested code section logic function.
The code segment test device of 11. 1 kinds of programs, it is characterised in that including:
Breakpoint setup unit, for when testing tested program, calls in described tested program The position of tested code section, arranges breakpoint/redirect processing unit;
Described breakpoint/redirect processing unit, for performing to calling described tested generation when described tested program During code fragment position, described breakpoint/redirect processing unit interrupts the execution flow process of described tested code section, and The execution of described tested program is jumped to testing process;
Test cell, is used in performing described testing process, testing results code segment, and obtains test Result.
12. according to the device described in claim 11, it is characterised in that described tested code section Type of code includes:
Binary program is videoed.
13. according to the device described in claim 12, it is characterised in that described tested program includes:
Operating system program or application program.
14. according to the device described in claim 13, it is characterised in that described breakpoint/redirect process list Unit includes:
Breakpoint, probe, dynamically amendment code segment or virtual executory one or combination in any.
15. according to the device described in claim 11, it is characterised in that also include:
Recovery unit, after testing process terminates, recovers the execution of described tested program.
16. according to the device described in claim 15, it is characterised in that described test cell, including:
Test environment constructing module, is used for constructing and checking test environment;
Code segment calling module, is used for calling described tested code section;
Test result acquisition module, for after described tested code section is finished, carries out described survey The inspection of examination environmental consequences and record.
17. according to the device described in claim 15, it is characterised in that described test cell, including:
Test environment constructing module, is used for constructing and checking test environment;
Code segment calling module, for calling the copy of described tested code section;
Test result acquisition module, after the copy of described tested code section is finished, carries out institute State inspection and the record of test environment result.
18. according to described device arbitrary in claim 16 or 17, it is characterised in that described test Unit, also includes:
Test environment cleaning module, before the execution of the described tested program being interrupted in recovery, cleaning Described test environment.
19. according to the device described in claim 17, it is characterised in that described test cell, also wraps Include:
Copy creating module, for before described structure and inspection test environment, when described tested code Section copy not in the presence of, create the copy of described tested code section.
20. according to the device described in claim 19, it is characterised in that described tested code section Copy includes:
Code segment with the equivalence of described tested code section logic function.
The code segment test system of 21. 1 kinds of programs, it is characterised in that include such as claim 11 to 20 In arbitrary described program code segment test device.
CN201310752450.1A 2013-12-31 2013-12-31 Code segment method of testing, device and the system of program Expired - Fee Related CN103761184B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310752450.1A CN103761184B (en) 2013-12-31 2013-12-31 Code segment method of testing, device and the system of program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310752450.1A CN103761184B (en) 2013-12-31 2013-12-31 Code segment method of testing, device and the system of program

Publications (2)

Publication Number Publication Date
CN103761184A CN103761184A (en) 2014-04-30
CN103761184B true CN103761184B (en) 2017-01-04

Family

ID=50528426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310752450.1A Expired - Fee Related CN103761184B (en) 2013-12-31 2013-12-31 Code segment method of testing, device and the system of program

Country Status (1)

Country Link
CN (1) CN103761184B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653244B (en) * 2014-11-10 2019-04-19 华为数字技术(苏州)有限公司 A kind of optimization method for software and device
CN104809071B (en) * 2015-05-14 2017-08-11 北京润科通用技术有限公司 A kind of code test method and device
CN107038108B (en) * 2015-08-20 2020-11-03 腾讯科技(深圳)有限公司 Software testing method and device
CN107229558B (en) * 2016-03-23 2020-10-16 阿里巴巴集团控股有限公司 Software testing method and device
CN107665169B (en) * 2016-07-29 2020-07-28 龙芯中科技术有限公司 Method and device for testing processor program
CN112395185B (en) * 2019-08-15 2024-04-12 腾讯科技(深圳)有限公司 Program testing method and related device
CN112579409B (en) * 2020-12-05 2024-06-04 西安翔腾微电子科技有限公司 OpenGL graphic task analysis method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183330A (en) * 2007-12-13 2008-05-21 东信和平智能卡股份有限公司 Online debugging system of embedded system and debug method thereof
US20090307532A1 (en) * 2008-06-04 2009-12-10 Jason Neal Raber Stealthy debugger
CN101727393A (en) * 2009-12-29 2010-06-09 青岛海信宽带多媒体技术有限公司 Method for dynamically testing embedded system software
CN102395928A (en) * 2009-03-27 2012-03-28 Abb股份公司 System and method for automatically testing a program for safety-related automation systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183330A (en) * 2007-12-13 2008-05-21 东信和平智能卡股份有限公司 Online debugging system of embedded system and debug method thereof
US20090307532A1 (en) * 2008-06-04 2009-12-10 Jason Neal Raber Stealthy debugger
CN102395928A (en) * 2009-03-27 2012-03-28 Abb股份公司 System and method for automatically testing a program for safety-related automation systems
CN101727393A (en) * 2009-12-29 2010-06-09 青岛海信宽带多媒体技术有限公司 Method for dynamically testing embedded system software

Also Published As

Publication number Publication date
CN103761184A (en) 2014-04-30

Similar Documents

Publication Publication Date Title
CN103761184B (en) Code segment method of testing, device and the system of program
JP6930891B2 (en) Easier debugging of serverless applications through graph rewriting
US10241897B2 (en) Identifying test gaps using code execution paths
Amalfitano et al. A gui crawling-based technique for android mobile application testing
Bellomo et al. Toward design decisions to enable deployability: Empirical study of three projects reaching for the continuous delivery holy grail
CN106302008A (en) Data-updating method and device
Ahmed et al. Generating combinatorial test cases using Simplified Swarm Optimization (SSO) algorithm for automated GUI functional testing
US9367428B2 (en) Transparent performance inference of whole software layers and context-sensitive performance debugging
CN102567172B (en) For parallel workloads emulation mode and the system of application performance test
US11768755B2 (en) Graph analysis and database for aggregated distributed trace flows
CN105117346A (en) Automatic testing method and system for distributed system of virtualization platform
US9507691B2 (en) Conditional component breakpoint setting system and method
CN105159738A (en) Hot patch implementation method and system
CN113590454A (en) Test method, test device, computer equipment and storage medium
CN106021101A (en) Method and device for testing mobile terminal
CN104462943A (en) Non-intrusive performance monitoring device and method for service system
Arora et al. Evaluation of flow graph and dependence graphs for program representation
CN109753281B (en) Micro-grid energy management strategy visualization development tool based on graphical programming
CN103034501B (en) The function calling method of a kind of linux platform and function call device
Romano et al. Dum-tool
CN103631585A (en) Method and system for developing application program
Ali et al. Model-based test case generation approach for mobile applications load testing using OCL enhanced activity diagrams
CN112199753B (en) Shear wall generation method and device, electronic equipment and storage medium
Song et al. An xpath-based approach to reusing test scripts for android applications
KR20120105752A (en) Psa model modification script of nuclear power plant and psa model mapping algorithm using thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20171208

Address after: 402260 Chongqing city Jiangjin Luohuang Industrial Park B District

Patentee after: CHONGQING HANYUAN MACHINERY Co.,Ltd.

Address before: 510640 Guangdong City, Tianhe District Province, No. five, road, public education building, unit 371-1, unit 2401

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Effective date of registration: 20171208

Address after: 510640 Guangdong City, Tianhe District Province, No. five, road, public education building, unit 371-1, unit 2401

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170104