CN109697167B - Method and system for managing test variables, electronic device and storage medium - Google Patents
Method and system for managing test variables, electronic device and storage medium Download PDFInfo
- Publication number
- CN109697167B CN109697167B CN201811612102.3A CN201811612102A CN109697167B CN 109697167 B CN109697167 B CN 109697167B CN 201811612102 A CN201811612102 A CN 201811612102A CN 109697167 B CN109697167 B CN 109697167B
- Authority
- CN
- China
- Prior art keywords
- variable
- test
- variables
- current
- write
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 441
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000007726 management method Methods 0.000 claims abstract description 32
- 238000012163 sequencing technique Methods 0.000 claims abstract description 6
- 238000012986 modification Methods 0.000 claims description 6
- 230000004048 modification Effects 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 3
- 238000011161 development Methods 0.000 abstract description 9
- 238000013522 software testing Methods 0.000 abstract description 3
- 230000000007 visual effect Effects 0.000 abstract description 2
- 238000012545 processing Methods 0.000 description 13
- 238000010586 diagram Methods 0.000 description 10
- 230000000694 effects Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application provides a management method and system of a test variable, electronic equipment and a storage medium, relates to the field of software testing, and is used for solving the problem of variable management in the development process of a software test program. The management method comprises the following steps: acquiring a test step of current edition and a current test group to which the test step belongs; traversing the previous test group of the current test group, and acquiring variables and variable information created in each test step with write-in authority in the previous test group with write-in authority; traversing the previous test steps of the test steps edited currently in the current test group, and acquiring variables and variable information created by the previous test steps with write-in permission; and sequencing the acquired variables according to the context, wherein the variable information of the following variables covers the variable information of the same-name above variables to form an available variable table of the current edited testing step. According to the method and the device, the available variable table can be obtained for each testing step, so that the reference and the creation of the variables are facilitated, and the efficiency is improved through visual display of the webpage.
Description
Technical Field
The present application relates to the field of software testing, and in particular, to a method and system for managing test variables, an electronic device, and a storage medium.
Background
In the process of developing a software test program, each test step has the requirements of referencing variables and creating new variables, the later-executed test step can reference the variables created by the first-executed test step and can also create a new variable, and a large number of variables are referenced and created in the whole test process.
As the business is accumulated, the number of testing steps is increased, the generated variables are increased, and the reference and the creation of the variables are more complicated. Specifically, during the development testing step, when referencing a variable, the user needs to know where the variable was created, what the value of the variable is; when creating a variable, a user needs to know whether the created new variable will override the value of an existing homonymous variable.
In the existing common software testing framework, only the writing and reading functions of the variables are provided during the development and testing steps, that is, the variables can be created and referred, but all available variables cannot be known, and the source and value of each variable are not shown. The method is easy to refer to the nonexistent variable name during testing, or creates a same-name variable to cover the original variable and the like, so that the testing result is wrong or deviates from the expectation of a user.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present application and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
In view of this, the present application provides a method, a system, an electronic device, and a storage medium for managing test variables, so as to solve the problems in the prior art that when editing test steps, an available variable list, a variable source, and a variable value cannot be obtained, and thus, when a non-existent variable is referred to, when a wrong variable name is referred to, and when a new variable is added, a same-name variable is covered.
According to an aspect of the present application, there is provided a test variable management method, including: acquiring a test step of current edition and a current test group to which the test step belongs; traversing the previous test group of the current test group, and acquiring variables and variable information created in each test step with write-in authority in the previous test group with write-in authority; traversing the previous test step of the test step edited currently in the current test group, and acquiring the variable and the variable information created by the previous test step with the write-in permission; and sequencing the acquired variables according to the context, wherein the variable information of the following variables covers the variable information of the same-name above variables to form the available variable table of the current edited testing step.
Preferably, the management method further includes: acquiring the write-in permission of the test step of the current edition; if the current edited testing step has the write-in permission, sorting the variables in the available variable table of the current edited testing step and the variables created in the current edited testing step according to the context, wherein the variable information of the following variables covers the variable information of the same-name preceding variables to form a variable result table of the current edited testing step; and using the variable result table of the current edited test step as an available variable table of the adjacent following test step in the current test group.
Preferably, the management method further includes: acquiring the write-in permission of the current test group; if the current test group has the write-in authority, taking a variable result table of the lowest test step with the write-in authority in the current test group as a variable result table of the current test group; and using the variable result table of the current test set as an available variable table of the uppermost test step in the adjacent lower test set.
Preferably, in the above management method, the variable information of a variable includes a name, a value, and a creation source of the variable.
Preferably, in the above management method, the step of overwriting the variable information of the following variable with the variable information of the preceding variable of the same name includes: acquiring a current variable and variable information thereof; checking whether the current variable in the context sorting has the above variable with the same name; and if so, covering the variable information of the current variable with the variable information of the above variable with the same name.
Preferably, the management method further includes: receiving a modification request, and acquiring a corresponding test step to be modified and a corresponding amount to be modified; modifying the variable information of the amount to be modified in the step of testing to be modified; and acquiring the write-in permission of the test step to be modified, if the test step to be modified has the write-in permission, judging whether the following test step of the test step to be modified creates a following variable with the same name as the to-be-modified quantity; if so, covering the variable information of the to-be-modified quantity to an available variable table of the adjacent following test step of creating the same-name variable; and if not, adding the variable information of the quantity to be corrected to an available variable table of each following test step.
Preferably, in the above management method, if the test step to be modified has a write permission, the method further includes: acquiring a test group to be modified to which the test step to be modified belongs and the write-in permission of the test group to be modified; when the test set to be modified does not have the write right, whether the context variable with the same name as the quantity to be modified is created or not is searched in the context test step of the test set to be modified.
Preferably, the management method further includes: and displaying the available variable table on an editing page of the currently edited testing step.
According to another aspect of the present application, there is provided a test variable management system including: the test step acquisition module is used for acquiring the test step edited currently and the current test group to which the test step belongs; the first traversal module is used for traversing the previous test group of the current test group and acquiring the variables and variable information created in the test steps with the write-in authority in the previous test group with the write-in authority; the second traversal module is used for traversing the previous test steps of the current edited test steps in the current test group and acquiring the variables and variable information created by the previous test steps with write-in permission; and the available list generating module is used for sequencing the acquired variables according to the context, and the variable information of the following variables covers the variable information of the same-name preceding variables to form the available variable list of the current edited testing step.
According to another aspect of the present application, there is provided an electronic device including: a processor; and a memory for storing executable instructions; wherein the processor is configured to perform the steps of the method of managing test variables described above via execution of the executable instructions.
According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method for managing test variables as described above.
This application lies in with prior art's beneficial effect:
according to the method and the device, in the editing process of the testing step, the variable list which can be used in the current editing testing step can be checked, the name, value and creation source of each variable are displayed, the defect that the available variables are found manually is overcome, and the working efficiency is improved;
the method has the advantages that the upper variables are covered by the lower variables with the same name, so that the only and correct available variables are obtained in each testing step during editing, and the accuracy of variable reference and creation is improved;
the available variable list is displayed based on the webpage, client software does not need to be installed, and the method is visual and convenient.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 is a schematic diagram illustrating steps of a method for managing test variables according to an embodiment of the present application;
FIGS. 2 and 3 are schematic diagrams illustrating steps in an embodiment for further processing of the available variable table for a currently edited test step;
FIG. 4 is a diagram illustrating steps of modifying a variable to be modified in the embodiment;
FIG. 5 is a block diagram of a management system for testing variables according to an embodiment of the present application;
FIG. 6 is a block diagram of another test variable management system according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device in an embodiment of the present application;
fig. 8 shows a schematic structural diagram of a computer-readable storage medium in an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar structures, and thus their repetitive description will be omitted.
The management method of the test variables is applied to the development stage of the software test program and is used for managing the variables involved in the development process of the software test program. The method can be used in the initial stage of development and in the development process, and the 'currently edited testing step' can be any one of the testing steps of the software testing program. The following describes a method for managing test variables in the present application, taking the management of variables in the development process of a software test program as an example.
Fig. 1 is a schematic diagram illustrating a method for managing test variables according to an embodiment, and referring to fig. 1, in some embodiments, the method for managing test variables includes:
and S10, acquiring the test step of the current edition and the current test group to which the test step belongs.
And S20, traversing the previous test group of the current test group, and acquiring the variables and the variable information created in the test step with the write-in authority in the previous test group with the write-in authority.
S30, traversing the previous testing steps of the current edited testing steps in the current testing group, and acquiring the variables and the variable information created by the previous testing steps with the writing authority.
And S40, sequencing the acquired variables according to the context, covering the variable information of the following variables with the variable information of the same-name preceding variables, and forming an available variable table of the current edited testing step.
The test group is a test case or a test scene, and the software test program usually comprises a plurality of test groups to realize comprehensive tests under different conditions. Each test set includes one or more test steps. The writing authority refers to whether authority is written into the context, and influences on variables of the context. If one test step has write-in permission, the variable of the test step can be written into the context, covers the homonymous variable of the above and is quoted by the test step of the following; if a test step does not have write permission, the variables of the test step only take effect on the test step itself. The write-in permission of the test group is the same, if one test group has write-in permission, the variable of the test step with the write-in permission in the test group can be written into the global context, covers the homonymous variable of the above and is quoted by the test step of the following; if a test group does not have the write permission, the variables of the test steps with the write permission in the test group only take effect in the test group, that is, only the context of the test group can be written, and the variables of other test groups are not influenced.
Therefore, when the management method for test variables of the present application is used for the first time in the development process of the software test program, as described in S20, the above test group of the current test group is traversed, and the variables and the variable information created by each test step having the write authority in the above test group having the write authority are acquired. Therefore, in the above environment of the current test group, the variable which can be written into the current test group is obtained. And as described in S30, traversing the above test steps of the test steps currently edited in the current test group, and acquiring the variables and the variable information created by the above test steps with the write permission. Therefore, in the above environment of the current test group of the current edited test step, the variable which can be written in the current edited test step is obtained. The sum of the variables obtained in S20 and S30 is the variable that can be written to the currently edited test step in the global context of the currently edited test step. The acquired variables may have the same name, so through S40, the acquired variables are sorted according to the context, the variable information of the following variables covers the variable information of the same name above variables, no retention of the same name variables occurs, and finally the available variable table of the test step of the current edit is formed in a summary manner.
In the preferred embodiment, whether the variables are of the same name is judged by the names of the variables. The variable information of each variable comprises the name, value and creation source of the variable, and the name of the variable can be used as an identifier for distinguishing different variables. When the names of the two variables are the same, the two variables are judged to be identical, and the variable information of the following variable is adopted to cover the variable information of the upper variable with the same name, so that one name is ensured to correspond to one effective variable, and the accuracy of variable management is improved. Based on this, the step of S40 in which the variable information of the context variable overrides the variable information of the context variable of the same name specifically includes: acquiring a current variable and variable information thereof; checking whether the current variable in the context sorting has the above variable with the same name; if yes, the variable information of the current variable is overlaid with the variable information of the above variable with the same name. The context sorting is sorting of the variables acquired in S20 and S30 according to the context.
All the testing steps with the write-in permission above the testing step of the current edition in the global are obtained by judging the write-in permission of each testing step above the testing step of the current edition, and the obtained variables of the testing steps are subjected to de-duplication and summarization to form an available variable list of the testing step of the current edition. When the currently edited testing step is edited, any variable in the available variable list can be referred to, and a new variable can be created.
In a specific embodiment, the global context of the currently compiled test step 3-2 (the following example refers to the currently compiled test step 3-2 for step 3-2, and correspondingly, all the above test steps of step 3-2 are referred to as steps x-x) is referred to in the following table:
global context for step 3-2
The current test group in the step 3-2 is the test group 3, and in the above test groups of the test group 3, the test group 1 has write-in authority, and the test group 2 does not have write-in authority. Therefore, when the available variable table of step 3-2 is obtained, the step of testing with write permission of the above test group with write permission obtained in S20 includes: step 1-1 and step 1-2; the above test step of obtaining that the current test group has the write permission in S30 includes: and 3-1. The global above test step of step 3-2 with write permission comprises: step 1-1, step 1-2 and step 3-1. The variables created in step 1-1 include variable A and variable B, the variables created in step 1-2 include variable A and variable C, and the variables created in step 3-1 include variable E. Finally, after sorting by context and de-overwriting by S40, that is, after the variable information of the variable A created in step 1-2 is overwritten with the variable information of the variable A created in step 1-1, the available variable table (called as available variable table 3-2) of step 3-2 is formed as follows: { variable A: value 2, from step 1-2; a variable B: the value is dynamically obtained from step 1-1; a variable C: the values are obtained dynamically, from step 1-2; the variable E: value 8 from step 3-1. Step 3-2 may refer to any variable from the available variable table 3-2 at the time of editing, and may also recreate a new variable. The available variables in the step 3-2, the name, value, creation source and other variable information of each available variable can be clearly observed through the available variable table 3-2, so that the needed variables can be quickly selected, and the problems of wrong lead and missing lead caused by manually searching the variables and wrong coverage of the variables when new variables are created are avoided.
In a preferred embodiment, the available variable table 3-2 can be pushed to the editing page in the step 3-2 in a webpage display mode, that is, the available variable table is directly displayed on the editing page in the current editing test step, and client software does not need to be installed, so that the display is convenient. For example, the names of the available variables may be displayed in a pull-down menu manner, and when a certain available variable is triggered, information such as a value and a creation source of the available variable may be further displayed, and when the available variable is selected, the available variable may be referred to in a test step of the current editing.
Further, in the global context of step 3-2 shown in the above table, each test step can obtain its available variable table according to the methods described in S10-S40. Taking step 2-2 as an example, the above test step with write permission according to step 2-2 acquired in S20 and S30 includes: step 1-1, step 1-2 and step 2-1. The variables created in the step 1-1 comprise a variable A and a variable B, the variables created in the step 1-2 comprise a variable A and a variable C, and the variables created in the step 2-1 comprise a variable A and a variable B. Sorting according to context through S40, and removing duplication coverage, namely, after the variable information of the variable A created in the step 1-2 is covered by the variable information of the variable A created in the step 1-1, the variable information of the variable A created in the step 2-1 is covered by the variable information of the variable A created in the step 1-2, and the variable information of the variable B created in the step 2-1 is covered by the variable information of the variable B created in the step 1-1, an available variable table (called as an available variable table 2-2) of the step 2-2 is formed: { variable A: value 4 from step 2-1; a variable B: value 5 from step 2-1; a variable C: the value is dynamically obtained from step 1-2 }. Step 2-2 during editing, any variable may be referenced from the available variable table 2-2, or a new variable may be created. The obtaining principle of the available variable tables of the rest testing steps is consistent, so the description is omitted. The variables covered in the table above are briefly described below:
the dynamic acquisition refers to acquiring the value of a variable only when a test is executed, so that the dynamic acquisition is displayed as dynamic acquisition when the test step is edited, and the dynamic acquisition and the fixed value can be mutually covered. In the available variable table in the step 1-3, the variable A takes a value of 2, and the variable A in the step 1-2 covers the variable A with the same name in the step 1-1. In the available list in the step 2-1, the variable created in the step 1-3 cannot be acquired, because the step 1-3 has no write permission, the created variable only takes effect on the step 1-3, and the context cannot be written. In the available variable table of step 2-3, the value of the variable A is dynamically obtained, and the variable A created in step 2-2 is overlaid on the same-name variable A created in step 2-1. The available variable table for step 3-1 is the same as the available variable table for step 1-2, and is the variable created in the initial step 1-1. The available variable table of step 3-1 is not affected by each test step in test set 2, because test set 2 does not have write permission, and the variables created by each test step in test set 2 only take effect in the context of test set 2, and cannot be written into other test sets.
Further, in some preferred embodiments, in order to facilitate the acquisition of the available variable table of the subsequent testing step and avoid repeated acquisition and processing of data, the method for managing the testing variables further includes the step of further processing the available variable table of the currently edited testing step. Referring to fig. 2, the method for managing test variables further includes:
s501, acquiring write-in permission of the current edited test step; s502, if the current edited testing step has the write-in authority, sorting the variables in the available variable table of the current edited testing step and the variables created in the current edited testing step according to the context, wherein the variable information of the following variables covers the variable information of the same-name preceding variables to form a variable result table of the current edited testing step; and S503, taking the variable result table of the currently edited test step as an available variable table of the adjacent following test step in the current test group.
When the currently edited testing step has write-in authority, the created variable can be written in a context (the context here refers to the current testing group to which the currently edited testing step belongs), covers the above same-name variable of the current testing group, and is referred by the following testing step of the current testing group. Therefore, the variables in the available variable table of the currently edited testing step and the variables created in the currently edited testing step are deduplicated and summarized, that is, sorted by context, and the variable information of the following variables covers the variable information of the above variables with the same name, so as to form a variable result table of the currently edited testing step. The variable result table for the current compiled test step is used as the available variable table for the next test step in the current test set. From the perspective of the adjacent context testing step, when the adjacent context testing step acquires the available variable table thereof, it is not necessary to traverse each of the above testing steps with writing right, and it is only necessary to perform deduplication and summarization on the available variable table of the above testing step (i.e. the currently edited testing step) with the nearest neighbor having writing right and the variables created by the above testing step (i.e. the currently edited testing step) with writing right, so as to save the process of repeated data acquisition and processing.
Taking the global context of step 3-2 shown in the above table as an example, the test step currently being edited is, for example, step 1-2. Step 1-2 after obtaining its available variable table (i.e. the variables created in the initial step 1-1, including variables a and B) and creating the variables (including variables a and C), since step 1-2 has write authority, the created variables can be written into the context, so that through the process of S502, the available variable table of step 1-2 is sorted by context with the created variables, and the variable information of the following variables covers the variable information of the above variables with the same name, forming a variable result table of step 1-2 (including variable a from step 1-2, variable B from step 1-1, and variable C from step 1-2). The variable results table for steps 1-2 is used as the available variable table for the test steps 1-3 adjacent thereto in said test set 1.
Further, for mutual transmission of variables among different test groups, the write permission of the test group needs to be considered in addition to the write permission of the test step. When the test group has the write-in authority, the variable created in the test step with the write-in authority in the test group can be written into not only the context of the test group, but also other test groups, that is, the variable created in the test step with the write-in authority in the test group with the write-in authority can be written into the global context. And when the test group does not have the write right, the variable created by the test step with the write right in the test group only takes effect in the context of the test group.
Referring to fig. 3, in some embodiments, the method for managing test variables further includes: s601, acquiring the write-in permission of the current test group; s602, if the current test group has the write-in authority, taking a variable result table of the most following test step with the write-in authority in the current test group as a variable result table of the current test group; and S603, taking the variable result table of the current test group as an available variable table of the uppermost test step in the adjacent lower test group.
Still taking the global context of step 3-2 shown in the above table as an example, step 1-2 has write permission, and the test set 1 thereof has write permission, while none of the test steps (i.e., step 1-3) in the test set 1 below step 1-2 has write permission, so step 1-2 is the lowest test step in the test set 1 having write permission. The variable result table for step 1-2 is the variable result table for test set 1 and is the available variable table for the uppermost test step 2-1 of the next test set 2 below test set 1. From the perspective of the adjacent lower test set 2, the upper test step 2-1 does not need to acquire and process variables from the global upper environment when acquiring the available variable table, and only needs to locate the nearest upper test set with write permission, i.e. the test set 1, above the upper test set. And further acquiring a variable result table of a step 1-2 which is a lowest test step with write permission in the test group 1, and taking the variable result table as an available variable table of the highest test step 2-1. The following test steps (step 2-2, step 2-3) in test group 2 perform the acquisition of the available variable table using the logic steps of S501 to S503 described in the above embodiment.
When the uppermost test step 3-1 of the test set 3 is obtaining its available variable table, it is positioned to the nearest upper test set with write authority located above it in the same way, because the test set 2 has no write authority, it is positioned to the test set 1 with write authority, and it is further obtained to the lowermost test step with write authority in the test set 1, i.e. the variable result table of step 1-2, as its available variable table of the uppermost test step 3-1.
In the above embodiments, the test steps and the test groups without the write permission do not need to generate the variable result table, and the variable result table does not affect the context, so that data processing and resource occupation are saved.
Further, in some embodiments, when a variable of any test step is modified, for example, a variable is newly added in a certain test step, or the name of a variable is modified, or a variable is deleted, and the like, while the variable is modified, the influence of the modified variable on the context is calculated, and the context is dynamically modified in a synchronous manner. Referring to fig. 4, the method for managing test variables further includes:
s701, receiving a modification request, and acquiring a corresponding test step to be modified and a quantity to be modified; s702, modifying the variable information of the quantity to be modified in the testing step to be modified; s703, acquiring the write-in authority of the test step to be modified, and S704, if the test step to be modified has the write-in authority, judging whether the following test step of the test step to be modified creates a following variable with the same name as the to-be-modified variable; s705, if yes, covering the variable information of the variable to be modified to the available variable table of the adjacent following test step of which the same-name variable is created; and S706, if not, adding the variable information of the to-be-modified quantity to an available variable table of each following test step.
When a test step to be modified has write permission to modify the amount to be modified created, the following test steps are also affected. If the following test step creates the following variable with the same name as the to-be-modified variable, only the variable information of the to-be-modified variable needs to be covered to the available variable table of the adjacent following test step of which the same name variable is created. By adjacent context test step is meant the nearest neighbor context test step that created the same-name variable. And the other following test steps which create the same-name variable can use the variable information of the same-name variable in the variable table to come from the respective nearest preceding test step which creates the same-name variable and are not influenced by the test step to be modified. And if the following test step does not create the following variable with the same name as the to-be-modified quantity, adding the variable information of the to-be-modified quantity to an available variable table of each following test step for each following test step to refer to.
Further, in S706, when the variable information of the amount to be modified is added to the available variable table of each of the following test steps, the test group to be modified to which the test step to be modified belongs and the write permission of the test group to be modified need to be determined. When the test set to be modified does not have the write right, whether the context variable with the same name as the quantity to be modified is created or not is searched in the context test step of the test set to be modified so as to limit the influence of the quantity to be modified to the context of the test set to be modified. When the test set to be modified has write rights, the variable information of the amount to be modified may be added to the global available variable table of the following test step.
In the management method for the test variables in each embodiment, the available variable table of each test step is obtained in the editing process of the test step, and the names, values and creation sources of the available variables are visually displayed through a webpage, so that the variables are conveniently quoted and created; the context is dynamically modified in synchronization as variables are modified, ensuring the accuracy of the available variable table for each test step.
The embodiment of the application also provides a management system for the test variables. Referring to FIG. 5, in some embodiments, a management system for testing variables includes:
a test step acquiring module 10, configured to acquire a currently edited test step and a current test group to which the test step belongs. The test step acquiring module 10 may be configured to execute S10 described in the above embodiment of the method for managing test variables.
And the first traversal module 20 is configured to traverse the previous test group of the current test group, and obtain the variables and the variable information created in each test step with the write permission in the previous test group with the write permission. The first traversal module 20 can be used to execute S20 described in the above embodiments of the method for managing test variables.
And a second traversing module 30, configured to traverse the previous testing step of the currently edited testing step in the current testing group, and obtain the variable and the variable information created in the previous testing step with the write permission. The second traversal module 30 can be used to execute S30 described in the above embodiments of the method for managing test variables.
And the available list generating module 40 is configured to sort the acquired variables according to context, wherein the variable information of the following variables covers the variable information of the above variables with the same name, and form an available variable list of the currently edited testing step. The available list generating module 40 may be configured to execute S40 described in the above embodiment of the method for managing the test variables.
Further, in a preferred embodiment, the management system for testing variables may further include a module for further processing the available variable table and a module for modifying the variables. Referring to FIG. 6, in some embodiments, the management system for testing variables further comprises:
and a step result table generating module 50, configured to further process the available variable table in the current editing step according to the write permission in the current editing step, so as to form a variable result table in the current editing step. The step result table generating module 50 may be configured to execute steps S501 to S503 described in the above embodiments of the method for managing the test variables.
Further, the management system for testing variables further comprises: and a test group result table generating module 60, configured to further process the available variable table in the current test group according to the write permission of the current test group, so as to form a variable result table of the current test group. The test set result table generating module 60 may be configured to execute steps S601 to S603 described in the above embodiments of the method for managing the test variables.
Further, the management system for testing variables further comprises: and a modification module 70, configured to modify the variable to be modified in the test step to be modified according to the modification request, and synchronize the variable information of the variable to be modified to the context according to the write permission of the test step to be modified and the write permission of the test group in which the test step to be modified is located. The modification module 70 may be configured to perform steps S701 to S706 described in the above embodiments of the method for managing the test variables.
The management system for the test variables obtains the available variable table of each test step in the editing process of the test steps, and visually displays the names, values and creation sources of the available variables through the webpage, so that the variable reference and creation are facilitated; the context is dynamically modified in synchronization as variables are modified, ensuring the accuracy of the available variable table for each test step.
The embodiment of the present application further provides an electronic device, which includes a processor and a memory, where the memory stores executable instructions, and the processor is configured to execute the steps of the management method for test variables in the foregoing embodiments by executing the executable instructions.
As described above, in the editing process of the testing steps, the electronic device of the present application obtains the available variable table of each testing step, and visually displays the name, value and creation source of the available variable through the web page, thereby facilitating variable reference and creation; the context is dynamically modified in synchronization as variables are modified, ensuring the accuracy of the available variable table for each test step.
Fig. 7 is a schematic structural diagram of an electronic device in an embodiment of the present application, and it should be understood that fig. 7 only schematically illustrates various modules, which may be virtual software modules or actual hardware modules, and the combination, the splitting, and the addition of the remaining modules of these modules are within the scope of the present application.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" platform.
An electronic device 700 according to this embodiment of the present application is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, electronic device 700 is embodied in the form of a general purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one memory unit 720, a bus 730 connecting the different platform components (including memory unit 720 and processing unit 710), a display unit 740, etc.
Wherein the storage unit stores program code, which can be executed by the processing unit 710, to cause the processing unit 710 to perform the steps according to various exemplary embodiments of the present application, which are described in the above-mentioned management method for test variables section of the present specification. For example, the processing unit 710 may perform the steps shown in fig. 1 to 4, respectively.
The storage unit 720 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)7201 and/or a cache memory unit 7202, and may further include a read only memory unit (ROM) 7203.
The storage unit 720 may also include a program/utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The electronic device 700 may also communicate with one or more external devices 800 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 700, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 700 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 750. Also, the electronic device 700 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 760. The network adapter 760 may communicate with other modules of the electronic device 700 via the bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms, to name a few.
The embodiment of the present application further provides a computer-readable storage medium, which is used for storing a program, and when the program is executed, the steps of the method for managing the test variables of the above embodiments are implemented. In some possible embodiments, the various aspects of the present application may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the present application described in the above-mentioned method for managing test variables of the present description, when the program product is run on the terminal device.
As described above, the computer-readable storage medium of the present application obtains the available variable table of each test step in the editing process of the test step, and visually displays the name, value and creation source of the available variable through a web page, thereby facilitating variable reference and creation; the context is dynamically modified in synchronization as variables are modified, ensuring the accuracy of the available variable table for each test step.
Fig. 8 is a schematic structural diagram of a computer-readable storage medium of the present application. Referring to fig. 8, a program product 900 for implementing the above method according to an embodiment of the present application is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The foregoing is a more detailed description of the present application in connection with specific preferred embodiments and it is not intended that the present application be limited to these specific details. For those skilled in the art to which the present application pertains, several simple deductions or substitutions may be made without departing from the concept of the present application, and all should be considered as belonging to the protection scope of the present application.
Claims (9)
1. A method for managing test variables, comprising:
acquiring a test step of current edition and a current test group to which the test step belongs;
traversing the previous test group of the current test group, and acquiring variables and variable information created in each test step with write-in authority in the previous test group with write-in authority;
traversing the previous test step of the test step edited currently in the current test group, and acquiring the variable and the variable information created by the previous test step with the write-in permission;
sequencing the acquired variables according to context, wherein the variable information of the following variables covers the variable information of the same-name above variables to form an available variable table of the current edited testing step; and
acquiring the write-in permission of the test step of the current edition;
if the current edited testing step has the write-in permission, sorting the variables in the available variable table of the current edited testing step and the variables created in the current edited testing step according to the context, wherein the variable information of the following variables covers the variable information of the same-name preceding variables to form a variable result table of the current edited testing step;
using the variable result table of the currently edited test step as an available variable table of the adjacent following test step in the current test group; and
acquiring the write-in permission of the current test group;
if the current test group has the write-in authority, taking a variable result table of the lowest test step with the write-in authority in the current test group as a variable result table of the current test group;
and taking the variable result table of the current test group as an available variable table of the uppermost test step in the adjacent lower test group.
2. The management method of claim 1, wherein the variable information of a variable includes a name, a value, and a creation source of the variable.
3. The management method of claim 2, wherein the step of overwriting variable information of a context variable with variable information of a context variable of the same name comprises:
acquiring a current variable and variable information thereof;
checking whether the current variable in the context sorting has the above variable with the same name;
and if so, covering the variable information of the current variable with the variable information of the above variable with the same name.
4. The management method of claim 1, further comprising:
receiving a modification request, and acquiring a corresponding test step to be modified and a corresponding amount to be modified;
modifying the variable information of the amount to be modified in the step of testing to be modified; and
acquiring the write-in permission of the test step to be modified, and if the test step to be modified has the write-in permission, judging whether the following test step of the test step to be modified creates a following variable with the same name as the to-be-modified quantity;
if so, covering the variable information of the to-be-modified quantity to an available variable table of the adjacent following test step of creating the same-name variable; and if not, adding the variable information of the quantity to be corrected to an available variable table of each following test step.
5. The method for managing as set forth in claim 4, wherein if the test step to be modified has write permission, further comprising:
acquiring a test group to be modified to which the test step to be modified belongs and the write-in permission of the test group to be modified;
when the test set to be modified does not have the write right, whether the context variable with the same name as the quantity to be modified is created or not is searched in the context test step of the test set to be modified.
6. The management method of claim 1, further comprising:
and displaying the available variable table on an editing page of the currently edited testing step.
7. A system for managing test variables, comprising:
the test step acquisition module is used for acquiring the test step edited currently and the current test group to which the test step belongs;
the first traversal module is used for traversing the previous test group of the current test group and acquiring the variables and variable information created in the test steps with the write-in authority in the previous test group with the write-in authority;
the second traversal module is used for traversing the previous test steps of the current edited test steps in the current test group and acquiring the variables and variable information created by the previous test steps with write-in permission;
the available list generation module is used for sequencing the acquired variables according to the context, and the variable information of the following variables covers the variable information of the same-name preceding variables to form an available variable list of the current edited testing step; and
a step result table generating module for acquiring the write-in permission of the test step of the current edition; if the current edited testing step has the write-in permission, sorting the variables in the available variable table of the current edited testing step and the variables created in the current edited testing step according to the context, wherein the variable information of the following variables covers the variable information of the same-name preceding variables to form a variable result table of the current edited testing step; and using the variable result table of the currently edited test step as an available variable table of the adjacent following test step in the current test group; and
the test group result table generating module is used for acquiring the write-in permission of the current test group; if the current test group has the write-in authority, taking a variable result table of the lowest test step with the write-in authority in the current test group as a variable result table of the current test group; and using the variable result table of the current test group as an available variable table of the uppermost test step in the adjacent lower test group.
8. An electronic device, comprising:
a processor; and
a memory for storing executable instructions;
wherein the processor is configured to perform the steps of the method of managing test variables of any of claims 1 to 6 via execution of the executable instructions.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for managing test variables according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811612102.3A CN109697167B (en) | 2018-12-27 | 2018-12-27 | Method and system for managing test variables, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811612102.3A CN109697167B (en) | 2018-12-27 | 2018-12-27 | Method and system for managing test variables, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109697167A CN109697167A (en) | 2019-04-30 |
CN109697167B true CN109697167B (en) | 2022-03-25 |
Family
ID=66232108
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811612102.3A Active CN109697167B (en) | 2018-12-27 | 2018-12-27 | Method and system for managing test variables, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109697167B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115687140B (en) * | 2022-11-10 | 2024-01-30 | 江苏衫数科技集团有限公司 | Test case writing method and system based on automatic test |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101174240A (en) * | 2006-11-03 | 2008-05-07 | 凌阳科技股份有限公司 | Software testing management method and system thereof |
CN102521120A (en) * | 2011-11-16 | 2012-06-27 | 中国民航信息网络股份有限公司 | Software automation test system and method |
CN102708053A (en) * | 2012-04-27 | 2012-10-03 | 北京邮电大学 | Method for determining context environmental effect of function call in program path |
CN103186457A (en) * | 2011-12-29 | 2013-07-03 | 阿里巴巴集团控股有限公司 | Method and device for automatically generating test case |
CN106528395A (en) * | 2015-09-09 | 2017-03-22 | 阿里巴巴集团控股有限公司 | Test case generation method and apparatus |
CN106681903A (en) * | 2015-11-11 | 2017-05-17 | 阿里巴巴集团控股有限公司 | Method and device for generating test case |
CN107894763A (en) * | 2017-11-23 | 2018-04-10 | 广东电网有限责任公司电力科学研究院 | A kind of automation of transformation substations tester test parameter collocation method and system |
CN108733432A (en) * | 2017-04-14 | 2018-11-02 | 阿里巴巴集团控股有限公司 | The implementation method of private method, call method and its device under programmed environment |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8978011B2 (en) * | 2005-05-09 | 2015-03-10 | International Business Machines Corporation | Managing test results in a data center |
US9009292B2 (en) * | 2007-07-30 | 2015-04-14 | Sybase, Inc. | Context-based data pre-fetching and notification for mobile applications |
US9632754B2 (en) * | 2012-07-06 | 2017-04-25 | International Business Machines Corporation | Auto generation and linkage of source code to test cases |
CN106326102A (en) * | 2015-07-06 | 2017-01-11 | 阿里巴巴集团控股有限公司 | Test method and apparatus |
US10372597B2 (en) * | 2017-05-03 | 2019-08-06 | International Business Machines Corporation | Software testing and verification |
-
2018
- 2018-12-27 CN CN201811612102.3A patent/CN109697167B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101174240A (en) * | 2006-11-03 | 2008-05-07 | 凌阳科技股份有限公司 | Software testing management method and system thereof |
CN102521120A (en) * | 2011-11-16 | 2012-06-27 | 中国民航信息网络股份有限公司 | Software automation test system and method |
CN103186457A (en) * | 2011-12-29 | 2013-07-03 | 阿里巴巴集团控股有限公司 | Method and device for automatically generating test case |
CN102708053A (en) * | 2012-04-27 | 2012-10-03 | 北京邮电大学 | Method for determining context environmental effect of function call in program path |
CN106528395A (en) * | 2015-09-09 | 2017-03-22 | 阿里巴巴集团控股有限公司 | Test case generation method and apparatus |
CN106681903A (en) * | 2015-11-11 | 2017-05-17 | 阿里巴巴集团控股有限公司 | Method and device for generating test case |
CN108733432A (en) * | 2017-04-14 | 2018-11-02 | 阿里巴巴集团控股有限公司 | The implementation method of private method, call method and its device under programmed environment |
CN107894763A (en) * | 2017-11-23 | 2018-04-10 | 广东电网有限责任公司电力科学研究院 | A kind of automation of transformation substations tester test parameter collocation method and system |
Non-Patent Citations (3)
Title |
---|
Analysis of Input Variable"s Influence on Control Condition in Automatic Test;Ang Liu 等;《IEEE》;20131024;第347-350页 * |
LDRA Testbed单元测试操作步骤;ldxab;《https://wenku.baidu.com/view/73aa8b3802d8ce2f0066f5335a8102d276a2610f.html 》;20180505;第4-8页 * |
调试验证平台中闭环测试和故障注入的设计与实现;谢家森;《中国优秀博硕士学位论文全文数据库(硕士) 工程科技II辑》;20141015(第10期);C031-31 * |
Also Published As
Publication number | Publication date |
---|---|
CN109697167A (en) | 2019-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10210076B2 (en) | White box testing | |
US10621211B2 (en) | Language tag management on international data storage | |
CN111241203B (en) | Hive data warehouse synchronization method, system, equipment and storage medium | |
CN114416667B (en) | Method and device for rapidly sharing network disk file, network disk and storage medium | |
US20180129633A1 (en) | Copying text format pattern | |
CN111124872A (en) | Branch detection method and device based on difference code analysis and storage medium | |
US11281623B2 (en) | Method, device and computer program product for data migration | |
CN115048254B (en) | Simulation test method, system, equipment and readable medium for data distribution strategy | |
US10984190B2 (en) | Atom-based sensible synchronization for information indexing | |
CN109697167B (en) | Method and system for managing test variables, electronic device and storage medium | |
AU2022228142A1 (en) | Intelligent change summarization for designers | |
CN113886741A (en) | Method for typesetting formula and related product | |
US10726178B1 (en) | Functional logic cone signature generation for circuit analysis | |
CN117130990A (en) | Data processing method and device | |
CN113590088B (en) | Method and device for automatically analyzing use condition of component and electronic equipment | |
US20230093225A1 (en) | Annotating a log based on log documentation | |
CN113626747A (en) | Method and device for generating breadcrumb navigation | |
CN110543520A (en) | data migration method and device | |
CN112559331A (en) | Test method and device | |
CN111176718A (en) | Script online method and device, storage medium and electronic equipment | |
CN109976765B (en) | Application group deployment method, device, equipment and storage medium | |
KR102395671B1 (en) | Electronic device that provides improved file management function using management folder and operating method thereof | |
CN115687141A (en) | Application program testing method and device, electronic equipment and storage medium | |
CN115757996A (en) | Browser page updating method and device | |
CN118535451A (en) | Program interface testing method, device, equipment, medium and product |
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 | ||
EE01 | Entry into force of recordation of patent licensing contract | ||
EE01 | Entry into force of recordation of patent licensing contract |
Application publication date: 20190430 Assignee: Nanjing Manyun Cold Chain Technology Co.,Ltd. Assignor: JIANGSU MANYUN SOFTWARE TECHNOLOGY Co.,Ltd. Contract record no.: X2023980038397 Denomination of invention: Management methods, systems, electronic devices, and storage media for testing variables Granted publication date: 20220325 License type: Common License Record date: 20230724 |