CN106528399A - Test case determination method and apparatus - Google Patents
Test case determination method and apparatus Download PDFInfo
- Publication number
- CN106528399A CN106528399A CN201510587411.XA CN201510587411A CN106528399A CN 106528399 A CN106528399 A CN 106528399A CN 201510587411 A CN201510587411 A CN 201510587411A CN 106528399 A CN106528399 A CN 106528399A
- Authority
- CN
- China
- Prior art keywords
- code
- function
- target software
- test case
- edition
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a test case determination method and apparatus. The method comprises the steps of performing differential comparison on codes of two versions in response to a comparison request of target software of the first and second versions, and determining modified codes in the target software of the second version; determining target functions involved by the modified codes; and determining test cases corresponding to the target functions, wherein the test cases are used for testing the target software of the second version. The target software of the first version is tested target software; the modified codes in the second version relative to the first version are obtained through comparison; the functions involved by the modified codes and the test cases corresponding to the functions are determined; the test cases are used for testing the target software of the second version; and compared with a function of modifying the target software of the first version, test cases corresponding to other same code parts do not need to be tested again, so that the test efficiency is improved.
Description
Technical field
The application is related to software testing technology field, more particularly, it relates to a kind of test case determination side
Method and device.
Background technology
In software development process, for the software of a certain version for completing, need by technical staff
Software function is tested, this process can use test case.Test case is considered as one group of bar
Part or variable, tester determine according to test case whether software correctly works.A software of correspondence and
Speech, how many according to the function of software, test case can have multiple, and citing is such as, soft for a download
Part, its function include normal download, suspend, download after the completion of install automatically, continuous download.In order to survey
Try whether this software correctly works, at least need at least one test case to be respectively provided with to each function,
For testing whether corresponding function correctly can be realized.
For with a software, multiple versions may be submitted in software development process.Prior art is every
When submitting a redaction to, full dose test case covering is carried out to the software of the version, then according to test
As a result determine whether each function of software is normally realized.
As new version software only may be transformed to some functions of legacy version software, big portion between the two
Divide function still identical, therefore prior art carries out full dose test case covering to each new version software
There is partial test use-case retest in scheme, increased the testing time.
The content of the invention
In view of this, it is this application provides a kind of test case determines method and device, existing for solving
The partial test use-case weight method of full dose test case covering existing for is carried out to each new version software
Repetition measurement examination, the problem for increasing the testing time.
To achieve these goals, it is proposed that scheme it is as follows:
A kind of test case determines method, including:
The contrast request of the first and second two versions of response target software, to the first and second two versions
The code of this target software carries out differentiation comparison, determines the change code in second edition target software,
Wherein first version target software is the target software for having completed to test, and second edition target software is
Target software to be tested;
Determine the object function changed involved by code, wherein described object function includes changing code
Contained function, and possess the function of call relation with the function changed contained by code;
Determine the test case corresponding to the object function.
A kind of test case determining device, including:
Differentiation comparing unit, for responding the contrast request of the first and second two versions of target software,
Differentiation comparison is carried out to the code of the target software of the first and second two versions, second edition mesh is determined
Change code in mark software, wherein first version target software are the target software for having completed to test,
Second edition target software is target software to be tested;
Function determining unit, for determining the object function changed involved by code, wherein described mesh
Scalar functions include changing the function contained by code, and possess and call with the function changed contained by code
The function of relation;
Function corresponding unit, for determining the test case corresponding to the object function.
It can be seen from above-mentioned technical scheme that, the test case that the embodiment of the present application is provided determines method,
When the contrast of the target software of the first and second two versions of response is asked, the code of two versions is entered
Row differentiation compares, and determines the change code in second edition target software, further determines that change generation
Code involved by object function, here object function include change code contained by function and with change
Function contained by code possesses the function of call relation, finally determines the test corresponding to object function
Use-case, this partial test use-case is for testing to the target software of the second edition.Due to first version
Target software is the target software for having completed to test, and which had tested each function, and the application is led to
Cross contrast and draw code of the second edition compared to first version transfer portion, and determine transfer portion generation
Function and test case corresponding with the function involved by code, can test using these test cases
The function that second edition target software is changed compared to first version target software, remaining same code part
Corresponding test case is improve testing efficiency without the need for testing again so as to reduce the testing time.
Description of the drawings
In order to be illustrated more clearly that the embodiment of the present application or technical scheme of the prior art, below will be to reality
Apply accompanying drawing to be used needed for example or description of the prior art to be briefly described, it should be apparent that, below
Accompanying drawing in description is only embodiments herein, for those of ordinary skill in the art, not
On the premise of paying creative work, can be with according to the other accompanying drawings of accompanying drawing acquisition for providing.
Fig. 1 determines method flow diagram for a kind of test case disclosed in the embodiment of the present application;
Fig. 2 is that another kind of test case determines method flow diagram disclosed in the embodiment of the present application;
Fig. 3 is that disclosed another test case of the embodiment of the present application determines method flow diagram;
Fig. 4 is that disclosed another test case of the embodiment of the present application determines method flow diagram;
A kind of code coverage views of the Fig. 5 for the embodiment of the present application example;
Fig. 6 is a kind of test case determining device structural representation disclosed in the embodiment of the present application;
Fig. 7 is a kind of function determining unit structural representation disclosed in the embodiment of the present application;
Fig. 8 is a kind of code analysis cellular construction schematic diagram disclosed in the embodiment of the present application;
Fig. 9 answers cellular construction schematic diagram for a kind of function pair disclosed in the embodiment of the present application;
Figure 10 is another kind of test case determining device structural representation disclosed in the embodiment of the present application;
Figure 11 is a kind of server hardware structural representation disclosed in the embodiment of the present application.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, the technical scheme in the embodiment of the present application is carried out
Clearly and completely describe, it is clear that described embodiment is only some embodiments of the present application, and
It is not all, of embodiment.Based on the embodiment in the application, those of ordinary skill in the art are not doing
The every other embodiment obtained under the premise of going out creative work, belongs to the scope of the application protection.
Referring to Fig. 1, Fig. 1 determines method flow diagram for a kind of test case disclosed in the embodiment of the present application.
As described in Figure 1, the method includes:
The contrast request of step S100, the first and second two versions of response target software, to the first He
The code of the target software of the second two versions carries out differentiation comparison, in determining second edition target software
Change code;
Wherein, first version target software be completed test target software, second edition target
Software is target software to be tested.Target software is the software for waiting for testing.
General, the complete software of User Exploitation is submitted in SVN systems, and SVN is the letter of Subversion
Claim, be the version control system of an open source code.The target software of different editions is in SVN systems
There are different version numbers.User can determine to be contrasted two version by way of being input into version number
This target software.
Optionally, the executive agent of the application method can be server, respond target software by server
Two different editions contrast request, and perform subsequent action.
Further to the contrast request of the first and second two versions of target software, which can be user
Initiate, such as user is input into contrast solicited message in the server, and contrast solicited message can be included will
The target software for being contrasted, and Liang Ge version numbers to be contrasted.
Step S110, determine it is described change code involved by object function;
Wherein, the object function includes changing the function that contains of code, and with change contained by code
Function possess the function of call relation.
For a software, its code can include multiple class files, again can be with each class file
Including multiple functions (being properly termed as method) again.Can possess call relation between which part function,
Such as A function call B functions, B function call C functions, C function call D functions.Then for tetra- letters of A-D
For number, its call relation each other, for example possess call relation with A functions has B functions, C function and D
Function.
By determining the object function involved by change code, it may be determined that go out the code institute shadow of transfer portion
Loud function, this partial function are object function.
Step S120, determine test case corresponding to the object function.
Due to representated by program in machine code being several functions, function can realize some functions, such as A
Function can realize transferred account service etc., therefore possess certain corresponding relation between function and function.And survey
Example on probation is exactly directed to function and writes, and for One function, writes one or more test cases.
Therefore, also possesses corresponding relation between function and test case.So, according to the two corresponding relations,
Can determine that the test case corresponding to object function.This partial test use-case is for the second edition
Target software carries out test use.
The test case that the embodiment of the present application is provided determines method, in the first and second two versions of response
When the contrast of target software is asked, differentiation comparison is carried out to the code of two versions, the second edition is determined
Change code in this target software, further determines that the object function changed involved by code, here mesh
Scalar functions include the function changed contained by code and possess with the function changed contained by code calling pass
The function of system, finally determines the test case corresponding to object function, and it is right that this partial test use-case is used for
The target software of the second edition is tested.As first version target software is to have completed test
Target software, which had tested each function, and the application draws the second edition compared to the by contrast
The code of one revision part, and determine the function involved by transfer portion code and with the function
Corresponding test case, can test second edition target software compared to first using these test cases
The function of versioned object software alteration, as the test case corresponding to remaining same code part, its
Test had been carried out in first edition target software, therefore in the test process of second edition target software,
This partial test use-case is improve testing efficiency without the need for testing again so as to reduce the testing time.
Optionally, the code that developer writes all is the form of a line a line, therefore it is determined that changing generation
During code, can be determining in the form of changing line code.Certainly, in addition to this mode, may be used also
With in the form of the code block that the code field in row or a few line codes are constituted.For Unify legislation,
Hereafter only illustrated in the form of changing line code.
In another embodiment of the application, describe another kind of test case and determine method.Referring to Fig. 2,
Fig. 2 is that another kind of test case determines method flow diagram disclosed in the embodiment of the present application.
As shown in Fig. 2 the method includes:
The contrast request of step S200, the first and second two versions of response target software, to the first He
The code of the target software of the second two versions carries out differentiation comparison, in determining second edition target software
Change code;
Wherein, first version target software be completed test target software, second edition target
Software is target software to be tested.Target software is the software for waiting for testing.
Step S210, the code to second edition target software are analyzed, and obtain contained by each line code
Function and each function between call relation;
When being analyzed to code, it is possible to use morphological analysis and parsing method carry out code analysis,
The function included by each line code can be obtained by morphology, syntactic analysiss.Further again by static point
The calling figure analytic function of analysis instrument androguard, is carried out to the code of the second edition target software
Analysis, obtains the call relation between function.
Step S220, the function with reference to contained by each line code and the call relation between each function,
It is determined that changing the object function involved by line code;
Specifically, by it is described change line code contained by function, and with change line code contained by
The function that function possesses call relation is defined as object function.
Step S230, determine test case corresponding to the object function.
As different function pairs answers different functions, and different functions corresponds to different test cases,
Therefore may further determine that out that the test corresponding to the object function is used after object function is determined
Example.This partial test use-case carries out test use for the target software to the second edition.
In the present embodiment, describe by code analysis draw function contained by each line code and each
The process of the call relation between function.By using morphological analysis plus the mode of syntactic analysiss, can obtain
Per the attribute of the code structures such as the affiliated file class name of line code, included function and variable;By static point
Analysis instrument can then analyze the call relation between each function.
Next it is discussed in detail morphology, syntactic analysiss, and static analysis tools androguard's is concrete
Implementation.
1st, morphological analysis
The process of morphological analysis is exactly, according to language rule, to formulate state when reading in character and turn in simple terms
Change figure.Lexical analyzer is just jumped to accordingly according to state transition graph when a character is read in every time
State.If jumping to one " final state ", just illustrate currently to be resolved to one effectively
Morphology mark token, program can provide this mark, are reset to original state and continue to read in next word
Symbol, repetitive cycling is until read code end.
The realization of morphological analysis, generally comprises:
1) read method protected char ReadChar () of character late.
2) record character string protected the char [] scanWord that current state conversion has run through.
3) the pointer protected int of the character string position that current state conversion has run through are recorded
indexOfWord。
4) state transition method, and Main Analysis logic public void DFA ().
Morphological analysis can provide a morphology mark list, and the structure of each morphology mark is:
// type
private TokenType tokenType;
// context string
private String tokenContent;
// be expert at
private int tokenLineNumber。
2nd, syntactic analysiss
After code text is converted into morphology mark token streams by morphological analysis by previous step, next step
It is exactly the structure for analyzing code according to grammatical ruless from token streams.
Grammatical ruless can be represented with production, and such as in java, a java source program includes bag
The statement of name, import lists and the statement of class, so can be represented with production mark:
program->packageStatement[importStatement]classDeclaration
This production means a java source program (program), is grammatically by Yi Tiaobao
The statement (packageStatement) of name, multiple import statements (importStatement) and
Statement (classDeclaration) composition of individual class.The such mark of similar classDeclaration is referred to as
Syntax notation.
The statement classDeclaration of wherein class so can be represented again:
classDeclaration->[modifier]('class'|'interface')typeModifier'extends'
typeModifier'implements'[typeModifier]classBlock
In this production, plus the expression of single quotation marks syntax notation matches specific morphology mark, this
The syntax notation of type cannot be further continued for splitting in parsing, but directly match morphology mark,
Referred to as terminal symbol.Corresponding similar classDeclaration so also needs to continue to split being referred to as parsing
Nonterminal symbol.
The process of syntactic analysiss, it can be understood as from the token streams for reading in, analyze grammaticalness generation
The sentence of formula.Specific analysis method has a lot, and we employ a kind of relatively simple recurrence here
Decline analytic process, specially:
1) index to record the position scanned in current token streams using an integer.
2) analytic method is write for each nonterminal symbol.
If 3) nonterminal symbol has more than the production of, in this approach to which adopts
Production carries out branch prediction.
4), when processing single production, run into the scanning index position that the first step is then created by correct terminal symbol
Move forward;The correlation method created in calling second step if running into nonterminal symbol.
5) if necessary to produce the result (being such as parsed a class/method structure) for parsing, in method
It is constructed before return.
3rd, function calling relationship analysis
Androguard is an apk analytical tool increased income.In the present embodiment, we use its calling figure
Analytic function carrys out analytic function call relation.
Need python environment is first installed using androguard.After installation, the apk that compiling is completed
It is placed under its catalogue, using python androgexf.py-i xxx.apk-o xxx.gexf, you can obtain portion
Gexf files comprising all function calling relationships in apk.
Gexf forms are to read and draw the file format of graph of a relation for some graph of a relation softwares, are substantially
The file of xml forms.Node in file is exactly the summit in graph of a relation, during edge is exactly graph of a relation
Side.In gexf files, one function of vertex representation, while represent a call relation.
Gexf files just be can read using dom4j storehouses, the call relation between function is obtained.Realizing
Cheng Zhong, has found the gexf file sizes for generating in more than 10M, if in directly overall reading easily causes
Deposit less than oom.So adopting event driven method when reading, often having processed a dom node just makes
With detach method releasing memory.
In another embodiment of the application, describe another test case and determine method.Referring to Fig. 3,
Fig. 3 is that disclosed another test case of the embodiment of the present application determines method flow diagram.
As shown in figure 3, the method includes:
The contrast request of step S300, the first and second two versions of response target software, to the first He
The code of the target software of the second two versions carries out differentiation comparison, in determining first version target software
Change code;
Wherein, first version target software be completed test target software, second edition target
Software is target software to be tested.Target software is the software for waiting for testing.
Step S310, determine it is described change code involved by object function;
Wherein, the object function includes changing the function that code is included, and is included with code is changed
Function possess the function of call relation.
Step S320, determine target class belonging to the object function;
Specifically, several class files are included in code file, and each class file includes several functions.
For the object function for determining in this step, the target class file belonging to which is further determined that.
Step S330, according to the corresponding relation between the class that is pre-configured with and functional module, determine the target
The corresponding objective function module of class;
In software programming, general class file correspondence One function module, namely in order to realize
Certain functional module, needs to write at least one class file.We can be from inheritance to class and work(
The corresponding relation of energy intermodule is divided, for example:
The class for inheriting FragmentActivity or Activity divides page functional module into;
The class for inheriting BaseAdapter divides adapter functions module into;
The class for inheriting RelativeLayout, LinearLayout etc. these layouts divides place function module into.
Step S340, according to the corresponding relation between the functional module that is pre-configured with and test case, will be with institute
State the corresponding test case of objective function module and be defined as the corresponding test case of the object function.
It is understood that the setting of test case is precisely in order to whether each function of test software can
Correctly, therefore the correspondence different functional module of software, different test cases can be write.Certainly, it is arbitrary
Test case corresponding to functional module is not limited as one, and which can have multiple.Basis in this step
Corresponding relation between the functional module being pre-configured with and test case, determines corresponding with objective function module
Test case, this partial test use-case be used for subsequent execution.
In the present embodiment, corresponding relation between class and functional module, functional module have been pre-configured with it and have used with test
Corresponding relation between example, and then when the target class belonging to object function is determined, by inquiring about corresponding relation,
Determine corresponding test case.
In order to make it easy to understand, being illustrated by following examples.
Assume that a software code includes two functional modules, respectively download module and page module altogether.
Wherein, it is for download module and page module have write 4 test cases respectively, as shown in table 1 below:
Download module | It is normal to download | Suspend | Download completes to install | It is continuous to download |
Page module | Homepage | Details page | Game page | Review pages |
Table 1
Determine that second edition target software has changed 1-10 line codes through contrast, this 10 line code is related to altogether
And two functions of A and B.Found by searching corresponding relation, A and B the two functions are belonged to down
Module is carried, therefore 4 test cases corresponding with download module in upper table 1 are defined as into pending survey
Example on probation.By performing the download that above-mentioned 4 test cases can determine that the target software of the second edition
Whether function correctly performs.
In another embodiment of the application, describe another test case and determine method.Referring to Fig. 4,
Fig. 4 is that disclosed another test case of the embodiment of the present application determines method flow diagram.
As shown in figure 4, the method includes:
The contrast request of step S400, the first and second two versions of response target software, to the second edition
The code of this target software carries out pitching pile, and is compiled into pitching pile bag;
Wherein, first version target software be completed test target software, second edition target
Software is target software to be tested.Target software is the software for waiting for testing.
When the purpose of pitching pile is for the subsequent execution pitching pile bag, for the code for going to is labeled.
Optionally, Emma pile pitching methods, Emma pile pitching methods can be selected herein to export full dose covering
Rate is reported, namely whole pitching pile bag is after being finished, the coverage rate situation of all code lines.
Step S410, the code to the target software of the first and second two versions carry out differentiation comparison,
Determine the change code in the pitching pile bag;
Step S420, determine it is described change code involved by object function;
Wherein, the object function includes changing the function that code is included, and is included with code is changed
Function possess the function of call relation.
Step S430, determine test case corresponding to the object function;
Step S440, the pitching pile bag is performed according to the test case, change in determining the pitching pile bag
The covering state of code.
Specifically, for test software be APK softwares when, its generally require on mobile phone perform, handss
The covering state of the change code determined can be uploaded to backstage after being finished by machine.
Due to determining the code changed in pitching pile bag in the present embodiment, and then can determine that for change
The covering request of partial code.For example, in pitching pile bag, 50-60 line codes are change code, according to survey
Example on probation finds after performing pitching pile bag that, for 50-60 line codes, wherein 50-45 line codes are covered
(namely performing the meaning of the line code), and 46-60 line codes are not covered with.Specifically each line code
Coverage condition can be distinguished by color mark.
By determining the covering state for changing code, can choose whether to supplement increases test case.For
Function in change code involved by unlapped code line increases new test case, is so saving blind
On the basis of the human cost of range estimation examination, the generation of test leakage problem is effectively reduced.
Referring to Fig. 5, a kind of code coverage views of the Fig. 5 for the embodiment of the present application example.
In Fig. 5, one section of code file is illustrated, the wherein code of the 253rd row to the 262nd row is second
Change code of the versioned object software compared to first version target software.After implementation of test cases,
Change coverage condition such as Fig. 5 of code, the 254-256 line codes of its bend covering represent and performed (
I.e. the partial code is capped), remaining code is represented and was not carried out.
Certainly, by way of Fig. 5 merely illustrates by oblique line the code to represent covering, in addition also
The code for covering can be marked by color mark or alternate manner.
Below the test case determining device that the embodiment of the present application is provided is described, survey described below
With above-described test case, example determining device on probation determines that method can be mutually to should refer to.
Referring to Fig. 6, Fig. 6 is a kind of test case determining device structural representation disclosed in the embodiment of the present application.
As shown in fig. 6, the device includes:
Differentiation comparing unit 61, the contrast for responding the first and second two versions of target software please
Ask, differentiation comparison is carried out to the code of the target software of the first and second two versions, the second edition is determined
Change code in this target software, wherein first version target software are the target for having completed to test
Software, second edition target software are target software to be tested;
Function determining unit 62, it is for determining the object function changed involved by code, wherein described
Object function includes changing the function contained by code, and possesses tune with the function changed contained by code
With the function of relation;
Function corresponding unit 63, for determining the test case corresponding to the object function.
The test case determining device that the embodiment of the present application is provided, in the first and second two versions of response
When the contrast of target software is asked, differentiation comparison is carried out to the code of two versions, the second edition is determined
Change code in this target software, further determines that the object function changed involved by code, here mesh
Scalar functions include the function changed contained by code and possess with the function changed contained by code calling pass
The function of system, finally determines the test case corresponding to object function, and it is right that this partial test use-case is used for
The target software of the second edition is tested.As first version target software is to have completed test
Target software, which had tested each function, and the application draws the second edition compared to the by contrast
The code of one revision part, and determine the function involved by transfer portion code and with the function
Corresponding test case, can test second edition target software compared to first using these test cases
The function of versioned object software alteration, as the test case corresponding to remaining same code part, its
Test had been carried out in first edition target software, therefore in the test process of second edition target software,
This partial test use-case is improve testing efficiency without the need for testing again so as to reduce the testing time.
Optionally, when it is determined that changing code, can be determining in the form of changing line code.Certainly,
In addition to this mode, can also be using forms such as change code field, change code blocks.In order to unite
One description, is hereafter only illustrated in the form of changing line code.
Optionally, the embodiment of the present application illustrates a kind of alternative construction of above-mentioned function determining unit 62, such as
Shown in Fig. 7, function determining unit 62 can include:
Code analysis unit 621, for being analyzed to the code of second edition target software, obtains each row
The call relation between function and each function contained by code;
Function reference unit 622, between the function and each function with reference to contained by each line code
Call relation, by it is described change line code contained by function, and with change line code contained by
The function that function possesses call relation is defined as object function.
Optionally, the embodiment of the present application illustrates a kind of alternative construction of above-mentioned code analysis unit 621,
As shown in figure 8, code analysis unit 621 can include:
Morphology parsing unit 6211, for using morphological analysis and parsing method to described second
The code of versioned object software is analyzed, and obtains the function contained by each line code;
Call relation analytic unit 6212, for the calling figure using static analysis tools androguard point
Analysis function, is analyzed to the code of the second edition target software, obtains calling pass between function
System.
Optionally, the embodiment of the present application illustrates a kind of alternative construction of above-mentioned function corresponding unit 63, such as
Shown in Fig. 9, function corresponding unit 63 can include:
Class determining unit 631, for determining the target class belonging to the object function;
Module determining unit 632, the corresponding relation between the class being pre-configured with for basis and functional module, really
Determine the corresponding objective function module of the target class;
Test case determining unit 633, for according to right between the functional module and test case being pre-configured with
Should be related to, will test case corresponding with the objective function module to be defined as the object function corresponding
Test case.
Optionally, the embodiment of the present application illustrates another kind of alternative construction of above-mentioned test case determining device,
Understand that the device can also include with reference to Fig. 6 and Figure 10:
Pitching pile unit 64, for carrying out in the code of the target software to the first and second two versions
Before differentiation compares, pitching pile is carried out to the code of the target software of the second edition, and is compiled into pitching pile bag;
Then the differentiation comparing unit 61 determines the process tool for changing code in second edition target software
Body is the change code in the determination pitching pile bag, and further, the device also includes:
Status determining unit 65 is covered, for the object function institute being determined in the function corresponding unit 63
After corresponding test case, the pitching pile bag is performed according to the test case, determine the pitching pile bag
The middle covering state for changing code.
By determining the covering state for changing code, can choose whether to supplement increases test case.For
Function in change code involved by unlapped code line increases new test case, is so saving blind
On the basis of the human cost of range estimation examination, the generation of test leakage problem is effectively reduced.
The embodiment of the present application also provides a kind of server, and the server can include that test described above is used
Example determining device, for the description of test case determining device can refer to corresponding part description above, herein
Repeat no more.
The hardware configuration of the server for providing to the embodiment of the present application below is described, and relates in being described below
And the part that multimedia file is processed can refer to corresponding part description above.Figure 11 is carried for the embodiment of the present application
For server hardware architecture diagram, with reference to Figure 11, the server can include:
Processor 1, communication interface 2, memorizer 3, communication bus 4, and display screen 5;
Wherein processor 1, communication interface 2, memorizer 3 and display screen 5 complete phase by communication bus 4
Communication between mutually;
Optionally, communication interface 2 can be the interface of communication module, the such as interface of gsm module;
Processor 1, for configuration processor;
Memorizer 3, for depositing program;
Program can include program code, and described program code includes the operational order of processor.
The possibly central processor CPU of processor 1, or specific integrated circuit ASIC
(Application Specific Integrated Circuit), or be arranged to implement the embodiment of the present application
One or more integrated circuits.
Memorizer 3 may include high-speed RAM memorizer, it is also possible to also including nonvolatile memory
(non-volatile memory), for example, at least one disk memory.
Wherein, program can be specifically for:
The contrast request of the first and second two versions of response target software, to the first and second two versions
The code of this target software carries out differentiation comparison, determines the change code in second edition target software,
Wherein first version target software is the target software for having completed to test, and second edition target software is
Target software to be tested;
Determine the object function changed involved by code, wherein described object function includes changing code
Contained function, and possess the function of call relation with the function changed contained by code;
Determine the test case corresponding to the object function.
Optionally, program can be specifically for realizing the step of test case in each embodiment determines method.
The foregoing description of the disclosed embodiments, enables professional and technical personnel in the field to realize or use
The application.Various modifications to these embodiments will be aobvious and easy for those skilled in the art
See, generic principles defined herein can in the case of without departing from spirit herein or scope,
Realize in other embodiments.Therefore, the application is not intended to be limited to the embodiments shown herein,
And it is to fit to the most wide scope consistent with principles disclosed herein and features of novelty.
Claims (10)
1. a kind of test case determines method, it is characterised in that include:
The contrast request of the first and second two versions of response target software, to the first and second two versions
The code of this target software carries out differentiation comparison, determines the change code in second edition target software,
Wherein first version target software is the target software for having completed to test, and second edition target software is
Target software to be tested;
Determine the object function changed involved by code, wherein described object function includes changing code
Contained function, and possess the function of call relation with the function changed contained by code;
Determine the test case corresponding to the object function.
2. method according to claim 1, it is characterised in that the change code is for changing row generation
Code, it is described to determine the object function changed involved by code, including:
The code of second edition target software is analyzed, obtain function contained by each line code and
Call relation between each function;
The call relation between function and each function with reference to contained by each line code, changes described
Function contained by dynamic line code, and possess the letter of call relation with the function changed contained by line code
Number is defined as object function.
3. method according to claim 2, it is characterised in that described to second edition target software
Code be analyzed, obtain the call relation between the function and each function contained by each line code,
Including:
The code of the second edition target software is carried out point using morphological analysis and parsing method
Analysis, obtains the function contained by each line code;
Using the calling figure analytic function of static analysis tools androguard, to the second edition target
The code of software is analyzed, and obtains the call relation between function.
4. method according to claim 1, it is characterised in that the determination object function institute
Corresponding test case, including:
Determine the target class belonging to the object function;
According to the corresponding relation between the class and functional module being pre-configured with, the corresponding mesh of the target class is determined
Mark functional module;
According to the corresponding relation between the functional module and test case being pre-configured with, will be with the objective function
The corresponding test case of module is defined as the corresponding test case of the object function.
5. method according to claim 1, it is characterised in that described to the first and second two
Before the differentiation that the code of the target software of version carries out compares, the method also includes:
Pitching pile is carried out to the code of the target software of the second edition, and is compiled into pitching pile bag;
During then the change code in the determination second edition target software is specially and determines the pitching pile bag
Code is changed, further, after the test case determined corresponding to the object function, the party
Method also includes:
The pitching pile bag is performed according to the test case, the covering of code in determining the pitching pile bag, is changed
State.
6. a kind of test case determining device, it is characterised in that include:
Differentiation comparing unit, for responding the contrast request of the first and second two versions of target software,
Differentiation comparison is carried out to the code of the target software of the first and second two versions, second edition mesh is determined
Change code in mark software, wherein first version target software are the target software for having completed to test,
Second edition target software is target software to be tested;
Function determining unit, for determining the object function changed involved by code, wherein described mesh
Scalar functions include changing the function contained by code, and possess and call with the function changed contained by code
The function of relation;
Function corresponding unit, for determining the test case corresponding to the object function.
7. device according to claim 6, it is characterised in that the change code is for changing row generation
Code, the function determining unit include:
Code analysis unit, for being analyzed to the code of second edition target software, obtains each row generation
Function and the call relation between each function contained by code;
Function reference unit, between the function and each function with reference to contained by each line code
Call relation, by it is described change line code contained by function, and with change line code contained by letter
The function that number possesses call relation is defined as object function.
8. device according to claim 7, it is characterised in that the code analysis unit includes:
Morphology parsing unit, for using morphological analysis and parsing method to the second edition
The code of target software is analyzed, and obtains the function contained by each line code;
Call relation analytic unit, for calling map analysis work(using static analysis tools androguard
Can, the code of the second edition target software is analyzed, the call relation between function is obtained.
9. device according to claim 6, it is characterised in that the function corresponding unit includes:
Class determining unit, for determining the target class belonging to the object function;
Module determining unit, the corresponding relation between the class being pre-configured with for basis and functional module, it is determined that
The corresponding objective function module of the target class;
Test case determining unit, for according to the functional module that is pre-configured with it is corresponding between test case
Test case corresponding with the objective function module is defined as the corresponding survey of the object function by relation
Example on probation.
10. device according to claim 6, it is characterised in that also include:
Pitching pile unit, it is poor for the code in the target software to the first and second two versions
Before alienation is compared, pitching pile is carried out to the code of the target software of the second edition, and is compiled into pitching pile bag;
Then the differentiation comparing unit determines that the process for changing code in second edition target software is concrete
For determining the change code in the pitching pile bag, further, the device also includes:
Status determining unit is covered, for determining corresponding to the object function in the function corresponding unit
Test case after, perform the pitching pile bag according to the test case, change in determining the pitching pile bag
The covering state of dynamic code.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510587411.XA CN106528399A (en) | 2015-09-15 | 2015-09-15 | Test case determination method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510587411.XA CN106528399A (en) | 2015-09-15 | 2015-09-15 | Test case determination method and apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106528399A true CN106528399A (en) | 2017-03-22 |
Family
ID=58348665
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510587411.XA Pending CN106528399A (en) | 2015-09-15 | 2015-09-15 | Test case determination method and apparatus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106528399A (en) |
Cited By (25)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107423214A (en) * | 2017-04-18 | 2017-12-01 | 恒生电子股份有限公司 | Software regression testing use-case acquisition methods, device and storage medium and electronic equipment |
CN107451058A (en) * | 2017-07-31 | 2017-12-08 | 北京云测信息技术有限公司 | A kind of software development methodology and device |
CN107992409A (en) * | 2017-11-21 | 2018-05-04 | 平安养老保险股份有限公司 | Method for generating test case, device, computer equipment and storage medium |
CN108268374A (en) * | 2017-11-03 | 2018-07-10 | 平安科技(深圳)有限公司 | software version test method, device, terminal device and storage medium |
CN108491321A (en) * | 2018-03-06 | 2018-09-04 | 平安科技(深圳)有限公司 | test case range determining method, device and storage medium |
CN108874661A (en) * | 2018-05-07 | 2018-11-23 | 上海陆家嘴国际金融资产交易市场股份有限公司 | Test mapping relations library generating method, device, computer equipment and storage medium |
CN109240911A (en) * | 2018-08-13 | 2019-01-18 | 腾讯科技(北京)有限公司 | Accurate test method, device and computer equipment |
CN109271322A (en) * | 2018-09-25 | 2019-01-25 | 杭州群核信息技术有限公司 | A kind of software test range determining method, method for testing software and device |
CN109542779A (en) * | 2018-11-12 | 2019-03-29 | 泰康保险集团股份有限公司 | Test method, device and storage medium |
CN109634864A (en) * | 2018-12-12 | 2019-04-16 | 江苏满运软件科技有限公司 | The automatic source tracing method of entrance function, device, electronic equipment, storage medium |
CN110221968A (en) * | 2019-05-20 | 2019-09-10 | 平安普惠企业管理有限公司 | Method for testing software and Related product |
CN111694738A (en) * | 2020-06-04 | 2020-09-22 | 贵州易鲸捷信息技术有限公司 | Method for generating SQL test script |
CN111782556A (en) * | 2020-08-26 | 2020-10-16 | 中国银行股份有限公司 | Automatic test method and device |
CN111831574A (en) * | 2020-07-27 | 2020-10-27 | 中国工商银行股份有限公司 | Regression test planning method, device, computer system and medium |
CN111897727A (en) * | 2020-07-30 | 2020-11-06 | 平安科技(深圳)有限公司 | Software testing method and device, computer equipment and storage medium |
CN112099838A (en) * | 2019-06-17 | 2020-12-18 | 腾讯科技(深圳)有限公司 | Method, device and storage medium for determining version difference |
CN112631935A (en) * | 2020-12-30 | 2021-04-09 | 中国农业银行股份有限公司 | Version conflict-based test method and device |
CN112860544A (en) * | 2021-01-21 | 2021-05-28 | 南威软件股份有限公司 | Code detection method, device, equipment and computer readable storage medium |
CN113190442A (en) * | 2021-04-27 | 2021-07-30 | 上海安畅网络科技股份有限公司 | Method and system for measuring test range and checking test coverage |
CN113448862A (en) * | 2021-07-12 | 2021-09-28 | 上海哔哩哔哩科技有限公司 | Software version testing method and device and computer equipment |
CN113626325A (en) * | 2021-08-05 | 2021-11-09 | 杭州遥望网络科技有限公司 | Interface testing method, device and equipment in code iterative updating |
CN113760769A (en) * | 2021-09-13 | 2021-12-07 | 北京百度网讯科技有限公司 | Test case processing method and device, electronic equipment and storage medium |
CN114490424A (en) * | 2022-02-24 | 2022-05-13 | 北京启明星辰信息安全技术有限公司 | Automatic testing method and device |
CN115437965A (en) * | 2022-10-27 | 2022-12-06 | 南京讯优智超软件科技有限公司 | Data processing method suitable for test management platform |
CN116069667A (en) * | 2023-03-06 | 2023-05-05 | 天津卓朗昆仑云软件技术有限公司 | Test case auxiliary positioning method and device based on code analysis |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101408862A (en) * | 2007-10-12 | 2009-04-15 | 李周 | Embedded system test method |
US20110321013A1 (en) * | 2010-06-23 | 2011-12-29 | Quickunit Ltd | Interactive environment for test case generation associated with a computer code |
CN103198010A (en) * | 2012-01-06 | 2013-07-10 | 腾讯科技(深圳)有限公司 | Software testing method, device and system |
CN103678097A (en) * | 2012-09-05 | 2014-03-26 | 百度在线网络技术(北京)有限公司 | Method and device for selecting regression test case |
CN104239799A (en) * | 2014-09-05 | 2014-12-24 | 清华大学 | Android application program privacy stealing detection method and system based on behavior chain |
-
2015
- 2015-09-15 CN CN201510587411.XA patent/CN106528399A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101408862A (en) * | 2007-10-12 | 2009-04-15 | 李周 | Embedded system test method |
US20110321013A1 (en) * | 2010-06-23 | 2011-12-29 | Quickunit Ltd | Interactive environment for test case generation associated with a computer code |
CN103198010A (en) * | 2012-01-06 | 2013-07-10 | 腾讯科技(深圳)有限公司 | Software testing method, device and system |
CN103678097A (en) * | 2012-09-05 | 2014-03-26 | 百度在线网络技术(北京)有限公司 | Method and device for selecting regression test case |
CN104239799A (en) * | 2014-09-05 | 2014-12-24 | 清华大学 | Android application program privacy stealing detection method and system based on behavior chain |
Cited By (31)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107423214A (en) * | 2017-04-18 | 2017-12-01 | 恒生电子股份有限公司 | Software regression testing use-case acquisition methods, device and storage medium and electronic equipment |
CN107451058A (en) * | 2017-07-31 | 2017-12-08 | 北京云测信息技术有限公司 | A kind of software development methodology and device |
CN108268374A (en) * | 2017-11-03 | 2018-07-10 | 平安科技(深圳)有限公司 | software version test method, device, terminal device and storage medium |
CN107992409A (en) * | 2017-11-21 | 2018-05-04 | 平安养老保险股份有限公司 | Method for generating test case, device, computer equipment and storage medium |
CN108491321A (en) * | 2018-03-06 | 2018-09-04 | 平安科技(深圳)有限公司 | test case range determining method, device and storage medium |
CN108491321B (en) * | 2018-03-06 | 2021-05-25 | 平安科技(深圳)有限公司 | Method and device for determining test case range and storage medium |
CN108874661A (en) * | 2018-05-07 | 2018-11-23 | 上海陆家嘴国际金融资产交易市场股份有限公司 | Test mapping relations library generating method, device, computer equipment and storage medium |
CN108874661B (en) * | 2018-05-07 | 2020-12-22 | 未鲲(上海)科技服务有限公司 | Test mapping relation library generation method and device, computer equipment and storage medium |
CN109240911A (en) * | 2018-08-13 | 2019-01-18 | 腾讯科技(北京)有限公司 | Accurate test method, device and computer equipment |
CN109271322A (en) * | 2018-09-25 | 2019-01-25 | 杭州群核信息技术有限公司 | A kind of software test range determining method, method for testing software and device |
CN109542779A (en) * | 2018-11-12 | 2019-03-29 | 泰康保险集团股份有限公司 | Test method, device and storage medium |
CN109634864A (en) * | 2018-12-12 | 2019-04-16 | 江苏满运软件科技有限公司 | The automatic source tracing method of entrance function, device, electronic equipment, storage medium |
CN110221968A (en) * | 2019-05-20 | 2019-09-10 | 平安普惠企业管理有限公司 | Method for testing software and Related product |
CN112099838A (en) * | 2019-06-17 | 2020-12-18 | 腾讯科技(深圳)有限公司 | Method, device and storage medium for determining version difference |
CN112099838B (en) * | 2019-06-17 | 2023-08-15 | 腾讯科技(深圳)有限公司 | Method, device and storage medium for determining version difference |
CN111694738A (en) * | 2020-06-04 | 2020-09-22 | 贵州易鲸捷信息技术有限公司 | Method for generating SQL test script |
CN111831574B (en) * | 2020-07-27 | 2023-09-05 | 中国工商银行股份有限公司 | Regression test planning method, regression test planning device, computer system and medium |
CN111831574A (en) * | 2020-07-27 | 2020-10-27 | 中国工商银行股份有限公司 | Regression test planning method, device, computer system and medium |
CN111897727A (en) * | 2020-07-30 | 2020-11-06 | 平安科技(深圳)有限公司 | Software testing method and device, computer equipment and storage medium |
CN111782556A (en) * | 2020-08-26 | 2020-10-16 | 中国银行股份有限公司 | Automatic test method and device |
CN112631935A (en) * | 2020-12-30 | 2021-04-09 | 中国农业银行股份有限公司 | Version conflict-based test method and device |
CN112860544A (en) * | 2021-01-21 | 2021-05-28 | 南威软件股份有限公司 | Code detection method, device, equipment and computer readable storage medium |
CN113190442A (en) * | 2021-04-27 | 2021-07-30 | 上海安畅网络科技股份有限公司 | Method and system for measuring test range and checking test coverage |
CN113448862A (en) * | 2021-07-12 | 2021-09-28 | 上海哔哩哔哩科技有限公司 | Software version testing method and device and computer equipment |
CN113448862B (en) * | 2021-07-12 | 2022-08-02 | 上海哔哩哔哩科技有限公司 | Software version testing method and device and computer equipment |
CN113626325A (en) * | 2021-08-05 | 2021-11-09 | 杭州遥望网络科技有限公司 | Interface testing method, device and equipment in code iterative updating |
CN113760769A (en) * | 2021-09-13 | 2021-12-07 | 北京百度网讯科技有限公司 | Test case processing method and device, electronic equipment and storage medium |
CN113760769B (en) * | 2021-09-13 | 2023-11-07 | 北京百度网讯科技有限公司 | Test case processing method and device, electronic equipment and storage medium |
CN114490424A (en) * | 2022-02-24 | 2022-05-13 | 北京启明星辰信息安全技术有限公司 | Automatic testing method and device |
CN115437965A (en) * | 2022-10-27 | 2022-12-06 | 南京讯优智超软件科技有限公司 | Data processing method suitable for test management platform |
CN116069667A (en) * | 2023-03-06 | 2023-05-05 | 天津卓朗昆仑云软件技术有限公司 | Test case auxiliary positioning method and device based on code analysis |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106528399A (en) | Test case determination method and apparatus | |
CN112100054B (en) | Data management and control oriented program static analysis method and system | |
US8473971B2 (en) | Type inference and type-directed late binding | |
AU2012203071B2 (en) | Computer-implemented method, system and computer program product for displaying a user interface component | |
US9043759B1 (en) | System and method for generating software unit tests simultaneously with API documentation | |
US8099721B2 (en) | Parsing of declarations in all branches of preprocessor conditionals | |
US20160313981A1 (en) | Configuration-preserving preprocessor | |
US20070044066A1 (en) | Embedded multi-language programming | |
US20060277523A1 (en) | Annotations for tracking provenance | |
US8037450B2 (en) | System and methods for tracing code generation in template engines | |
JP6911059B2 (en) | Query optimizer for CPU utilization and code refactoring | |
US9311077B2 (en) | Identification of code changes using language syntax and changeset data | |
CN102591777A (en) | Unit test code generation method and device | |
CN111124479B (en) | Method and system for analyzing configuration file and electronic equipment | |
CN103970659A (en) | Android application software automation testing method based on pile pitching technology | |
CN101751281A (en) | System and method for generating compiler | |
CN103294596A (en) | Early warning method for contract-type software fault based on program invariants | |
López-Fernández et al. | Meta-model validation and verification with metabest | |
CN110058849A (en) | Generation method, device, computer equipment and the storage medium of flow chart | |
CN110941655A (en) | Data format conversion method and device | |
CN112825068B (en) | Data blood margin generation method and device | |
US9304743B1 (en) | Converting from incorrect program code to correct program code | |
CN117215661A (en) | Event processing method, device and storage medium | |
CN109960590A (en) | A method of optimization embedded system diagnostic printing | |
CN113805861B (en) | Code generation method based on machine learning, code editing system and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 |
Application publication date: 20170322 |
|
RJ01 | Rejection of invention patent application after publication |