CN115827421A - Testing method and device based on knowledge graph - Google Patents

Testing method and device based on knowledge graph Download PDF

Info

Publication number
CN115827421A
CN115827421A CN202211055789.1A CN202211055789A CN115827421A CN 115827421 A CN115827421 A CN 115827421A CN 202211055789 A CN202211055789 A CN 202211055789A CN 115827421 A CN115827421 A CN 115827421A
Authority
CN
China
Prior art keywords
test
result
test case
program
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
CN202211055789.1A
Other languages
Chinese (zh)
Inventor
胡丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202211055789.1A priority Critical patent/CN115827421A/en
Publication of CN115827421A publication Critical patent/CN115827421A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a testing method and a testing device based on a knowledge graph, wherein the method comprises the following steps: acquiring a test requirement input by a target user; performing word segmentation processing on the test requirement to obtain a word segmentation result; matching the word segmentation result with a preset industry database to determine an entity, an attribute and an attribute value; generating a query statement according to the entity, the attribute and the attribute value; inquiring a preset industry knowledge graph according to the inquiry statement to generate a test case; acquiring configuration information in a configuration file corresponding to the test case; and executing a test program on the test case according to the configuration information to obtain a test result. According to the invention, the test case is generated through the knowledge map, so that automatic testing is triggered, the technical problem of low testing efficiency caused by the fact that the test case needs to be manually compiled in the prior art is solved, and the technical effect of effectively improving the testing efficiency is achieved.

Description

Testing method and device based on knowledge graph
Technical Field
The invention relates to the technical field of finance, in particular to a testing method and device based on a knowledge graph.
Background
In the bank peripheral system, there are a large number of transaction flows and batch procedures, and the testing of these transaction flows and batch procedures requires a large labor cost and time cost. However, the existing automation tools are biased to solve the programming problem, and generally, a manual test case compiling and manual test mode are adopted for program testing, so that the testing efficiency is lower and the testing cost is higher.
In view of the above problems, no effective solution has been proposed.
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
Disclosure of Invention
The embodiment of the invention provides a testing method based on a knowledge graph, which is used for automatically testing a bank peripheral system and comprises the following steps:
acquiring a test requirement input by a target user;
performing word segmentation processing on the test requirement to obtain a word segmentation result;
matching the word segmentation result with a preset industry database to determine an entity, an attribute and an attribute value;
generating a query statement according to the entity, the attribute and the attribute value;
inquiring a preset industry knowledge graph according to the inquiry statement to generate a test case;
acquiring configuration information in a configuration file corresponding to the test case;
and executing a test program on the test case according to the configuration information to obtain a test result.
In a preferred embodiment, querying a preset industry knowledge graph according to the query statement to generate a test case, includes:
generating a test case with a correct value according to the reachable path of the query statement in the industry knowledge graph;
and generating a test case with an error value according to the complementary words of the test requirements of the query statement.
In a preferred embodiment, after executing a test program on the test case according to the configuration information to obtain a test result, the method further includes:
determining whether the test is successful according to the test result;
under the condition that the test is determined to be successful, storing the test result and recording the test result into a test log;
under the condition that the test is determined to be unsuccessful, repeatedly executing the test program until the execution times exceed a preset time threshold;
generating an error alarm and recording a test log of the test case under the condition that the execution times exceed a preset time threshold;
wherein the test log is used to generate a test report.
In a preferred embodiment, after generating the test case, the method further includes:
storing the test case into a preset table file;
correspondingly, according to the configuration information, executing a test program on the test case to obtain a test result includes:
reading a test case from the table file;
automatically executing the test program according to the information carried in the configuration file to obtain a test result;
and inserting the test result into a pre-established test result database table, and recording a storage path of the test result in the database table.
In a preferred embodiment, the information carried in the configuration file includes at least one of: the method comprises the following steps of transaction codes, names of test programs, preset times threshold values, storage positions of the test programs, test execution time, prepositioned tasks of tests, storage positions of test results and structured query language of test data.
The embodiment of the invention also provides a testing device based on the knowledge graph, which is used for automatically testing the bank peripheral system and comprises the following components:
the first acquisition module is used for acquiring the test requirements input by a target user;
the word segmentation module is used for carrying out word segmentation processing on the test requirement to obtain a word segmentation result;
the matching module is used for matching the word segmentation result with a preset industry database so as to determine an entity, an attribute and an attribute value;
the first generation module is used for generating a query statement according to the entity, the attribute and the attribute value;
the second generation module is used for inquiring a preset industry knowledge graph according to the inquiry statement and generating a test case;
the second acquisition module is used for acquiring configuration information in a configuration file corresponding to the test case;
and the test module is used for executing a test program on the test case according to the configuration information to obtain a test result.
In a preferred embodiment, the test module comprises:
the first acquisition unit is used for acquiring the transaction code corresponding to the test case and the storage position of the transaction code, or acquiring the transaction code, the test case, the test execution time, the maximum test times, the test preposition task, the test result storage position and the test data according to the test program name corresponding to the test case, the storage position of the test program;
the execution unit is used for automatically executing the transaction test or the test program according to the transaction code corresponding to the test case and the storage position of the transaction code, or according to the test program name corresponding to the test case, the storage position of the test program, the test execution time, the maximum test times, the test preposition task, the test result storage position and the test data;
the generating unit is used for inserting the result of the transaction test or the execution result of the test program into a test result database table;
and the exporting unit is used for exporting the data of the test result database table to a configuration file path.
The embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the above-mentioned test method based on the knowledge graph.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for testing based on a knowledge graph is implemented.
An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the method for testing based on a knowledge graph is implemented.
The embodiment of the invention can automatically generate the test case of the bank peripheral system and realize high-efficiency and rapid automatic test work of the system so as to ensure the stable operation of the bank peripheral system. Compared with the technical scheme of manually compiling the test cases for system testing in the prior art, the test cases are generated through the knowledge graph, so that more convenient and faster automatic testing can be realized, the testing efficiency can be effectively improved, and the testing cost is reduced.
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 prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts. In the drawings:
FIG. 1 is a flow chart of a method of one embodiment of a knowledge-graph based testing method provided herein;
FIG. 2 is a block diagram illustrating an embodiment of a test system according to the present application;
FIG. 3 is a flow chart of a method of one embodiment of intelligent testing provided herein;
FIG. 4 is a block diagram of a hardware configuration of an electronic device of a knowledge-graph-based testing method according to the present application;
FIG. 5 is a block diagram of an embodiment of a knowledge-graph based test device provided herein.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
Aiming at the problems that the existing test for the bank peripheral system cannot automatically generate a test case and cannot carry out automatic test, the knowledge graph can be introduced to automatically generate the test case and the automatically generated test case is utilized to carry out automatic test in the embodiment.
FIG. 1 is a flow chart of a method of one embodiment of a knowledge-graph based testing method as provided herein. Although the present application provides the method operation steps or apparatus structures as shown in the following embodiments or figures, more or less operation steps or module units may be included in the method or apparatus based on conventional or non-inventive efforts. In the case of steps or structures which do not logically have the necessary cause and effect relationship, the execution sequence of the steps or the module structure of the apparatus is not limited to the execution sequence or the module structure described in the embodiments and shown in the drawings of the present application. When the described method or module structure is applied in an actual device or end product, the method or module structure according to the embodiments or shown in the drawings can be executed sequentially or executed in parallel (for example, in a parallel processor or multi-thread processing environment, or even in a distributed processing environment).
Specifically, as shown in fig. 1, the method for testing based on knowledge graph may include the following steps:
s101: acquiring a test requirement input by a target user;
wherein the type of the test requirement may be, but is not limited to: transfer transaction, service inquiry or consultation, new account registration, existing account login and the like, wherein the test requirement can be expressed by natural sentences, such as 'I want to carry out system test on transfer transaction', and the input mode of the test requirement can be text input or voice input.
S102: performing word segmentation processing on the test requirement to obtain a word segmentation result;
s103: matching the word segmentation result with a preset industry database to determine an entity, an attribute and an attribute value;
s104: generating a query statement according to the entity, the attribute and the attribute value;
s105: inquiring a preset industry knowledge graph according to the inquiry statement to generate a test case;
the preset industry knowledge graph can be generated as follows:
s1: knowledge is acquired, and for the linguistic data input by voice, a voice recognition module can be adopted to convert the linguistic data into characters, and then entities, entity relationships, roles and the like in the characters are recognized; for a corpus input to a document, entities, relationships, and attributes in the document may be identified.
Specifically, taking a bank system knowledge graph as an example, the entity extraction may include: accounts, account groups, cash pools, products, groups, customers, etc.; relationship extraction, wherein a relationship may be an entity to entity relationship, may include: a subscription relationship, an affiliation relationship, a primary-secondary relationship, a type, a secondary category, a hierarchy, etc.; extracting attributes, wherein the attributes may be attribute information of an entity, and may include: general current account, domestic account, overseas account, special virtual account.
S2: knowledge fusion, considering that the knowledge acquired from a plurality of channels sometimes has description inconsistency, in order to solve the problem, the knowledge fusion can be performed, and the differences of descriptions relative to the same entity from different knowledge bases can be resolved and entity disambiguated through the knowledge fusion, so that knowledge entities, relationships, attributes and the like are aligned to form complete, accurate and comprehensive entity description. For example, taking a bank system knowledge graph as an example, from two documents descriptions of account categories, one document description is: one user has an account with a period, and the description of the other document is: and if the user is in the same word, the user account and the user account can be determined to belong to the same word through similarity calculation, so that the two entities can be combined into one entity.
S3: knowledge graph storage, wherein data of a knowledge graph can be organized and stored in a three-tuple (subject, predicate, object) mode, each three-tuple can represent a piece of knowledge, the knowledge is organized according to a certain logic, for example, the knowledge graph can be constructed in a top-down mode, firstly, classification and relation between objects are determined, and attributes of the objects are determined, for example, for financial professional terms, definitions of the terms can be preset, and then, data collection and storage are performed according to a set data model.
S4: knowledge calculation can comprise path calculation, subgraph calculation and inconsistency detection, wherein the knowledge calculation is mainly calculated according to an existing knowledge graph, a starting point is given, all subgraphs and all paths can be calculated, each path can be used as complete knowledge, and each knowledge can be used as a complete correctness test case when the test case is generated.
Correspondingly, when a preset industry knowledge graph is inquired according to the inquiry statement to generate a test case, the test case with a correct value can be generated according to the reachable path of the inquiry statement in the industry knowledge graph; and generating a test case with an error value according to the complementary words of the test requirements of the query statement.
In one embodiment of the invention, a plurality of different test case types such as "large transfer", "purchase financing product", "shopping payment", etc. may be generated by querying the industry knowledge map for content related to "transfer transactions".
S106: acquiring configuration information in a configuration file corresponding to the test case;
wherein, the information carried in the configuration file comprises at least one of the following: the method comprises the following steps of transaction codes, names of test programs, preset times threshold values, storage positions of the test programs, test execution time, prepositioned tasks of tests, storage positions of test results and structured query language of test data.
S107: and executing a test program on the test case according to the configuration information to obtain a test result.
Specifically, after the test case is generated, the method further includes:
storing the test case into a preset table file;
correspondingly, according to the configuration information, executing a test program on the test case to obtain a test result, and the method comprises the following steps:
step 1: reading a test case from the table file;
step 2: automatically executing the test program according to the information carried in the configuration file to obtain a test result;
and step 3: and inserting the test result into a pre-established test result database table, and recording a storage path of the test result in the database table.
Considering that some tests are not successful once in the actual test process, sometimes several times of tests are needed, for this reason, a preset time threshold value, that is, the maximum number of times of the repeatable tests, can be set, and after the test result is obtained by executing the test program on the test case according to the configuration information, whether the test is successful or not can be determined according to the test result; under the condition that the test is determined to be successful, storing the test result and recording the test result into a test log; under the condition that the test is determined to be unsuccessful, repeatedly executing the test program until the execution times exceed a preset time threshold; generating an error alarm and recording a test log of the test case under the condition that the execution times exceed a preset time threshold; wherein the test log is used for generating a test report.
Wherein, the test report may further include: execution case time, total number of execution cases, success number of execution, failure case number, etc. After the test report is generated, the robustness and functional integrity of the program requested to be tested by the test requirement can be judged based on the test result recorded in the test report.
The above method is described below with reference to a specific example, however, it should be noted that this specific example is only for better illustration of the present application and should not be construed as an undue limitation of the present application.
For the reason that the concept of introducing a knowledge graph is considered in the embodiment, a test case is automatically formed based on the knowledge graph, so that automatic testing is triggered to achieve the purpose of effective system testing efficiency.
Specifically, in order to implement automatic testing of a banking system, in this example, a testing system is provided, which may be as shown in fig. 2, and includes: the system comprises a knowledge acquisition module 201, a knowledge fusion module 202, a knowledge storage module 203, a knowledge calculation module 204 and an intelligent test module 205, which are described in detail as follows:
1) The knowledge acquisition module 201 may convert the corpus input by voice into a text by using a voice recognition module, and then recognize an entity, an entity relationship, a role, and the like in the text; for a corpus input into a document, entities, relationships, and attributes in the document may be identified.
Specifically, the method may include: entity extraction, wherein entities can include: accounts, account groups, cash pools, products, groups, customers, etc.; relationship extraction, wherein a relationship may be an entity to entity relationship, may include: subscription relationships, affiliations, primary and secondary relationships, types, sub-categories, hierarchies, and the like; extracting attributes, wherein the attributes may be attribute information of an entity, and may include: general current account, domestic account, overseas account and special virtual account.
2) The knowledge fusion module 202 may perform knowledge fusion in order to solve the problem, and may resolve differences between descriptions of different knowledge bases and the same entity through knowledge fusion, so as to align knowledge entities, relationships, attributes, and the like to form a complete, accurate, and comprehensive entity description. For example, from the descriptions of two documents for an account category, the description of one document is: the open period sub-account, another document description is: the open-period account and the open-period account can be determined to belong to the same word through similarity calculation, and therefore the two entities can be combined into one entity.
3) The knowledge storage module 203 may organize and store data of the knowledge graph by means of triples (subjects, predicates, objects), each of which may represent a piece of knowledge, and the knowledge may be organized according to a certain logic, for example, the knowledge graph may be built in a top-down manner, first determine classifications and relationships between objects, and clarify attributes of the objects, for example, for financial terminology, the definitions of the terms may be preset, and then perform data collection and storage according to a predetermined data model.
4) The knowledge calculation module 204 may include path calculation, subgraph calculation, and inconsistency detection, where the knowledge calculation is mainly calculated according to an existing knowledge graph, a starting point is given, all subgraphs and all paths may be calculated, each path may be used as a complete knowledge, and when a test case is generated, each knowledge may be used as a complete correctness test case.
5) The intelligent testing module 205, during testing, may search the constructed knowledge graph according to the given testing requirements to automatically generate a testing case, and read the configuration file according to the generated case to find a corresponding testing program to automatically execute the testing.
Specifically, the intelligent testing module 205 may perform the intelligent testing according to the steps shown in fig. 3:
step 301, receiving a test requirement input by a user, and identifying and segmenting the test requirement;
step 302, receiving the segmentation recognition result, and performing synonym processing and recognition on the segmentation to obtain the segmentation required by the test;
step 303, according to the test requirement word segmentation, finding out a matched entity, attribute or attribute value in a database;
step 304, generating a database query statement according to the entity, the attribute and the attribute value obtained by matching, or finding out a corresponding query statement from a pre-established test requirement statement table commonly used for searching;
305, inquiring a pre-established financial knowledge map according to the obtained inquiry statement, generating a test case with a correct value according to the reachable path, generating a test case with an error value according to the complementary word of the test requirement, and importing the generated test case into an EXCEL file;
step 306, reading the configuration file, finding a test program related to the requirement according to the test case in the EXCEL file, automatically triggering to test, if the test is successful, saving the test result, if the test is unsuccessful, re-executing the operation according to the execution times in the configuration file, if the test is not successful after exceeding the preset execution times, reporting an error and recording a log, then quitting the test of the current test case, and then executing the next test case until all the test cases in the file are completely executed;
specifically, reading the configuration file, finding a test program related to the requirement according to the test case in the EXCEL file, and automatically triggering to perform the test may include:
s1: reading the EXCEL file;
s2: reading a configuration file, and reading related information of a transaction code, a program name, the maximum execution times, a transaction or program storage position, test execution time, a preposed task, a test result storage position, test data SQL and the like of a test program from the configuration file;
s3: automatically executing a test program or transaction according to the information read from the configuration file;
s4: inserting the test transaction result data into a test result database table;
s5: exporting to a configuration file path according to the database table data.
307, generating a test report according to the test result, wherein the test report may include: execution case time, total number of execution cases, success number of execution, failure case number, etc. Based on the test results recorded in the test report, the robustness and the functional integrity of the program can be accurately judged.
In the above example, the test case and the test data are automatically generated according to the established knowledge graph spectrum, the test case is automatically executed and the test report is generated only by setting the test configuration table under the condition of tuning the test environment without the prior knowledge of testers and manually compiling the test case and manually executing the test case, so that the test efficiency can be effectively improved and the test accuracy can be improved.
The method embodiments provided in the above embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the example of the method running on the electronic device, fig. 4 is a block diagram of a hardware structure of the electronic device of the method for testing based on the knowledge graph provided in the present application. As shown in fig. 4, the electronic device 10 may include one or more (only one shown in the figure) processors 02 (the processors 02 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 04 for storing data, and a transmission module 06 for communication functions. It will be understood by those skilled in the art that the structure shown in fig. 4 is only an illustration and is not intended to limit the structure of the electronic device. For example, the electronic device 10 may also include more or fewer components than shown in FIG. 4, or have a different configuration than shown in FIG. 4.
The memory 04 may be configured to store software programs and modules of application software, for example, program instructions/modules corresponding to the short message sending method in the embodiment of the present application, and the processor 02 executes various functional applications and data processing by operating the software programs and modules stored in the memory 04, that is, implements the short message sending method of the application software. The memory 04 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 04 may further include memory located remotely from the processor 02, which may be connected to the electronic device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission module 06 is used for receiving or transmitting data via a network. Specific examples of such networks may include wireless networks provided by communication providers of the electronic device 10. In one example, the transmission module 06 includes a Network adapter (NIC) that can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission module 06 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
At the software level, the knowledge-graph based test device may be as shown in fig. 5, including:
a first obtaining module 501, configured to obtain a test requirement input by a target user;
a word segmentation module 502, configured to perform word segmentation processing on the test requirement to obtain a word segmentation result;
a matching module 503, configured to match the word segmentation result with a preset industry database to determine an entity, an attribute, and an attribute value;
a first generating module 504, configured to generate a query statement according to the entity, the attribute, and the attribute value;
a second generating module 505, configured to query a preset industry knowledge graph according to the query statement, and generate a test case;
a second obtaining module 506, configured to obtain configuration information in a configuration file corresponding to the test case;
the test module 507 is configured to execute a test program on the test case according to the configuration information to obtain a test result.
In one embodiment, the test module 507 may include:
the first acquisition unit is used for acquiring the transaction code corresponding to the test case and the storage position of the transaction code, or acquiring the transaction code, the test case, the test execution time, the maximum test times, the test preposition task, the test result storage position and the test data according to the test program name corresponding to the test case, the storage position of the test program;
the execution unit is used for automatically executing the transaction test or the test program according to the transaction code corresponding to the test case and the storage position of the transaction code, or according to the test program name corresponding to the test case, the storage position of the test program, the test execution time, the maximum test times, the test preposition task, the test result storage position and the test data;
the generating unit is used for inserting the result of the transaction test or the execution result of the test program into a test result database table;
and the exporting unit is used for exporting the data of the test result database table to a configuration file path.
In an embodiment, the second generating module 505 may be specifically configured to generate a test case with a correct value according to a reachable path of the query statement in the industry knowledge graph; generating a test case with an error value according to the complementary words of the test requirements of the query statement; and storing the test case into a preset table file.
In an embodiment, the testing module 507 may be specifically configured to determine whether the test is successful according to the test result; under the condition that the test is determined to be successful, storing the test result and recording the test result into a test log; under the condition that the test is determined to be unsuccessful, repeatedly executing the test program until the execution times exceed a preset time threshold; and generating an error alarm and recording a test log of the test case under the condition that the execution times exceed a preset time threshold.
In an embodiment, the test module 507 may be further configured to read a test case from the form file; automatically executing the test program according to the information carried in the configuration file to obtain a test result; and inserting the test result into a pre-established test result database table, and recording a storage path of the test result in the database table.
The embodiment of the present application further provides a specific implementation manner of an electronic device, which is capable of implementing all steps in the test method based on the knowledge graph in the foregoing embodiment, where the electronic device specifically includes the following contents: a processor (processor), a memory (memory), a communication Interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the processor is configured to call a computer program in the memory, and the processor implements all the steps of the knowledge-graph based testing method in the above embodiments when executing the computer program, for example, the processor implements the following steps when executing the computer program:
step 1: acquiring a test requirement input by a target user;
step 2: performing word segmentation processing on the test requirement to obtain a word segmentation result;
and step 3: matching the word segmentation result with a preset industry database to determine an entity, an attribute and an attribute value;
and 4, step 4: generating a query statement according to the entity, the attribute and the attribute value;
and 5: inquiring a preset industry knowledge graph according to the inquiry statement to generate a test case;
and 6: acquiring configuration information in a configuration file corresponding to the test case;
and 7: and executing a test program on the test case according to the configuration information to obtain a test result.
Embodiments of the present application further provide a computer-readable storage medium capable of implementing all steps in the knowledge-graph based testing method in the above embodiments, where the computer-readable storage medium stores thereon a computer program, and when the computer program is executed by a processor, the computer program implements all steps of the knowledge-graph based testing method in the above embodiments, for example, the processor implements the following steps when executing the computer program:
step 1: acquiring a test requirement input by a target user;
and 2, step: performing word segmentation processing on the test requirement to obtain a word segmentation result;
and step 3: matching the word segmentation result with a preset industry database to determine an entity, an attribute and an attribute value;
and 4, step 4: generating a query statement according to the entity, the attribute and the attribute value;
and 5: inquiring a preset industry knowledge graph according to the inquiry statement to generate a test case;
step 6: acquiring configuration information in a configuration file corresponding to the test case;
and 7: and executing a test program on the test case according to the configuration information to obtain a test result.
An embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the method for testing based on a knowledge graph is implemented.
The embodiment of the invention can automatically generate the test case of the bank peripheral system and realize high-efficiency and rapid automatic test work of the system so as to ensure the stable operation of the bank peripheral system. Compared with the technical scheme of manually compiling the test cases for system testing in the prior art, the test cases are generated through the knowledge graph, so that more convenient and faster automatic testing can be realized, and the time and energy consumed by manual labor are reduced.
According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A test method based on knowledge graph is characterized by comprising the following steps:
acquiring a test requirement input by a target user;
performing word segmentation processing on the test requirement to obtain a word segmentation result;
matching the word segmentation result with a preset industry database to determine an entity, an attribute and an attribute value;
generating a query statement according to the entity, the attribute and the attribute value;
inquiring a preset industry knowledge graph according to the inquiry statement to generate a test case;
acquiring configuration information in a configuration file corresponding to the test case;
and executing a test program on the test case according to the configuration information to obtain a test result.
2. The method of claim 1, wherein querying a preset industry knowledge graph according to the query statement to generate a test case comprises:
generating a test case with a correct value according to the reachable path of the query statement in the industry knowledge graph;
and generating a test case with an error value according to the complementary words of the test requirements of the query statement.
3. The method of claim 1, wherein after executing a test program on the test case according to the configuration information to obtain a test result, the method further comprises:
determining whether the test is successful according to the test result;
under the condition that the test is determined to be successful, storing the test result and recording the test result into a test log;
under the condition that the test is determined to be unsuccessful, repeatedly executing the test program until the execution times exceed a preset time threshold;
generating an error alarm and recording a test log of the test case under the condition that the execution times exceed a preset time threshold;
wherein the test log is used for generating a test report.
4. The method of claim 1, after generating the test case, further comprising:
storing the test case into a preset table file;
correspondingly, according to the configuration information, executing a test program on the test case, and obtaining a test result includes:
reading a test case from the table file;
automatically executing the test program according to the information carried in the configuration file to obtain a test result;
and inserting the test result into a pre-established test result database table, and recording the storage path of the test result in the database table.
5. The method of claim 4, wherein the information carried in the configuration file comprises at least one of: the method comprises the following steps of transaction codes, names of test programs, preset times threshold values, storage positions of the test programs, test execution time, prepositioned tasks of tests, storage positions of test results and structured query language of test data.
6. A knowledge-graph-based testing apparatus, comprising:
the first acquisition module is used for acquiring the test requirements input by a target user;
the word segmentation module is used for carrying out word segmentation processing on the test requirement to obtain a word segmentation result;
the matching module is used for matching the word segmentation result with a preset industry database so as to determine an entity, attributes and attribute values;
the first generation module is used for generating a query statement according to the entity, the attribute and the attribute value;
the second generation module is used for inquiring a preset industry knowledge graph according to the inquiry statement and generating a test case;
the second acquisition module is used for acquiring the configuration information in the configuration file corresponding to the test case;
and the test module is used for executing a test program on the test case according to the configuration information to obtain a test result.
7. The apparatus of claim 6, wherein the test module comprises:
the first acquisition unit is used for acquiring the transaction code corresponding to the test case and the storage position of the transaction code, or according to the test program name corresponding to the test case, the storage position of the test program, the test execution time, the maximum test times, the test preposition task, the test result storage position and the test data;
the execution unit is used for automatically executing the transaction test or the test program according to the transaction code corresponding to the test case and the storage position of the transaction code, or according to the test program name corresponding to the test case, the storage position of the test program, the test execution time, the maximum test times, the test preposition task, the test result storage position and the test data;
the generating unit is used for inserting the result of the transaction test or the execution result of the test program into a test result database table;
and the exporting unit is used for exporting the data of the test result database table to a configuration file path.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the knowledge-graph based testing method of any one of claims 1 to 5 when executing the computer program.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the knowledge-graph based testing method of any one of claims 1 to 5.
10. A computer program product, characterized in that the computer program product comprises a computer program which, when being executed by a processor, implements the knowledge-graph based testing method of any one of claims 1 to 5.
CN202211055789.1A 2022-08-31 2022-08-31 Testing method and device based on knowledge graph Pending CN115827421A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211055789.1A CN115827421A (en) 2022-08-31 2022-08-31 Testing method and device based on knowledge graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211055789.1A CN115827421A (en) 2022-08-31 2022-08-31 Testing method and device based on knowledge graph

Publications (1)

Publication Number Publication Date
CN115827421A true CN115827421A (en) 2023-03-21

Family

ID=85523301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211055789.1A Pending CN115827421A (en) 2022-08-31 2022-08-31 Testing method and device based on knowledge graph

Country Status (1)

Country Link
CN (1) CN115827421A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116401678A (en) * 2023-06-08 2023-07-07 中汽智联技术有限公司 Construction and extraction method of automobile information security test case
CN117453576A (en) * 2023-12-25 2024-01-26 企迈科技有限公司 DXM model-based SaaS software test case construction method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116401678A (en) * 2023-06-08 2023-07-07 中汽智联技术有限公司 Construction and extraction method of automobile information security test case
CN116401678B (en) * 2023-06-08 2023-09-01 中汽智联技术有限公司 Construction and extraction method of automobile information security test case
CN117453576A (en) * 2023-12-25 2024-01-26 企迈科技有限公司 DXM model-based SaaS software test case construction method
CN117453576B (en) * 2023-12-25 2024-04-09 企迈科技有限公司 DXM model-based SaaS software test case construction method

Similar Documents

Publication Publication Date Title
CN115827421A (en) Testing method and device based on knowledge graph
CN108985912B (en) Data reconciliation
CN110457302B (en) Intelligent structured data cleaning method
CN104750795A (en) Intelligent semantic searching system and method
CN110543356A (en) abnormal task detection method, device and equipment and computer storage medium
CN110427375B (en) Method and device for identifying field type
Visengeriyeva et al. Anatomy of metadata for data curation
CN110659282A (en) Data route construction method and device, computer equipment and storage medium
CN110909126A (en) Information query method and device
CN103020225B (en) A kind of CPU type identifier method and hardware detection system
CN113076410A (en) Abnormal information processing method, device, equipment and storage medium
CN112328805A (en) Entity mapping method of vulnerability description information and database table based on NLP
CN113626558B (en) Intelligent recommendation-based field standardization method and system
CN110532359A (en) Legal provision query method, apparatus, computer equipment and storage medium
CN108388513B (en) Automatic testing method and device
CN107368500A (en) Data pick-up method and system
CN112559369A (en) Automatic testing method, automatic testing equipment and storage medium
CN116737758A (en) Database query statement generation method, device, equipment and storage medium
CN103034719B (en) CPU type identifier method, equipment and hardware detection system
CN114579716A (en) Knowledge graph query method and device
CN111027296A (en) Report generation method and system based on knowledge base
CN110309211A (en) A kind of method and relevant device positioning ETL Process Problems
CN112749154B (en) Data warehousing method, device and equipment and computer readable storage medium
CN110532561B (en) Data detection method and device, storage medium and electronic device
CN110023970A (en) System and method for verifying non-structured Enterprise Resources Plan data

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