CN114860608A - Scene construction based system automation testing method, device, equipment and medium - Google Patents

Scene construction based system automation testing method, device, equipment and medium Download PDF

Info

Publication number
CN114860608A
CN114860608A CN202210588186.1A CN202210588186A CN114860608A CN 114860608 A CN114860608 A CN 114860608A CN 202210588186 A CN202210588186 A CN 202210588186A CN 114860608 A CN114860608 A CN 114860608A
Authority
CN
China
Prior art keywords
scene
test
variable
case
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210588186.1A
Other languages
Chinese (zh)
Inventor
石广学
洪诚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202210588186.1A priority Critical patent/CN114860608A/en
Publication of CN114860608A publication Critical patent/CN114860608A/en
Pending legal-status Critical Current

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/3684Test management for test design, e.g. generating new test cases
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method, a device and equipment for automatically testing a system based on scene construction, wherein the method comprises the following steps: if test configuration information of the user terminal is received, scene template arrangement is carried out according to the test configuration information to obtain a test case set, virtual test data corresponding to each scene case are constructed according to a data format corresponding to each scene case in the test case set, data processing is respectively carried out on the virtual data according to the scene cases and the system to be tested to obtain a variable result of each scene case, and a variable analysis result of each scene case is obtained by comparing an expected result with the variable result. The invention belongs to the technical field of functional testing, generates a test case set containing scene cases by arranging scene templates to flexibly configure the scene cases corresponding to various scenes, and compares variable results with expected results based on variable results to realize comparison and analysis of the variable results of the scenes, thereby greatly improving the efficiency of carrying out automatic testing on a system.

Description

Scene construction based system automation testing method, device, equipment and medium
Technical Field
The invention relates to the technical field of function testing, belongs to an application scene based on scene construction for automatically testing a system in a smart city, and particularly relates to a method, a device, equipment and a medium for automatically testing the system based on the scene construction.
Background
An enterprise needs to test a system in the process of system construction and system upgrading so as to verify whether each function of the system is complete, so that the system can be tested by applying an automatic testing method, the regression verification cost is higher by adopting the existing testing method aiming at the problem that the quantity of variables needed to be involved in the testing process taking the variables determining the risk decision result as the verification core is higher, the process of constructing a verification scene based on variable logic in the existing testing method is more complicated, the time consumption of the construction process is long, the efficiency of automatically testing the system is lower, and the testing cost is higher. Therefore, the problem of low test efficiency exists in the automatic test process of the system in the prior art method.
Disclosure of Invention
The embodiment of the invention provides a method, a device and equipment for automatically testing a system based on scene construction, and aims to solve the problem of low testing efficiency in the process of automatically testing the system in the prior art.
In a first aspect, an embodiment of the present invention provides a method for automatically testing a system based on scene construction, where the method includes:
if test configuration information from the user terminal is received, arranging a scene template according to the test configuration information to obtain a corresponding test case set;
constructing to obtain virtual test data corresponding to each scene case according to the data format corresponding to each scene case in the test case set;
respectively performing data processing on the virtual test data corresponding to each scene case according to each scene case and the system to be tested so as to generate variable results corresponding to each scene case;
and comparing the preset expected result with the variable result of each scene case to obtain a variable analysis result corresponding to each scene case.
In a second aspect, an embodiment of the present invention provides a system automation test apparatus based on scene construction, including:
the test case set acquisition unit is used for arranging a scene template according to the test configuration information to obtain a corresponding test case set if the test configuration information from the user terminal is received;
the virtual test data acquisition unit is used for constructing and obtaining virtual test data corresponding to each scene case according to the data format corresponding to each scene case in the test case set;
the variable result acquisition unit is used for respectively carrying out data processing on the virtual test data corresponding to each scene case according to each scene case and the system to be tested so as to generate a variable result corresponding to each scene case;
and the variable analysis result acquisition unit is used for comparing the preset expected result with the variable result of each scene case to obtain the variable analysis result corresponding to each scene case.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor, when executing the computer program, implements the method for automatically testing a system based on scene building according to the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the method for automatically testing a system based on scene building according to the first aspect.
The embodiment of the invention provides a system automatic testing method, device and equipment based on scene construction. By the method, the scene templates are arranged to generate the test case set containing the scene cases, so that the scene cases corresponding to various scenes are flexibly configured, the variable analysis result is obtained by comparing the variable result with the expected result to realize the comparative analysis of the variable result of each scene, and the efficiency of automatically testing the system is greatly improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a system automation test method based on scene construction according to an embodiment of the present invention;
fig. 2 is an application scenario diagram of a system automation test method based on scenario construction according to an embodiment of the present invention;
fig. 3 is a schematic sub-flow diagram of a system automation testing method based on scene construction according to an embodiment of the present invention;
fig. 4 is another schematic sub-flow diagram of a system automation testing method based on scene construction according to an embodiment of the present invention;
fig. 5 is a schematic view of another sub-flow of the method for automatically testing a system based on scene construction according to the embodiment of the present invention;
fig. 6 is a schematic view of another sub-flow of the system automation test method based on scene construction according to the embodiment of the present invention;
fig. 7 is another schematic flowchart of a system automation testing method based on scene construction according to an embodiment of the present invention;
fig. 8 is another schematic flowchart of a system automation test method based on scene construction according to an embodiment of the present invention;
FIG. 9 is a schematic block diagram of a system automation test device constructed based on a scenario according to an embodiment of the present invention;
FIG. 10 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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 invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic flow chart of a system automation test method based on scene construction according to an embodiment of the present invention; fig. 2 is an application scenario diagram of a system automation test method based on scenario construction according to an embodiment of the present invention; the scene-based constructed system automatic testing method is applied to a management server 10, network connection is established between the management server 10 and a user terminal 20 to realize transmission of data information, the scene-based constructed system automatic testing method is executed through application software installed in the management server 10, and the management server 10 is a server side used for executing the scene-based constructed system automatic testing method to automatically test a system, such as a server constructed by an enterprise or a government department to perform system testing; the user terminal 30 is a terminal device, such as a desktop computer, a notebook computer, a tablet computer, or a mobile phone, for the tester to use and establish a network connection with the management server 10 for data transmission. As shown in fig. 1, the method includes steps S110 to S140.
And S110, if the test configuration information from the user terminal is received, arranging a scene template according to the test configuration information to obtain a corresponding test case set.
And if the test configuration information from the user terminal is received, arranging a scene template according to the arrangement information in the test configuration information to obtain a corresponding test case set. The user can configure the test configuration information through the user terminal and input the test configuration information into the management server, wherein the user of the user terminal can be a system tester. After receiving the test configuration information, the management server can arrange the scene template according to the test configuration information, so as to obtain a corresponding test case set, wherein the test case set can contain one or more scene cases, the test configuration information comprises one or more groups of arrangement information, and each arrangement information consists of an arrangement template sequence, a statement identifier and demand information.
In an embodiment, as shown in fig. 3, step S110 includes sub-steps S111, S112, S113, S114 and S115.
And S111, acquiring a scene template corresponding to the arrangement template sequence of each arrangement information in a preset template database.
The management server is configured with a template database, the template database comprises a plurality of templates, each template corresponds to one data processing action, the arrangement template sequence comprises a plurality of template identifications, scene templates corresponding to each identification can be respectively obtained from the template database according to the template identifications contained in the arrangement template sequence, namely, the scene templates corresponding to each arrangement information can be obtained, and the number of the scene templates corresponding to each arrangement information is equal to the number of the template identifications contained in the arrangement template sequence in the arrangement information. The template contained in the template database can be DB-Action, AS-Action, ES-Action, Mock-Action, MQ-Action, HTTP-Action, Redis-Action and the like, and the DB-Action template can be used for packaging the API of the database, providing the SQL maintenance entrance of the database, supporting pre-embedded data and cleaning data; the ES-Action template can be used for encapsulating an elastic search API, providing an ES statement maintenance entry, supporting pre-embedded data and cleaning data.
And S112, acquiring scene sentences corresponding to each scene template in the arrangement information according to the sentence marks of each arrangement information.
Each scene template may correspondingly include different scene statements, each scene statement may be used to perform a data processing operation on data, and then a corresponding scene statement may be acquired from the scene template according to a statement identifier corresponding to each scene template in the arrangement information, where the statement identifier corresponding to one scene template in the arrangement information may be one or more, and the acquired scene statements corresponding to the corresponding scene template may also be one or more.
And S113, determining a functional interface corresponding to the demand information of each piece of arrangement information according to a functional module contained in the system to be tested.
The management server is provided with a system to be tested, the system to be tested is also a software system to be tested, the system to be tested comprises a plurality of function modules, the arrangement information is also provided with demand information, the demand information is specific demand information for testing specific function modules in the system to be tested, corresponding function interfaces can be determined from the system to be tested according to the specific function modules to be tested in the demand information, and the function interfaces can be used for inputting corresponding data and processing the data through the corresponding function modules.
S114, combining the scene statements and the functional interfaces according to the corresponding relation between the template identifications and the requirement information in each piece of arrangement information to generate test statements corresponding to each template identification.
If a corresponding relationship exists between a scene template in a certain arrangement template sequence of the arrangement information and a certain functional module in the demand information, the scene statement corresponding to the same scene module can be combined with the corresponding functional interface according to the corresponding relationship, so that the test statement corresponding to each template identifier is generated.
And S115, sequentially combining the test sentences according to the arrangement template sequence of each arrangement information to obtain a test case set containing the scene case corresponding to each arrangement information.
The arrangement template sequence is composed of a plurality of template identifications which are arranged in sequence, test sentences corresponding to the template identifications can be sequentially combined according to the arrangement sequence of the template identifications in each arrangement template sequence, a scene case can be generated after the test sentences corresponding to the arrangement template sequences are combined, a test case set corresponding to the test configuration information can be obtained by obtaining the scene case corresponding to each arrangement template sequence, and the number of the scene cases in the test case set is equal to the number of the arrangement information in the test configuration information. Specifically, the generated scene case can be a normal scene case or an abnormal scene case, various scenes can be flexibly configured through the test configuration information, the richness of the test scenes is greatly improved, and meanwhile the generation efficiency of the scene case is improved.
And S120, constructing to obtain virtual test data corresponding to each scene case according to the data format corresponding to each scene case in the test case set.
And constructing to obtain virtual test data corresponding to each scene case according to the data format corresponding to each scene case in the test case set. In order to realize the omnibearing test of the system to be tested, corresponding virtual test data can be constructed according to the data format of each scene case, and massive basic test data can be quickly obtained by the method, so that the system test efficiency is greatly improved.
In an embodiment, as shown in fig. 4, step S120 includes substeps S121 and S122.
And S121, mapping each scene case according to a preset mapping relation table to determine a data format corresponding to each scene case.
The management server is pre-configured with a mapping relation table, the mapping relation table comprises a mapping relation between each keyword and a corresponding data format, the keywords in each scene case can be obtained, and the keywords of each scene case are mapped according to the mapping relation table, so that the data format corresponding to each scene case is determined.
If the keyword in a scene case is the amount of the payable fee, the corresponding data format is obtained by mapping and is 8 decimal numbers and comprises 2 decimal numbers.
And S122, constructing data according to the data format corresponding to each scene case to generate virtual test data corresponding to each scene case.
The data construction method can be used for carrying out data construction according to the determined data format and the test configuration information corresponding to each scene case, specifically, a test quantity is also configured in the test configuration information, the test quantity can be used for limiting the number of times of system test, if the test quantity is 10 thousands, 10 thousands of virtual data corresponding to each scene case can be respectively constructed according to the data format corresponding to each scene case, the data construction process is a process of randomly generating data according to the data format, and the obtained virtual data corresponding to one scene case are the virtual test data of the scene case.
And S130, respectively performing data processing on the virtual test data corresponding to each scene case according to each scene case and the system to be tested to generate variable results corresponding to each scene case.
And respectively carrying out data processing on the virtual test data corresponding to each scene case according to each scene case and the system to be tested so as to obtain variable results generated corresponding to each scene case. The generated virtual test data can be subjected to data processing according to the scene cases and the system to be tested, each scene case can be combined with the virtual test data corresponding to the scene case to realize a function test on the system to be tested, a variable result corresponding to each scene case can be generated by testing the system to be tested, specifically, each virtual data can be correspondingly generated into a variable value after being tested, and the quantity of the variable values contained in the variable result corresponding to the scene case is equal to the quantity of the virtual data contained in the virtual test data corresponding to the scene case.
In an embodiment, as shown in fig. 5, step S130 includes sub-steps S131, S132, and S133.
S131, replacing the virtual test data of each scene case into the test sentence corresponding to each scene case for sentence assembly to obtain the test assembly sentence corresponding to each scene case.
The test statements of the scenario cases do not contain specific data values, that is, keywords in the test statements corresponding to the scenario cases can be replaced according to the virtual test data, so that statement assembly is performed on each test data of the scenario cases, that is, the test assembly statement corresponding to each scenario case can be obtained, and if the number of virtual data in the virtual test data corresponding to a certain scenario case is P, the number of generated test assembly statements corresponding to the scenario case is also P.
For example, in the DB-Action SQL statement select from word where word cardNo $ { cardNo }, the keyword of the card number "cardNo" in the SQL statement can be replaced with the corresponding test data by the Template replacement technique, so that the complete SQL is generated and executed.
S132, executing the test assembly statement of each scene case to perform data processing on the virtual data in the test assembly statement to obtain a corresponding data processing result.
The test assembly statements of each scene case can be executed, and the virtual data in each test data is processed through the processing codes in the scene cases, namely the test data is processed through calculation, format conversion and the like, so that a corresponding data processing result is obtained.
And S133, inputting the corresponding data processing result into the system to be tested according to the test assembly statement of each scene case for data processing so as to obtain a variable result fed back by the system to be tested.
The obtained data processing result can be input into the system to be tested according to the functional interface contained in the test assembly statement of the scene case, the data processing result is further processed through the system to be tested, and the system to be tested can feed back the corresponding variable result after processing the data.
S140, comparing the preset expected result with the variable result of each scene case to obtain a variable analysis result corresponding to each scene case.
And comparing the preset expected result with the variable result of each scene case to obtain a variable analysis result corresponding to each scene case. After the variable result of each scene case is obtained, comparison and verification can be carried out according to the preset expected result and the variable result, so that the variable analysis result of each scene case is obtained.
In an embodiment, as shown in fig. 6, step S140 includes sub-steps S141 and S142.
S141, acquiring target matching information corresponding to the variable identification in the expected result according to the variable identification of each scene case; and S142, judging whether the variable type and the variable value of the variable result contained in each scene case are matched with the target matching information or not, and taking the matching result as a variable analysis result corresponding to each scene case.
The scene cases comprise variable identifications, the variable identifications are uniquely corresponding to the variables, corresponding target matching information can be obtained from an expected result according to the variable identifications of the scene cases, the target matching information corresponding to the scene cases can be respectively obtained according to the variable identifications of the scene cases, and the target matching information comprises type matching information and numerical value matching information. The variable type of each variable value in the variable result of each scene case can be obtained, and whether the variable type of each variable value and the variable value are matched with the target matching information corresponding to the scene case or not is judged, so that the variable result of each scene case is compared and verified, the matching result of each variable value in the variable result of the scene case is obtained, and the variable analysis result corresponding to the scene case can be obtained. If the variable value and the variable type of the variable value are matched with the target matching information, the obtained matching result is consistent; and if the variable value or the variable type of the variable value is not matched with the target matching information, the obtained matching result is inconsistent. The numerical matching information of the expected result can be obtained by processing the test data according to the test data and the corresponding data processing logic (such as mathematical operation logics of addition, subtraction, multiplication, division and the like), and the comparison and verification of the variable value of the variable result is directly carried out on the basis of the actual processing result corresponding to the original test data and the variable value generated by the test, so that the work of editing the assertion program code is saved, and the test efficiency is further improved.
In an embodiment, as shown in fig. 7, step S150 is further included after step S140.
S150, performing correlation aggregation on the test configuration information, the system to be tested, the test case set and the variable analysis result to obtain test aggregation information and storing the test aggregation information.
Specifically, the test configuration information, the system to be tested, and the test case set generated by the test and the variable analysis result obtained by the comparative analysis can be obtained, the four parts of data are associated and aggregated, the test configuration information includes the requirement information corresponding to each arrangement information, the system to be tested includes the current system version number, the test case set includes the scene case corresponding to each arrangement information, the variable analysis result includes the variable analysis result corresponding to each arrangement information, the information included in the four parts of data can be aggregated according to each scene case, the test information corresponding to each scene case is obtained and serves as the test aggregation information, the test aggregation information is stored, and the information is retrieved based on the version number, the requirement information, the scene case or the variable identification and the like at the later stage, so that the scene case associated with the retrieval information can be obtained from the stored test aggregation information and further analyzed and processed .
In an embodiment, as shown in fig. 8, step S1410 is further included after step S140.
And S1410, counting the variable analysis result according to a preset variable database to obtain test statistical information corresponding to the test configuration information.
The management server is also provided with a variable database, and the variable analysis result of each scene case obtained by the test can be counted according to the variables contained in the variable database, so that the corresponding test statistical information can be obtained. The variable database comprises all variables related to the system to be tested, and consistency rate statistics can be performed on the variables corresponding to each variable identification according to the variable identifications contained in the variable analysis result of each scene case, namely, the consistent proportion of the matching result in each variable is counted to obtain the test consistency rate of each variable; and obtaining the number of variable identifications contained in the variable analysis result of each scene case, and calculating the test coverage of the test according to the number of the variable identifications and the total number of the variables in the variable database, wherein the test coverage is the number of the variable identifications divided by the total number of the variables in the variable database. And taking the obtained test consistency rate and the test coverage rate as test statistical information corresponding to the test configuration information.
The technical method can be applied to an application scene based on scene construction for carrying out automatic test on the system, so that the construction of a smart city is promoted.
In the automatic system testing method based on the scene construction provided by the embodiment of the invention, if test configuration information of a user terminal is received, scene template arrangement is carried out according to the test configuration information to obtain a test case set, virtual test data corresponding to each scene case in the test case set are constructed according to a data format corresponding to each scene case, data processing is respectively carried out on the virtual data according to the scene cases and a system to be tested to obtain a variable result of each scene case, and a variable analysis result of each scene case is obtained by comparing an expected result with the variable result. By the method, the scene templates are arranged to generate the test case set containing the scene cases, so that the scene cases corresponding to various scenes are flexibly configured, the variable analysis result is obtained by comparing the variable result with the expected result to realize the comparative analysis of the variable result of each scene, and the efficiency of automatically testing the system is greatly improved.
The embodiment of the invention also provides a system automatic testing device based on scene construction, which can be configured in a management server and used for executing any embodiment of the system automatic testing method based on scene construction. Specifically, referring to fig. 9, fig. 9 is a schematic block diagram of a system automation test device constructed based on a scene according to an embodiment of the present invention.
As shown in fig. 9, the system automation test apparatus 100 constructed based on a scene includes a test case set acquisition unit 110, a virtual test data acquisition unit 120, a variable result acquisition unit 130, and a variable analysis result acquisition unit 140.
The test case set obtaining unit 110 is configured to, if test configuration information from the user terminal is received, perform scene template arrangement according to the test configuration information to obtain a corresponding test case set.
In one embodiment, the test case set obtaining unit 110 includes sub-units: a scene template obtaining unit, configured to obtain a scene template corresponding to the arrangement template sequence of each arrangement information in a preset template database; a scene statement acquiring unit, configured to acquire a scene statement corresponding to each scene template in the layout information according to a statement identifier of each layout information; the functional interface determining unit is used for determining a functional interface corresponding to the demand information of each piece of arrangement information according to a functional module contained in the system to be tested; the test statement generating unit is used for combining the scene statement and the functional interface according to the corresponding relation between the template identifier and the requirement information in each piece of arrangement information so as to generate a test statement corresponding to each template identifier; and the test statement combining unit is used for sequentially combining the test statements according to the arrangement template sequence of each arrangement information to obtain a test case set containing the scene case corresponding to each arrangement information.
The virtual test data obtaining unit 120 is configured to obtain virtual test data corresponding to each scene case according to the data format corresponding to each scene case in the test case set.
In an embodiment, the virtual test data acquiring unit 120 includes sub-units: the data format determining unit is used for mapping each scene case according to a preset mapping relation table so as to determine a data format corresponding to each scene case; and the data construction unit is used for constructing data according to the data format corresponding to each scene case so as to generate virtual test data corresponding to each scene case.
The variable result obtaining unit 130 is configured to perform data processing on the virtual test data corresponding to each of the scene cases according to each of the scene cases and the system under test, so as to generate a variable result corresponding to each of the scene cases.
In a specific embodiment, the variable result obtaining unit 130 includes sub-units: the test assembly statement acquisition unit is used for replacing the virtual test data of each scene case into the test statement corresponding to each scene case for statement assembly so as to obtain the test assembly statement corresponding to each scene case; the data processing result acquisition unit is used for executing the test assembly statement of each scene case so as to perform data processing on the virtual data in the test assembly statement to obtain a corresponding data processing result; and the data processing unit is used for inputting the corresponding data processing result into the system to be tested for data processing according to the test assembly statement of each scene case so as to obtain a variable result fed back by the system to be tested.
The variable analysis result obtaining unit 140 is configured to compare the preset expected result with the variable result of each of the scene cases to obtain a variable analysis result corresponding to each of the scene cases.
In a specific embodiment, the variable analysis result obtaining unit 140 includes sub-units: the target matching information acquisition unit is used for acquiring target matching information corresponding to the variable identification in the expected result according to the variable identification of each scene case; and the matching judgment unit is used for judging whether the variable type and the variable value of the variable result contained in each scene case are matched with the target matching information or not and taking the matching result as a variable analysis result corresponding to each scene case.
In a specific embodiment, the system automation test device 100 constructed based on the scenario further includes sub-units: and the information aggregation storage unit is used for performing correlation aggregation on the test configuration information, the system to be tested, the test case set and the variable analysis result to obtain test aggregation information and storing the test aggregation information.
In a specific embodiment, the system automation test device 100 based on scene construction further includes a subunit: and the analysis result counting unit is used for counting the variable analysis result according to a preset variable database so as to obtain the test statistical information corresponding to the test configuration information.
The system automation test device based on the scene construction provided by the embodiment of the invention is applied to the system automation test method based on the scene construction, if test configuration information of a user terminal is received, scene template arrangement is carried out according to the test configuration information to obtain a test case set, virtual test data corresponding to each scene case in the test case set are constructed according to a data format corresponding to each scene case, data processing is respectively carried out on the virtual data according to the scene cases and a system to be tested to obtain a variable result of each scene case, and a variable analysis result of each scene case is obtained by comparing an expected result with the variable result. By the method, the scene templates are arranged to generate the test case set containing the scene cases, so that the scene cases corresponding to various scenes are flexibly configured, the variable analysis result is obtained by comparing the variable result with the expected result to realize the comparative analysis of the variable result of each scene, and the efficiency of automatically testing the system is greatly improved.
The system automation test device constructed based on the scene can be realized in the form of a computer program, and the computer program can be run on a computer device as shown in fig. 10.
Referring to fig. 10, fig. 10 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device can be a management server used for executing the scene-based construction system automatic testing method and realizing the scene-based construction to automatically test the system.
Referring to fig. 10, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a storage medium 503 and an internal memory 504.
The storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to execute the system automation test method based on scene building, wherein the storage medium 503 may be a volatile storage medium or a non-volatile storage medium.
The processor 502 is used to provide computing and control capabilities that support the operation of the overall computer device 500.
The internal memory 504 provides an environment for running the computer program 5032 in the storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be enabled to execute the system automation test method based on the scene construction.
The network interface 505 is used for network communication, such as providing transmission of data information. Those skilled in the art will appreciate that the configuration shown in fig. 10 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 500 to which aspects of the present invention may be applied, and that a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The processor 502 is configured to run the computer program 5032 stored in the memory to implement the corresponding functions in the above-mentioned system automation test method based on scene building.
Those skilled in the art will appreciate that the embodiment of a computer device illustrated in fig. 10 does not constitute a limitation on the specific construction of the computer device, and that in other embodiments a computer device may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor, and in such embodiments, the structures and functions of the memory and the processor are consistent with those of the embodiment shown in fig. 10, and are not described herein again.
It should be understood that, in the embodiment of the present invention, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, 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, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a volatile or non-volatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps included in the above-mentioned system automation test method based on scene building.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only a logical division, and there may be other divisions when the actual implementation is performed, or units having the same function may be grouped into one unit, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a computer-readable storage medium, which includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned computer-readable storage media comprise: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A system automation test method based on scene construction is characterized in that the method is applied to a management server, network connection is established between the management server and a user terminal to realize data information transmission, and the method comprises the following steps:
if test configuration information from the user terminal is received, arranging a scene template according to the test configuration information to obtain a corresponding test case set;
constructing to obtain virtual test data corresponding to each scene case according to the data format corresponding to each scene case in the test case set;
respectively performing data processing on the virtual test data corresponding to each scene case according to each scene case and the system to be tested so as to generate variable results corresponding to each scene case;
and comparing the preset expected result with the variable result of each scene case to obtain a variable analysis result corresponding to each scene case.
2. The method as claimed in claim 1, wherein the test configuration information includes one or more groups of layout information, each of which is composed of a layout template sequence, a statement identifier and requirement information, and the performing of the scene template layout according to the test configuration information to obtain a corresponding test case set includes:
acquiring a scene template corresponding to the arrangement template sequence of each arrangement information in a preset template database;
acquiring scene sentences corresponding to each scene template in the arrangement information according to the sentence marks of each arrangement information;
determining a functional interface corresponding to the demand information of each piece of arrangement information according to a functional module contained in a system to be tested;
combining the scene statements and the functional interfaces according to the corresponding relation between the template identifications and the requirement information in each piece of arrangement information to generate test statements corresponding to each template identification;
and sequentially combining the test statements according to the arrangement template sequence of each arrangement information to obtain a test case set containing the scene case corresponding to each arrangement information.
3. The method for automatically testing a system constructed based on a scene as claimed in claim 1, wherein the constructing virtual test data corresponding to each scene case according to the data format corresponding to each scene case in the test case set comprises:
mapping each scene case according to a preset mapping relation table to determine a data format corresponding to each scene case;
and constructing data according to the data format corresponding to each scene case to generate virtual test data corresponding to each scene case.
4. The method as claimed in claim 1, wherein the performing data processing on the virtual test data corresponding to each of the scene cases according to each of the scene cases and the system under test to generate the variable result corresponding to each of the scene cases comprises:
replacing the virtual test data of each scene case into a test statement corresponding to each scene case for statement assembly to obtain a test assembly statement corresponding to each scene case;
executing the test assembly statement of each scene case to perform data processing on the virtual data in the test assembly statement to obtain a corresponding data processing result;
and inputting the corresponding data processing result into a system to be tested for data processing according to the test assembly statement of each scene case so as to obtain a variable result fed back by the system to be tested.
5. The method as claimed in claim 1, wherein the comparing the preset expected result with the variable result of each of the scenario cases to obtain the variable analysis result corresponding to each of the scenario cases comprises:
acquiring target matching information corresponding to the variable identification in the expected result according to the variable identification of each scene case;
and judging whether the variable type and the variable value of the variable result contained in each scene case are matched with the target matching information or not, and taking the matching result as a variable analysis result corresponding to each scene case.
6. The method as claimed in claim 1, wherein the comparing step further comprises, after obtaining the variable analysis result corresponding to each of the scenario cases by comparing the preset expected result with the variable result of each of the scenario cases, the method further comprising:
and performing correlation aggregation on the test configuration information, the system to be tested, the test case set and the variable analysis result to obtain test aggregation information and storing the test aggregation information.
7. The method as claimed in claim 1, wherein the comparing of the variable result of each scene case with the preset expected result to obtain the variable analysis result corresponding to each scene case further comprises:
and counting the variable analysis result according to a preset variable database to obtain test statistical information corresponding to the test configuration information.
8. The device for automatically testing the system based on the scene construction is characterized in that the device is configured in a management server, a network connection is established between the management server and a user terminal to realize the transmission of data information, and the device comprises:
the test case set acquisition unit is used for arranging a scene template according to the test configuration information to obtain a corresponding test case set if the test configuration information from the user terminal is received;
the virtual test data acquisition unit is used for constructing and obtaining virtual test data corresponding to each scene case according to the data format corresponding to each scene case in the test case set;
the variable result acquisition unit is used for respectively carrying out data processing on the virtual test data corresponding to each scene case according to each scene case and the system to be tested so as to generate a variable result corresponding to each scene case;
and the variable analysis result acquisition unit is used for comparing the preset expected result with the variable result of each scene case to obtain the variable analysis result corresponding to each scene case.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for automated testing of a system constructed based on scenarios according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method for automated testing of a system constructed based on scenarios as claimed in any one of claims 1 to 7.
CN202210588186.1A 2022-05-26 2022-05-26 Scene construction based system automation testing method, device, equipment and medium Pending CN114860608A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210588186.1A CN114860608A (en) 2022-05-26 2022-05-26 Scene construction based system automation testing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210588186.1A CN114860608A (en) 2022-05-26 2022-05-26 Scene construction based system automation testing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114860608A true CN114860608A (en) 2022-08-05

Family

ID=82640621

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210588186.1A Pending CN114860608A (en) 2022-05-26 2022-05-26 Scene construction based system automation testing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114860608A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543774A (en) * 2022-08-17 2022-12-30 睿智合创(北京)科技有限公司 Automatic case measuring and calculating method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543774A (en) * 2022-08-17 2022-12-30 睿智合创(北京)科技有限公司 Automatic case measuring and calculating method
CN115543774B (en) * 2022-08-17 2023-06-23 睿智合创(北京)科技有限公司 Case automation measuring and calculating method

Similar Documents

Publication Publication Date Title
CN108090567B (en) Fault diagnosis method and device for power communication system
US8707268B2 (en) Testing operations of software
CN110502516B (en) Table data analysis method and device, computer equipment and storage medium
CN112889042A (en) Identification and application of hyper-parameters in machine learning
CN107092554B (en) Method and device for confirming fault code of application program
WO2019061664A1 (en) Electronic device, user's internet surfing data-based product recommendation method, and storage medium
CN114116496A (en) Automatic testing method, device, equipment and medium
CN109445768B (en) Database script generation method and device, computer equipment and storage medium
CN110688111A (en) Configuration method, device, server and storage medium of business process
CN108345658B (en) Decomposition processing method of algorithm calculation track, server and storage medium
CN111737148A (en) Automatic regression testing method and device, computer equipment and storage medium
CN114860608A (en) Scene construction based system automation testing method, device, equipment and medium
CN111475494A (en) Mass data processing method, system, terminal and storage medium
CN111124878A (en) Test report generation method and device, computer equipment and storage medium
CN112395182A (en) Automatic testing method, device, equipment and computer readable storage medium
CN113205230A (en) Data prediction method, device and equipment based on model set and storage medium
CN106651408B (en) Data analysis method and device
CN111738356A (en) Object feature generation method, device, equipment and storage medium for specific data
CN115345600B (en) RPA flow generation method and device
CN110795308A (en) Server inspection method, device, equipment and storage medium
CN114528208A (en) Program error information identification method, device, equipment and medium
CN113986762A (en) Test case generation method and device
CN103761247B (en) A kind of processing method and processing device of error file
CN109040990B (en) Information acquisition method and device, computer equipment and storage medium
CN113254352A (en) Test method, device, equipment and storage medium for test case

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