CN108733557B - Test point generation method and device - Google Patents

Test point generation method and device Download PDF

Info

Publication number
CN108733557B
CN108733557B CN201810263820.8A CN201810263820A CN108733557B CN 108733557 B CN108733557 B CN 108733557B CN 201810263820 A CN201810263820 A CN 201810263820A CN 108733557 B CN108733557 B CN 108733557B
Authority
CN
China
Prior art keywords
test
function
type
implementation
characteristic
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.)
Active
Application number
CN201810263820.8A
Other languages
Chinese (zh)
Other versions
CN108733557A (en
Inventor
岳炳词
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN201810263820.8A priority Critical patent/CN108733557B/en
Publication of CN108733557A publication Critical patent/CN108733557A/en
Application granted granted Critical
Publication of CN108733557B publication Critical patent/CN108733557B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The embodiment of the application provides a test point generation method and a test point generation device, wherein the method comprises the following steps: obtaining test point description of functional requirements, and taking test keywords in the test point description as first-class test keywords; obtaining an implementation parameter of each first type of test keyword according to a preset corresponding relation between the test keyword and the implementation parameter; replacing the test keywords in the test point description with target implementation parameters formed by implementation parameters of the first type of test keywords, respectively, to generate first test points corresponding to the target implementation parameters, where the target implementation parameters include: a combined implementation parameter and/or an independent implementation parameter, one combined implementation parameter comprising: an implementation parameter for each of the at least two first type test keys, an independent implementation parameter comprising: an implementation parameter for a first type of test key. By applying the scheme provided by the embodiment of the application to generating the test points, the generation efficiency of the test points can be improved.

Description

Test point generation method and device
Technical Field
The present application relates to the field of software testing technologies, and in particular, to a test point generation method and apparatus.
Background
Developers develop various functions in the development process, and in order to ensure that the functions finally provided for users are correct, after the developers develop the various functions, testers are required to test the functions.
In the prior art, when testing functions, a test point is generally generated for a function to be tested, and then the generated test point is used for testing. However, when the test points are generated, the test points are generally generated by a tester in a manual mode, so that the test points are easily affected by factors such as working experience and work arrangement of the tester when the test points are generated, and the generation efficiency of the test points is low.
Disclosure of Invention
An object of the embodiments of the present application is to provide a test point generation method and apparatus, so as to improve test point generation efficiency. The specific technical scheme is as follows:
the embodiment of the application discloses a test point generation method, which comprises the following steps:
obtaining test point description of functional requirements, and taking test keywords in the test point description as first-class test keywords;
obtaining an implementation parameter of each first type of test keyword according to a preset corresponding relation between the test keyword and the implementation parameter;
replacing the test keywords in the test point description with target implementation parameters formed by implementation parameters of the first type of test keywords, respectively, to generate first test points corresponding to the target implementation parameters, where the target implementation parameters include: a combined implementation parameter and/or an independent implementation parameter, one combined implementation parameter comprising: an implementation parameter for each of the at least two first type test keys, an independent implementation parameter comprising: an implementation parameter for a first type of test key.
The embodiment of the application discloses test point generates device, the device includes:
the information acquisition module is used for acquiring test point descriptions of functional requirements and taking test keywords in the test point descriptions as first-class test keywords;
the parameter obtaining module is used for obtaining the implementation parameters of each first type of test key word according to the preset corresponding relation between the test key word and the implementation parameters;
a first test point generation module, configured to replace the test keywords in the test point description with target implementation parameters formed from implementation parameters of a first type of test keywords, respectively, and generate a first test point corresponding to the target implementation parameters, where the target implementation parameters include: a combined implementation parameter and/or an independent implementation parameter, one combined implementation parameter comprising: an implementation parameter for each of the at least two first type test keys, an independent implementation parameter comprising: an implementation parameter for a first type of test key.
An embodiment of the application discloses an electronic device, comprising a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the steps of the test point generation method disclosed by the embodiment of the application are realized.
A machine-readable storage medium stores machine-executable instructions that, when invoked and executed by a processor, cause the processor to: the steps of the test point generation method disclosed by the embodiment of the application are realized.
As can be seen from the above, in the scheme provided in the embodiment of the present application, after the test point description of the functional requirement and the test key word described in the test point are obtained, the implementation parameter of each test key word is obtained according to the preset corresponding relationship between the test key word and the implementation parameter, then each target implementation parameter formed by the implementation parameter of the first type of test key word is used to replace the test key word in the test point description, and then the test point corresponding to the target implementation parameter is generated. Compared with the prior art, the test point can be automatically generated by applying the scheme provided by the embodiment of the application without manual operation of a tester, so that the influence of factors such as the working experience of the tester, the work arrangement and the like on the process of generating the test point is small, and the efficiency of generating the test point can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a first test point generation method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a second test point generation method provided in the embodiment of the present application;
fig. 3 is a schematic flowchart of a third test point generation method provided in the embodiment of the present application;
fig. 4 is a schematic flowchart of a fourth test point generation method provided in the embodiment of the present application;
fig. 5 is a schematic structural diagram of a first test point generation apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a second test point generation apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a third test point generation apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the prior art, in the process of testing software functions, test points are easily affected by factors such as working experience of testers and work arrangement when being generated, and the technical problem of low test point generation efficiency exists.
In an embodiment of the present application, a test point generating method is provided, where the method includes:
obtaining test point description of functional requirements, and taking test keywords in the test point description as first-class test keywords;
obtaining an implementation parameter of each first type of test keyword according to a preset corresponding relation between the test keyword and the implementation parameter;
replacing the test keywords in the test point description with target implementation parameters formed by implementation parameters of the first type of test keywords, respectively, to generate first test points corresponding to the target implementation parameters, where the target implementation parameters include: a combined implementation parameter and/or an independent implementation parameter, one combined implementation parameter comprising: an implementation parameter for each of the at least two first type test keys, an independent implementation parameter comprising: an implementation parameter for a first type of test key.
Compared with the prior art, the test point can be automatically generated by applying the scheme provided by the embodiment of the application without manual operation of a tester, so that the influence of factors such as the working experience and the work arrangement of the tester on the process of generating the test point is small, and the efficiency of generating the test point can be improved.
The concepts involved in the various embodiments of the present application are described below.
1. Testing points: the source of the project requirement is the specific content to be tested, which is extracted from the project requirement.
2. Functional requirements are as follows: for a software function, the functional requirements of a software function can be understood as: it is desirable that this software functionality specifically fulfill the requirements of the content.
3. Description of test points: refers to the description information of a test point.
The test point description may be presented in various forms, for example, the test point description may be simple textual description information, and in addition, in each of the solutions provided in the embodiments of the present application, the test point is generated by a machine, so that, in order to facilitate the machine to identify the test point description, the test point description may also be information in which the textual description is combined with a code description, for example, a test point description is presented as a whole as a character string, the character string may include a textual description, and may also include code descriptions such as variables, for example, the format of the test point description may be:
xxxxx[yyy]xxxxx[zzz]xxxxx
where xxxxx denotes a literal description, yyy and zzz denote variables, e.g., variables used to denote technical terms, etc., [ ] are preset characters used to identify a code description or variable.
4. Testing the key words: it is to be understood that the test key may specifically be a technical term, which is used to represent a software functional test item. For example, for the software function of the network device, the test key may be: IP messages, interfaces, etc.
5. Realizing parameters: the method is specific to the test keywords, and for each test keyword, multiple values may exist in the implementation process, and each value may be referred to as an implementation parameter of the test keyword. Taking the test keyword as an IP packet as an example, the implementation parameters may include: TCP messages, UDP messages, and the like.
The test point generation method provided by the embodiment of the present application is described in detail through specific embodiments below.
Fig. 1 is a schematic flowchart of a first test point generation method provided in an embodiment of the present application, where the method at least includes the following steps.
S101, obtaining test point description of functional requirements, and taking test keywords in the test point description as first-class test keywords.
Only one test keyword may exist in one test point description, or multiple test keywords may exist, which is not limited in this application.
In one implementation, after completing a software function, a software function developer may write a test point description of a function requirement of the software function, and specify each test keyword in the test point description, in this case, the test point description and the test keyword may be stored in a file, so as to generate a test point later, and in addition, the file may be referred to as a function requirement file for convenience of description.
Specifically, each of the test keywords may be stored in the function requirement file in a form of a list.
Based on the above description, in this step, the test point description and the test keyword may be obtained from the function requirement file. In an implementation manner of the present application, when storing the test keywords of the test point requirement and the test point requirement in the function requirement file, keywords may be set for both, for example: thus, when the test point description and the test keywords are obtained from the function required file, the keywords such as the test _ description and the test _ keyword can be firstly identified, and then the contents stored after the keywords are read, so that the test point description and the test keywords are obtained.
S102, obtaining the implementation parameters of each first type of test key word according to the preset corresponding relation between the test key words and the implementation parameters.
The preset corresponding relationship between the test keywords and the implementation parameters may be stored in a first information base.
Because the corresponding relation between the keywords and the implementation parameters is preset, the first information base can also be understood as being preset, so that the corresponding relation between the test keywords and the implementation parameters accumulated in the test process can be continuously updated to the first information base along with the development of test work, the corresponding relation stored in the first information base is continuously improved, and the test analysis results after the test are effectively inherited.
S103, replacing the test key words in the test point description with each target implementation parameter formed by the implementation parameters of the first type of test key words, and generating first test points corresponding to the target implementation parameters.
Wherein the target implementation parameters include: a combined implementation parameter and/or an independent implementation parameter, one combined implementation parameter comprising: an implementation parameter for each of the at least two first type test keys, an independent implementation parameter comprising: an implementation parameter for a first type of test key.
The first test point corresponding to the target implementation parameter generated in this step may be understood as a part of the test points of the aforementioned functional requirements.
In an implementation manner of the present application, in order to ensure that a software function is tested more comprehensively, all implementation parameters included in all target implementation parameters used in a process of replacing a test keyword need to include all implementation parameters of each first type of test keyword.
Specifically, the implementation parameter used in the process of replacing the test keyword may be only a combination implementation parameter, may be only an independent implementation parameter, or may include both a combination implementation parameter and an independent implementation parameter.
When a test key in the description of the test point is replaced by a combined implementation parameter, the combined implementation parameter does not necessarily contain an implementation parameter of each test key in all the first-class test keys, so that the test key corresponding to the contained implementation parameter can be replaced during replacement. Similarly, when a test keyword in the description of the test point is replaced by an independent implementation parameter, the test keyword corresponding to the implementation parameter is replaced, and other test keywords are kept unchanged.
As can be known from the foregoing description, the test point description may be presented by combining a text description with a code description, and in this case, when the test point description includes a preset character for identifying a variable, the preset character and the variable identified by the preset character may be replaced together as a first type of test keyword. In addition, in the one-time replacement process, when the implementation parameters included in the combined implementation parameters or the independent implementation parameters are implementation parameters of part of the test keywords, in order to enhance the readability of the finally generated test points, the first type of test keywords which are not replaced by the implementation parameters can be directly used as the content in the first test points.
For example, when the format of the test point description is xxxxx [ yyy ] xxxxx [ zzz ] xxxxx, yyy and zzz are variables used for representing test keywords, and [ ] is a preset character used for representing variables, assuming that the implementation parameters of the test keywords corresponding to yyy and zzz are YY and ZZ respectively, after the keyword replacement, the test point description is as follows: xxxxxYxxxxxxxZZxxxxx. In addition, when there is an implementation parameter of yyy or zzz, after the keyword replacement is performed, the test point description may be: xxxxxyyyxxxxxzzzxxxxx or xxxxxxxyyyxxxxxxzzxxxxx.
In addition, all the implementation parameters adopted in the process of replacing the test keywords cover each first-type test keyword, and the implementation parameters of some first-type test keywords can repeatedly appear in different combined implementation parameters or independent implementation parameters.
Although the implementation parameters of each first-class test keyword may repeatedly appear in the combination implementation parameters and the independent implementation parameters, considering that the repeated appearance of the implementation parameters may result in an increase in the number of finally generated test points, so that the test efficiency is low when the software function is subsequently tested, the influence on the number of test points and other factors may be considered when determining all the implementation parameters adopted in the process of replacing the test keywords.
As can be seen from the above, in the scheme provided in this embodiment, after the test point description of the functional requirement and the test key words described by the test point are obtained, the implementation parameters of the test key words are obtained according to the preset corresponding relationship between the test key words and the implementation parameters, and then the test key words in the test point description are respectively replaced by the target implementation parameters formed by the implementation parameters of the first type of test key words, so as to automatically generate the test points corresponding to the target implementation parameters. Compared with the prior art, the scheme provided by the embodiment can be used for automatically generating the test points without manual operation of testers, so that the process of generating the test points is less influenced by the factors such as the working experience and the work arrangement of the testers, and the efficiency of generating the test points can be improved.
In an implementation manner of the present application, after each test point is generated, a test number may be set for the generated test point, so that developers or testers can know each generated test point clearly.
The following describes the test point generation method by using a specific example in conjunction with the flowchart shown in fig. 2.
S201: obtaining test point description FuncStr of functional requirements and a test keyword _ t in the FuncStr;
in this example, assuming that the value of t is 0 and 1, that is, the number of test keywords in FuncStr is 2, and the variable n represents the number, then n is 2;
according to the above description, the test keywords in FuncStr are: keyword _1 and keyword _2,
assume that the format of FuncStr is: xxxxx [ yyy ] xxxxx [ zzz ] xxxxx.
S202: obtaining an implementation parameter of each keyword _ t from a preset first information base;
the number of implementation parameters of the keyword _ t is represented by the count _ t, and then the implementation parameters and the number of implementation parameters of the keyword _1 and the keyword _2 are respectively:
clList [ ] of keyword _1 is: A. b, the number of implementation parameters count _1 is 2;
clList [ ] of keyword _2 is: C. d, E, the number of implementation parameters count _2 is 3;
the maximum value of count _1 and count _2 is denoted by count, which is 3.
The variable k is set to 0.
S203: and judging whether k is smaller than count, if so, executing S204, otherwise, executing S211.
S204: the initial test point is set to testItemStr ═ FuncStr, and the variable t is set to 0.
S205: and judging whether t is smaller than n, if so, executing S206, otherwise, executing S210.
S206: and judging whether k is smaller than count _ t, if so, executing S207, otherwise, executing S208.
S207: replace [ keyword _ t ] in testitestmt with clList [ k ] of keyword _ t, and perform S209.
S208: replace [ keyword _ t ] in testItemStr with keyword _ t, and execute S209.
S209: t +1, and returns to S205.
S210: testItemStr is determined as one test point, k ═ k +1, and is put back to S203.
S211: and finishing the generation of the test point of the function requirement corresponding to the FuncStr.
According to the above process, the finally obtained test points are respectively:
xxxxxAxxxxxCxxxxx
xxxxxBxxxxxDxxxxx
xxxxxkeyword_1xxxxxExxxxx
that is, the combined implementation parameters employed in the test key replacement process are [ A, C ], [ B, D ], and the independent implementation parameter is [ E ].
The inventor finds that a plurality of function requirements may exist for one software function in the process of generating the test points, and finds that each function requirement has different requirement types through analysis, for example, the function requirements of one software function can be divided into basic function requirements and non-basic function requirements, or the function requirements of one software function can be divided into basic function requirements and main function requirements, and the like.
Wherein, the basic function requirement can be understood as: the implementation of a software function must fulfill the content requirements.
In view of the foregoing, in an implementation manner of the present application, referring to fig. 3, a flowchart of a third test point generation method is provided, and compared with the embodiment shown in fig. 1, the test point generation method in this embodiment further includes the following steps.
S104: a requirement type of the functional requirement is obtained.
Specifically, the requirement type may be set by a developer, and in view of this, in an implementation manner of the present application, the requirement type may also be obtained from a function requirement file.
S105: and when the requirement type characterization function requirement is a first type of function requirement, obtaining at least one survival characteristic for supporting normal realization of the function to be tested.
Wherein, the first kind of function requirements are as follows: functional requirements other than basic functional requirements, the functions to be tested are: and software functions corresponding to the functional requirements.
Specifically, the survival characteristics can be understood as follows: the operating environment includes a property.
For the function to be tested, the function is difficult to exist independently in the process of realizing the function, and generally has a living environment required by the function, and the living environment can be regarded as being composed of characteristics, namely the characteristics included in the operating environment for supporting the normal realization of the function to be tested, namely the living characteristics, because the living characteristics need to be tested in the testing process to ensure that the generated features work normally.
For example, for the software function of the network device, the survival characteristic may be an interface, a route, a device type, a dual-device hot-standby function, and the like.
S106: and obtaining the survival test value of each survival characteristic in the at least one survival characteristic according to the preset corresponding relation between the survival characteristic and the survival test value.
The predetermined correspondence between the survival characteristic and the survival test value may be stored in a second information base.
Because the corresponding relation between the survival characteristic and the survival test value is preset, the second information base can also be understood as preset, so that the corresponding relation between the survival characteristic and the survival test value accumulated in the test process can be continuously updated to the second information base along with the development of test work, the corresponding relation stored in the second information base is continuously improved, and the test analysis result after the test is finished can be effectively inherited.
Specifically, the survival test value of a survival characteristic can be understood as: this survival property is valued during the test.
S107: and generating a second test point with function requirements according to the obtained survival test value and the test point description.
As can be seen from the above, in this embodiment, when the function requirement is a first type of function requirement except a basic function requirement, the test point is generated according to the survival characteristic, so that the generated test point is richer, and more comprehensive test on the software function is facilitated in the following process.
In an implementation manner of the present application, the generating the second test point of the functional requirement according to the obtained survival test value and the test point description (S107) may include the following process.
And aiming at each survival characteristic, generating a second test point with function requirement according to the following mode:
generating a test condition template containing the characteristic representation information of the survival characteristic according to a preset condition generation rule, and determining a test point template formed by the test condition template and the test point description;
and replacing the characteristic representation information of the survival characteristic in the determined test point template by the test value of the survival characteristic aiming at each survival characteristic to obtain a second test point with the function requirement.
The characteristic representation information of one survival characteristic may be understood as: information indicating the survival characteristic, for example, a specific character or variable, a combination of a specific character or variable and a specific symbol, or the like.
Wherein, the test condition template can be understood as: and generating a template by using the characteristic representation information of the survival characteristic according to a preset condition generation rule.
The condition generating rule may be determined according to a relationship between the survival characteristic and the function to be tested, for example, the relationship between the generating characteristic and the function to be tested may be: and when the survival characteristic takes a certain survival test value, the function to be tested realizes the function requirement and the like. In this case, the preset condition generating rule may be a rule expressed by one of the lower templates:
the case at … …, when … …, etc.
Wherein, the position "… …" is: the characteristics represent information, and thus "… …" in the above pattern is replaced by the survival test value of the survival characteristic when the test condition template is generated.
For example, the test condition template may be: in the case of the "property representing information",
the site description may be: xxxxx [ yyy ] xxxxx [ zzz ] xxxxx,
the test point template may thus be:
in the case of the "property expression information", xxxxx [ yyy ] xxxxx [ zzz ] xxxxx,
then, in the replacement process, the above-mentioned "property indicating information" is replaced with the survival test value of the survival property.
In addition, [ yyy ], [ zzz ] may also be replaced with the implementation parameters of the test key.
In the implementation mode, the test point template is generated firstly, and then the test value of the survival characteristic replaces the characteristic representation information used for representing the survival characteristic in the template, so that the test point can be conveniently generated by a machine.
In another implementation manner of the present application, referring to fig. 4, a schematic flow chart of a fourth test point generation method is provided, and compared with the foregoing embodiment shown in fig. 3, in this embodiment, the test point generation method further includes the following steps.
S108: and when the requirement type characterization function requirement is the first type of function requirement, taking the characteristic having a combined execution relation with the function to be tested as a combined characteristic, and respectively obtaining the execution relation between the function to be tested and each combined characteristic.
For the functions to be tested, it may be difficult to satisfy the user's requirements by itself, and the user's requirements can be completed only by combining with other characteristics.
When the combination of the functions to be tested and the combination characteristics meets the requirements of the user, the two functions may have different execution relations, that is, the two functions may have different execution orders, for example:
the function to be tested is performed before the combined characteristic, the function to be tested is performed after the combined characteristic, and so on.
S109: and aiming at each combination characteristic, according to the execution relation between the function to be tested and the combination characteristic, using the test point formed by the test condition corresponding to the combination characteristic and the test point description as a third test point of the function requirement.
Wherein, the test condition corresponding to one combination characteristic is as follows: a combined test value of the combined characteristic is generated in combination with the execution relation of the function to be tested and the combined characteristic.
Specifically, the combined test value of a combined characteristic can be understood as: this combined characteristic takes value during the test.
Since the execution sequence between the function to be tested and the combination property may be different, the test conditions corresponding to different combination properties may also be different.
For example, when the function to be tested is executed before the combined characteristic, the function to be tested is a precondition for the execution of the combined characteristic, in this case, the test condition corresponding to the combined characteristic may be: a combined test value of a combined property + "functional" validity test, assuming that a combined test value of a certain combined property is: MM, the testing condition for this combined characteristic is: testing the effectiveness of the MM function;
when the function to be tested is executed after the combined characteristic, the combined characteristic is a precondition for the execution of the function to be tested, in this case, the test condition corresponding to the combined characteristic may be: "in the case of" + one combined test value of a combined property + "function execution", it is assumed that one combined test value of a certain combined property is: NN, the test conditions for this combined characteristic are: in the case of NN function execution.
The "+" indicates a connector, that is, information before and after the symbol is connected together, and when information is connected, the connected information is "content of" and "the symbol is not included".
For a combination characteristic, when a test point formed by the test condition corresponding to the combination characteristic and the test point description is determined according to the execution relation between the function to be tested and the combination characteristic, the test point formed by placing the test condition corresponding to the combination characteristic before the test point description or the test point formed by placing the test condition corresponding to the combination characteristic after the test point description is determined according to the execution relation between the function to be tested and the combination characteristic.
For example, if the function to be tested is executed before combining the features, then the test points are: the test point describes the test condition corresponding to the + combination characteristic;
when the function to be tested is executed after combining the features, then the test points are: and combining the test conditions + test point description corresponding to the characteristics.
It should be noted that other implementation manners of generating the test point in combination with the combination characteristic are similar to the manner of generating the test point in combination with the survival characteristic, and the difference is that the combination characteristic and the survival characteristic are different, and therefore, the details are not described herein again.
As can be seen from the above, in this embodiment, when the function requirement is a first type of function requirement except a basic function requirement, the test point is generated according to the combination characteristic, so that the generated test point is richer, and more comprehensive test on the software function is facilitated in the following.
In an implementation manner of the present application, the test point generating method may further include the following steps.
Obtaining test types of functions to be tested, and taking the characteristics of the functions to be tested, which need to be tested, of each test type as functional characteristics, wherein the functions to be tested are as follows: software functions corresponding to the functional requirements;
and aiming at each test type, generating a fourth test point according to the functional characteristics of the function to be tested under the test type.
The implementation manner may be executed after the test points of each function requirement of the function to be tested are generated, and certainly may also be executed after all the test points of one function requirement of the function to be tested are generated, which is not limited in the present application.
In testing software functions, it is possible to test for different aspects, i.e. there are various test types, for example: stress testing, anomaly testing, safety testing, and the like. Based on this, in order to test the software function more comprehensively, test points can be generated for different test types of the software function in addition to the test point generation modes provided in the foregoing embodiments.
In an implementation manner of the present application, when a test point is generated according to a functional characteristic that a function to be tested needs to be tested in a test type for each test type, the test point may be generated according to the following manner for each test type:
judging whether a preset character string for identifying the functional characteristics exists in the functional test value of the test type;
if the test result exists, replacing a preset character string in the function test value by information containing the target function characteristic, and taking the replaced function test value as a fourth test point, wherein the target function characteristic is as follows: the function to be tested needs to be tested under the test type of the test value;
and if the target function characteristic does not exist, generating a fourth test point containing the information of the target function characteristic and the test value.
Specifically, the preset character string may be "()" or the like.
The information of the target functional characteristic may be determined according to a specific scenario of the software functional test, for example, the information of the target functional characteristic may be: the information formed by the target function characteristic and the three words of "function" may also be: test values, target functional characteristics, and information formed by the five words "functional validity", and so on.
Assume that the functional test values for one test type are: xxxxx () xxxxx, with the predetermined string: () The target functional characteristics are: PP, then the information of the target functional characteristics may be: and PP functions, wherein test points generated after information replacement are as follows: the function of xxxxxpxxxxx;
further assume that the test values are: QQ, then the information of the target functional characteristic may be: the QQPP function validity, the test point generated after carrying out information replacement is: xxxxxQQPP functional validity xxxxx.
Specifically, the functional test value of a test type can be understood as: this test type takes values during the test.
The functional test value of a test type may be determined according to a preset correspondence of the test type and the functional test value.
Specifically, the correspondence between the test type and the functional test value may be stored in the third information base.
In addition, because the corresponding relationship between the test type and the functional test value is preset, the third information base can also be understood as being preset, so that along with the development of test work, the corresponding relationship between the test type and the functional test value accumulated in the test process can be continuously updated to the third information base, the corresponding relationship stored in the third information base is continuously improved, and the test analysis result after the test is completed can be effectively inherited.
It should be noted that, in the embodiment of the present application, the first information base, the second information base, and the third information base may be the same information base or different information bases, and the present application does not limit this.
As can be seen from the above, in this embodiment, test points are generated for different test types of the test function, so that the generated test points are richer, and more comprehensive test on the software function is facilitated in the following process.
When the test point generation scheme provided by each embodiment is applied to generate the test points, the test point generation efficiency is improved because the test points are not influenced by factors such as working experience, working arrangement and the like of testers, so that software function developers can efficiently obtain the test points and refer to the test points, the test points can reversely guide the developers to develop software functions, development idea is improved, and the improvement of the quality of the software functions is facilitated for the developers.
In addition, because the dependency of the test point generating process on the working experience of the tester is reduced, the tester with insufficient working experience can still generate high-quality test points, and the quality difference of the test points generated by the testers with different working experiences is reduced.
Corresponding to the test point generation method, the embodiment of the application also provides a test point generation device.
Fig. 5 is a schematic structural diagram of a first test point generation apparatus provided in an embodiment of the present application, where the apparatus includes:
an information obtaining module 501, configured to obtain test point descriptions of functional requirements, and use test keywords in the test point descriptions as first-type test keywords;
a parameter obtaining module 502, configured to obtain an implementation parameter of each first type of test keyword according to a preset corresponding relationship between the test keyword and the implementation parameter;
a first test point generating module 503, configured to replace the test keywords in the test point description with target implementation parameters formed by implementation parameters of a first type of test keywords, respectively, to generate a first test point corresponding to the target implementation parameters, where the target implementation parameters include: a combined implementation parameter and/or an independent implementation parameter, one combined implementation parameter comprising: an implementation parameter for each of the at least two first type test keys, an independent implementation parameter comprising: an implementation parameter for a first type of test key.
As can be seen from the above, in the scheme provided in this embodiment, after the test point description of the functional requirement and the test key words described by the test point are obtained, the implementation parameters of the test key words are obtained according to the preset corresponding relationship between the test key words and the implementation parameters, and then the test key words in the test point description are respectively replaced by the target implementation parameters formed by the implementation parameters of the first type of test key words, so as to generate the test points corresponding to the target implementation parameters. Compared with the prior art, the scheme provided by the embodiment can be used for automatically generating the test points without manual operation of testers, so that the process of generating the test points is less influenced by the factors such as the working experience and the work arrangement of the testers, and the efficiency of generating the test points can be improved.
In an implementation manner of the present application, referring to fig. 6, a schematic structural diagram of a second test point generation apparatus is provided, and compared with the foregoing embodiment shown in fig. 5, in this embodiment, the test point generation apparatus further includes:
a type obtaining module 504, configured to obtain a requirement type of the function requirement;
a survival characteristic obtaining module 505, configured to obtain at least one survival characteristic for supporting normal implementation of a function to be tested when the requirement type represents that the function requirement is a first type of function requirement, where the first type of function requirement is: functional requirements other than basic functional requirements, the functions to be tested being: a software function corresponding to the function requirement;
a test value obtaining module 506, configured to obtain a survival test value of each survival characteristic in the at least one survival characteristic according to a preset corresponding relationship between the survival characteristic and the survival test value;
a second test point generating module 507, configured to generate a second test point of the function requirement according to the obtained survival test value and the test point description.
In an implementation manner of the present application, the second test point generating module 507 is specifically configured to generate a second test point of the function requirement for each survival characteristic;
the second test point generating module 507 includes:
the template determining unit is used for generating a test condition template containing the characteristic representation information of the survival characteristic according to the preset condition generating rule and determining a test point template formed by the test condition template and the test point description;
and the test point obtaining unit is used for replacing the characteristic representation information of the survival characteristic in the determined test point template with the survival test value of the survival characteristic to obtain the second test point of the function requirement.
As can be seen from the above, in this embodiment, when the function requirement is a first type of function requirement except a basic function requirement, the test point is generated according to the survival characteristic, so that the generated test point is richer, and more comprehensive test on the software function is facilitated in the following process.
In an implementation manner of the present application, referring to fig. 7, a schematic structural diagram of a third test point generation apparatus is provided, and compared with the foregoing embodiment shown in fig. 6, in this embodiment, the test point generation apparatus further includes:
a relationship obtaining module 508, configured to, when the requirement type represents that the function requirement is the first type of function requirement, take a characteristic having a combined execution relationship with the function to be tested as a combined characteristic, and obtain an execution relationship between the function to be tested and each combined characteristic respectively;
a third test point generating module 509, configured to, for each combination characteristic, according to the execution relationship between the function to be tested and the combination characteristic, use a test point formed by the test condition corresponding to the combination characteristic and the test point description as a third test point of the function requirement, where a test condition corresponding to one combination characteristic: and generating a combined test value of the combined characteristic by combining the execution relation of the function to be tested and the combined characteristic.
As can be seen from the above, in this embodiment, when the function requirement is a first type of function requirement except a basic function requirement, the test point is generated according to the combination characteristic, so that the generated test point is richer, and more comprehensive test on the software function is facilitated in the following.
In an implementation manner of the present application, the test point generating apparatus may further include:
the function characteristic obtaining module is used for obtaining the test type of the function to be tested and taking the characteristic of the function to be tested, which needs to be tested, of each test type as the function characteristic, wherein the function to be tested is as follows: a software function corresponding to the function requirement;
and the fourth test point generating module is used for generating a fourth test point according to the functional characteristics of the function to be tested under the test type aiming at each test type.
Specifically, the fourth test point generating module is specifically configured to generate a test point according to the following manner for each test type:
judging whether a preset character string for identifying functional characteristics exists in the functional test value of the test type;
if yes, replacing a preset character string in the functional test value by information containing target functional characteristics, and taking the replaced functional test value as a fourth test point, wherein the target functional characteristics are as follows: the function to be tested needs to test the function characteristic under the test type of the function test value;
and if the target function characteristic does not exist, generating a fourth test point containing the information of the target function characteristic and the function test value.
As can be seen from the above, in this embodiment, test points are generated for different test types of the test function, so that the generated test points are richer, and more comprehensive test on the software function is facilitated in the following process.
Corresponding to the test point generation method and device, the embodiment of the application also provides electronic equipment. The electronic device includes a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the test point generation method provided by the embodiment of the application is realized.
In an implementation manner of the present application, the test point generation method includes:
obtaining test point description of functional requirements, and taking test keywords in the test point description as first-class test keywords;
obtaining an implementation parameter of each first type of test keyword according to a preset corresponding relation between the test keyword and the implementation parameter;
replacing the test keywords in the test point description with target implementation parameters formed by implementation parameters of the first type of test keywords, respectively, to generate first test points corresponding to the target implementation parameters, where the target implementation parameters include: a combined implementation parameter and/or an independent implementation parameter, one combined implementation parameter comprising: an implementation parameter for each of the at least two first type test keys, an independent implementation parameter comprising: an implementation parameter for a first type of test key.
It should be noted that other implementation manners of the test point generation method, which are caused by the machine executable instruction by the processor to implement, are the same as the various implementation manners of the foregoing method embodiment, and are not described herein again.
The machine-readable storage medium may include Random Access Memory (RAM) and may also include Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the machine-readable storage medium may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
As can be seen from the above, in the scheme provided in this embodiment, after obtaining the test point description of the functional requirement and the test key word described in the test point, the electronic device obtains the implementation parameter of each test key word according to the preset corresponding relationship between the test key word and the implementation parameter, and then replaces the test key word in the test point description with each target implementation parameter formed by the implementation parameter of the first type of test key word, thereby generating the test point corresponding to the target implementation parameter. Compared with the prior art, the scheme provided by the embodiment can be used for automatically generating the test points without manual operation of testers, so that the process of generating the test points is less influenced by the factors such as the working experience and the work arrangement of the testers, and the efficiency of generating the test points can be improved.
Embodiments of the present application also provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: the test point generation method provided by the embodiment of the application is realized.
In an implementation manner of the present application, the test point generation method includes:
obtaining test point description of functional requirements, and taking test keywords in the test point description as first-class test keywords;
obtaining an implementation parameter of each first type of test keyword according to a preset corresponding relation between the test keyword and the implementation parameter;
replacing the test keywords in the test point description with target implementation parameters formed by implementation parameters of the first type of test keywords, respectively, to generate first test points corresponding to the target implementation parameters, where the target implementation parameters include: a combined implementation parameter and/or an independent implementation parameter, one combined implementation parameter comprising: an implementation parameter for each of the at least two first type test keys, an independent implementation parameter comprising: an implementation parameter for a first type of test key.
It should be noted that other implementation manners of the test point generation method that the machine executable instruction causes the processor to implement are the same as the various implementation manners of the foregoing method embodiment, and are not described herein again.
As can be seen from the above, in the scheme provided in this embodiment, after the executable instruction stored in the machine-readable storage medium is executed to obtain the test point description of the functional requirement and the test key words of the test point description, the implementation parameters of each test key word are obtained according to the preset corresponding relationship between the test key words and the implementation parameters, and then the test key words in the test point description are respectively replaced by each target implementation parameter formed by the implementation parameters of the first type of test key words, so as to generate the test points corresponding to the target implementation parameters. Compared with the prior art, the scheme provided by the embodiment can be used for automatically generating the test points without manual operation of testers, so that the process of generating the test points is less influenced by the factors such as the working experience and the work arrangement of the testers, and the efficiency of generating the test points can be improved.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the embodiments of the apparatus, the electronic device, and the machine-readable storage medium, since they are substantially similar to the embodiments of the method, the description is simple, and in relation to the embodiments, reference may be made to the partial description of the embodiments of the method.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (10)

1. A test point generation method is characterized by comprising the following steps:
obtaining test point description of functional requirements, and taking test keywords in the test point description as first-class test keywords;
obtaining an implementation parameter of each first type of test keyword according to a preset corresponding relation between the test keyword and the implementation parameter;
replacing the test keywords in the test point description with target implementation parameters formed by implementation parameters of the first type of test keywords, respectively, to generate first test points corresponding to the target implementation parameters, where the target implementation parameters include: a combined implementation parameter and/or an independent implementation parameter, one combined implementation parameter comprising: an implementation parameter for each of the at least two first type test keys, an independent implementation parameter comprising: an implementation parameter for a first type of test key; the target implementation parameters adopted in the process of replacing the test keywords comprise implementation parameters of each first type of test keywords.
2. The method of claim 1, further comprising:
obtaining a requirement type of the function requirement;
when the requirement type represents that the function requirement is a first type of function requirement, obtaining at least one survival characteristic for supporting normal realization of a function to be tested, wherein the first type of function requirement is as follows: functional requirements other than basic functional requirements, the functions to be tested being: a software function corresponding to the function requirement;
obtaining a survival test value of each survival characteristic in the at least one survival characteristic according to a preset corresponding relation between the survival characteristic and the survival test value;
and generating a second test point of the function requirement according to the obtained survival test value and the test point description.
3. The method of claim 2, wherein the step of generating the second site of the functional requirement based on the obtained survival test value and the site description comprises:
and aiming at each survival characteristic, generating a second test point of the function requirement according to the following mode:
generating a test condition template containing the characteristic representation information of the survival characteristic according to the preset condition generation rule, and determining a test point template formed by the test condition template and the test point description;
and replacing the characteristic representation information of the survival characteristic in the determined test point template with the survival test value of the survival characteristic to obtain a second test point of the functional requirement.
4. A method according to claim 2 or 3, characterized in that the method further comprises:
when the requirement type represents that the function requirement is the first type of function requirement, taking a characteristic having a combined execution relation with the function to be tested as a combined characteristic, and respectively obtaining the execution relation between the function to be tested and each combined characteristic;
regarding each combination characteristic, according to the execution relation between the function to be tested and the combination characteristic, taking a test point formed by the test condition corresponding to the combination characteristic and the test point description as a third test point of the function requirement, wherein the test condition corresponding to one combination characteristic: and generating a combined test value of the combined characteristic by combining the execution relation of the function to be tested and the combined characteristic.
5. The method of claim 1, further comprising:
obtaining test types of functions to be tested, and taking the characteristics of the functions to be tested, which need to be tested, of each test type as functional characteristics, wherein the functions to be tested are as follows: a software function corresponding to the function requirement;
and aiming at each test type, generating a fourth test point according to the functional characteristics of the function to be tested under the test type.
6. The method of claim 5, wherein the step of generating test points according to the functional characteristics of the function to be tested under the test type for each test type comprises:
for each test type, test points are generated as follows:
judging whether a preset character string for identifying functional characteristics exists in the functional test value of the test type;
if yes, replacing a preset character string in the functional test value by information containing target functional characteristics, and taking the replaced functional test value as a fourth test point, wherein the target functional characteristics are as follows: the function to be tested needs to test the function characteristic under the test type of the function test value;
and if the target function characteristic does not exist, generating a fourth test point containing the information of the target function characteristic and the function test value.
7. A test point generation apparatus, the apparatus comprising:
the information acquisition module is used for acquiring test point descriptions of functional requirements and taking test keywords in the test point descriptions as first-class test keywords;
the parameter obtaining module is used for obtaining the implementation parameters of each first type of test key word according to the preset corresponding relation between the test key word and the implementation parameters;
a first test point generation module, configured to replace the test keywords in the test point description with target implementation parameters formed from implementation parameters of a first type of test keywords, respectively, and generate a first test point corresponding to the target implementation parameters, where the target implementation parameters include: a combined implementation parameter and/or an independent implementation parameter, one combined implementation parameter comprising: an implementation parameter for each of the at least two first type test keys, an independent implementation parameter comprising: an implementation parameter for a first type of test key; the target implementation parameters adopted in the process of replacing the test keywords comprise implementation parameters of each first type of test keywords.
8. The apparatus of claim 7, further comprising:
the type obtaining module is used for obtaining the requirement type of the function requirement;
a survival characteristic obtaining module, configured to obtain at least one survival characteristic for supporting normal implementation of a function to be tested when the requirement type represents that the function requirement is a first type of function requirement, where the first type of function requirement is: functional requirements other than basic functional requirements, the functions to be tested being: a software function corresponding to the function requirement;
the test value obtaining module is used for obtaining the survival test value of each survival characteristic in the at least one survival characteristic according to the preset corresponding relation between the survival characteristic and the survival test value;
and the second test point generation module is used for generating a second test point of the function requirement according to the obtained survival test value and the test point description.
9. An electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: carrying out the method steps of any one of claims 1 to 6.
10. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: carrying out the method steps of any one of claims 1 to 6.
CN201810263820.8A 2018-03-28 2018-03-28 Test point generation method and device Active CN108733557B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810263820.8A CN108733557B (en) 2018-03-28 2018-03-28 Test point generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810263820.8A CN108733557B (en) 2018-03-28 2018-03-28 Test point generation method and device

Publications (2)

Publication Number Publication Date
CN108733557A CN108733557A (en) 2018-11-02
CN108733557B true CN108733557B (en) 2022-02-25

Family

ID=63940632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810263820.8A Active CN108733557B (en) 2018-03-28 2018-03-28 Test point generation method and device

Country Status (1)

Country Link
CN (1) CN108733557B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901054A (en) * 2019-03-25 2019-06-18 苏州中晟宏芯信息科技有限公司 The function coverage model measurement point extracting method and system of fixed and floating conversion circuit
CN111352832A (en) * 2020-02-24 2020-06-30 腾讯科技(成都)有限公司 Method and device for automatically testing page
CN113190434B (en) * 2021-04-12 2024-03-08 成都安易迅科技有限公司 Test case generation method and device, storage medium and computer equipment
CN113672498B (en) * 2021-07-19 2023-09-15 华人运通(江苏)技术有限公司 Automatic diagnosis test method, device and equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043716A (en) * 2010-12-24 2011-05-04 南京联创科技集团股份有限公司 Automatic software testing method based on business driving
CN102254035A (en) * 2011-08-09 2011-11-23 广东电网公司电力科学研究院 Relational database testing method and system
JP6248008B2 (en) * 2014-07-29 2017-12-13 日立オートモティブシステムズ株式会社 Software verification system and control device
CN104503900A (en) * 2014-11-21 2015-04-08 北京奇虎科技有限公司 Test case generation method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
关键字驱动的自动化测试框架设计与实现;王磊;《电子测试》;20100806(第08期);全文 *
基于全对偶算法的自动化测试方法;文俊浩等;《重庆大学学报(自然科学版)》;20051030(第10期);全文 *

Also Published As

Publication number Publication date
CN108733557A (en) 2018-11-02

Similar Documents

Publication Publication Date Title
CN108733557B (en) Test point generation method and device
Zhang et al. Repocoder: Repository-level code completion through iterative retrieval and generation
JP7095408B2 (en) Software program fault location
US8935794B2 (en) Verifying application security vulnerabilities
JP5669630B2 (en) Test case generation method, program and system
US20170228309A1 (en) System and method for equivalence class analysis-based automated requirements-based test case generation
US7865780B2 (en) Method for test case generation
EP3063634A1 (en) Software commit risk level
CN108874661B (en) Test mapping relation library generation method and device, computer equipment and storage medium
US10346290B2 (en) Automatic creation of touring tests
JP2008191963A (en) Source code verification system, source code verification method and source code verification program
US10509717B1 (en) System, method, and computer program for automatically testing software applications including dynamic web pages
US20090157827A1 (en) System and method for generating response email templates
WO2015039793A1 (en) Derivation of generalized test cases
JP2014021982A (en) Iterative generation of symbolic test drivers for object-oriented languages
Michelon et al. The life cycle of features in highly-configurable software systems evolving in space and time
US10823782B2 (en) Ensuring completeness of interface signal checking in functional verification
CN115576828A (en) Test case generation method, device, equipment and storage medium
US8813036B2 (en) Visual representation of a difference between Cartesian product models
US20160239407A1 (en) Small scale integration test generation
CN112988578A (en) Automatic testing method and device
US10839132B2 (en) Automatic cover point generation based on register transfer level analysis
US20170293549A1 (en) System and method for test generation from software specification models that contain nonlinear arithmetic constraints over real number ranges
CN111159028A (en) Webpage testing method and device
JP5758311B2 (en) Test code generation device, test code generation method, test code generation program

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
GR01 Patent grant
GR01 Patent grant