CN118210710A - Test case set generation method and system of service software and electronic equipment - Google Patents

Test case set generation method and system of service software and electronic equipment Download PDF

Info

Publication number
CN118210710A
CN118210710A CN202410255157.2A CN202410255157A CN118210710A CN 118210710 A CN118210710 A CN 118210710A CN 202410255157 A CN202410255157 A CN 202410255157A CN 118210710 A CN118210710 A CN 118210710A
Authority
CN
China
Prior art keywords
service
software
path
description document
test case
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
CN202410255157.2A
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.)
709th Research Institute of CSSC
Original Assignee
709th Research Institute of CSSC
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 709th Research Institute of CSSC filed Critical 709th Research Institute of CSSC
Priority to CN202410255157.2A priority Critical patent/CN118210710A/en
Publication of CN118210710A publication Critical patent/CN118210710A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a test case set generation method and system of service software and electronic equipment, wherein the method comprises the following steps: analyzing a service description document of the service software to obtain an operation flow of the service software and constraint information of interfaces, operations and variables of each atomic service in the operation flow so as to construct a service graph model corresponding to the service software; the service graph model is used for describing the process of each service path of the service software and takes each atomic service as each node; the service description document comprises a description document of an operation flow, a description document of each atomic service and a description document of constraint information of variables; traversing each service path in the service graph model, solving constraint information of each service path, and generating a test case set of the service software by combining test assertion and use ratio of each service path obtained by analyzing a log document of the service software. The application can provide the test case set generation method with less manual intervention and low case redundancy for the service software test.

Description

Test case set generation method and system of service software and electronic equipment
Technical Field
The application belongs to the technical field of software testing, and particularly relates to a method and a system for generating a test case set of service software and electronic equipment.
Background
With the development of service-oriented architecture (Service Oriented Architecture, SOA) software, a test method and an automatic generation related technology of test cases for service software, especially for service software including combined services or business processes, have become a focus of research.
In the existing research, the method and the technology for generating the test case set aiming at the service software are mainly divided into a test technology based on a model, a test technology based on mutation, a test method based on heuristic and the like. The test technology based on the model has the problems of insufficient constraint information acquisition, inaccurate use cases of the generated use case sets, high redundancy and the like; both mutation-based test technology and heuristic test method have the problems that testing is required on the basis of original codes, and the generation of test cases requires a large amount of manual intervention. Therefore, in the face of testing a large-scale service software system, a test case set generation method with less manual intervention and low case redundancy needs to be provided on the basis of researching the existing test case set generation method of each combined service.
Disclosure of Invention
Aiming at the defects of the prior art, the application aims to provide a test case set generation method, a system and electronic equipment of service software, and aims to solve the problems of large amount of manual intervention and high redundancy in the existing combined service test case set generation method.
In order to achieve the above object, in a first aspect, the present application provides a test case set generating method of service software, including the following steps:
step S101, analyzing a service description document of service software to obtain an operation flow of the service software and constraint information of interfaces, operations and variables of each atomic service in the operation flow so as to construct a service diagram model corresponding to the service software; the service graph model is used for describing the process of each service path of service software and takes each atomic service as each node; the service description document comprises a description document of the operation flow, a description document of each atomic service and a description document of constraint information of variables;
Step S102, analyzing a log document of service software to obtain test assertion and use duty ratio of each service path in a service graph model;
Step S103, traversing each service path in the service graph model, solving constraint information of each service path, and generating a test case set of the service software by combining test assertion and use duty ratio of each service path.
In an alternative example, step S101 specifically includes:
Analyzing the description document of the operation flow of the service software to obtain the service description sequence, each structuring activity and the atomic service called in each structuring activity in the operation flow, and analyzing the description document of each atomic service and the description document of the constraint information of the variables to obtain the interface, the operation and the constraint information of the variables of each atomic service;
Converting each structuring activity in the operation flow into various relation structures, establishing each relation structure sequence according to the service description sequence of the operation flow, and filling the atomic service called in each structuring activity into various relation structures to form a service diagram model backbone;
and supplementing constraint information of interfaces, operations and variables of each atomic service on the basis of a service graph model backbone, and obtaining a service graph model corresponding to service software.
In an alternative example, each type of relationship structure is specifically a relationship structure corresponding to a single operation, a sequence operation, a branch selection operation, a parallel operation, or a loop operation.
In an alternative example, step S102 specifically includes:
And matching the execution sequence obtained based on the log file analysis of the service software with each service path in the service graph model to obtain each matched service path, and analyzing the test assertion and the use duty ratio of each service path based on the input/output value and the use times in the execution sequence corresponding to each matched service path and combining the input/output range in the constraint information of each matched service path.
In an alternative example, step S102 further includes:
Analyzing the newly added log file continuously, repeatedly calculating the use duty ratio of each service path until the change value of the use duty ratio of each service path before and after the newly added log file is lower than a preset threshold value, and obtaining the final use duty ratio of each service path.
In an optional example, the test case set generating method further includes:
If the service description document of the service software is changed, analyzing the changed service description document to obtain a changed service diagram model;
and performing traversal comparison operation on the service graph models before and after the change, and identifying the change type and the changed service path to generate a test case set aiming at the changed service path.
In one alternative example, the change types include service changes, link changes, interface changes, operation changes, and variable changes.
In a second aspect, the present application provides a test case set generating system for service software, including:
The service diagram model construction module is used for analyzing the service description document of the service software to obtain the operation flow of the service software and the constraint information of interfaces, operations and variables of each atomic service in the operation flow so as to construct a service diagram model corresponding to the service software; the service graph model is used for describing the process of each service path of service software and takes each atomic service as each node; the service description document comprises a description document of the operation flow, a description document of each atomic service and a description document of constraint information of variables;
the log file analysis module is used for analyzing the log file of the service software to obtain test assertion and use duty ratio of each service path in the service graph model;
The test case set generation module is used for traversing each service path in the service graph model, solving constraint information of each service path, and generating a test case set of the service software by combining test assertion and use ratio of each service path.
In a third aspect, the present application provides an electronic device comprising: at least one memory for storing a program; at least one processor for executing a memory-stored program, which when executed is adapted to carry out the method described in the first aspect or any one of the possible implementations of the first aspect.
In a fourth aspect, the present application provides a computer readable storage medium storing a computer program which, when run on a processor, causes the processor to perform the method described in the first aspect or any one of the possible implementations of the first aspect.
In a fifth aspect, the application provides a computer program product which, when run on a processor, causes the processor to perform the method described in the first aspect or any one of the possible implementations of the first aspect.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
In general, the above technical solutions conceived by the present application have the following beneficial effects compared with the prior art:
The application provides a test case set generation method, a system and electronic equipment of service software, which are used for constructing a service diagram model corresponding to the service software by carrying out combined analysis on a description document of an operation flow of the service software, a description document of each atomic service and a description document of constraint information of variables, traversing each service path in the service diagram model, and generating the test case set of the service software by combining test assertion and use proportion of each service path obtained by analysis of a background log document, thereby being capable of quickly generating a test case set with high coverage rate for test automation of the service software, having less manual intervention, improving the accuracy of the test case set and reducing redundancy of the test case set.
Drawings
FIG. 1 is one of the flow diagrams of the test case set generation method provided by the embodiment of the application;
FIG. 2 is a second flowchart of a test case set generating method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for generating a changed software use case set according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a relationship of a service description document provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a relationship structure of service graph model construction provided by an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a test case set generating system according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In embodiments of the application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
The embodiment of the application provides a test case set generating method of service software, and fig. 1 is one of flow diagrams of the test case set generating method provided by the embodiment of the application, as shown in fig. 1, and comprises the following steps:
step S101, analyzing a service description document of service software to obtain an operation flow of the service software and constraint information of interfaces, operations and variables of each atomic service in the operation flow so as to construct a service diagram model corresponding to the service software; the service graph model is used for describing the process of each service path of service software and takes each atomic service as each node; the service description document comprises a description document of the operation flow, a description document of each atomic service and a description document of constraint information of variables;
Step S102, analyzing a log document of service software to obtain test assertion and use duty ratio of each service path in a service graph model;
Step S103, traversing each service path in the service graph model, solving constraint information of each service path, and generating a test case set of the service software by combining test assertion and use duty ratio of each service path.
It is understood that services, links, interfaces, operations, and variables are progressively refined processes. The description document of the operation flow, namely the content of the combined service description document BPEL is rough, the content of service link < PARTNERLINKS > can be obtained by analyzing the BPEL by taking the description document as a main body, each atomic service is linked, and constraint information such as interfaces, operation and called variables used in each atomic service can be obtained according to the analysis of the description document WSDL of each atomic service. For constraint information such as the operation range of the variable, besides the analysis of WSDL, the analysis of the variable constraint description document XSD which is a description document of the constraint information of the variable is needed, and the variable name and the type information in the type description < types > obtained through the WSDL analysis can be associated with the variable in the XSD document for combined analysis. Here, constraint information is constraint relation arranged in flow sequence by detail information such as interfaces, operations, variables, and the like.
The service graph model is constructed by means of service description document combination analysis, visualization of document analysis is achieved, the complete process of each service path of service software is intuitively described, redundant use cases cannot be generated, but the ratio of the occupied path of each path in unit time in the actual use process of the software cannot be obtained, the accurate input and output values are not easy to generate, therefore, analysis information of a background log file is required to be introduced, the information can be obtained, test assertion can be obtained, the generated test use cases conform to the use habit, the reliability is high, and the section of the test use cases is consistent with the use section.
It should be noted that, the embodiment of the application realizes the automatic generation of the test case set of the service software, without manual intervention, can obtain the sufficient constraint information of each service path through the combination analysis of the service description document, improves the accuracy of the test case set, reduces the redundancy of the test case set, and combines the analysis data of the background log document, the automatically generated test case set contains the contents of service name, basic operation, structuring activity, interface, variable range, test assertion and the like, the proportion of the case is consistent with the use ratio, each service path is covered, and the obtained effective case can be executed.
According to the method provided by the embodiment of the application, the description document of the operation flow of the service software, the description document of each atomic service and the description document of constraint information of the variables are combined and analyzed to construct the service graph model corresponding to the service software, each service path in the service graph model is traversed, and the test assertion and the use ratio of each service path obtained by combining the analysis of the background log document are combined to generate the test case set of the service software, so that the test case set with high coverage rate can be quickly generated for the test automation of the service software, the manual intervention is less, the accuracy of the test case set is improved, and the redundancy of the test case set is reduced.
Based on the above embodiment, step S101 specifically includes:
Analyzing the description document of the operation flow of the service software to obtain the service description sequence, each structuring activity and the atomic service called in each structuring activity in the operation flow, and analyzing the description document of each atomic service and the description document of the constraint information of the variables to obtain the interface, the operation and the constraint information of the variables of each atomic service;
Converting each structuring activity in the operation flow into various relation structures, establishing each relation structure sequence according to the service description sequence of the operation flow, and filling the atomic service called in each structuring activity into various relation structures to form a service diagram model backbone;
and supplementing constraint information of interfaces, operations and variables of each atomic service on the basis of a service graph model backbone, and obtaining a service graph model corresponding to service software.
It will be appreciated that the process of forming the service graph model backbone may form a complete service path from start to end, and the complementary process may obtain the service graph model tip, thereby completing the service graph model creation in a sequence from backbone to tip, and granularity from coarse to fine. In the supplementing process, irrelevant operation, variable and constraint content on each service path can be removed, so that operation and constraint information of each service path is concise and clear, and invalid constraints such as unused operation and variable in the process are removed.
Based on any of the above embodiments, each type of relationship structure is specifically a relationship structure corresponding to a single operation, a sequence operation, a branch selection operation, a parallel operation, or a loop operation.
Here, the branch selection operation selects one of the branches according to the judgment condition.
Based on any of the above embodiments, step S102 specifically includes:
And matching the execution sequence obtained based on the log file analysis of the service software with each service path in the service graph model to obtain each matched service path, and analyzing the test assertion and the use duty ratio of each service path based on the input/output value and the use times in the execution sequence corresponding to each matched service path and combining the input/output range in the constraint information of each matched service path.
It can be understood that the effective service paths in the service graph model can be further screened by combining the actual execution data, i.e. the execution sequence, such as the IP address, the request time, the reference page URL, and the like, obtained by analyzing the log document in a feature comparison mode. And judging whether the input and output values in the corresponding execution sequences are in the input and output ranges according to the input and output ranges in the constraint information of each service path in the service graph model, so as to obtain test assertion of each service path and obtain an abnormal service path.
The usage ratio of each service path can be calculated according to the usage times of each service path, and further the problem level can be analyzed according to the usage ratio of the abnormal service path, for example, the usage ratio of the abnormal service path is higher, and the problem level is higher.
Based on any of the above embodiments, step S102 further includes:
Analyzing the newly added log file continuously, repeatedly calculating the use duty ratio of each service path until the change value of the use duty ratio of each service path before and after the newly added log file is lower than a preset threshold value, and obtaining the final use duty ratio of each service path.
It can be understood that the embodiment of the application aims at the use ratio of the path to screen the analysis information of the log files which are needed to be adopted, ensures that the use ratio of the finally obtained path is close to the actual use ratio, and improves the accuracy of the generated test case set.
Based on any of the above embodiments, at the same time, in order to adapt to the changing user requirements and external environments, the service software changes are also performed at any time, which includes not only the changes of the internal structures or variables of the program, but also the upgrade or replacement of the component service, the replacement of the business process, the change of the interface information of the component service, and the like, and these changes exist in the rapid iterative development process of the service software. How to quickly identify the change content and further obtain the test case set aiming at the service change part is another problem to be solved urgently.
In this regard, the embodiment of the present application further includes:
If the service description document of the service software is changed, analyzing the changed service description document to obtain a changed service diagram model;
and performing traversal comparison operation on the service graph models before and after the change, and identifying the change type and the changed service path to generate a test case set aiming at the changed service path.
It will be appreciated that if a change is identified in a portion, all service paths that have passed the change in the path overlay process need to be used as changed service paths, and test case sets need to be regenerated for testing according to constraint information of the changed service paths.
Based on any of the above embodiments, the change types include service changes, link changes, interface changes, operation changes, and variable changes.
It can be understood that 5 types of service change, link change, interface change, operation change, variable change and the like are step-by-step refinement processes, and as the service graph model is also constructed in the step-by-step refinement mode, the 5 types of changes can be identified through traversal comparison operation, so that the generated test case set can be more accurate.
By performing the comparison operation using a traversal algorithm such as a depth-first traversal, if the change type is identified as a service change, the contents of the link change, the interface change, the operation change, and the variable change are further identified later, and if the change type is identified as an interface change, the contents of the operation change and the variable change are further identified later.
Based on any one of the embodiments, the application provides a service software test case set automatic generation method and system based on service description and log document analysis, aiming at the problems existing in the existing service software test case generation method. FIG. 2 is a second flowchart of a test case set generating method according to an embodiment of the present application, as shown in FIG. 2, the steps of the service software test case set automatic generating method based on service description and log document parsing are as follows:
1. Service description document parsing. And carrying out combination analysis on service description related XML documents such as a combination service or business flow description document BPEL, a single service description document WSDL, a variable constraint description document XSD and the like corresponding to the service software to obtain information including control flow, information flow, constraint conditions and the like.
2. And modeling service software. According to the information obtained by analyzing the service description document, converting the basic activity and the structured activity of the service software into the basic structure of the service software model; and obtaining a service graph Model (SERVICE GRAPH Model SGM) corresponding to the service software by combining the infrastructure with the nodes which are obtained by combining and analyzing the active structures of the service software and contain contents such as atomic service, interfaces, variables, IP addresses and the like.
3. And (5) analyzing the log file. By analyzing the background log document, matching the execution sequences of the IP address, the request time, the reference page URL and the like with each branch of the obtained service graph model; traversing the matched effective logs to obtain the proportion of each branch path in the service graph model and the input and output data set.
4. And automatically generating the test case set. And obtaining all control flow paths including constraint information such as links, interfaces, variables and the like among services, namely complete service paths according to the service graph model. And traversing each control flow path by using depth priority, and automatically generating a test case set of the service software according to the ratio of each branch path, the input and output data set and the coverage of each abnormal branch.
5. Software change testing. Fig. 3 is a flowchart of a method for generating a set of changed software use cases according to an embodiment of the present application, where as shown in fig. 3, for a service software having a change, a service graph model is obtained by analyzing a description document before and after the change of the service software. And comparing the change contents of the service graph models before and after the change, identifying the change type and the changed service path which is the changed service path, and automatically generating a test case set of the change influencing part.
The specific implementation of the application comprises the following steps:
1) And opening a service software use case set generating tool, and importing service description related XML documents such as a combined service or business flow description document BPEL, a single service description document WSDL, a variable constraint description document XSD and the like. Clicking the "analysis" button to analyze the data and obtain the information including control flow, information flow and constraint condition.
FIG. 4 is a schematic diagram of a service description document provided in an embodiment of the present application, as shown in FIG. 4, the service description document BPEL is parsed to obtain an ordered service sequence < sequence >, a flow branch < switch >, a loop < while >, a select service execution < pick >, and a parallel service execution < flow >, where the service execution is structured; further analyzing basic operations such as description operation < assignment >, input operation < receive >, output operation < reply >, call service operation < invoke > and the like in the structured activity; further analyzing constraint information such as operation information < operation > and input/output parameters < from >, < to >; then, the variable name, the variable type, the atomic service called and other detailed information are obtained by analyzing the variable description < variables > part and the service link < PARTNERLINKS > part.
And then analyzing the WSDL document of the single service according to the related WSDL document information in the service link < PARTNERLINKS >, obtaining a port parameter < portType >, a message parameter type < message >, a basic data type < types >, content operation information < operation > and input/output parameters < input message >, < output message >, a service binding protocol < binding >, and defining < service > tag content by a service endpoint to obtain constraint contents such as data, variables, page websites and the like.
Finally, the variable constraint description document XSD is analyzed to obtain variable constraint information (all information, sequence, choice, attribute, element, simple type, complex type, etc.), and variable information such as input/output change type, numerical range, etc. in each single service is obtained by associating variable names and type information in the type description < types > with variables in the XSD document.
2) And after the analysis of the required document is completed by using a service software use case set generating tool, clicking a 'generating model' button to establish a service model, and obtaining a service model corresponding to the service description document.
FIG. 5 is a schematic diagram of a relationship structure of service graph model construction according to an embodiment of the present application, as shown in FIG. 5, according to information obtained by parsing a service description document, the service graph model construction is completed in a sequence from trunk to terminal and from coarse to fine granularity. Firstly, the structured activities in the service software combined service or the business process operation flow are correspondingly a plurality of relational structures such as an initial (initial), an end (end), a branch (branch), a mix (merge), a parallel branch (fork), a parallel mix (join), a cycle (cycle) and the like, various structure sequences are established according to the service description sequence, and then the atomic services called in the structures are filled in the structures to form a service diagram model backbone. Nodes a, b and c in fig. 5 represent different atomic services.
And supplementing constraint information such as ports, operations, data types, page information and the like in each atomic service according to the operation and variables used by each service in the flow trunk to obtain the service diagram model terminal. And combining the service graph model trunks obtained before to obtain the complete service graph model corresponding to the service software. In the supplementing process, irrelevant operation, variable and constraint content on each service path can be removed, so that operation and constraint information of each service path is concise and clear, and invalid constraints such as unused operation and variable in the process are removed.
3) After the service graph model is obtained, if the service graph model is directly traversed to obtain the use case set, a series of problems such as lack of test assertion, lack of use case proportion data of each path, incapability of confirming problem level and the like exist in the obtained use case set.
Therefore, in order to solve the problem of the automatically generated test case set, log document analysis operation is introduced, and test assertion, case occupation ratio and other information are obtained through log analysis, so that the problem is solved. The background log file contains execution data sets such as operation time, page addresses, mouse operations, input and output values and the like. Firstly, comparing the characteristics of the information such as page websites and mouse operations with each path in the service graph model, and realizing the identification and the supplementation of the paths of the service graph model by adopting a voting method based on path characteristics; then deleting the unrecognizable data set to realize the purification of log data; and finally summarizing data such as input and output ranges, path use times and the like corresponding to each path of the service graph model, and obtaining information such as test assertion, path proportion, namely path use duty ratio and the like. It will be appreciated that if several paths are aligned to be similar, a voting method is required to see which path is similar.
And taking the path proportion as a target, and stopping analyzing the log document when the path proportion change is lower than a preset threshold value due to the fact that the content of the log data set is added.
4) Clicking a 'generating' button in a service software case set generating tool, traversing each control flow path of the model by using depth priority, solving each path constraint information, and automatically generating a test case set of the service software by combining log analysis content. The automatically generated test case set comprises the contents of service names, basic operations, structured activities, interfaces, variable ranges, test assertions and the like, and the proportion of the case is consistent with the use ratio.
5) For the service software with the change, the service description document before and after the change is imported, after clicking a 'change identification' button, the operation of step 2) is carried out on the service software before and after the change, and then the comparison operation is carried out by adopting a depth-first traversal service diagram model before and after the change; the change area of the service graph model is divided into 5 types of service change, link change, interface change, operation change, variable change and the like, so that change identification is realized; finally, according to the different types of changes, the test case set is automatically generated for the change part.
Based on any one of the above embodiments, the present application provides a test case set generating system for service software, and fig. 6 is a schematic structural diagram of the test case set generating system provided by the embodiment of the present application, as shown in fig. 6, including:
The service diagram model construction module 610 is configured to parse a service description document of the service software to obtain an operation flow of the service software and constraint information of interfaces, operations and variables of each atomic service in the operation flow, so as to construct a service diagram model corresponding to the service software; the service graph model is used for describing the process of each service path of service software and takes each atomic service as each node; the service description document comprises a description document of the operation flow, a description document of each atomic service and a description document of constraint information of variables;
The log document analysis module 620 is configured to analyze a log document of the service software to obtain a test assertion and a usage duty ratio of each service path in the service graph model;
the test case set generating module 630 is configured to traverse each service path in the service graph model, solve constraint information of each service path, and combine the test assertion and the usage ratio of each service path to generate a test case set of the service software.
It can be understood that the detailed functional implementation of each module may be referred to the description in the foregoing method embodiment, and will not be repeated herein.
It should be understood that, the system is used to execute the method in the foregoing embodiment, and corresponding program modules in the system implement principles and technical effects similar to those described in the foregoing method, and the working process of the system may refer to the corresponding process in the foregoing method, which is not repeated herein.
Based on the method in the above embodiment, the embodiment of the application provides an electronic device. Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application, as shown in fig. 7, the electronic device may include: processor 710, communication interface (Communications Interface) 720, memory 730, and communication bus 740, wherein processor 710, communication interface 720, memory 730 communicate with each other via communication bus 740. Processor 710 may invoke logic instructions in memory 730 to perform the methods of the embodiments described above.
Further, the logic instructions in the memory 730 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application.
Based on the method in the above embodiment, the embodiment of the present application provides a computer-readable storage medium storing a computer program, which when executed on a processor, causes the processor to perform the method in the above embodiment.
Based on the method in the above embodiments, an embodiment of the present application provides a computer program product, which when run on a processor causes the processor to perform the method in the above embodiments.
It is to be appreciated that the processor in embodiments of the present application may be a central processing unit (central processing unit, CPU), other general purpose processor, digital signal processor (DIGITAL SIGNAL processor, DSP), application Specific Integrated Circuit (ASIC), field programmable gate array (field programmable GATE ARRAY, FPGA) or other programmable logic device, transistor logic device, hardware components, or any combination thereof. The general purpose processor may be a microprocessor, but in the alternative, it may be any conventional processor.
The steps of the method in the embodiment of the present application may be implemented by hardware, or may be implemented by executing software instructions by a processor. The software instructions may be comprised of corresponding software modules that may be stored in random access memory (random access memory, RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable ROM (erasable PROM, EPROM), electrically Erasable Programmable ROM (EEPROM), registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Drive (SSD)), etc.
It will be appreciated that the various numerical numbers referred to in the embodiments of the present application are merely for ease of description and are not intended to limit the scope of the embodiments of the present application.
It will be readily appreciated by those skilled in the art that the foregoing description is merely a preferred embodiment of the application and is not intended to limit the application, but any modifications, equivalents, improvements or alternatives falling within the spirit and principles of the application are intended to be included within the scope of the application.

Claims (10)

1. The test case set generation method of the service software is characterized by comprising the following steps of:
step S101, analyzing a service description document of service software to obtain an operation flow of the service software and constraint information of interfaces, operations and variables of each atomic service in the operation flow so as to construct a service diagram model corresponding to the service software; the service graph model is used for describing the process of each service path of service software and takes each atomic service as each node; the service description document comprises a description document of the operation flow, a description document of each atomic service and a description document of constraint information of variables;
Step S102, analyzing a log document of service software to obtain test assertion and use duty ratio of each service path in a service graph model;
Step S103, traversing each service path in the service graph model, solving constraint information of each service path, and generating a test case set of the service software by combining test assertion and use duty ratio of each service path.
2. The test case set generation method according to claim 1, wherein step S101 specifically includes:
Analyzing the description document of the operation flow of the service software to obtain the service description sequence, each structuring activity and the atomic service called in each structuring activity in the operation flow, and analyzing the description document of each atomic service and the description document of the constraint information of the variables to obtain the interface, the operation and the constraint information of the variables of each atomic service;
Converting each structuring activity in the operation flow into various relation structures, establishing each relation structure sequence according to the service description sequence of the operation flow, and filling the atomic service called in each structuring activity into various relation structures to form a service diagram model backbone;
and supplementing constraint information of interfaces, operations and variables of each atomic service on the basis of a service graph model backbone, and obtaining a service graph model corresponding to service software.
3. The test case set generating method according to claim 2, wherein each type of relationship structure is specifically a relationship structure corresponding to a single operation, a sequence operation, a branch selection operation, a parallel operation or a loop operation.
4. The test case set generation method according to claim 1, wherein step S102 specifically includes:
And matching the execution sequence obtained based on the log file analysis of the service software with each service path in the service graph model to obtain each matched service path, and analyzing the test assertion and the use duty ratio of each service path based on the input/output value and the use times in the execution sequence corresponding to each matched service path and combining the input/output range in the constraint information of each matched service path.
5. The test case set generation method according to claim 1, wherein step S102 further comprises:
Analyzing the newly added log file continuously, repeatedly calculating the use duty ratio of each service path until the change value of the use duty ratio of each service path before and after the newly added log file is lower than a preset threshold value, and obtaining the final use duty ratio of each service path.
6. The test case set generation method according to claim 1, further comprising:
If the service description document of the service software is changed, analyzing the changed service description document to obtain a changed service diagram model;
and performing traversal comparison operation on the service graph models before and after the change, and identifying the change type and the changed service path to generate a test case set aiming at the changed service path.
7. The test case set generation method of claim 6, wherein the change types include service changes, link changes, interface changes, operation changes, and variable changes.
8. A test case set generating system of service software, comprising:
The service diagram model construction module is used for analyzing the service description document of the service software to obtain the operation flow of the service software and the constraint information of interfaces, operations and variables of each atomic service in the operation flow so as to construct a service diagram model corresponding to the service software; the service graph model is used for describing the process of each service path of service software and takes each atomic service as each node; the service description document comprises a description document of the operation flow, a description document of each atomic service and a description document of constraint information of variables;
the log file analysis module is used for analyzing the log file of the service software to obtain test assertion and use duty ratio of each service path in the service graph model;
The test case set generation module is used for traversing each service path in the service graph model, solving constraint information of each service path, and generating a test case set of the service software by combining test assertion and use ratio of each service path.
9. An electronic device, comprising:
at least one memory for storing a computer program;
At least one processor for executing the memory-stored program, which processor is adapted to perform the method according to any of claims 1-7, when the memory-stored program is executed.
10. A computer readable storage medium storing a computer program, characterized in that the computer program, when run on a processor, causes the processor to perform the method according to any one of claims 1-7.
CN202410255157.2A 2024-03-06 2024-03-06 Test case set generation method and system of service software and electronic equipment Pending CN118210710A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410255157.2A CN118210710A (en) 2024-03-06 2024-03-06 Test case set generation method and system of service software and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410255157.2A CN118210710A (en) 2024-03-06 2024-03-06 Test case set generation method and system of service software and electronic equipment

Publications (1)

Publication Number Publication Date
CN118210710A true CN118210710A (en) 2024-06-18

Family

ID=91445423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410255157.2A Pending CN118210710A (en) 2024-03-06 2024-03-06 Test case set generation method and system of service software and electronic equipment

Country Status (1)

Country Link
CN (1) CN118210710A (en)

Similar Documents

Publication Publication Date Title
CN110245078B (en) Software pressure testing method and device, storage medium and server
CN112650766B (en) Database data operation method, system and server
US7881440B2 (en) Method for automatic graphical profiling of a system
CN110147327B (en) Multi-granularity-based web automatic test management method
CN115309566A (en) Dynamic management method and system for service interface
CN112162960A (en) Health government affair information sharing method, device and system
CN114422564A (en) Audit tracing method and device for access data, computer equipment and storage medium
CN114490762B (en) Data source access method, device, medium and equipment for decision engine
CN114706734A (en) Monitoring method and monitoring system for business application
CN115934097A (en) Method, device, storage medium and electronic device for generating executable statement
CN111552521A (en) Application data reporting method, device, server and storage medium
CN112395339B (en) Intersystem data admission verification method, device, computer equipment and storage medium
CN112559525A (en) Data checking system, method, device and server
CN118210710A (en) Test case set generation method and system of service software and electronic equipment
WO2022267865A1 (en) Workflow creation method and system, and electronic device and computer-readable storage medium
CN107517079B (en) Power communication optical path alternate path analysis method and device
CN110209722A (en) A kind of data-interface for data exchange
CN110032781A (en) Edit temporal constraint method, apparatus, computer equipment and storage medium
CN115630201A (en) Method and device for analyzing association relation of system components
CN112035366B (en) Test case generation method, device and equipment
CN112988718A (en) Method and system for automatically monitoring power
CN111401020A (en) Interface loading method and system and computing equipment
CN112436993B (en) VPN private line discovery method and device based on configuration file analysis
CN114785847B (en) Network control software development configuration method, terminal and storage medium
CN113392022B (en) Test requirement analysis method, device, computer readable medium and program product

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination