Object testing method, object testing device, electronic device and readable storage medium

By building and training the test model, the problem of failures in the existing technology cannot be protected and accurately positioned in real time, real-time detection and fault positioning of the system are realized, and the stable operation of the system is ensured.

CN113127362BActive Publication Date: 2024-11-05INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110445287.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-23
Publication Date
2024-11-05
Estimated Expiration
2041-04-23

AI Technical Summary

Technical Problem

The existing technology lacks the real-time protection ability of the system in enterprise management, relies too much on existing fault information knowledge, cannot diagnose incremental faults, and cannot accurately locate the location where the fault occurs.

Method used

By obtaining the code data associated with the functions of the object to be tested, processing and building a test model, and using dynamic planning methods to train and adjust the model, real-time detection and fault location of the system are achieved.

Benefits of technology

There is no need to rely on existing fault information knowledge, and it can accurately locate fault nodes, ensure stable operation of the system, and realize real-time protection of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113127362B_ABST
    Figure CN113127362B_ABST
Patent Text Reader

Abstract

The present disclosure provides an object testing method, which can be used in the field of computer technology or other fields. The method includes: obtaining code data associated with functions in the object to be tested, wherein the object to be tested includes multiple functions, and each function has associated code data; processing the code data to obtain multiple function information associated with the functions and the association relationship between each function information associated with the function and the function information associated with other functions; constructing a test model of the object to be tested based on the function information and the association relationship, wherein the function information corresponds to the nodes of the test model one by one; using the test model to test the object to be tested and outputting the test results. The present disclosure also provides an object testing device, an electronic device, a readable storage medium and a computer program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and more specifically, to an object testing method, an object testing device, an electronic device, a readable storage medium, and a computer program product. Background Art

[0002] In enterprise management, as the scale of the system continues to expand, the stock of code continues to accumulate. The current method for automatic fault monitoring and diagnosis in the system is to generate a set of causes that cause the inconsistency based on long-term time experience and a large amount of fault information knowledge, by analyzing the inconsistency between the actual input and output of the object, and then analyzing and finding the cause of the fault from the cause set, or predicting the cause of the fault in advance based on the value of the input domain.

[0003] In the process of realizing the concept disclosed in the present invention, the inventors found that there are at least the following problems in the related technology: fault inspection is only performed when a fault occurs or is about to occur, and there is a lack of the ability to protect the system in real time; it relies too much on existing fault information knowledge and has no diagnosis ability for incremental faults; and it can only diagnose the general cause of the problem, and cannot accurately locate the location where the problem occurs. Summary of the invention

[0004] In view of this, the present disclosure provides an object testing method, an object testing device, an electronic device, a readable storage medium, and a computer program product.

[0005] One aspect of the present disclosure provides an object testing method, comprising:

[0006] Acquire code data associated with a function in an object to be tested, wherein the object to be tested includes a plurality of functions, each of the functions having associated code data;

[0007] Processing the code data to obtain a plurality of function information associated with the function and an association relationship between each piece of function information associated with the function and function information associated with other functions;

[0008] Constructing a test model of the object to be tested according to the function information and the association relationship, wherein the function information corresponds one-to-one to the nodes of the test model;

[0009] The test model is used to test the object to be tested, and the test result is output.

[0010] According to an embodiment of the present disclosure, the acquiring of code data associated with a function in the object to be tested includes:

[0011] Acquiring functional information of the object to be tested; and

[0012] The function information is processed to obtain the code data associated with the function.

[0013] According to an embodiment of the present disclosure, the processing of the code data to obtain a plurality of function information associated with the function and an association relationship between each piece of function information associated with the function and function information associated with other functions includes:

[0014] Extracting features from the code data according to a function feature template, and outputting a plurality of function information, wherein the function feature template includes: function type, method name, parameter type, parameter name and method body;

[0015] According to the calling relationship of each piece of function information, the association relationship between each piece of function information associated with the function and the function information associated with other functions is obtained.

[0016] According to an embodiment of the present disclosure, constructing a test model of the object to be tested according to the function information and the association relationship includes:

[0017] Using the function information as nodes, constructing an initial test model according to the association relationship;

[0018] The initial test model is trained by a dynamic programming method to obtain the final test model.

[0019] According to an embodiment of the present disclosure, the training of the initial test model by a dynamic programming method includes:

[0020] Input the training data into the initial test model and output the true output value;

[0021] When the true output value is inconsistent with the predicted output value, the initial test model is adjusted until the output true output value is consistent with the predicted output value, wherein the predicted output value is the expected output value after the training data is input into the initial test model.

[0022] According to an embodiment of the present disclosure, the step of testing the object to be tested by using the test model and outputting the test result includes:

[0023] Input test data into the test model and output test values;

[0024] In the case where the test value is inconsistent with the predicted value, traverse all nodes of the test model to determine the target node that causes the inconsistency between the test value and the predicted value, wherein the predicted value is an expected output value after the test value is input into the test model;

[0025] The function information corresponding to the target node is output as the test result.

[0026] Another aspect of the present disclosure provides an object testing system, comprising:

[0027] An acquisition module, used for acquiring code data associated with a function in an object to be tested, wherein the object to be tested includes a plurality of functions, each of which has associated code data;

[0028] A processing module, used for processing the code data to obtain a plurality of function information associated with the functions and an association relationship between each piece of function information associated with the function and function information associated with other functions;

[0029] A construction module, used to construct a test model of the object to be tested according to the function information and the association relationship, wherein the function information corresponds to the nodes of the test model one by one;

[0030] The testing module is used to test the object to be tested using the testing model and output the testing result.

[0031] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors implement the method as described above.

[0032] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above method when executed.

[0033] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and when the instructions are executed, are used to implement the method as described above.

[0034] According to an embodiment of the present disclosure, by processing each code data associated with a function, the function information associated with each function and the association relationship between each function information and other function information are obtained, and a test model is constructed based on the function information and the association relationship. Since the test model is obtained by comprehensively combing the structure of the test object, the test object is tested according to the test model, there is no need to rely on the existing fault information knowledge, and the node where the fault occurs can be accurately located. At the same time, the test object can be detected at any time through the test model to ensure the stable operation of the test object. Thereby, the technical problems in the prior art that the system cannot be guarded in real time, is too dependent on the existing fault information knowledge, has no diagnostic capability for incremental faults, and cannot accurately locate the location where the problem occurs are effectively overcome. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0036] Figure 1 An exemplary system architecture to which the object testing method according to an embodiment of the present disclosure can be applied is schematically shown.

[0037] Figure 2 The flowchart of the object testing method according to the embodiment of the present disclosure is schematically shown.

[0038] Figure 3 A schematic diagram of a system structure arrangement according to an embodiment of the present disclosure is schematically shown.

[0039] Figure 4 A schematic diagram of a function feature template according to an embodiment of the present disclosure is schematically shown.

[0040] Figure 5 The structural diagram of the test model according to the embodiment of the present disclosure is schematically shown.

[0041] Figure 6 The block diagram of the object testing system according to the embodiment of the present disclosure is schematically shown.

[0042] Figure 7 A block diagram of a computer system suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0043] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0044] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0045] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0046] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0047] In enterprise management, as the scale of the system continues to expand and the stock of code continues to accumulate, when faults are exposed, the traditional fault monitoring and diagnosis method is to manually troubleshoot the faults through logs, source code analysis, etc. This method has the following two shortcomings: it takes a lot of time to troubleshoot and diagnose the faults, and it is impossible to fully discover other problems caused by the fault; only when the fault occurs, the relevant personnel will start to diagnose the fault, which can easily lead to serious consequences for the core business.

[0048] At present, there are a large number of methods for automatic fault monitoring and diagnosis in systems, such as expert systems, neural networks, and uncertainty theory. The design ideas of the above methods are based on long-term time experience and a large amount of fault information knowledge. By targeting the inconsistency between the actual input and output of the object, a set of causes that cause this inconsistency is generated. When a fault is found, different algorithms are used to analyze and find the cause of the fault from the cause set, or to predict the cause of the fault in advance based on the value of the input domain.

[0049] In the process of realizing the concept disclosed in the present invention, the inventors found that there are at least the following problems in the related technology: fault inspection is only performed when a fault occurs or is about to occur, and there is a lack of the ability to protect the system in real time; it relies too much on existing fault information knowledge and has no diagnosis ability for incremental faults; and it can only diagnose the general cause of the problem, and cannot accurately locate the location where the problem occurs.

[0050] The embodiments of the present disclosure provide an object testing method, an object testing device, an electronic device, a readable storage medium, and a computer program product. The object testing method, the object testing device, the electronic device, the readable storage medium, and the computer program product of the embodiments of the present disclosure can be applied to the field of computer technology, and can also be used in any field other than the field of computer technology, and the embodiments of the present disclosure are not limited to this. The object testing method includes obtaining code data associated with a function in an object to be tested, wherein the object to be tested includes multiple functions, and each function has associated code data; processing the code data to obtain multiple function information associated with the function and the association relationship between each function information associated with the function and the function information associated with other functions; constructing a test model of the object to be tested according to the function information and the association relationship, wherein the function information corresponds to the nodes of the test model one by one; using the test model to test the object to be tested and output the test results.

[0051] Figure 1 The exemplary system architecture 100 to which the object testing method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0052] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0053] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients and / or social platform software, etc. (only as examples).

[0054] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0055] The server 105 may be a server that provides various services, such as a background management server (only an example) that provides support for websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0056] It should be noted that the object testing method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the object testing system provided in the embodiment of the present disclosure can generally be arranged in the server 105. The object testing method provided in the embodiment of the present disclosure can also be performed by a server or server cluster that is different from the server 105 and can communicate with the terminal device 101, 102, 103 and / or the server 105. Accordingly, the object testing system provided in the embodiment of the present disclosure can be arranged in a server or server cluster that is different from the server 105 and can communicate with the terminal device 101, 102, 103 and / or the server 105. Alternatively, the object testing method provided in the embodiment of the present disclosure can also be performed by the terminal device 101, 102, or 103, or it can also be performed by other terminal devices different from the terminal device 101, 102, or 103. Accordingly, the object testing system provided in the embodiment of the present disclosure can also be arranged in the terminal device 101, 102, or 103, or it can be arranged in other terminal devices different from the terminal device 101, 102, or 103.

[0057] For example, the object to be tested may be originally stored in any one of the terminal devices 101, 102, or 103 (for example, the terminal device 101, but not limited thereto), or may be stored on an external storage device and may be imported into the terminal device 101. Then, the terminal device 101 may locally execute the object testing method provided by the embodiment of the present disclosure, or send the object to be tested to other terminal devices, servers, or server clusters, and the other terminal devices, servers, or server clusters that receive the object to be tested may execute the object testing method provided by the embodiment of the present disclosure.

[0058] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0059] Figure 2 The flowchart of the object testing method according to the embodiment of the present disclosure is schematically shown.

[0060] like Figure 2 As shown, the method includes operations S201 to S204.

[0061] In operation S201 , code data associated with a function in an object to be tested is obtained, wherein the object to be tested includes a plurality of functions, and each function has associated code data.

[0062] According to an embodiment of the present disclosure, the object to be tested may include an application program, an application system, etc. on a carrier. The carrier may include an electronic device, the electronic device may include a terminal device, and the terminal device may include a smart phone, a tablet computer, a portable computer, or a desktop computer, etc. The code data may include a code file associated with the function of the object to be tested, etc.

[0063] When obtaining code data associated with the functions in the object to be tested, for example, the object to be tested can be sorted by manual sorting to obtain code data related to each function of the object to be tested. The code data associated with the functions in the object to be tested can also be sorted automatically by the system, and the present disclosure does not limit the method for obtaining code data.

[0064] For example, the object to be tested is a mobile phone application of a bank, which includes at least query function, login function, transfer function and payment function, etc. Each of the above functions involves at least one code file.

[0065] In operation S202, the code data is processed to obtain a plurality of function information associated with the functions and association relationships between each piece of function information associated with a function and function information associated with other functions.

[0066] According to an embodiment of the present disclosure, function information may include, for example, function methods, etc. The association relationship may include, for example, at least one of the following: if function method A includes function method B, then A calls B; there is no calling relationship between function method A and function method B, and they are not called by the same function method; there is no calling relationship between function method A and function method B, but they are both called by the same function method, and A is called first and then B is called.

[0067] In operation S203, a test model of the object to be tested is constructed according to the function information and the association relationship, wherein the function information corresponds one-to-one to the nodes of the test model.

[0068] According to an embodiment of the present disclosure, the test model may include a tree-like test model and the like.

[0069] According to an embodiment of the present disclosure, taking the login function of a bank's mobile application as an example, when constructing a tree-like test model of the login function, the code files involved in the login function are used as nodes, and the tree-like test model of the login function is constructed according to the calling relationship of each code file.

[0070] In operation S204, the test object is tested using the test model, and the test result is output.

[0071] According to the embodiments of the present disclosure, the test model can be used to automatically test the object to be tested by setting a time interval. For example, the time interval can be set to 24 hours, that is, the object to be tested is automatically tested once every 24 hours. Other intervals can also be set according to specific implementation needs.

[0072] According to an embodiment of the present disclosure, the test result may include information such as test normal, test error, error location, etc.

[0073] According to an embodiment of the present disclosure, by processing each code data associated with a function, the function information associated with each function and the association relationship between each function information and other function information are obtained, and a test model is constructed based on the function information and the association relationship. Since the test model is obtained by comprehensively combing the structure of the test object, the test object is tested according to the test model, there is no need to rely on the existing fault information knowledge, and the node where the fault occurs can be accurately located. At the same time, the test object can be detected at any time through the test model to ensure the stable operation of the test object. Thereby, the technical problems in the prior art that the system cannot be guarded in real time, is too dependent on the existing fault information knowledge, has no diagnostic capability for incremental faults, and cannot accurately locate the location where the problem occurs are effectively overcome.

[0074] According to an embodiment of the present disclosure, obtaining code data associated with a function in an object to be tested includes: obtaining function information of the object to be tested; and processing the function information to obtain code data associated with the function.

[0075] According to an embodiment of the present disclosure, the method for obtaining the functional information of the object to be tested may be, for example, to manually sort the object to be tested to obtain each functional information of the object to be tested. The functional information in the object to be tested may also be automatically sorted by the system, and the present disclosure does not limit the method for obtaining the functional information.

[0076] According to an embodiment of the present disclosure, the code data may include, for example, a code file. The code file may include, for example, at least one function information.

[0077] According to the embodiments of the present disclosure, by comprehensively combing the structure of the test object, the location where the problem occurs can be accurately determined during the test, thereby preventing the problems of missed detection and inaccurate problem location.

[0078] Figure 3 A schematic diagram of a system structure arrangement according to an embodiment of the present disclosure is schematically shown.

[0079] like Figure 3 As shown, the object to be tested is an application as an example, the application includes N functions, denoted as Func_I, where I represents the Ith function of the application. Each function involves multiple code files, denoted as Code_I, and I represents the Ith code file. Each code file includes multiple function methods, denoted as Method_I_J, and I represents the Jth function method of the Ith code file.

[0080] According to an embodiment of the present disclosure, the code data is processed to obtain a plurality of function information associated with the functions and the association relationship between each function information associated with the function and the function information associated with other functions includes:

[0081] Extract features from the code data according to the function feature template and output multiple function information, wherein the function feature template includes: function type, method name, parameter type, parameter name and method body;

[0082] According to the calling relationship of each piece of function information, the association relationship between each piece of function information associated with a function and the function information associated with other functions is obtained.

[0083] According to an embodiment of the present disclosure, the calling relationship may include: if function method A contains function method B, then A calls B; there is no calling relationship between function method A and function method B, and they are not called by the same function method; there is no calling relationship between function method A and function method B, but they are both called by the same function method, and A is called first and then B.

[0084] According to the embodiments of the present disclosure, by performing feature extraction on code data and files through function feature templates, function information corresponding to each function can be accurately and comprehensively extracted, which can reduce the amount of calculation and improve the detection speed.

[0085] Figure 4 A schematic diagram of a function feature template according to an embodiment of the present disclosure is schematically shown.

[0086] like Figure 4 As shown, the function feature template includes function type, method name, parameter type, parameter name and method body.

[0087] According to an embodiment of the present disclosure, constructing a test model of an object to be tested according to function information and association relationships includes:

[0088] Using function information as nodes, an initial test model is constructed based on association relationships;

[0089] The initial test model is trained by dynamic programming method to obtain the final test model.

[0090] According to the embodiments of the present disclosure, the initial test model is trained by a dynamic programming method, which can effectively improve the test accuracy of the test model, so that the test model can better monitor the faults existing in the entire system.

[0091] Figure 5 The structural diagram of the test model according to the embodiment of the present disclosure is schematically shown.

[0092] like Figure 5 As shown, the function information includes Method_I_1 to Method_I_4. Among them:

[0093] The association relationship between function method Method_I_1 and function method Method_I_2 is that function method Method_I_1 contains function method Method_I_2, then function method Method_I_1 calls function method Method_I_2, which is recorded as Method_I_1→Method_I_2;

[0094] The association relationship between function method Method_I_1 and function method Method_I_4 is that function method Method_I_1 contains function method Method_I_4, then function method Method_I_1 calls function method Method_I_4, which is recorded as Method_I_1→Method_I_4;

[0095] The association relationship between function method Method_I_2 and function method Method_I_4 is that function method Method_I_2 and function method Method_I_4 do not have a calling relationship, but both are called by function method Method_I_1, and Method_I_2 is called first, and then Method_I_4 is called, which is recorded as Method_I_2*Method_I_4;

[0096] The association relationship between function method Method_I_2 and function method Method_I_3 is that there is no calling relationship and they are not called by the same function, which is recorded as Method_I_2^Method_I_3;

[0097] The association relationship between function method Method_I_3 and function method Method_I_4 is that function method Method_I_4 contains function method Method_I_3, so function method Method_I_4 calls function method Method_I_3, which is recorded as Method_I_4→Method_I_3.

[0098] It should be noted that the above embodiments are only illustrative embodiments, and according to specific implementation requirements, other test models that can achieve the same technical effects may also be used.

[0099] According to an embodiment of the present disclosure, training the initial test model by a dynamic programming method includes:

[0100] Input the training data into the initial test model and output the true output value;

[0101] In the case where the true output value is inconsistent with the predicted output value, the initial test model is adjusted until the true output value of the output is consistent with the predicted output value, wherein the predicted output value is the expected output value after the training data is input into the initial test model. According to the embodiment of the present disclosure, a dynamic programming method is used to define W[A, B] as the relationship between the Ath function method and the Bth function method, wherein A→B and A*B represent 1, and A^B represents 0. Input the training data, connect the entire data generation process, and obtain the true output value. If the true output value is different from the expected output value after the training data is input into the initial test model, adjust the entire test model and continue training. Until the true output value of the output is consistent with the predicted output value, the generated relationship diagram is used as the test model.

[0102] According to an embodiment of the present disclosure, the training data may include an operation instruction corresponding to the function. For example, the login function of a certain application is used as the object to be tested, and the training data is an operation instruction for clicking a login button. It should be noted that the above embodiments are only illustrative embodiments and do not limit the content of the present disclosure.

[0103] According to an embodiment of the present disclosure, the test model is used to test the object to be tested, and the output of the test result includes:

[0104] Input test data into the test model and output test values;

[0105] When the test value is inconsistent with the predicted value, all nodes of the test model are traversed to determine the target node that causes the inconsistency between the test value and the predicted value, wherein the predicted value is the expected output value after the test value is input into the test model; the function information corresponding to the target node is output as the test result.

[0106] According to the embodiments of the present disclosure, the target node that causes the inconsistency between the test value and the predicted value is output as the final result, so that the accurate location of the fault can be obtained, and the detection efficiency is effectively improved.

[0107] According to the embodiments of the present disclosure, before testing the object to be tested, each node in the test model can be assigned a value, the function method name of the output result in the test model is used as the root node, and each function method name in the test model is used as a process label. And each process label is sorted from small to large according to the order of calling and a sorting label is generated.

[0108] According to the embodiments of the present disclosure, each function of the object to be tested corresponds to a set of test data. During the test, the test data corresponding to the function to be tested is input into the test model at a frequency of every 24 hours, and the test value is output. It should be noted that the above embodiments are only illustrative embodiments, and other test frequencies may also be used according to specific implementation needs.

[0109] Compare the test value with the expected output value. If the two are different, it means that there is a problem with the function. Take the test value as the root node, use the depth-first method in the backtracking method to traverse the entire test model from the root node, compare each process label and the sorting label, get the process label with the smallest sorting, output its corresponding function method, and get the function information corresponding to the target node that causes the inconsistency between the test value and the predicted value. If the two are the same, it means that there is no problem with the function.

[0110] Figure 6 The block diagram of the object testing system according to the embodiment of the present disclosure is schematically shown.

[0111] like Figure 6 As shown, the object testing system 600 includes an acquisition module 601 , a processing module 602 , a construction module 603 and a testing module 604 .

[0112] The acquisition module 601 is used to acquire code data associated with a function in the object to be tested, wherein the object to be tested includes multiple functions, and each function has associated code data;

[0113] The processing module 602 is used to process the code data to obtain a plurality of function information associated with the functions and an association relationship between each function information associated with the function and function information associated with other functions;

[0114] A construction module 603 is used to construct a test model of the object to be tested according to the function information and the association relationship, wherein the function information corresponds to the nodes of the test model one by one;

[0115] The testing module 604 is used to test the test object using the test model and output the test result.

[0116] According to an embodiment of the present disclosure, by processing each code data associated with a function, the function information associated with each function and the association relationship between each function information and other function information are obtained, and a test model is constructed based on the function information and the association relationship. Since the test model is obtained by comprehensively combing the structure of the test object, the test object is tested according to the test model, there is no need to rely on the existing fault information knowledge, and the node where the fault occurs can be accurately located. At the same time, the test object can be detected at any time through the test model to ensure the stable operation of the test object. Thereby, the technical problems in the prior art that the system cannot be guarded in real time, is too dependent on the existing fault information knowledge, has no diagnostic capability for incremental faults, and cannot accurately locate the location where the problem occurs are effectively overcome.

[0117] According to an embodiment of the present disclosure, the acquisition module 601 includes an acquisition unit and a first processing unit.

[0118] The acquisition unit is used to acquire the functional information of the object to be tested.

[0119] The first processing unit is used to process the function information to obtain code data associated with the function.

[0120] According to an embodiment of the present disclosure, the processing module 602 includes: an extraction unit and a second processing unit.

[0121] The extraction unit is used to extract features from code data according to a function feature template and output multiple function information, wherein the function feature template includes: function type, method name, parameter type, parameter name and method body.

[0122] The second processing unit is used to obtain the association relationship between each function information associated with a function and the function information associated with other functions according to the calling relationship of each function information.

[0123] According to an embodiment of the present disclosure, the testing module 604 includes a construction unit and a training unit.

[0124] The construction unit is used to construct an initial test model based on the association relationship using the function information as a node.

[0125] The training unit is used to train the initial test model through a dynamic programming method to obtain a final test model.

[0126] According to an embodiment of the present disclosure, the training unit includes an input subunit and an adjustment subunit.

[0127] The input subunit is used to input the training data into the initial test model and output the true output value.

[0128] The adjustment subunit is used to adjust the initial test model when the actual output value is inconsistent with the predicted output value until the output actual output value is consistent with the predicted output value, wherein the predicted output value is the expected output value after the training data is input into the initial test model.

[0129] According to an embodiment of the present disclosure, the test module 604 includes an input unit, a determination unit, and an output unit.

[0130] An input unit, used to input test data into the test model and output test values;

[0131] A determination unit, used for traversing all nodes of the test model when the test value is inconsistent with the predicted value, and determining a target node that causes the inconsistency between the test value and the predicted value, wherein the predicted value is an expected output value after the test value is input into the test model;

[0132] The output unit is used to output the function information corresponding to the target node as the test result.

[0133] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0134] For example, any multiple of the acquisition module 601, the processing module 602, the construction module 603, and the test module 604 can be combined in one module / unit / subunit for implementation, or any one of the modules / units / subunits can be split into multiple modules / units / subunits. Alternatively, at least part of the functions of one or more of these modules / units / subunits can be combined with at least part of the functions of other modules / units / subunits and implemented in one module / unit / subunit. According to an embodiment of the present disclosure, at least one of the acquisition module 601, the processing module 602, the construction module 603, and the test module 604 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the acquisition module 601 , the processing module 602 , the construction module 603 and the testing module 604 may be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function may be executed.

[0135] It should be noted that the object testing system part in the embodiment of the present disclosure corresponds to the object testing method part in the embodiment of the present disclosure. The description of the object testing system part specifically refers to the object testing method part, which will not be repeated here.

[0136] Figure 7 A block diagram of a computer system suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Figure 7 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0137] like Figure 7 As shown, the computer system 700 according to the embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703. The processor 701 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 701 may also include an onboard memory for caching purposes. The processor 701 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.

[0138] In RAM 703, various programs and data required for the operation of system 700 are stored. Processor 701, ROM 702 and RAM 703 are connected to each other through bus 704. Processor 701 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 702 and / or RAM 703. It should be noted that the program can also be stored in one or more memories other than ROM 702 and RAM 703. Processor 701 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0139] According to an embodiment of the present disclosure, the system 700 may further include an input / output (I / O) interface 705, which is also connected to the bus 704. The system 700 may further include one or more of the following components connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.

[0140] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the processor 701, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0141] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0142] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0143] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 702 and / or the RAM 703 described above and / or one or more memories other than the ROM 702 and the RAM 703 .

[0144] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the object testing method provided by the embodiment of the present disclosure.

[0145] When the computer program is executed by the processor 701, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0146] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 709, and / or installed from the removable medium 711. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0147] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, Python, "C" language, or similar programming languages. The program code can be executed entirely on a user computing device, partially on a user device, partially on a remote computing device, or entirely on a remote computing device or server.

[0148] Where a remote computing device is involved, the remote computing device may be connected to the user computing device through any type 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., through the Internet using an Internet service provider).

[0149] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0150] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0151] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes 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 various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. An object testing method, comprising: Acquire code data associated with a function in an object to be tested, wherein the object to be tested includes a plurality of functions, each of the functions having associated code data; Processing the code data to obtain a plurality of function information associated with the function and an association relationship between each piece of function information associated with the function and function information associated with other functions; Constructing a test model of the object to be tested according to the function information and the association relationship, wherein the function information corresponds one-to-one to the nodes of the test model; Assign a value to each node in the test model, use the function method name of the output result in the test model as the root node, and use each function method name in the test model as a process label; Sort each process tag from small to large according to the order of calling and generate sorted tags; Using the test model to test the object to be tested, and outputting the test result; The step of testing the object to be tested by using the test model and outputting the test result includes: Input test data into the test model and output test values; When the test value is inconsistent with the predicted value, traverse all nodes of the test model from the root node, compare each process label with the ranking label, and obtain the process label with the smallest ranking; Output the function method corresponding to the process label with the smallest ranking, and obtain the target node that causes the inconsistency between the test value and the predicted value, wherein the predicted value is the expected output value after the test value is input into the test model; The function information corresponding to the target node is output as the test result.

2. The method according to claim 1, wherein: The obtaining of code data associated with the function in the object to be tested comprises: Acquiring functional information of the object to be tested; and The function information is processed to obtain the code data associated with the function.

3. The method according to claim 1, wherein: The step of processing the code data to obtain a plurality of function information associated with the function and an association relationship between each piece of function information associated with the function and other pieces of function information associated with the function includes: Extracting features from the code data according to a function feature template, and outputting a plurality of function information, wherein the function feature template includes: function type, method name, parameter type, parameter name and method body; According to the calling relationship of each piece of function information, the association relationship between each piece of function information associated with the function and the function information associated with other functions is obtained.

4. The method according to claim 1, wherein: The constructing the test model of the object to be tested according to the function information and the association relationship comprises: Using the function information as nodes, constructing an initial test model according to the association relationship; The initial test model is trained by a dynamic programming method to obtain the final test model.

5. The method according to claim 4, wherein: The training of the initial test model by a dynamic programming method includes: Input the training data into the initial test model and output the true output value; When the true output value is inconsistent with the predicted output value, the initial test model is adjusted until the output true output value is consistent with the predicted output value, wherein the predicted output value is the expected output value after the training data is input into the initial test model.

6. An object testing system, comprising: An acquisition module, used for acquiring code data associated with a function in an object to be tested, wherein the object to be tested includes a plurality of functions, each of which has associated code data; A processing module, used for processing the code data to obtain a plurality of function information associated with the functions and an association relationship between each piece of function information associated with the function and function information associated with other functions; A construction module is used to construct a test model of the object to be tested according to the function information and the association relationship. Wherein, the function information corresponds one-to-one to the nodes of the test model; Assign a value to each node in the test model, use the function method name of the output result in the test model as the root node, and use each function method name in the test model as a process label; Sort each process tag from small to large according to the order of calling and generate sorted tags; A testing module, used to test the object to be tested using the test model and output the test result; Wherein, the test module includes an input unit, a determination unit and an output unit; The input unit is used to input test data into the test model and output test values; The determining unit is used for traversing all nodes of the test model from the root node when the test value is inconsistent with the predicted value, comparing each of the process labels with the sorting labels, and obtaining the process label with the smallest sorting; The output unit is used to output the function method corresponding to the process label with the smallest ranking, and obtain the target node that causes the inconsistency between the test value and the predicted value, wherein the predicted value is the expected output value after the test value is input into the test model; The function information corresponding to the target node is output as the test result.

7. An electronic device comprising: one or more processors; A memory for storing one or more instructions, Wherein, when the one or more instructions are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 5.

9. A computer program product, comprising computer executable instructions, wherein the instructions are used to implement the method according to any one of claims 1 to 5 when executed by a computer.