[go: up one dir, main page]

CN107085555A - code testing method, device, terminal and storage medium - Google Patents

code testing method, device, terminal and storage medium Download PDF

Info

Publication number
CN107085555A
CN107085555A CN201710256843.1A CN201710256843A CN107085555A CN 107085555 A CN107085555 A CN 107085555A CN 201710256843 A CN201710256843 A CN 201710256843A CN 107085555 A CN107085555 A CN 107085555A
Authority
CN
China
Prior art keywords
code
change
test
association
tested
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
CN201710256843.1A
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.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics 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 Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201710256843.1A priority Critical patent/CN107085555A/en
Publication of CN107085555A publication Critical patent/CN107085555A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/362Debugging of software
    • G06F11/3628Debugging of software of optimised code

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 code testing method, a code testing device, a code testing terminal and a code testing storage medium, and relates to the technical field of computer application. The code testing method comprises the following steps: acquiring a change code in the coded code to be tested; indexing the code to be tested, and acquiring an associated code having a calling relation with the change code; and performing code testing on the change codes and the associated codes, and outputting test results corresponding to the change codes and the associated codes to confirm whether the change codes and the associated codes are related to execution. Compared with a method for testing only writing test cases for the demand points of the version, the technical scheme of the invention can better evaluate the influence range after code change, has more complete test coverage range, ensures the test quality, has accurate target for test work, and can greatly improve the test efficiency while ensuring the quality compared with a full-function regression test.

Description

Code test method, device, terminal and storage medium
Technical field
The present invention relates to Computer Applied Technology field, more particularly to a kind of code test method, device, terminal and storage Medium.
Background technology
At present, computer technology and network are developed rapidly, are very easy to daily life.In technicalization Today, in order to meet each side such as people's life, work, amusement to convenience and the demand of high efficiency, increasing equipment It is intended to carry out intelligentized control method using computer software.
For the smart machine of the series exploitations such as TV, mobile phone, function can be just realized often through change software code Adjustment, meets the diversified demand of user.At present, developer completes software version according to user's request or product up-gradation demand After the written in code work of this demand, function can be tested oneself with actual variation point according to demand, still, during due to test Between etc. factor image, tester in most instances all without carry out global function regression test, be typically to this version Demand point writes test case, and then test case is tested.
Because tester is seldom to version change appraisal procedure, and test content is limited, to coverage neither one It is reliable to assess, often because test scope covering is not complete and causes software quality low.And if each version is carried out Global function regression test, although can largely improve software quality, but efficiency is very low.Developer is writing for code Person, changes to code and measurements of coverage has a deep perception, but this judge be by developer artificially Assess, precise degrees depend on the careful degree and the degree of understanding to item code of developer, it is many unreliable to still suffer from Factor.
The content of the invention
The embodiments of the invention provide a kind of code test method, device, terminal and storage medium, to solve existing generation Global function regression test takes too long in code method of testing or code tester scope covers not congruent problem, realizes that code emphasis is examined Survey all standing and tool detection of scope.
In a first aspect, the embodiments of the invention provide a kind of code test method, this method includes:
Obtain the change code in the code to be tested after coding;
Code to be tested is indexed, the association code that there is call relation with the change code is obtained;
Code tester is carried out to the change code and the association code, and is exported and the change code and the pass Join the corresponding test result of code, to confirm whether the change code is related to the execution of the association code.
Second aspect, the embodiment of the present invention additionally provides a kind of code tester device, and the device includes:
Code obtaining module is changed, for obtaining the change code in the code to be tested after coding;
Association code acquisition module, for being indexed to code to be tested, obtains to exist with the change code and calls The association code of relation;
Test result output module, for carrying out code tester to the change code and the association code, and is exported Test result corresponding with the change code and the association code, to confirm the change code and the association code Whether related perform.
The third aspect, the embodiment of the invention also discloses a kind of terminal, the terminal includes:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are by one or more of computing devices so that one or more of processing Device realizes the code test method described in any embodiment of the present invention.
Fourth aspect, the embodiment of the invention also discloses a kind of computer-readable recording medium, is stored thereon with computer Program, realizes the code test method described in any embodiment of the present invention when the program is executed by processor.
The technical scheme of the embodiment of the present invention, by obtaining the change code in the code to be tested after coding, Yi Jiyu There is the association code of call relation in change code, code tester is carried out based on change code and association code, relative to existing There is demand point of the technology only to this version to write the method that test case is tested, can preferably assess after code change Coverage, test coverage is more complete, moreover, the influence model that the technical program, which is not dependency need side and developer, to be provided Enclose, it is ensured that the test result quality of code tester output, while above-mentioned technical proposal allows test job to have accurate target, phase Global function regression test is contrasted, while quality is ensured, additionally it is possible to significantly lift testing efficiency.
Brief description of the drawings
In order to clearly illustrate the technical scheme of exemplary embodiment of the present, below to needed for description embodiment The accompanying drawing to be used does a simple introduction.Obviously, the accompanying drawing introduced is a part of embodiment of the invention to be described Accompanying drawing, rather than whole accompanying drawings, for those of ordinary skill in the art, on the premise of not paying creative work, may be used also To obtain other accompanying drawings according to these accompanying drawings.
A kind of flow chart for code administration method that Fig. 1 is provided by the embodiment of the present invention one;
A kind of flow chart for code administration method that Fig. 2A is provided by the embodiment of the present invention two;
A kind of flow chart for code administration method example that Fig. 2 B are applicable by the embodiment of the present invention two;
A kind of structured flowchart for code administration device that Fig. 3 is provided by the embodiment of the present invention three;
A kind of structural representation for terminal that Fig. 4 is provided by the embodiment of the present invention four.
Embodiment
Further illustrate technical scheme below in conjunction with the accompanying drawings and by embodiment.It may be appreciated It is that specific embodiment described herein is used only for explaining the present invention, rather than limitation of the invention.Further need exist for explanation , for the ease of description, part related to the present invention rather than entire infrastructure are illustrate only in accompanying drawing.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail The processing described as flow chart or method.Although each step is described as the processing of order, many of which by flow chart Step can be implemented concurrently, concomitantly or simultaneously.In addition, the order of each step can be rearranged.When its operation The processing can be terminated during completion, it is also possible to the additional step being not included in accompanying drawing.The processing can be with Corresponding to method, function, code, subroutine, subprogram etc..
Embodiment one
A kind of flow chart for code test method that Fig. 1 is provided by the embodiment of the present invention one.The method of the present embodiment can To be performed by code administration device, the device can be realized by way of hardware and/or software, and typically can by server and Terminal coordinates the method for realizing the present embodiment.
The method of the present embodiment is specifically included:
S110, the change code obtained in the code to be tested after coding.
Wherein, the code that the code and property parameters that change code is changed including method logic are changed.Specifically Can be that the code to be tested after coding is compared with code before coding to obtain change code.Will be to be measured after coding Examination code is compared with code before coding can a variety of modes, and diff is ordered such as artificial mark or using file contrast Deng.
, can be using change code statistical tool to treating after coding in order to lift the accuracy rate of comparison efficiency and comparison result Test code is compared with code before coding.It is understood that the code based on different language or environment exploitation may be used also To carry out the comparison of code to be tested and code before coding using the change code statistical tool with code matches.
S120, code to be tested is indexed, obtains the association code that there is call relation with the change code.
In relational database, index is a kind of storage knot being ranked up to the value of one or more columns per page in database table In structure, including some table in a row, two row or the set of many train values and corresponding Compass physical label these values data The logical pointer inventory of page.Index provides the pointer for pointing to the data value being stored in the specified row of table, and then basis is specified Clooating sequence sorts to these pointers.Database, to find particular value, then finds the row comprising the value using index along pointer. It the SQL SQL statement corresponding to table is performed faster, can quickly access the spy in database table Determine information.The catalogue for functioning as books of index, the page number that can be in catalogue is quickly found out required content.
It is understood that before being indexed to code to be tested, in addition to:Rope is set up in Database Systems Draw.Wherein Database Systems are used to store code to be tested.The type indexed in the present embodiment can include simple index, unique Index, major key index and aggregat ion pheromones etc..The uniqueness that index ensure that data record is set up in Database Systems, is realized Referential integrity between table and table, can reduce the time of sequence and packet, quickly take when being indexed to code to be tested Data.
For the ease of understanding the logical relation between data and data, it can obtain and become by building code dependent tree There is the association code of call relation in more code.For example can be specifically to call pass between the code to be detected based on whole System builds full code dependent tree, so inquire about full code dependent tree with obtain with change that code has a call relation associate generation Code;It can also be according to the call relation between remaining code in change code and code to be detected, set up change code and rely on Tree, wherein, change code dependent tree includes change code and there is the association code of call relation with change code.
S130, to it is described change code and the association code carry out code tester, and export with it is described change code and The corresponding test result of the association code, to confirm whether the change code is related to the execution of the association code.
Specifically, code tester is carried out to change code and association code, can be made with changing code and association code For test scope, the test access in change code and association code is then obtained, and then code is proceeded by by test access Test.For the ease of being tested, test plan can be further generated, code tester is carried out according to test plan.Such energy It is enough effectively to carry out comprehensive coverage assessment, and can have the emphasis regression test of target according to test plan progress.
Exemplarily, output test result corresponding with change code and association code, to confirm change code with associating Whether the execution of code is related, can be specifically, when changing code and association code is respectively used to realize different functions, if Output with change code and the corresponding test result of association code, correspond respectively to change code and association code realized Function, then can confirm that change code is uncorrelated to the execution of association code, code is changed in other words and is independent of each other with association code; If output with returning to mistake in change code and the corresponding test result of association code, or response function and target requirement It is inconsistent that function changes desired function after code in other words, such as, and one or more than one function can not be realized, then Confirm that change code is related to the execution of association code, the execution of the execution influence association code of change code, or association generation The execution of the execution influence change code of code.
Based on output test result corresponding with change code and association code, it can also contrast after current change code Functional requirement, judge whether unwanted related influence, if can be then modified in time to code, advise ahead of time Keep away the appearance of bug.
The technical scheme of the present embodiment, by obtain coding after code to be tested in change code, and with change There is the association code of call relation in code, code tester is carried out based on change code and association code, relative to existing skill Art only writes the method that test case is tested to the demand point of this version, can preferably assess the influence after code change Scope, test coverage is more complete, moreover, the technical program is not the coverage that dependency need side and developer provide, The test result quality of code tester output is ensure that, while above-mentioned technical proposal allows test job to have accurate target, relatively Than global function regression test, while quality is ensured, additionally it is possible to significantly lift testing efficiency.
Embodiment two
The flow chart for the code administration method that Fig. 2A is provided by the embodiment of the present invention two, as shown in Figure 2 A, the present embodiment It is alternatively, described that code tester is carried out according to the change code and the association code on the basis of the various embodiments described above Including:In the association code and the change code, code is called as test access in the source for obtaining the change code; Test plan is generated based on the test access, code detection is carried out according to the test plan.
On the basis of above-mentioned technical proposal, further, there is call relation in the acquisition with the change code Association code specifically may include:The full code dependent tree built according to the call relation between the code to be tested;Described Inquired about in full code dependent tree, obtain the association code that there is call relation with the change code.
In order to quickly and easily obtain change code, alternatively, the change in the code to be tested obtained after coding Code includes:The code to be tested after coding is compared with code before coding based on file contrast order, tied according to comparing Fruit obtains change code;Wherein, the code and property parameters that the change code is changed including method logic are changed Code.
Specifically, the method for the present embodiment includes:
S210, based on file contrast order the code to be tested after coding is compared with the preceding code of coding, according to than Change code is obtained to result.
The code to be tested after coding is compared with the preceding code of coding based on file contrast order, i.e., code is before changing The code of latter two version is compared, and finds out the code line of redaction change, and method logic alternative and attribute are further included wherein becoming Parameter modification.Accordingly, the code that the code and property parameters that change code is changed including method logic are changed.Tool Body, order diff orders can be contrasted using file to compare the text and coding former generation of the code to be tested after coding The text of code, the difference of both display outputs in comparison result, to obtain change code.
Wherein, when the code to be tested after being encoded using diff orders is compared with code before coding, its comparison result The form of display may include at least one of following:Normal format (normal diff), context format (context Diff form (unified diff)), is merged, specific form can be configured according to the actual requirements, not limited herein.
S220, code to be tested is indexed, the full generation built according to the call relation between the code to be tested Code dependent tree.
Wherein, full code dependent tree can be understood as including in all codes to be tested and whole codes to be tested each section The dependent tree of mutual call relation between code.In other words, full code dependent tree includes the dependence between each section of code. Usually, if A object will complete a certain operation, it is necessary to helped, could completed using some operations of B object.Letter Yan Zhi, B exist as the method parameter of A some method.Now it is properly termed as class A and relies on class B.It is understood that in the presence of Often produce and influence each other between each section of code of dependence.Therefore, the full code dependent tree based on structure can be quickly square Just the association code of each section of code is found out, in other words, finds out with being easy to and there may be interactional each section of code.
S230, inquired about in the full code dependent tree, obtain the pass that there is call relation with the change code Join code.
Exemplarily, can the first inquiry change code in full code dependent tree, and then obtain each upper strata of change code Rely on code and each lower floor relies on code, be used as the association code that there is call relation with change code.It should be noted that closing Connection code not only includes the code for having the relation of directly relying on change code, in addition to indirectly relies on relation with change code Code.
Specifically, it can be the inquiry change code in complete code dependent tree;And then obtain the upper strata dependence of change code Code and lower floor rely on code;Rely on code and change the lower floor of code to change the upper strata of code and rely on code as current Code is changed, the upper strata that change code is obtained respectively relies on the upper strata dependence code of code, and the lower floor of change code relies on The lower floor of code relies on code, by that analogy, travels through full code dependent tree, there is call relation with change code until getting Whole association codes untill.
S240, in the association code and the change code, obtain it is described change code source call code conduct Test access.
As described above, there is the relation called and be called between association code and change code, therefore can be according to association Call relation before code and change code, in association code and change code, code is called in the source for obtaining change code, Source is called code proceed by code tester as the test access of code tester, and then from test access.
Specifically, the change code got is inquired about based on the full code dependent tree built in index information Or retrieval, all association codes for having relied on change code are found out, and source is up traced back to along full code dependent tree and are adjusted With source calls corresponding source to call code to be exactly impacted functional entrance, i.e. test access.
S250, based on the test access generate test plan, according to the test plan carry out code detection.
Wherein, test plan may include test access and test scope, and test plan can also include method of testing, survey Trial work section, test main points and testing tool etc..
Exemplarily, included based on test access generation test plan:According to the change code and the association code Generating the code in code tester planning documentation, the code tester planning documentation is used to represent test scope;Surveyed based on described Try entrance and code tester planning documentation generation test plan.Wherein, code tester planning documentation can effectively, comprehensively Ground covers the coverage that code is changed in code to be tested.According to obtained impacted functional entrance and code tester meter Document structure tree test plan is drawn, can understand to accurately determine out needs the part of emphasis regression test in code to be tested.
S260, output test result corresponding with the change code and the association code, to confirm the change generation Whether code is related to the execution of the association code.
The technical scheme of the present embodiment, not only with the same beneficial effect of above-mentioned technical proposal, and passes through file pair Acquisition change code is compared in the code to be tested after coding and code before coding than ordering, i.e., line code is entered using instrument Compare, it is more more accurate than the artificial judgement of original dependence developer, the artificial change code caused by can be prevented effectively from and lost The problems such as leakage, and the change outside being expected can be accurately compared out, be conducive to repair procedure leak in advance;And by building Full code dependent tree, can preferably embody the dependence between code, conveniently and efficiently inquire with change code deposit In the association code and acquisition test access of call relation, while being given birth to according to test access and by change code and association code The test plan generated into code tester planning documentation, reminds tester to do emphasis regression test to these functions, is protecting While demonstrate,proving test quality, testing efficiency is significantly lifted.
Fig. 2 B are a kind of example flow chart of code test method used in the present embodiment, as shown in Figure 2 B, first, are adopted Code comparison (diff) is carried out with instrument, determines whether that code is changed according to result of the comparison.Line code is entered using instrument Diff is more accurate than the original dependence artificial judgement of developer.It can so avoid as the test caused by human factor Point omit the problems such as, can accurately diff go out expection outside change so that patching bugs in advance.
If display has code change in code diff result, change code is obtained, and can be by being carried out to code Index (similar IDE IDE instruments conventional at present), the adjustment for the relation that is called and is called to code.Specifically Ground, can be that code to be tested is indexed, and find out the call relation between each section of code in code to be tested, construct complete Code dependent tree, and then inquiry obtains changing the dependent tree of code from full code dependent tree;Can also be by entering to code The upper strata of line index, some method that quick-searching code is realized or some attribute of code is relied on, construction code according to Lai Shu.It is indexed it should be noted that change code can be based only on, finds out to exist to call and be called with change code and close The association code of system, builds the dependent tree of change code.And then, it can be believed according to the change code got in the index built Retrieved in breath, find out all places for relying on change code, and along the constructed dependent tree for changing code up Trace back to source to call, it is exactly impacted functional entrance that these sources, which are called, that is, carry out the test access of code tester.
The change code and association code that method described above is obtained generate code tester planning documentation as coverage, And according to obtained impacted functional entrance and code tester planning documentation, test plan is generated, tester is reminded to this A little functions do emphasis regression test, and the test plan of generation can turn into the strength means of tester, rather than rely on The coverage that party in request and developer provide, so as to ensure that the quality for testing this link.Moreover, test plan allows survey Trial work makees have accurate target, the global function that compares regression test, while quality is ensured, significantly lifts testing efficiency.
Finally, output and change code and the corresponding test result of association code, available for confirm the change code and Whether the execution of the association code is related, and by contrasting the demand that current code is changed, can further determine whether exist Unwanted related influence, if can then enter line code amendment in time, evades code vulnerabilities ahead of time.
Embodiment three
Fig. 3 show a kind of structured flowchart of code tester device of the offer of the embodiment of the present invention three, and the device can pass through The mode of hardware and/or software is realized, and the method that typically the present embodiment can be realized with terminal and server.Such as Fig. 3 institutes Show, the code tester device of the present embodiment specifically may include:Change Code obtaining module 310, the and of association code acquisition module 320 Test result output module 330.
Wherein, change Code obtaining module 310, for obtaining the change code in the code to be tested after coding;Association Code obtaining module 320, for being indexed to code to be tested, obtains and there is associating for call relation with the change code Code;Test result output module 330, for carrying out code tester to the change code and the association code, and is exported Test result corresponding with the change code and the association code, to confirm the change code and the association code Whether related perform.
The technical scheme of the present embodiment, by obtain coding after code to be tested in change code, and with change There is the association code of call relation in code, code tester is carried out based on change code and association code, relative to existing skill Art only writes the method that test case is tested to the demand point of this version, can preferably assess the influence after code change Scope, test coverage is more complete, moreover, the technical program is not the coverage that dependency need side and developer provide, The test result quality of code tester output is ensure that, while above-mentioned technical proposal allows test job to have accurate target, relatively Than global function regression test, while quality is ensured, additionally it is possible to significantly lift testing efficiency.
On the basis of above-mentioned technical proposal, the test result output module may include:Test access acquiring unit and Code detection unit.
Wherein, test access acquiring unit, in the association code and the change code, obtaining the change Code is called as test access in the source of code;Code detection unit, for generating test plan, root based on the test access Code detection is carried out according to the test plan.
On the basis of above-mentioned each technical scheme, the association code acquisition module can be used for:
The full code dependent tree built according to the call relation between the code to be tested;
Inquired about in the full code dependent tree, obtain with it is described change that code has a call relation associate generation Code.
On the basis of above-mentioned each technical scheme, the change Code obtaining module is particularly used in:
The code to be tested after coding is compared with code before coding based on file contrast order, according to comparison result Obtain change code;Wherein, what the code and property parameters that the change code is changed including method logic were changed Code.
On the basis of above-mentioned each technical scheme, the code detection unit is particularly used in:
According to the change code and association code generation code tester planning documentation, the code tester plan text Code in shelves is used to represent test scope;
Based on the test access and code tester planning documentation generation test plan.
Said apparatus can perform the method that the embodiment of the present invention one and embodiment two are provided, and possess execution above method phase The functional module and beneficial effect answered.Not ins and outs of detailed description in the present embodiment, reference can be made to the embodiment of the present invention one The method provided with embodiment two.
Example IV
Fig. 4 is a kind of structural representation for terminal that the embodiment of the present invention four is provided.Fig. 4 is shown suitable for being used for realizing this The block diagram of the exemplary terminal 412 of invention embodiment.The terminal 412 that Fig. 4 is shown is only an example, should not be to the present invention The function of embodiment and use range band come any limitation.
As shown in figure 4, terminal 412 is showed in the form of universal computing device.The component of terminal 412 can include but not limit In:One or more processor or processor 416, storage device 428, for storing one or more programs, connection is not The bus 418 of homologous ray component (including storage device 428 and processor 416).When one or more programs are one or more Processor 416 is performed so that one or more processors 416 can realize the code tester side described in any embodiment of the present invention Method.
Bus 418 represents the one or more in a few class bus structures, including memory bus or Memory Controller, Peripheral bus, graphics acceleration port, processor or the local bus using any bus structures in a variety of bus structures.Lift For example, these architectures include but is not limited to industry standard architecture (ISA) bus, MCA (MAC) Bus, enhanced isa bus, VESA's (VESA) local bus and periphery component interconnection (PCI) bus.
Terminal 412 typically comprises various computing systems computer-readable recording medium.These media can be it is any can be by terminal 412 usable mediums accessed, including volatibility and non-volatile media, moveable and immovable medium.
Storage device 428 can include the computer system readable media of form of volatile memory, such as arbitrary access Memory (RAM) 430 and/or cache memory 432.Terminal 412 may further include other removable/nonremovable , volatile/non-volatile computer system storage medium.Only as an example, storage system 434 can be used for read-write it is not removable Dynamic, non-volatile magnetic media (Fig. 4 do not show, commonly referred to as " hard disk drive ").Although not shown in Fig. 4, can provide For the disc driver to may move non-volatile magnetic disk (such as " floppy disk ") read-write, and to may move anonvolatile optical disk The CD drive of (such as CD-ROM, DVD-ROM or other optical mediums) read-write.In these cases, each driver can To be connected by one or more data media interfaces with bus 418.Memory 428 can include the production of at least one program Product, the program product has one group of (for example, at least one) program module, and these program modules are configured to perform of the invention each The function of embodiment.
Program/utility 440 with one group of (at least one) program module 442, can be stored in such as memory In 428, such program module 442 includes but is not limited to operating system, one or more application program, other program modules And routine data, the realization of network environment is potentially included in each or certain combination in these examples.Program module 442 Generally perform the function and/or method in embodiment described in the invention.
Terminal 412 can also be logical with one or more external equipments 414 (such as keyboard, sensing equipment, display 424) Letter, can also enable a user to the equipment communication interacted with the terminal 412 with one or more, and/or with causing the terminal 412 Any equipment (such as network interface card, modem etc.) communication that can be communicated with one or more of the other computing device.This Planting communication can be carried out by input/output (I/O) interface 422.Also, terminal 412 can also by network adapter 420 with One or more network (such as LAN (LAN), wide area network (WAN) and/or public network, such as internet) communicates.Such as Shown in figure, network adapter 420 is communicated by bus 418 with other modules of terminal 412.Although it should be understood that not showing in figure Go out, terminal 412 can be combined and use other hardware and/or software module, included but is not limited to:It is microcode, device driver, superfluous Remaining processor, external disk drive array, RAID system, tape drive and data backup storage system etc..
Processor 416 is stored in the program in storage device 428 by operation, so as to perform various function application and number According to processing, for example, realize the code test method that the embodiment of the present invention is provided.
In addition, the embodiment of the present invention, which additionally provides one kind, includes computer-readable recording medium, computer is stored thereon with Program, is used to perform a kind of code test method, this method includes when the program is executed by processor:
Obtain the change code in the code to be tested after coding;
Code to be tested is indexed, the association code that there is call relation with the change code is obtained;
Code tester is carried out to the change code and the association code, and is exported and the change code and the pass Join the corresponding test result of code, to confirm whether the change code is related to the execution of the association code.Optionally, should Computer executable instructions can be also used for performing what any embodiment of the present invention was provided when being performed by computer processor The technical scheme of code test method.
Represent in flow charts or logic and/or step described otherwise above herein, for example, being considered use In the order list for the executable instruction for realizing logic function, it may be embodied in any computer-readable recording medium, For instruction execution system, device or equipment (such as computer based system including the system of processor or other can be from finger The system for making execution system, device or equipment instruction fetch and execute instruction) use, or combine these instruction execution systems, device Or equipment and use.For the purpose of this specification, " computer-readable recording medium " can be it is any can include, store, communicating, Propagate or transmission procedure is for instruction execution system, device or equipment or with reference to these instruction execution systems, device or equipment The device used.
The more specifically example (non-exhaustive list) of computer-readable recording medium includes following:With one or more The electrical connection section (electronic installation) of wiring, portable computer diskette box (magnetic device), random access memory (RAM) is read-only to deposit Reservoir (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device, and portable optic disk are only Read memory (CDROM).In addition, computer-readable recording medium can even is that can thereon printing described program paper or its His suitable medium, because can then enter edlin, interpretation or must for example by carrying out optical scanner to paper or other media Handled electronically to obtain described program with other suitable methods when wanting, be then stored in computer storage In.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.Above-mentioned In embodiment, the software that multiple steps or method can in memory and by suitable instruction execution system be performed with storage Or firmware is realized.If, and in another embodiment, can be with well known in the art for example, realized with hardware Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal Discrete logic, the application specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene Programmable gate array (FPGA) etc..
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means to combine specific features, structure, material or the spy that the embodiment or example are described Point is contained at least one embodiment of the present invention or example.In this manual, to the schematic representation of above-mentioned term not Necessarily refer to identical embodiment or example.Moreover, specific features, structure, material or the feature of description can be any One or more embodiments or example in combine in an appropriate manner.
Note, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art it is various it is obvious change, Readjust and substitute without departing from protection scope of the present invention.Therefore, although the present invention is carried out by above example It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also Other more equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.

Claims (12)

1. a kind of code test method, it is characterised in that including:
Obtain the change code in the code to be tested after coding;
Code to be tested is indexed, the association code that there is call relation with the change code is obtained;
Code tester is carried out to the change code and the association code, and is exported and the change code and the association generation The corresponding test result of code, to confirm whether the change code is related to the execution of the association code.
2. according to the method described in claim 1, it is characterised in that described to be entered according to the change code and the association code Line code test includes:
In the association code and the change code, code is called as test access in the source for obtaining the change code;
Test plan is generated based on the test access, code detection is carried out according to the test plan.
3. method according to claim 1 or 2, it is characterised in that the acquisition exists with the change code calls pass The association code of system includes:
The full code dependent tree built according to the call relation between the code to be tested;
Inquired about in the full code dependent tree, obtain the association code that there is call relation with the change code.
4. method according to claim 1 or 2, it is characterised in that the change in code to be tested after the acquisition coding More code includes:
The code to be tested after coding is compared with code before coding based on file contrast order, obtained according to comparison result Change code;Wherein, the code that the code and property parameters that the change code is changed including method logic are changed.
5. method according to claim 2, it is characterised in that described that test plan bag is generated based on the test access Include:
Generated according to the change code and the association code in code tester planning documentation, the code tester planning documentation Code be used for represent test scope;
Based on the test access and code tester planning documentation generation test plan.
6. a kind of code tester device, it is characterised in that including:
Code obtaining module is changed, for obtaining the change code in the code to be tested after coding;
Association code acquisition module, for being indexed to code to be tested, obtains and there is call relation with the change code Association code;
Test result output module, for carrying out code tester to the change code and the association code, and is exported and institute Change code and the corresponding test result of the association code are stated, to confirm the change code and the execution of the association code It is whether related.
7. device according to claim 6, it is characterised in that the test result output module is used for:
Test access acquiring unit, the source in the association code and the change code, obtaining the change code Code is called as test access;
Code detection unit, for generating test plan based on the test access, line code inspection is entered according to the test plan Survey.
8. the device according to claim 6 or 7, it is characterised in that the association code acquisition module is used for:
The full code dependent tree built according to the call relation between the code to be tested;
Inquired about in the full code dependent tree, obtain the association code that there is call relation with the change code.
9. the device according to claim 6 or 7, it is characterised in that the change Code obtaining module is particularly used in:
The code to be tested after coding is compared with code before coding based on file contrast order, obtained according to comparison result Change code;Wherein, the code that the code and property parameters that the change code is changed including method logic are changed.
10. device according to claim 7, it is characterised in that the code detection unit is particularly used in:
Generated according to the change code and the association code in code tester planning documentation, the code tester planning documentation Code be used for represent test scope;
Based on the test access and code tester planning documentation generation test plan.
11. a kind of terminal, it is characterised in that the terminal includes:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are by one or more of computing devices so that one or more of processors are real The existing code test method as described in any in claim 1-5.
12. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the program is by processor The code test method as described in any in claim 1-5 is realized during execution.
CN201710256843.1A 2017-04-19 2017-04-19 code testing method, device, terminal and storage medium Pending CN107085555A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710256843.1A CN107085555A (en) 2017-04-19 2017-04-19 code testing method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710256843.1A CN107085555A (en) 2017-04-19 2017-04-19 code testing method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN107085555A true CN107085555A (en) 2017-08-22

Family

ID=59612873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710256843.1A Pending CN107085555A (en) 2017-04-19 2017-04-19 code testing method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN107085555A (en)

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228965A (en) * 2017-12-06 2018-06-29 北京物芯科技有限责任公司 A kind of emulation verification method of storage unit, device and equipment
CN109558315A (en) * 2018-11-14 2019-04-02 泰康保险集团股份有限公司 The determination method, device and equipment of test scope
CN109582575A (en) * 2018-11-27 2019-04-05 网易(杭州)网络有限公司 Game test method and device
CN110147317A (en) * 2019-04-19 2019-08-20 平安普惠企业管理有限公司 Code test method and device, electronic equipment and storage medium
CN110716859A (en) * 2019-08-30 2020-01-21 平安普惠企业管理有限公司 Method for automatically pushing test cases for modified codes and related device
CN110865934A (en) * 2019-10-08 2020-03-06 北京百度网讯科技有限公司 Code verification method, device, electronic device and readable storage medium
CN111026665A (en) * 2019-12-09 2020-04-17 中国建设银行股份有限公司 Test range analysis method, device and equipment
CN111666206A (en) * 2020-04-30 2020-09-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for acquiring influence range of change code
CN112069057A (en) * 2020-08-07 2020-12-11 长沙市到家悠享网络科技有限公司 Code testing method, device, apparatus and storage medium
CN112199276A (en) * 2020-09-24 2021-01-08 建信金融科技有限责任公司 Alteration detection method and device for microservice architecture, server and storage medium
CN112380130A (en) * 2020-11-19 2021-02-19 康键信息技术(深圳)有限公司 Application testing method and device based on call dependency relationship
CN112596738A (en) * 2020-12-28 2021-04-02 北京字跳网络技术有限公司 Method and device for determining front-end page to be tested, storage medium and electronic equipment
CN113190448A (en) * 2021-05-06 2021-07-30 网易(杭州)网络有限公司 Test code updating method and device, electronic equipment and storage medium
CN113704129A (en) * 2021-09-03 2021-11-26 中国农业银行股份有限公司 Regression testing method, device, storage medium and equipment
CN113869789A (en) * 2021-10-19 2021-12-31 中国平安人寿保险股份有限公司 Risk monitoring method and device, computer equipment and storage medium
CN114090452A (en) * 2021-11-25 2022-02-25 合芯科技(苏州)有限公司 Version update test method, device, equipment and storage medium
CN114328254A (en) * 2021-12-30 2022-04-12 北京百度网讯科技有限公司 Method and device for testing system code, electronic equipment and storage medium
CN115269422A (en) * 2022-08-03 2022-11-01 中国银行股份有限公司 Method, device, equipment and medium for determining test range
WO2023273164A1 (en) * 2021-06-30 2023-01-05 中兴通讯股份有限公司 Code integrated verification method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7614042B1 (en) * 2005-01-21 2009-11-03 Microsoft Corporation System and method for selecting applicable tests in an automation testing system
US20110078651A1 (en) * 2009-09-28 2011-03-31 Cadence Design Systems, Inc. Method and system for test reduction and analysis
CN103699488A (en) * 2013-12-30 2014-04-02 优视科技有限公司 Call relation dependence graph based regression testing method and system
CN103870384A (en) * 2012-12-11 2014-06-18 航天信息股份有限公司 Test case presumption method and system
US20140181767A1 (en) * 2012-12-20 2014-06-26 Erez Kohavi Method, apparatus, and system for efficient pre-silicon debug
CN105183658A (en) * 2015-10-12 2015-12-23 用友网络科技股份有限公司 Software code testing method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7614042B1 (en) * 2005-01-21 2009-11-03 Microsoft Corporation System and method for selecting applicable tests in an automation testing system
US20110078651A1 (en) * 2009-09-28 2011-03-31 Cadence Design Systems, Inc. Method and system for test reduction and analysis
CN103870384A (en) * 2012-12-11 2014-06-18 航天信息股份有限公司 Test case presumption method and system
US20140181767A1 (en) * 2012-12-20 2014-06-26 Erez Kohavi Method, apparatus, and system for efficient pre-silicon debug
CN103699488A (en) * 2013-12-30 2014-04-02 优视科技有限公司 Call relation dependence graph based regression testing method and system
CN105183658A (en) * 2015-10-12 2015-12-23 用友网络科技股份有限公司 Software code testing method and device

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228965A (en) * 2017-12-06 2018-06-29 北京物芯科技有限责任公司 A kind of emulation verification method of storage unit, device and equipment
CN109558315A (en) * 2018-11-14 2019-04-02 泰康保险集团股份有限公司 The determination method, device and equipment of test scope
CN109558315B (en) * 2018-11-14 2022-02-15 泰康保险集团股份有限公司 Method, device and equipment for determining test range
CN109582575A (en) * 2018-11-27 2019-04-05 网易(杭州)网络有限公司 Game test method and device
CN109582575B (en) * 2018-11-27 2022-03-22 网易(杭州)网络有限公司 Game testing method and device
CN110147317A (en) * 2019-04-19 2019-08-20 平安普惠企业管理有限公司 Code test method and device, electronic equipment and storage medium
CN110716859A (en) * 2019-08-30 2020-01-21 平安普惠企业管理有限公司 Method for automatically pushing test cases for modified codes and related device
CN110865934B (en) * 2019-10-08 2023-10-27 北京百度网讯科技有限公司 Code verification method, device, electronic equipment and readable storage medium
CN110865934A (en) * 2019-10-08 2020-03-06 北京百度网讯科技有限公司 Code verification method, device, electronic device and readable storage medium
CN111026665A (en) * 2019-12-09 2020-04-17 中国建设银行股份有限公司 Test range analysis method, device and equipment
CN111026665B (en) * 2019-12-09 2023-02-28 建信金融科技有限责任公司 Test range analysis method, device and equipment
CN111666206A (en) * 2020-04-30 2020-09-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for acquiring influence range of change code
CN111666206B (en) * 2020-04-30 2023-12-22 北京百度网讯科技有限公司 Method, device, equipment and storage medium for acquiring influence range of change code
CN112069057A (en) * 2020-08-07 2020-12-11 长沙市到家悠享网络科技有限公司 Code testing method, device, apparatus and storage medium
CN112199276A (en) * 2020-09-24 2021-01-08 建信金融科技有限责任公司 Alteration detection method and device for microservice architecture, server and storage medium
CN112199276B (en) * 2020-09-24 2023-05-30 建信金融科技有限责任公司 Method, device, server and storage medium for detecting change of micro-service architecture
CN112380130A (en) * 2020-11-19 2021-02-19 康键信息技术(深圳)有限公司 Application testing method and device based on call dependency relationship
CN112596738A (en) * 2020-12-28 2021-04-02 北京字跳网络技术有限公司 Method and device for determining front-end page to be tested, storage medium and electronic equipment
CN113190448A (en) * 2021-05-06 2021-07-30 网易(杭州)网络有限公司 Test code updating method and device, electronic equipment and storage medium
WO2023273164A1 (en) * 2021-06-30 2023-01-05 中兴通讯股份有限公司 Code integrated verification method and device
CN113704129A (en) * 2021-09-03 2021-11-26 中国农业银行股份有限公司 Regression testing method, device, storage medium and equipment
CN113869789A (en) * 2021-10-19 2021-12-31 中国平安人寿保险股份有限公司 Risk monitoring method and device, computer equipment and storage medium
CN114090452A (en) * 2021-11-25 2022-02-25 合芯科技(苏州)有限公司 Version update test method, device, equipment and storage medium
CN114328254A (en) * 2021-12-30 2022-04-12 北京百度网讯科技有限公司 Method and device for testing system code, electronic equipment and storage medium
CN115269422A (en) * 2022-08-03 2022-11-01 中国银行股份有限公司 Method, device, equipment and medium for determining test range

Similar Documents

Publication Publication Date Title
CN107085555A (en) code testing method, device, terminal and storage medium
CN104765745B (en) Loading data in database are carried out with the method and system of logic checking
CN107025174A (en) For the method for the user interface abnormality test of equipment, device and readable storage media
CN106104472A (en) Specify logic checking rule and logic checking rule is applied to data
CN109656917A (en) Data detection method, device, equipment and the readable storage medium storing program for executing of multi-data source
US20160110426A1 (en) Selectivity estimation for query execution planning in a database
CN117909355A (en) Database query instruction generation method, device, computer equipment and storage medium
US8769480B1 (en) Integrated environment for developing information exchanges
CN108874665A (en) A kind of test result method of calibration, device, equipment and medium
CN112181962A (en) Report form checking method, device, equipment and storage medium
CN104054051A (en) Manipulating Source Code Patches
WO2019140850A1 (en) Test case recommendation method, electronic apparatus and readable storage medium
US10713150B1 (en) Accurate test coverage of generated code
US20160170860A1 (en) Dependent object delegation tester
CN109446096A (en) A kind of intelligence contract adjustment method, device and its storage medium
CN106095948A (en) The querying method of form, device and equipment
CN109408502A (en) A kind of data standard processing method, device and its storage medium
US10262263B2 (en) Retrieving database score contextual information
US20170132815A1 (en) Visualization of cross-pivoted data
US8510343B2 (en) Cogeneration of database applications and their databases
CN110223761A (en) One kind sketching the contours data lead-in method, device, electronic equipment and storage medium
CN104899371B (en) Survey of Transmission Line method and device
CN108920695B (en) A kind of data query method, apparatus, equipment and storage medium
CN115201925A (en) Two-dimensional spectrum identification method, device, equipment and medium based on nuclear magnetic resonance
Beedkar et al. Apache Wayang in Action: Enabling Data Systems Integration via a Unified Data Analytics Framework

Legal Events

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

Application publication date: 20170822