CN113282519B - Case data recommendation method, system and medium for software testing - Google Patents

Case data recommendation method, system and medium for software testing Download PDF

Info

Publication number
CN113282519B
CN113282519B CN202110828715.6A CN202110828715A CN113282519B CN 113282519 B CN113282519 B CN 113282519B CN 202110828715 A CN202110828715 A CN 202110828715A CN 113282519 B CN113282519 B CN 113282519B
Authority
CN
China
Prior art keywords
knowledge
knowledge base
case data
argument
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110828715.6A
Other languages
Chinese (zh)
Other versions
CN113282519A (en
Inventor
孟崎
贯春宇
闫卫杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Keyware Co ltd
Original Assignee
Beijing Keyware 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 Beijing Keyware Co ltd filed Critical Beijing Keyware Co ltd
Priority to CN202110828715.6A priority Critical patent/CN113282519B/en
Publication of CN113282519A publication Critical patent/CN113282519A/en
Application granted granted Critical
Publication of CN113282519B publication Critical patent/CN113282519B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Abstract

The invention provides a case data recommendation method, system and medium for software testing. The method comprises the following steps: step S1, acquiring a test requirement input by a user; step S2, extracting a knowledge argument sub-graph in the test requirement, wherein the knowledge argument sub-graph represents knowledge argument relations of natural language-based phrases and words contained in the test requirement; step S3, inquiring a knowledge base subgraph corresponding to the knowledge argument subgraph in a knowledge base; and step S4, determining the case data recommended to the user based on the inquired knowledge base subgraph. The method can realize the rapid construction of a large amount of test case data meeting the requirements, and can reduce the work of testers in the test case design stage, thereby saving a large amount of time in the test design process.

Description

Case data recommendation method, system and medium for software testing
Technical Field
The invention relates to the field of data analysis and processing, in particular to a case data recommendation method, system and medium for software testing.
Background
Software Testing (Software Testing) describes a process used to facilitate the identification of the correctness, integrity, security, and quality of Software. In other words, software testing is a process of auditing or comparing between actual output and expected output. The classical definition of software testing is: the process of operating a program under specified conditions to discover program errors, to measure software quality, and to evaluate whether it meets design requirements.
Software testing is generated in connection with the generation of software. The software scale in the early software development process is very small and low in complexity, the software development process is disordered and quite random, the test meaning is narrow, a developer is equal to debugging in the test process, the purpose is to correct known faults in the software, and the developer usually completes the part of work. As software and IT industries enter a large development stage, software tends to be large-scale and high in complexity, and the quality of the software is more and more important. Some basic theories and practical technologies of software testing are beginning to be developed, and people begin to design various processes and management methods for software development, and the software development mode gradually transits from a chaotic and unordered development process to a structured development process, and is characterized by structured analysis and design, structured review, structured program design and structured testing. With the concept of quality being integrated into the software testing definition, the software testing definition is changed, the testing is not simply a process of finding errors, and the testing is used as a main function of software quality assurance and comprises the content of software quality evaluation. In the "software testing complete guide", the test is any activity that aims at evaluating an attribute of a program or system; the test is a measure of the quality of the software. This definition is still cited so far. Software developers and testers are beginning to sit together to explore software engineering and testing problems.
The software test is mainly divided into stages of test requirement analysis, test plan, test design, test execution, test evaluation and the like. In the traditional test, the test work is very complicated, and a large amount of test personnel, software and hardware resources are required to be invested in each test stage to carry out the test work. A large amount of resources and time are consumed in the whole testing process.
Disclosure of Invention
The invention aims to provide a case data recommendation scheme for software testing, which aims to solve the technical problems in the prior art. The scheme is based on the intelligent test case recommendation technology of natural language processing, the work of test design can be simplified, the resource investment is reduced, and the test period is shortened.
The intelligent test case recommending technology based on natural language processing is mainly characterized in that a test case recommending model is generated by natural language processing, intelligent word segmentation, knowledge extraction and the like of typical test case data based on the collected typical test case data. When a tester designs a test case, test case data which can adapt to test requirements and functions as much as possible is recommended for the tester intelligently according to the test requirements and the test functions, so that the tester can quickly construct a large amount of test case data meeting the requirements, the work of the tester in the test case design stage is reduced, and a large amount of time is saved in the test design process.
The invention provides a case data recommendation method for software testing in a first aspect, which comprises the following steps: step S1, acquiring a test requirement input by a user; step S2, extracting a knowledge argument sub-graph in the test requirement, wherein the knowledge argument sub-graph represents knowledge argument relations of natural language-based phrases and words contained in the test requirement; step S3, inquiring a knowledge base subgraph corresponding to the knowledge argument subgraph in a knowledge base; and step S4, determining the case data recommended to the user based on the inquired knowledge base subgraph.
According to the method provided by the first aspect of the present invention, each knowledge base sub-graph in the knowledge base is constructed by: extracting knowledge arguments in the use case data based on a deep neural network; and determining the relation among a plurality of knowledge arguments by using dependency analysis or semantic analysis according to a grammatical structure, and determining an event role corresponding to the knowledge arguments based on the relation, thereby constructing the knowledge base subgraph of the use case data.
According to the method provided by the first aspect of the present invention, in the step S3, querying a knowledge base sub-graph corresponding to the argument of knowledge sub-graph in the knowledge base by determining the position of each argument included in the argument of knowledge sub-graph in the knowledge base.
According to the method provided by the first aspect of the present invention, the step S4 further includes: obtaining a plurality of candidate answers from the knowledge base subgraph; determining a plurality of paths in the knowledge base subgraph through a TRANSE algorithm; extracting feature vectors representing the candidate answer features from the paths; and taking the feature vector as an input of a classifier to acquire the case data recommended to the user.
The second aspect of the present invention provides a case data recommendation system for software testing, the system comprising: an acquisition unit configured to acquire a test requirement input by a user; an extracting unit, configured to extract a knowledge element sub-graph in the test requirement, wherein the knowledge element sub-graph represents knowledge element relations of natural language-based phrases and words contained in the test requirement; the query unit is configured to query a knowledge base subgraph corresponding to the knowledge argument subgraph in a knowledge base; and the determining unit is configured to determine the case data recommended to the user based on the queried knowledge base subgraph.
According to the system provided by the second aspect of the present invention, the knowledge base is included in the use case data recommendation system or is connected to the use case data recommendation system through an external connection; each of the knowledge base sub-graphs in the knowledge base is constructed by: extracting knowledge arguments in the use case data based on a deep neural network; and determining the relation among a plurality of knowledge arguments by using dependency analysis or semantic analysis according to a grammatical structure, and determining an event role corresponding to the knowledge arguments based on the relation, thereby constructing the knowledge base subgraph of the use case data.
According to the system provided by the second aspect of the present invention, the query unit is further configured to query the knowledge base sub-graph corresponding to the argument of knowledge sub-graph in the knowledge base by determining the position of each argument contained in the argument of knowledge sub-graph in the knowledge base.
According to the system provided by the second aspect of the present invention, the determining unit is further configured to: obtaining a plurality of candidate answers from the knowledge base subgraph; determining a plurality of paths in the knowledge base subgraph through a TRANSE algorithm; extracting feature vectors representing the candidate answer features from the paths; and taking the feature vector as an input of a classifier to acquire the case data recommended to the user.
A third aspect of the present invention provides a non-transitory computer readable medium storing instructions which, when executed by a processor, perform the steps of a use case data recommendation method for software testing according to the first aspect of the present invention.
By adopting the technical scheme, the invention has the following beneficial effects: the method can realize the rapid construction of a large amount of test case data meeting the requirements, and can reduce the work of testers in the test case design stage, thereby saving a large amount of time in the test design process.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description in the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram illustrating a flow of a case data recommendation method for software testing according to an embodiment of the present invention;
FIG. 2 is a block diagram of a use case data recommendation system for software testing according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a case data recommendation method for software testing, which can realize the rapid construction of a large amount of test case data meeting requirements, and can reduce the work of testers in the test case design stage, thereby saving a large amount of time in the test design process.
Fig. 1 is a schematic diagram of a flow of a case data recommendation method for software testing according to an embodiment of the present invention. As shown in fig. 1, the process 100 begins with step S1, where the test requirement input by the user is obtained. In some embodiments, in the step S1, the test requirement may be obtained based on a user input, or may be obtained by other methods, including but not limited to: through configuration of the test platform, or through external data import, etc.
Next, in step S2, a knowledgerelated sub-graph in the test requirement is extracted, wherein the knowledgerelated sub-graph represents knowledgerelated relations of natural language-based phrases and words contained in the test requirement.
In some embodiments, when a tester performs test case design, the information description of the current test requirement is subjected to learning of distributed expression by a deep learning method, phrases and words based on natural language contained in the requirement description are mapped to argument or argument relation of a knowledge base, and then the requirement description is converted into a requirement argument subgraph which can be understood by the knowledge base.
Subsequently, in step S3, the knowledge base sub-graph corresponding to the knowledge argument sub-graph is queried in the knowledge base.
In some embodiments, the test case collection in the knowledge base refers to the unified collection management of test case data generated in the full life cycle test process of application software in the system. And classifying, summarizing, warehousing and storing according to different test requirements, functions, test item information and the like to realize test case data accumulation.
In some embodiments, each of the knowledge-base subgraphs in the knowledge-base is constructed by: extracting knowledge arguments in the use case data based on a deep neural network; and determining the relation among a plurality of knowledge arguments by using dependency analysis or semantic analysis according to a grammatical structure, and determining an event role corresponding to the knowledge arguments based on the relation, thereby constructing the knowledge base subgraph of the use case data. For a test case to be stored in a stock, extracting knowledge arguments in test case data by constructing a deep neural network, determining the relation between different arguments by utilizing dependency analysis or semantic analysis based on a syntactic structure, simultaneously acquiring sentences correspondingly described by events according to trigger words of the events, identifying roles of the events corresponding to the arguments in the sentences described by the events, and constructing a complete knowledge graph, namely a knowledge base subgraph of the test case.
In some embodiments, a knowledge base sub-graph corresponding to the knowledge argument sub-graph in the knowledge base is queried by determining the location in the knowledge base of each argument contained in the knowledge argument sub-graph. That is, the position of the argument of knowledge in the argument of knowledge subgraph is inquired in the knowledge base to obtain the knowledge base subgraph with the argument at the position as the center.
Finally, in step S4, based on the queried knowledge base sub-graph, the use case data recommended to the user is determined. Specifically, a plurality of candidate answers are obtained from the knowledge base subgraph; determining a plurality of paths in the knowledge base subgraph through a TRANSE algorithm; extracting feature vectors representing the candidate answer features from the paths; and taking the feature vector as an input of a classifier to acquire the case data recommended to the user.
In some embodiments, the relation of different path deletions in the knowledge base subgraph is complemented through a TRANSE algorithm, then different paths in the knowledge base subgraph are solved, information extraction is carried out according to rules or templates, feature vectors representing the features of the problems and the candidate answers are obtained, a classifier is established, the candidate answers are screened through inputting the feature vectors, therefore, test case information possibly suitable for the current test requirements is screened out, and the test case information is recommended to a tester to complete test case design.
To sum up, the case data recommendation method for software testing in the first aspect of the present invention accumulates a large amount of test case data for natural language processing and learning by collecting and storing typical test case data designed by a tester according to test requirements during a test process. And carrying out deep processing according to the collected typical test case data to generate an intelligent case recommendation model. When the test is carried out, the test case data used by the tester is recommended through the intelligent recommendation model according to the test requirements and functions. Meanwhile, the accuracy and pertinence of intelligent recommendation of test cases are improved by learning a large amount of test case data.
A second aspect of the present invention provides a case data recommendation system for software testing, and fig. 2 is a structural diagram of a case data recommendation system for software testing according to an embodiment of the present invention. As shown in fig. 2, the system includes: an acquisition unit configured to acquire a test requirement input by a user; an extracting unit, configured to extract a knowledge element sub-graph in the test requirement, wherein the knowledge element sub-graph represents knowledge element relations of natural language-based phrases and words contained in the test requirement; the query unit is configured to query a knowledge base subgraph corresponding to the knowledge argument subgraph in a knowledge base; and the determining unit is configured to determine the case data recommended to the user based on the queried knowledge base subgraph.
In some embodiments, the knowledge base is contained in the use case data recommendation system or is connected to the use case data recommendation system through an external connection; each of the knowledge base sub-graphs in the knowledge base is constructed by: extracting knowledge arguments in the use case data based on a deep neural network; and determining the relation among a plurality of knowledge arguments by using dependency analysis or semantic analysis according to a grammatical structure, and determining an event role corresponding to the knowledge arguments based on the relation, thereby constructing the knowledge base subgraph of the use case data.
In some embodiments, the querying unit is further configured to query a knowledge base sub-graph corresponding to the argument of knowledge sub-graph in the knowledge base by determining the position of each argument contained in the argument of knowledge sub-graph in the knowledge base. In some embodiments, the determining unit is further configured to: obtaining a plurality of candidate answers from the knowledge base subgraph; determining a plurality of paths in the knowledge base subgraph through a TRANSE algorithm; extracting feature vectors representing the candidate answer features from the paths; and taking the feature vector as an input of a classifier to acquire the case data recommended to the user.
A third aspect of the present invention provides a non-transitory computer readable medium storing instructions which, when executed by a processor, perform the steps of a use case data recommendation method for software testing according to the first aspect of the present invention.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (5)

1. A case data recommendation method for software testing is characterized by comprising the following steps:
step S1, acquiring a test requirement input by a user;
step S2, extracting a knowledge argument sub-graph in the test requirement, wherein the knowledge argument sub-graph represents knowledge argument relations of natural language-based phrases and words contained in the test requirement;
step S3, inquiring a knowledge base subgraph corresponding to the knowledge argument subgraph in a knowledge base; and
step S4, determining the case data recommended to the user based on the inquired knowledge base subgraph;
wherein each of the knowledge base sub-graphs in the knowledge base is constructed by:
extracting knowledge arguments in the use case data based on a deep neural network;
determining relationships between a plurality of said knowledgeable arguments using dependency analysis or semantic parsing based on a syntactic structure, an
Determining an event role corresponding to the argument of knowledge based on the relationship, thereby constructing the knowledge base subgraph of the use case data;
wherein the step S4 further includes:
obtaining a plurality of candidate answers from the knowledge base subgraph;
determining a plurality of paths in the knowledge base subgraph through a TRANSE algorithm;
extracting feature vectors representing the candidate answer features from the paths; and
and taking the feature vector as an input of a classifier to acquire the use case data recommended to the user.
2. The use case data recommendation method for software testing according to claim 1, wherein in said step S3, querying a knowledge base sub-graph corresponding to said argument of knowledge sub-graph in said knowledge base by determining the position of each argument contained in said argument of knowledge sub-graph in said knowledge base.
3. A use case data recommendation system for software testing, the system comprising:
an acquisition unit configured to acquire a test requirement input by a user;
an extracting unit, configured to extract a knowledge element sub-graph in the test requirement, wherein the knowledge element sub-graph represents knowledge element relations of natural language-based phrases and words contained in the test requirement;
the query unit is configured to query a knowledge base subgraph corresponding to the knowledge argument subgraph in a knowledge base; and
a determining unit configured to determine the use case data recommended to the user based on the queried knowledge base sub-graph;
wherein the knowledge base is contained in the use case data recommendation system or is connected to the use case data recommendation system through an external connection, and each knowledge base sub-graph in the knowledge base is constructed in the following way:
extracting knowledge arguments in the use case data based on a deep neural network;
determining relationships between a plurality of said knowledgeable arguments using dependency analysis or semantic parsing based on a syntactic structure, an
Determining an event role corresponding to the argument of knowledge based on the relationship, thereby constructing the knowledge base subgraph of the use case data;
the determining unit is further configured to:
obtaining a plurality of candidate answers from the knowledge base subgraph;
determining a plurality of paths in the knowledge base subgraph through a TRANSE algorithm;
extracting feature vectors representing the candidate answer features from the paths; and
and taking the feature vector as an input of a classifier to acquire the use case data recommended to the user.
4. The use case data recommendation system for software testing according to claim 3, wherein said query unit is further configured to query a knowledge base sub-graph corresponding to said argument of knowledge sub-graph in said knowledge base by determining a location of each argument contained in said argument of knowledge sub-graph in said knowledge base.
5. A non-transitory computer readable medium storing instructions which, when executed by a processor, perform the steps in the use case data recommendation method for software testing of any of claims 1-2.
CN202110828715.6A 2021-07-22 2021-07-22 Case data recommendation method, system and medium for software testing Active CN113282519B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110828715.6A CN113282519B (en) 2021-07-22 2021-07-22 Case data recommendation method, system and medium for software testing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110828715.6A CN113282519B (en) 2021-07-22 2021-07-22 Case data recommendation method, system and medium for software testing

Publications (2)

Publication Number Publication Date
CN113282519A CN113282519A (en) 2021-08-20
CN113282519B true CN113282519B (en) 2021-11-12

Family

ID=77287141

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110828715.6A Active CN113282519B (en) 2021-07-22 2021-07-22 Case data recommendation method, system and medium for software testing

Country Status (1)

Country Link
CN (1) CN113282519B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113900954B (en) * 2021-10-28 2022-06-10 航天中认软件测评科技(北京)有限责任公司 Test case recommendation method and device using knowledge graph

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808437A (en) * 2016-03-09 2016-07-27 广州彩瞳网络技术有限公司 Automation testing method and system based on test case data table
CN107515826A (en) * 2017-08-28 2017-12-26 广州阿里巴巴文学信息技术有限公司 Test case accurate recommendation method, device, system, equipment and storage medium
CN109446104A (en) * 2018-11-16 2019-03-08 郑州云海信息技术有限公司 A kind of testing case management and device based on big data
CN112416778A (en) * 2020-11-24 2021-02-26 北京金山云网络技术有限公司 Test case recommendation method and device and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SG11201509527TA (en) * 2013-07-23 2015-12-30 Landmark Graphics Corp Automated generation of scripted and manual test cases
CN105426309B (en) * 2015-11-13 2018-04-06 上海斐讯数据通信技术有限公司 Automatic example generation method and device
CN110162468A (en) * 2019-04-26 2019-08-23 腾讯科技(深圳)有限公司 A kind of test method, device and computer readable storage medium
CN110347603B (en) * 2019-07-12 2023-08-15 北京精密机电控制设备研究所 Automatic software testing system and method for artificial intelligence
CN111427761A (en) * 2019-12-09 2020-07-17 北京关键科技股份有限公司 Intelligent recommendation of test cases
CN111176996A (en) * 2019-12-25 2020-05-19 平安普惠企业管理有限公司 Test case generation method and device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808437A (en) * 2016-03-09 2016-07-27 广州彩瞳网络技术有限公司 Automation testing method and system based on test case data table
CN107515826A (en) * 2017-08-28 2017-12-26 广州阿里巴巴文学信息技术有限公司 Test case accurate recommendation method, device, system, equipment and storage medium
CN109446104A (en) * 2018-11-16 2019-03-08 郑州云海信息技术有限公司 A kind of testing case management and device based on big data
CN112416778A (en) * 2020-11-24 2021-02-26 北京金山云网络技术有限公司 Test case recommendation method and device and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Model checking of statecharts using automatic white box test generation;D. Drusinsky;《48th Midwest Symposium on Circuits and Systems, 2005.》;20060221;第327-332页 *
基于镜像测试用例多样性和改进的测试用例选择策略的自适应随机测试方法研究;MICHAEL OMARI;《cnki优秀博士学位论文全文库 信息科技辑》;20210115;第I138-72页 *

Also Published As

Publication number Publication date
CN113282519A (en) 2021-08-20

Similar Documents

Publication Publication Date Title
García-Bañuelos et al. Complete and interpretable conformance checking of business processes
Fantechi et al. Applications of linguistic techniques for use case analysis
Baier et al. Matching events and activities by integrating behavioral aspects and label analysis
Liu et al. Identifying renaming opportunities by expanding conducted rename refactorings
CN109241104B (en) AISQL resolver in decision-making distributed database system and implementation method thereof
CN112765031B (en) Decomposition method of crowd-sourcing vulnerability mining task
Zhang et al. Automatically generating test templates from test names (n)
CN110297760A (en) Building method, device, equipment and the computer readable storage medium of test data
Wu et al. A survey of constrained combinatorial testing
Sun et al. Domain ontology construction and evaluation for the entire process of software testing
Shaikh et al. Overview of slicing and feedback techniques for efficient verification of UML/OCL class diagrams
CN113282519B (en) Case data recommendation method, system and medium for software testing
Oluwagbemi et al. Automatic generation of test cases from activity diagrams for UML based testing (UBT)
Rodriguez-Cardenas et al. Benchmarking Causal Study to Interpret Large Language Models for Source Code
Abukhalaf et al. On codex prompt engineering for OCL generation: an empirical study
Huo et al. Autolog: A log sequence synthesis framework for anomaly detection
CN110580170A (en) software performance risk identification method and device
Radulovic et al. Extending software quality models-A sample in the semantic technologies domain
Setiani et al. Test case understandability model
CN115830419A (en) Data-driven artificial intelligence technology evaluation system and method
CN103019924A (en) Input method intelligence evaluation system and input method intelligence evaluation method
CN111427761A (en) Intelligent recommendation of test cases
CN115080448A (en) Method and device for automatically detecting inaccessible path of software code
Li et al. Hybrid model with multi-level code representation for multi-label code smell detection (077)
CN113778454A (en) Automatic evaluation method and system for artificial intelligence experiment platform

Legal Events

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