CN117194250A - Test case generation method, device, equipment, medium and program product - Google Patents

Test case generation method, device, equipment, medium and program product Download PDF

Info

Publication number
CN117194250A
CN117194250A CN202311160613.7A CN202311160613A CN117194250A CN 117194250 A CN117194250 A CN 117194250A CN 202311160613 A CN202311160613 A CN 202311160613A CN 117194250 A CN117194250 A CN 117194250A
Authority
CN
China
Prior art keywords
module
case
word segmentation
feature
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
CN202311160613.7A
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.)
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology Co Ltd
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
ICBC Technology 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 Industrial and Commercial Bank of China Ltd ICBC, ICBC Technology Co Ltd filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202311160613.7A priority Critical patent/CN117194250A/en
Publication of CN117194250A publication Critical patent/CN117194250A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The disclosure provides a test case generation method, which can be applied to the technical field of software testing. The test case generation method comprises the following steps: extracting word segmentation from a business requirement document, wherein the word segmentation at least comprises a first module word segmentation and a second module word segmentation, wherein the first module corresponds to a first test case set, and the first module and the second module are contained in the same project or the same system; acquiring a second module feature word segmentation based on the second module word segmentation and a feature word segmentation extraction model, wherein the feature word segmentation extraction model is obtained based on the first module word segmentation training; obtaining case features based on the first module test case set and the development path diagram; obtaining case expansion characteristics based on the case characteristics and the case design method; and acquiring a second module test case based on the case expansion feature and the second module feature word segmentation. The present disclosure also provides a test case generating apparatus, a device, a storage medium, and a program product.

Description

Test case generation method, device, equipment, medium and program product
Technical Field
The present disclosure relates to the field of software testing, and in particular, to a test case generating method, apparatus, device, medium, and program product.
Background
The currently mainstream test case generation methods generally include the following two methods: 1. filtering the link which is not traversed based on the coding design path and the neural network to generate a test case; 2. the characteristic extraction is carried out on the existing case, and then the crossover and mutation are carried out by using a genetic algorithm so as to generate a new test case. The two methods are mainly used for generating test cases aiming at links which are not covered by the test cases, and are not suitable for new requirements and generating scene test cases.
Disclosure of Invention
In view of the foregoing, embodiments of the present disclosure provide a test case generation method, apparatus, device, medium, and program product.
According to a first aspect of the present disclosure, there is provided a test case generating method, including: extracting word segmentation from a business requirement document, wherein the word segmentation at least comprises a first module word segmentation and a second module word segmentation, wherein the first module corresponds to a first test case set, and the first module and the second module are contained in the same project or the same system; acquiring a second module feature word segmentation based on the second module word segmentation and a feature word segmentation extraction model, wherein the feature word segmentation extraction model is obtained based on the first module word segmentation training; obtaining case features based on the first module test case set and the development path diagram; obtaining case expansion characteristics based on the case characteristics and the case design method; and acquiring a second module test case based on the case expansion feature and the second module feature word segmentation.
According to an embodiment of the disclosure, the obtaining the second module feature word based on the second module word and feature word extraction model includes: training a neural network model based on the first test case set to obtain the feature word segmentation extraction model; and carrying out feature extraction on the second module word segmentation based on the feature word segmentation extraction model to obtain a second module feature word segmentation.
According to an embodiment of the present disclosure, the obtaining case features based on the first module test case set and the development path diagram includes: extracting functional test features based on the first module test case; acquiring development path elements based on the development path diagram, wherein the development path elements comprise module development paths and processing results corresponding to the module development paths; and acquiring the use case feature based on the functional test feature and the development path element.
According to an embodiment of the disclosure, the obtaining the second module test case based on the case expansion feature and the second module feature word includes: acquiring a second module full-test case based on the case expansion feature and the second module feature word segmentation; screening the second module full test cases to obtain the second module test cases, wherein the case design method comprises at least one of an equivalence class classification method, a boundary value analysis method, an error inference method, a scene involving method, a decision table method, an orthogonal method and a causal graph method; and/or screening the expansion case features based on a filtering algorithm.
According to an embodiment of the present disclosure, the method further comprises: and acquiring a first module updating test case based on the expansion case characteristics and the feature word segmentation to be tested of the first module.
According to an embodiment of the disclosure, the neural network model is a BP neural network.
A second aspect of the present disclosure provides a test case generating apparatus, including: the word segmentation extraction module is configured to extract word segmentation from the requirement document of the functional module, wherein the word segmentation at least comprises a first module word segmentation and a second module word segmentation, the first module corresponds to a first test case set, and the first module and the second module are contained in the same item or the same system; the feature acquisition module is configured to acquire a second module feature word based on the second module word and a feature word extraction model, wherein the feature word extraction model is obtained based on a first module word training; the feature design module is configured to acquire case features based on the first module test case set and the development path diagram; the characteristic expansion module is configured to obtain example expansion characteristics based on the example characteristics and the example design method; and the case generation module is configured to acquire a second module test case based on the case expansion feature and the second module feature word segmentation.
According to an embodiment of the disclosure, the method for the feature acquisition module to acquire the feature word of the second module based on the feature word of the second module and the feature word extraction model includes training a neural network model based on the first test case set to obtain the feature word extraction model; and carrying out feature extraction on the second module word segmentation based on the feature word segmentation extraction model to obtain a second module feature word segmentation.
According to an embodiment of the present disclosure, a method for a feature design module to obtain an example feature based on a first module test case set and a development path diagram includes: and extracting functional test characteristics based on the first module test case. And acquiring development path elements based on the development path diagram, wherein the development path elements comprise module development paths and processing results corresponding to the module development paths. And acquiring the use case feature based on the functional test feature and the development path element.
According to an embodiment of the present disclosure, a method for a case generation module to obtain a second module test case based on a case expansion feature and a second module feature word includes: and acquiring the full test case of the second module based on the case expansion feature and the second module feature word segmentation. And screening the full test cases of the second module to obtain the test cases of the second module. The use case design method comprises at least one of an equivalence class classification method, a boundary value analysis method, an error inference method, a scene relation method, a decision table method, an orthogonal method and a causal graph method. And screening the expansion case features based on a filtering algorithm.
According to an embodiment of the present disclosure, the method that the use case generation module may further perform includes: and acquiring a first module updating test case based on the expansion case characteristics and the feature word segmentation to be tested of the first module.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the test case generating method described above.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the test case generating method described above.
The fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the test case generating method described above.
In the embodiment of the disclosure, the word segmentation is extracted from the demand, the word segmentation extraction model is obtained by training the existing case set, the case feature extraction is carried out on the new module through the word segmentation extraction model, and the test case meeting the new demand is automatically generated by combining the development path and the feature design method. Therefore, under the condition that the module does not have the existing test cases, the test cases corresponding to the module can be automatically and accurately generated, the workload of testers is reduced, and the efficiency of generating the test cases is improved.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario diagram of a test case generation method, apparatus, device, medium and program product according to an embodiment of the present disclosure.
FIG. 2 schematically illustrates a flow chart of a test case generation method according to an embodiment of the present disclosure.
Fig. 3 schematically illustrates a flowchart of a method for obtaining a second module feature word based on the second module word and feature word extraction model according to an embodiment of the disclosure.
FIG. 4 schematically illustrates a flowchart of a method of obtaining case features based on a first module test case set and a development path graph, in accordance with an embodiment of the disclosure.
FIG. 5 schematically illustrates a flowchart of a method of obtaining a second module test case based on the case expansion feature and a second module feature word segmentation in accordance with an embodiment of the present disclosure.
FIG. 6 schematically illustrates a flowchart of a method of acquiring module test cases, according to an embodiment of the disclosure.
Fig. 7 schematically illustrates a flowchart of a method of updating a first module association use case, according to an embodiment of the disclosure.
Fig. 8 schematically shows a block diagram of a test case generating device according to an embodiment of the present disclosure.
FIG. 9 schematically illustrates a block diagram of an electronic device adapted to implement a test case generation method, according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Test case design is an important link in the software testing process, and aims to discover defects in software as much as possible. At present, two main-stream intelligent test case generation methods exist. The first scheme is to filter the link which is not traversed based on the combination of the coding design path and the neural network to generate a test case. The second scheme is to first extract the characteristics of the existing cases, then use the genetic algorithm to cross and mutate, and then generate new test cases. For the first method, the main purpose is to generate test cases for links not covered by the existing cases, which is not suitable for new requirements and scene test case generation. The second scheme can be used as an initial population of a genetic algorithm through the characteristic factors of the existing case training set, then generates offspring through crossing and combining, and finally obtains the optimal test case set through setting the iteration times. The use case generated by the method has a certain effect on use case improvement, but is biased to optimization and path solving, and the problem that the method is not suitable for new requirements and the generation of scene test use cases still exists.
In the technical scheme of the invention, the related user information (including but not limited to user personal information, user image information, user equipment information, such as position information and the like) and data (including but not limited to data for analysis, stored data, displayed data and the like) are information and data authorized by a user or fully authorized by all parties, and the processing of the related data such as collection, storage, use, processing, transmission, provision, disclosure, application and the like are all conducted according to the related laws and regulations and standards of related countries and regions, necessary security measures are adopted, no prejudice to the public welfare is provided, and corresponding operation inlets are provided for the user to select authorization or rejection.
In view of the foregoing problems in the prior art, an embodiment of the present disclosure provides a test case generating method, including: extracting word segmentation from a business requirement document, wherein the word segmentation at least comprises a first module word segmentation and a second module word segmentation, wherein the first module corresponds to a first test case set, and the first module and the second module are contained in the same project or the same system; acquiring a second module feature word segmentation based on the second module word segmentation and a feature word segmentation extraction model, wherein the feature word segmentation extraction model is obtained based on the first module word segmentation training; obtaining case features based on the first module test case set and the development path diagram; obtaining case expansion characteristics based on the case characteristics and the case design method; and acquiring a second module test case based on the case expansion feature and the second module feature word segmentation.
In the embodiment of the disclosure, the development case generation of the test case design is performed on the part which does not realize the test case traversal in the original case set, which is different from the traditional method. Extracting word segmentation from the demand, training the existing case set to obtain a word segmentation extraction model, extracting case characteristics of the new module or the original module through the word segmentation extraction model, and automatically generating test cases meeting the new demand by combining a development path and a characteristic design method. According to the scheme of the embodiment of the disclosure, the method and the device can support the importing analysis of the demand document and the test case, the generation of the new case and the expansion of the original case, realize the accurate case generation, greatly reduce the workload of the testers and improve the efficiency of the test case generation.
FIG. 1 schematically illustrates an application scenario diagram of a test case generation method, apparatus, device, medium and program product according to an embodiment of the present disclosure.
As shown in fig. 1, an application scenario 100 according to this embodiment may include terminal devices 101, 102, 103. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication client applications, such as shopping class applications, web browser applications, search class applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only) may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that, the test case generating method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the test case generating device provided by the embodiments of the present disclosure may be generally disposed in the server 105. The test case generation method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the test case generating device provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The test case generation method of the disclosed embodiment will be described in detail below with reference to fig. 2 to 6 based on the scenario described in fig. 1.
FIG. 2 schematically illustrates a flow chart of a test case generation method according to an embodiment of the present disclosure.
As shown in fig. 2, the test case generating method of this embodiment includes operations S210 to S250, and the test case generating method can be executed by the server 105.
In operation S210, a segmentation is extracted for the business requirement document. The word segmentation at least comprises a first module word segmentation and a second module word segmentation, wherein the first module corresponds to a first test case set, and the first module and the second module are contained in the same item or the same system.
In operation S220, a second module feature word is obtained based on the second module word and the feature word extraction model, where the feature word extraction model is obtained based on the first module word training.
In operation S230, case features are obtained based on the first module test case set and the development path graph.
In operation S240, case expansion characteristics are obtained based on the case characteristics and the case design method.
In operation S250, a second module test case is obtained based on the case expansion feature and the second module feature word segmentation.
In embodiments of the present disclosure, the first module and the second module may belong to the same item or system, and the modules have similarity or functional relative correspondence. Furthermore, the functions between the first module and the second module are the same, in the embodiment of the disclosure, the first test case set corresponding to the first module can be analyzed and processed, and the second module word segmentation is combined, so that the test case corresponding to the second module can be automatically generated accurately and reliably without independently writing the test case corresponding to the second module. It should be understood that, under the condition that the first module and the second module have similarity and functional continuity, the case feature extraction of the second module word can be more accurate by combining the analysis of the test case of the first module and the word segmentation extraction model obtained by the word segmentation training of the first module, and the designed case also meets the requirements of the project or the system. By applying the method of the embodiment of the invention, a certain help can be provided for the time-consuming test case writing work in the project, and the project delivery and system online time can be reduced.
In an embodiment of the present disclosure, the first module word segment and the second module word segment may be obtained by identifying a demand document. The keywords of the required document can be identified by adopting NLP, computer vision, data mining, machine learning and other technologies so as to obtain a first module word segmentation and a second module word segmentation. In a specific embodiment, the requirement document may be subjected to recognition transformation based on the jieba segmentation model to obtain the first module segmentation and the second module segmentation.
It should be understood that each module word may be a word segmentation pool, and the word segmentation pool may be processed by the feature word extraction model to obtain features associated with use cases. The first test case set is a written case set. The first test case set and the first module word are both contained in the feature word associated with the case, so that a feature word extraction model can be obtained based on training of the first module word.
In some specific embodiments, the first module word segmentation may be used as a training set, and a neural network model is used for training to obtain a feature word segmentation extraction model, so as to extract the use case features.
Fig. 3 schematically illustrates a flowchart of a method for obtaining a second module feature word based on the second module word and feature word extraction model according to an embodiment of the disclosure.
As shown in fig. 3, the method for acquiring the feature word of the second module based on the feature word of the second module and the feature word extraction model in this embodiment includes operations S310 to S320.
In operation S310, training a neural network model based on the first test case set to obtain the feature word segmentation extraction model.
In operation S320, feature extraction is performed on the second module word based on the feature word extraction model, so as to obtain a second module feature word.
In one specific example, a BP neural network may be used as a training base model for the feature extraction model. A BP (Back Propagation) neural network is a multi-layer feedforward neural network that is trained according to an error Back Propagation algorithm. The BP neural network adjusts the network weight through a backward propagation algorithm so that the BP neural network can gradually converge to the minimum error. It has better generalization ability and fault tolerance ability. In the embodiment of the disclosure, the BP neural network can be used for extracting the use case characteristics rapidly and efficiently.
Further, embodiments of the present disclosure obtain case features based on the first module test case set and the development path graph to design test cases. In the embodiment of the disclosure, each functional module and each path can be better covered by applying the development path and the use case characteristic at the same time, so that the comprehensiveness and the effectiveness of the test are improved.
FIG. 4 schematically illustrates a flowchart of a method of obtaining case features based on a first module test case set and a development path graph, in accordance with an embodiment of the disclosure.
As shown in fig. 4, the method for obtaining the case features based on the first module test case set and the development path diagram according to the embodiment includes operations S410 to S430.
In operation S410, functional test features are extracted based on the first module test case.
In operation S420, a development path element is acquired based on the development path diagram, wherein the development path element includes a module development path and a processing result corresponding to the module development path.
In operation S430, the use case feature is acquired based on the functional test feature and the development path element.
According to an embodiment of the present disclosure, a development path graph is obtained from a summary development path. The actual path and result can be obtained by scanning the source code. And judging the carding development realization path and possible results under each path based on the conditions. By analyzing the development path, the tester can better understand the structure, function and performance of the software system, thereby helping to grasp the testing focus and direction as a whole. Further, when the test case is designed, each functional module and path of the software system can be better considered, and the comprehensiveness of the test is ensured. The functional test features may be functional points, performance indicators, security issues, etc. that are of interest to the test case. These features help the tester better understand the intent and purpose of the test case, thereby more specifically designing the test solution. In embodiments of the present disclosure, the first test case may be segmented based on the TF-IDF method to extract functional test features. In combination with developing paths and case features, a tester can determine test cases for different functional modules and paths. In this way, the test cases can better cover various functional points and potential problems of the software system, and the test effectiveness is improved.
FIG. 5 schematically illustrates a flowchart of a method of obtaining a second module test case based on the case expansion feature and a second module feature word segmentation in accordance with an embodiment of the present disclosure.
As shown in fig. 5, the method for acquiring the second module test case based on the case expansion feature and the second module feature word in this embodiment includes operations S510 to S520.
In operation S510, a second module full test case is obtained based on the case expansion feature and the second module feature word segmentation.
In operation S520, the second module full test case is screened, and the second module test case is obtained.
The use case design method comprises at least one of an equivalence class classification method, a boundary value analysis method, an error inference method, a scene relating method, a decision table method, an orthographic method and a causal graph method. In an embodiment of the present disclosure, the second module full test cases may be filtered based on a filtering algorithm.
FIG. 6 schematically illustrates a flowchart of a method of acquiring module test cases, according to an embodiment of the disclosure.
As shown in FIG. 6, the A module case set corresponds to the first test case set, and different feature values, such as a feature value 1, a feature value 2 and a feature value 3, can be obtained based on the functional test feature extraction of the first test case set. The expansion case features can be obtained by expanding and combining (i.e. expanding) the feature values by using a case design standard method, and further, the expanded case features and the module word (i.e. the A module requirement word) extracted from the requirement document are combined to generate a total test case, which comprises, for example, case 1, case 2, case 3, case 4 and case 5. Further, the generated full test cases can be screened by combining a filtering algorithm to obtain final second module test cases. According to the embodiment of the disclosure, the case features can be randomly combined through a general standard test case design method to perform case design, and finally, the cross-coverage comprehensive test case is obtained. Screening is further performed to obtain final test cases. For example, case 1 and case 3 do not conform to the business logic, and are discarded, while case 2, case 4, case 5, which conform to the business logic, are reserved. The filtering algorithm may include collaborative filtering algorithm, content-based filtering algorithm, model-based filtering algorithm, machine learning filtering, etc. In some preferred embodiments, a collaborative filtering algorithm may be used to screen the full volume of test cases. In the collaborative filtering algorithm, the cases are recommended according to similarity comparison of the first test case and the generated full-scale test cases. The collaborative filtering algorithm is fast to realize, and data processing efficiency in the embodiment of the disclosure can be improved.
Embodiments of the present disclosure may also be used for updating the first module association use case.
Fig. 7 schematically illustrates a flowchart of a method of updating a first module association use case, according to an embodiment of the disclosure.
As shown in fig. 7, the method of updating the first module association use case of this embodiment includes operation S710.
In operation S710, a first module update test case is obtained based on the expansion case feature and the feature word to be tested of the first module. It should be understood that, by applying the embodiment of the present disclosure, the use cases of the existing modules may be used as a training set to generate extended use cases of the original modules.
In the embodiment of the disclosure, the method for generating the expansion case of the test case design is different from the traditional method for generating the expansion case of the test case design on the part which does not realize the test case traversal in the original case set. According to the embodiment of the disclosure, the word segmentation is extracted from the demand, the word segmentation extraction model is obtained by training the existing case set, the case feature extraction is carried out on the new module or the original module through the word segmentation extraction model, and the test case meeting the new demand is automatically generated by combining the development path and the feature design method. The extracted use case features can be expanded to obtain expansion use case features, so that the generated use case has finer granularity and more comprehensive coverage. The embodiment of the disclosure fundamentally solves the problem of large workload in the processes of carrying out demand analysis, test scene design, research and development design document carding by testers. The test efficiency is greatly improved, and meanwhile, the test cases of new and old projects are compatible to write, so that various use scenes of a user are facilitated.
Based on the test case generation method, the embodiment of the disclosure also provides a test case generation device. The device will be described in detail below in connection with fig. 8.
Fig. 8 schematically shows a block diagram of a test case generating device according to an embodiment of the present disclosure.
As shown in fig. 8, the test case generating apparatus 800 of this embodiment includes a word segmentation extraction module 810, a feature acquisition module 820, a feature design module 830, a feature expansion module 840, and a case generating module 850.
The word segmentation extraction module 810 is configured to extract a word segment from a requirement document of a functional module, where the word segment at least includes a first module word segment and a second module word segment, where the first module corresponds to a first test case set, and the first module and the second module are included in the same item or the same system.
The feature acquisition module 820 is configured to acquire a second module feature word based on the second module word and a feature word extraction model, wherein the feature word extraction model is derived based on a first module word training.
The feature design module 830 is configured to obtain case features based on the first module test case set and the development path graph.
The feature expansion module 840 is configured to obtain case expansion features based on the case features and case design methods.
The case generation module 850 is configured to obtain a second module test case based on the case expansion feature and the second module feature word segmentation.
According to an embodiment of the disclosure, the method for the feature acquisition module to acquire the feature word of the second module based on the feature word of the second module and the feature word extraction model includes training a neural network model based on the first test case set to obtain the feature word extraction model; and carrying out feature extraction on the second module word segmentation based on the feature word segmentation extraction model to obtain a second module feature word segmentation.
According to an embodiment of the present disclosure, a method for a feature design module to obtain an example feature based on a first module test case set and a development path diagram includes: and extracting functional test characteristics based on the first module test case. And acquiring development path elements based on the development path diagram, wherein the development path elements comprise module development paths and processing results corresponding to the module development paths. And acquiring the use case feature based on the functional test feature and the development path element.
According to an embodiment of the present disclosure, a method for a case generation module to obtain a second module test case based on a case expansion feature and a second module feature word includes: and acquiring the full test case of the second module based on the case expansion feature and the second module feature word segmentation. And screening the full test cases of the second module to obtain the test cases of the second module. The use case design method comprises at least one of an equivalence class classification method, a boundary value analysis method, an error inference method, a scene relation method, a decision table method, an orthogonal method and a causal graph method. And screening the expansion case features based on a filtering algorithm.
According to an embodiment of the present disclosure, the method that the use case generation module may further perform includes: and acquiring a first module updating test case based on the expansion case characteristics and the feature word segmentation to be tested of the first module.
Any of the word segmentation extraction module 810, the feature acquisition module 820, the feature design module 830, the feature expansion module 840, and the use case generation module 850 may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules, according to embodiments of the present disclosure. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the word segmentation extraction module 810, the feature acquisition module 820, the feature design module 830, the feature expansion module 840, and the use case generation module 850 may be implemented, at least in part, as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or as hardware or firmware in any other reasonable manner of integrating or packaging the circuitry, or as any one of or a suitable combination of any of the three. Alternatively, at least one of the segmentation extraction module 810, the feature acquisition module 820, the feature design module 830, the feature expansion module 840, and the use case generation module 850 may be at least partially implemented as computer program modules that, when executed, perform the corresponding functions.
FIG. 9 schematically illustrates a block diagram of an electronic device adapted to implement a test case generation method, according to an embodiment of the disclosure.
As shown in fig. 9, an electronic device 900 according to an embodiment of the present disclosure includes a processor 901 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. The processor 901 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. Processor 901 may also include on-board memory for caching purposes. Processor 901 may include a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the electronic device 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other by a bus 904. The processor 901 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the program may be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the disclosure, the electronic device 900 may also include an input/output (I/O) interface 905, the input/output (I/O) interface 905 also being connected to the bus 904. The electronic device 900 may also include one or more of the following components connected to the I/O interface 905: an input section 906 including a keyboard, a mouse, and the like; an output portion 907 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage portion 908 including a hard disk or the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on the drive 910 so that a computer program read out therefrom is installed into the storage section 908 as needed.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 902 and/or RAM 903 and/or one or more memories other than ROM 902 and RAM 903 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowcharts. The program code, when executed in a computer system, causes the computer system to implement the item recommendation method provided by embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed, and downloaded and installed in the form of a signal on a network medium, via communication portion 909, and/or installed from removable medium 911. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (11)

1. A test case generation method, comprising:
extracting word segmentation from a business requirement document, wherein the word segmentation at least comprises a first module word segmentation and a second module word segmentation, wherein the first module corresponds to a first test case set, and the first module and the second module are contained in the same project or the same system;
Acquiring a second module feature word segmentation based on the second module word segmentation and a feature word segmentation extraction model, wherein the feature word segmentation extraction model is obtained based on the first module word segmentation training;
obtaining case features based on the first module test case set and the development path diagram;
obtaining case expansion characteristics based on the case characteristics and the case design method; and
and acquiring a second module test case based on the case expansion feature and the second module feature word segmentation.
2. The method of claim 1, wherein the obtaining a second module feature word based on the second module word and feature word extraction model comprises:
training a neural network model based on the first test case set to obtain the feature word segmentation extraction model;
and carrying out feature extraction on the second module word segmentation based on the feature word segmentation extraction model to obtain a second module feature word segmentation.
3. The method of claim 1, wherein the obtaining case features based on the first module test case set and the development path graph comprises:
extracting functional test features based on the first module test case;
acquiring development path elements based on the development path diagram, wherein the development path elements comprise module development paths and processing results corresponding to the module development paths;
And acquiring the use case feature based on the functional test feature and the development path element.
4. The method of claim 1, wherein the obtaining a second module test case based on the case expansion feature and a second module feature word comprises:
acquiring a second module full-test case based on the case expansion feature and the second module feature word segmentation;
screening the second module full test cases to obtain the second module test cases,
the use case design method comprises at least one of an equivalence class classification method, a boundary value analysis method, an error inference method, a scene relation method, a decision table method, an orthogonal method and a causal graph method; and/or screening the expansion case features based on a filtering algorithm.
5. The method of claim 1, wherein the method further comprises:
and acquiring a first module updating test case based on the expansion case characteristics and the feature word segmentation to be tested of the first module.
6. The method of claim 2, wherein the neural network model is a BP neural network.
7. The method of claim 4, wherein the filtering algorithm is a collaborative filtering algorithm.
8. A test case generating apparatus, comprising:
the word segmentation extraction module is configured to extract word segmentation from the requirement document of the functional module, wherein the word segmentation at least comprises a first module word segmentation and a second module word segmentation, the first module corresponds to a first test case set, and the first module and the second module are contained in the same item or the same system;
the feature acquisition module is configured to acquire a second module feature word based on the second module word and a feature word extraction model, wherein the feature word extraction model is obtained based on a first module word training;
the feature design module is configured to acquire case features based on the first module test case set and the development path diagram;
the characteristic expansion module is configured to obtain example expansion characteristics based on the example characteristics and the example design method; and
and the case generation module is configured to acquire a second module test case based on the case expansion feature and the second module feature word segmentation.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-7.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any of claims 1-7.
11. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.
CN202311160613.7A 2023-09-08 2023-09-08 Test case generation method, device, equipment, medium and program product Pending CN117194250A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311160613.7A CN117194250A (en) 2023-09-08 2023-09-08 Test case generation method, device, equipment, medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311160613.7A CN117194250A (en) 2023-09-08 2023-09-08 Test case generation method, device, equipment, medium and program product

Publications (1)

Publication Number Publication Date
CN117194250A true CN117194250A (en) 2023-12-08

Family

ID=88988247

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311160613.7A Pending CN117194250A (en) 2023-09-08 2023-09-08 Test case generation method, device, equipment, medium and program product

Country Status (1)

Country Link
CN (1) CN117194250A (en)

Similar Documents

Publication Publication Date Title
US10891325B2 (en) Defect record classification
CN111582645B (en) APP risk assessment method and device based on factoring machine and electronic equipment
CN114358147A (en) Training method, identification method, device and equipment of abnormal account identification model
CN113535577A (en) Application testing method and device based on knowledge graph, electronic equipment and medium
CN109003181B (en) Suspicious user determination method, device, equipment and computer readable storage medium
CN115827122A (en) Operation guiding method and device, electronic equipment and storage medium
CN115292187A (en) Method and device for automatically testing code-free page, electronic equipment and medium
CN117194250A (en) Test case generation method, device, equipment, medium and program product
CN114897607A (en) Data processing method and device for product resources, electronic equipment and storage medium
CN111582649B (en) Risk assessment method and device based on user APP single-heat coding and electronic equipment
CN114237588A (en) Code warehouse selection method, device, equipment and storage medium
CN110879868A (en) Consultant scheme generation method, device, system, electronic equipment and medium
CN112711718A (en) Review information auditing method, device, medium and electronic equipment
CN110610392A (en) Data processing method and system, computer system and computer readable storage medium
CN117806977A (en) Test method, apparatus, device, medium and program product
CN118013506A (en) Test user switching method, device, equipment, storage medium and program product
CN117667636A (en) Log analysis method, system, equipment and medium based on generalized linear model
CN115292157A (en) Test script generation method, device, equipment, storage medium and program product
CN118093418A (en) Test case assessment method, apparatus, device, medium and program product
CN115688725A (en) Report frame template generation method and device, electronic equipment and medium
CN115098398A (en) Test case processing method, device, equipment and medium
CN117234910A (en) Information processing method, device, equipment and storage medium
CN115689263A (en) Information generation method, device, equipment and storage medium
CN116627792A (en) Test code optimization method, apparatus, device, medium and program product
CN114677202A (en) Type identification method, training method and device, electronic equipment and storage medium

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