A method, apparatus, device and medium for testing a service function
Patent Information
- Application Number
- CN202611394005.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-09
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]本发明提供了一种业务功能的测试方法、装置、设备及介质,可以解决现有的业务功能的测试方法存在的业务功能的测试效率较低,人力资源消耗大,测试结果的准确性也较差的问题
[0010]本发明实施例的技术方案,通过获取与目标功能匹配的功能说明书,根据所述功能说明书对预先配置的语义模型进行训练,得到目标测试模型,之后通过所述目标测试模型对各目标业务进行处理,得到与各目标业务匹配的依赖测试结果,最后通过所述目标测试模型,基于各依赖测试结果对所述目标功能进行闭环测试,得到目标测试结果,解决了现有的业务功能的测试方法存在的业务功能的测试效率较低,人力资源消耗大,测试结果的准确性也较差的问题,实现了业务功能的自动化测试,提高了业务功能的测试效率,节约了人力资源,同时保证了测试结果的准确性。
Smart Images

Figure CN123011727A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software testing, and more particularly to a method, apparatus, equipment, and medium for testing business functions. Background Technology
[0002] As software systems continue to expand in scale and business complexity increases, the testing of business functions faces increasingly severe challenges. Traditional business function testing methods are no longer sufficient to meet the current rapid iteration needs of R&D, exposing many problems that urgently need to be addressed.
[0003] In terms of test case generation, traditional software test cases rely entirely on manual writing combined with requirements documents. Testers need to understand the business logic line by line and manually design test scenarios. When requirements iterate, interfaces are adjusted, or database table structures change, test cases need to be updated manually line by line, resulting in low overall testing efficiency and a high risk of missing implicit business verification points. This highly manual testing method not only consumes a lot of human resources but also makes it difficult to guarantee comprehensive test coverage. In terms of dependency analysis, existing software dependency analysis tools only obtain service call relationships based on static code syntax scanning and cannot associate them with upper-level business semantic logic, thus failing to identify implicit dependencies at the business level. Due to the lack of understanding of the business semantic level, these tools cannot accurately capture deep dependencies in the business process, leading to frequent cross-service compatibility failures after code deployment, which seriously affects the stability and reliability of the system. In terms of unified testing standards, the current development process lacks a unified business semantic benchmark, and there is no unified verification standard for test scripts, code logic, and online operation links. The disconnect between test assets and business design rules hinders the establishment of an effective tracing mechanism. This makes it impossible to trace online defects back to original business design issues, severely complicating defect localization and review, and significantly restricting the continuous improvement of test quality. Furthermore, regarding multi-dimensional topology verification, there is a lack of layered and interconnected dependency verification mechanisms in the market. The topology in the business design phase, the code implementation topology, and the actual online execution topology are independent of each other, resulting in persistent discrepancies. This disconnect between design and operation leads to frequent occurrences of various hidden online faults, which traditional testing methods cannot detect and intercept before deployment.
[0004] In summary, existing testing methods for business functions suffer from low testing efficiency, high human resource consumption, and poor accuracy of test results. Summary of the Invention
[0005] This invention provides a testing method, apparatus, equipment, and medium for business functions, which can solve the problems of low testing efficiency, high human resource consumption, and poor accuracy of test results in existing business function testing methods.
[0006] In a first aspect, embodiments of the present invention provide a method for testing business functions, the method comprising: Obtain a functional specification that matches the target function, train a pre-configured semantic model based on the functional specification, and obtain a target test model. The target function consists of at least one target business. The target test model is used to process each target service to obtain dependency test results that match each target service. Using the target test model, closed-loop testing is performed on the target function based on the results of each dependency test to obtain the target test results.
[0007] Secondly, embodiments of the present invention provide a testing apparatus for business functions, the apparatus comprising: The model training module is used to obtain a functional specification that matches the target function, train a pre-configured semantic model according to the functional specification, and obtain a target test model. The target function consists of at least one target business. The result matching module is used to process each target service through the target test model to obtain the dependency test results that match each target service. The closed-loop testing module is used to perform closed-loop testing on the target function based on the results of each dependency test using the target test model, and obtain the target test results.
[0008] Thirdly, embodiments of the present invention provide an electronic device, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform a test method for a business function as described in any embodiment of the present invention.
[0009] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer instructions, which are used to cause a processor to execute a test method for a business function as described in any embodiment of the present invention.
[0010] The technical solution of this invention obtains a functional specification matching the target function, trains a pre-configured semantic model based on the functional specification to obtain a target test model, processes each target business using the target test model to obtain dependency test results matching each target business, and finally performs closed-loop testing on the target function based on the dependency test results using the target test model to obtain the target test result. This solves the problems of low testing efficiency, high manpower consumption, and poor accuracy of test results in existing business function testing methods. It realizes automated testing of business functions, improves testing efficiency, saves manpower, and ensures the accuracy of test results.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart of a testing method for a business function provided according to Embodiment 1 of the present invention; Figure 2 This is a flowchart of a testing method for a business function according to Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of the structure of a business function testing device provided according to Embodiment 3 of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device that implements a testing method for a business function according to an embodiment of the present invention. Detailed Implementation
[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0015] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, any variations of the terms "comprising" and "having" are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0016] Example 1 Figure 1 This is a flowchart of a business function testing method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation of automating the testing of software business functions. The method can be executed by a business function testing device, which can be implemented in hardware and / or software. The business function testing device can be configured in a terminal or server with business function testing capabilities.
[0017] like Figure 1 As shown, the method includes: S110. Obtain the functional specification that matches the target function, and train the pre-configured semantic model according to the functional specification to obtain the target test model.
[0018] The target function consists of at least one target business; further, the target function is a complete business function unit to be tested, such as the order payment function in an e-commerce system, which may consist of multiple target businesses such as inventory verification, coupon redemption, payment deduction, and order status update.
[0019] The functional specification includes: business associations matching the target function and at least one target business, business processes matching each target business, business nodes and node data associations matching each business process, business modules and business operation invariants matching each business node respectively.
[0020] Specifically, the business relationship is used to describe the execution order and dependencies between various target businesses. For example, in the order payment function mentioned above, the business relationship can be used to stipulate sequential constraints such as inventory verification must be performed before payment deduction. Furthermore, the business process refers to the sequence of execution steps within a single target business. Furthermore, the business node refers to each execution step node in the business process. The node data relationship is used to describe the data flow rules between various business nodes. For example, the product inventory query node needs to receive the product ID as input and output the inventory quantity to the downstream inventory sufficiency judgment node. Furthermore, the business module refers to the actual software function module corresponding to the business node. The business operation invariant refers to the constraint conditions that the business node must always satisfy during execution.
[0021] The semantic model refers to a pre-configured structured model framework for understanding business semantics. The semantic model can construct a standardized business semantic representation by parsing business entities, business processes, and data relationships in the functional specification. In this embodiment, the semantic model can be implemented using ontology technology. Ontology is a formal method for describing domain knowledge, which constructs a domain knowledge graph by defining concepts, attributes, and relationships between concepts.
[0022] S120. Process each target service using the target test model to obtain dependency test results that match each target service.
[0023] The process involves processing each target service using the target testing model to obtain dependency test results matching each target service. This includes: acquiring real operational data for each target service; processing the real operational data of the target service using the target testing model to obtain the actual business nodes and their data relationships; cross-comparing the node data relationships of the target service with each business module using the target testing model to obtain a first comparison result; cross-comparing the node data relationships of the target service with the actual node data relationships using the target testing model to obtain a second comparison result; cross-comparing each business module of the target service with the actual business nodes using the target testing model to obtain a third comparison result; and obtaining dependency test results matching the target service based on the first, second, and third comparison results.
[0024] Furthermore, the actual runtime data refers to the runtime data generated when the target business is executed in the actual production or testing environment, including but not limited to service call logs, interface request and response data, database operation records, distributed tracing data, etc.; the actual business node refers to the business step node that is actually executed and parsed from the actual runtime data; the actual node data association refers to the actual data flow relationship between each actual business node that is restored from the actual runtime data.
[0025] Specifically, the first comparison result is used to verify whether all business nodes in the plan have corresponding business modules. For example, the node data association relationship of the inventory verification business process in the functional specification is compared with each business module to confirm that the query product inventory node has a corresponding module implementation. Further, the second comparison result is used to verify whether the actual data flow relationship is consistent with the planned data flow relationship. For example, the planned association relationship in the functional specification where the "Query Product Inventory" node should output "Inventory Quantity" to the "Judgment Inventory Adequacy" node is compared with the actual association relationship in the actual operation where the "Query Cache Inventory" node outputs "Cache Inventory Quantity" to downstream nodes to detect whether there are data field inconsistencies or flow path deviations. Further, the third comparison result is used to verify whether the business module actually executed is consistent with the planned business module. For example, the module A corresponding to the "Query Product Inventory" node in the functional specification is compared with the module B actually called by the "Query Cache Inventory" node in the actual operation to identify whether there are module replacements or undeclared module changes.
[0026] Furthermore, the dependency test results include a summary of the three-layer comparison results for each target service, used to determine the consistency status of the target service at the semantic dependency layer, code mapping layer, and runtime verification layer. When the first comparison result, the second comparison result, and the third comparison result are all consistent, the dependency test result is passed; if any comparison result is inconsistent, the dependency test result is failed, and specific abnormal comparison information is output.
[0027] S130. Using the target test model, perform closed-loop testing on the target function based on the results of each dependency test to obtain the target test results.
[0028] Specifically, the target function is subjected to closed-loop testing based on the results of each dependency test using the target test model to obtain the target test results. This includes: when all dependency test results for each target service are passed, processing the service relationships using the target test model to obtain the target service execution order; generating a target test skeleton based on the target service execution order and the node data relationships of each target service; processing the service operation invariants of each service node using the target test model to generate a standardized test fixture; obtaining a target test script based on the test skeleton and the standardized test fixture; and executing the target test script to perform closed-loop testing on the target function to obtain the target test results.
[0029] Furthermore, the execution order of the target business refers to the sequential execution order of each target business as parsed from the business relationship; for example, for the order payment function, the business relationship specifies a serial execution order of "inventory verification → coupon redemption → payment deduction → order status update", then the execution order of the target business is this sequence.
[0030] Specifically, the target test skeleton refers to a test code framework structure built based on the execution order of the target business and the data association between nodes. The test skeleton defines the organization of test cases, the call chain of each target business, the interface parameter passing rules, and the expected response structure, but does not include specific test data or assertion logic. Furthermore, the standardized test fixture refers to a fixed set of data and precondition configurations generated based on the business operation invariants of each business node to support test execution. The test fixture includes standard input data, expected output data, environment initialization configuration, and boundary value datasets, etc. Further, the target test script refers to directly executable automated test code formed by assembling the target test skeleton and the standardized test fixture. The target test script includes a complete set of test cases, assertion logic, exception handling mechanisms, and test report output configuration. Furthermore, the closed-loop test refers to a complete testing process that executes the test cases of each target business sequentially according to the execution order of the target business and verifies the correctness of the end-to-end business process. In this embodiment, the closed-loop test not only verifies the correctness of individual business nodes but also focuses on whether the data flow and state transmission between business nodes meet expectations.
[0031] Those skilled in the art should understand that, given the known execution order of the target business and the correlation of node data, the method of generating test scripts by generating test skeletons and standardized test fixtures is a mature existing technology. This embodiment will not elaborate on its specific generation principle and data processing flow.
[0032] Furthermore, by using the target test model to perform closed-loop testing on the target function based on the results of each dependency test, and obtaining the target test result, the method further includes: when any dependency test result of the target service fails, setting the target service as an abnormal service and outputting the dependency test result of the abnormal service; in response to the user's modification instruction for the abnormal service, returning to the modified target function based on the target test model to perform the operation of processing each target service through the target test model.
[0033] Specifically, the abnormal service refers to the target service where inconsistencies exist in the dependency test results. For example, when the third comparison result of the inventory verification service shows that the planned S module is inconsistent with the actual C module, the inventory verification service is set as an abnormal service. The dependency test results of the abnormal service include specific inconsistency comparison items, expected values and actual values, timestamps of inconsistency occurrence, and relevant code version information, so that users can quickly locate the root cause of the problem.
[0034] Optionally, based on the above steps, the testing method for the business function further includes: real-time monitoring of the change status of each target business; when an update is detected in any target business, setting the target business with the update as the updated business; processing the updated business through the target test model to obtain update dependency test results; when the update dependency test results pass, traversing the business association relationship through the target test model to obtain a list of subordinate businesses matching the updated business; and performing closed-loop testing on the target function based on the update dependency test results through the target test model to obtain target test results and output the list of subordinate businesses.
[0035] The "change status" refers to the status indicator indicating that the code, configuration, dependent interfaces, or database structure of the target business have been modified; the "updated business" refers to the target business that has been detected to have undergone changes; and the "lower-level business list" refers to the set of all affected target businesses downstream of the updated business, obtained by traversing business relationships. The lower-level businesses are the target businesses affected by the changes in the updated business. For example, if the business relationship stipulates that payment deduction triggers order status update and inventory deduction confirmation, then when payment deduction is an updated business, order status update and inventory deduction confirmation are its lower-level businesses.
[0036] The technical solution of this invention obtains a functional specification that matches the target function, trains a pre-configured semantic model based on the functional specification to obtain a target test model, processes each target business using the target test model to obtain dependency test results that match each target business, and finally performs closed-loop testing on the target function based on the dependency test results using the target test model to obtain the target test results. This achieves automated testing of business functions, improves testing efficiency, saves human resources, and ensures the accuracy of test results.
[0037] Example 2 Figure 2 This is a flowchart of a testing method for a business function provided in Embodiment 2 of the present invention. This embodiment is a refinement based on the above embodiment. Specifically, this embodiment refines the method of training a pre-configured semantic model according to the functional specification to obtain a target test model.
[0038] like Figure 2 As shown, the method includes: S210. Obtain the functional specification that matches the target function.
[0039] The target function consists of at least one target business.
[0040] Furthermore, the functional specification includes: business associations matching the target function and at least one target business, business processes matching each target business, business nodes and node data associations matching each business process, business modules and business operation invariants matching each business node respectively.
[0041] S220. The data relationships of each target business, each business process and each node in the functional specification are processed by the pre-configured semantic model to obtain a standardized directed business dependency graph as a semantic dependency layer.
[0042] The standardized directed business dependency graph refers to a network of dependency relationships between business entities represented by a directed graph data structure. The nodes in the directed graph represent business entities, including target businesses, business processes, and business nodes, and the directed edges represent the dependency directions between entities. The standardization means that the nodes and edges in the graph follow a unified naming convention, type definition, and attributes, which facilitates subsequent graph traversal algorithm processing and cross-system data exchange.
[0043] Furthermore, the semantic dependency layer refers to the top-level abstraction that is built based on business semantic understanding and reflects the logical dependencies at the business design level. In this embodiment, the semantic dependency layer is independent of the specific code implementation and runtime environment, and only focuses on the correctness at the business rule level.
[0044] For example, when processing the functional specification through a semantic model, each target business is first identified as a top-level node. For instance, the order payment function is broken down into four target business nodes: inventory verification, coupon redemption, payment deduction, and order status update. Secondly, the internal business processes of each target business are analyzed. Inventory verification is broken down into four process nodes: receiving requests, querying inventory, judging sufficiency, and returning results. Finally, the data relationships between nodes are extracted, and directed edges are established between the inventory query, node output, and inventory quantity data items pointing to the input of the sufficiency judgment node, as well as cross-business directed edges between the output verification of the sufficiency judgment node and the input of the payment deduction node.
[0045] S230. The semantic model is used to process each business node and each business module in the functional specification to obtain the code mapping dependency relationship as the code mapping layer.
[0046] The code mapping dependency relationship refers to the bidirectional association between business nodes and specific software code implementation units. The code mapping dependency relationship establishes a bridge from business design to technical implementation, so that changes at the business level can be accurately located to the affected code scope, and conversely, exceptions at the code level can also be traced back to the original business node.
[0047] Specifically, the code mapping layer refers to a mid-level abstraction that records the correspondence between business nodes and code implementation units. The code mapping layer inherits the business logic of the semantic dependency layer and connects downwards to the actual execution status of the runtime verification layer. In this embodiment, the mapping information in the code mapping layer is typically maintained in the form of a ledger, including metadata such as business node identifier, code class name, method signature, database table name, interface path, version number, and last update time.
[0048] S240. The semantic model is used to process the invariants of each business operation in the functional specification to obtain the runtime verification dependency relationship as the runtime verification layer.
[0049] The runtime verification dependency relationship refers to the mapping relationship between the business runtime invariant and the actual runtime environment. The runtime verification dependency relationship transforms the constraints at the business level into check rules that can be verified in real time during code execution, ensuring that the system's running state always meets the business design expectations. For example, the business runtime invariant "the inventory quantity must be greater than or equal to zero" is transformed into the runtime verification rule "after each inventory deduction operation, execute a query to verify that the inventory field value is ≥ 0"; the business runtime invariant "the payment interface response time does not exceed 500 milliseconds" is transformed into the runtime verification rule "insert a timer at the payment interface call point, and trigger an alarm if it exceeds 500 milliseconds".
[0050] Specifically, the runtime verification layer refers to the lowest level abstraction built on business operation invariants, used to verify whether the actual operating state of the system conforms to business rules.
[0051] S250. Associate the semantic dependency layer, code mapping layer and runtime verification layer to obtain the target test model.
[0052] S260. Process each target service using the target test model to obtain dependency test results that match each target service.
[0053] S270. Using the target test model, perform closed-loop testing on the target function based on the results of each dependency test to obtain the target test results.
[0054] The technical solution of this invention involves obtaining a functional specification that matches the target function, processing the data relationships of each target business, each business process, and each node in the functional specification using a semantic model to obtain a standardized directed business dependency graph as a semantic dependency layer, then processing each business node and each business module in the functional specification using the semantic model to obtain a code mapping dependency relationship as a code mapping layer, then processing each business runtime invariant in the functional specification using the semantic model to obtain a runtime verification dependency relationship as a runtime verification layer, then associating the semantic dependency layer, the code mapping layer, and the runtime verification layer to obtain the target test model, then processing each target business using the target test model to obtain dependency test results matching each target business, and finally performing closed-loop testing on the target function based on the dependency test results using the target test model to obtain the target test results. This achieves automated testing of business functions, improves testing efficiency, saves human resources, and ensures the accuracy of test results.
[0055] Example 3 Figure 3 This is a schematic diagram of a business function testing device provided in Embodiment 3 of the present invention.
[0056] like Figure 3 As shown, the device includes: The model training module 310 is used to obtain a functional specification that matches the target function, train a pre-configured semantic model according to the functional specification, and obtain a target test model. The target function consists of at least one target business. The result matching module 320 is used to process each target service through the target test model to obtain the dependency test results that match each target service. The closed-loop testing module 330 is used to perform closed-loop testing on the target function based on the results of each dependency test using the target test model, and obtain the target test results.
[0057] The technical solution of this invention obtains a functional specification that matches the target function, trains a pre-configured semantic model based on the functional specification to obtain a target test model, processes each target business using the target test model to obtain dependency test results that match each target business, and finally performs closed-loop testing on the target function based on the dependency test results using the target test model to obtain the target test results. This achieves automated testing of business functions, improves testing efficiency, saves human resources, and ensures the accuracy of test results.
[0058] Based on the above embodiments, the model training module 310 includes: The first model training unit is used to process the data relationships of each target business, each business process and each node in the functional specification through a pre-configured semantic model to obtain a standardized directed business dependency graph as a semantic dependency layer. The second model training unit is used to process each business node and each business module in the functional specification through the semantic model to obtain the code mapping dependency relationship as the code mapping layer. The third model training unit is used to process the various business operation invariants in the functional specification through the semantic model to obtain the runtime verification dependency relationship as the runtime verification layer. The model association unit is used to associate the semantic dependency layer, code mapping layer and runtime verification layer to obtain the target test model.
[0059] Based on the above embodiments, the result matching module 320 includes: The real data acquisition unit is used to acquire the real operational data of each target business. The actual data acquisition unit is used to process the actual operation data of the target service through the target test model to obtain the actual service nodes and the actual node data association relationship of the target service. The first comparison unit is used to cross-compare the node data association relationship and each business module of the target business through the target test model to obtain the first comparison result; The second comparison unit is used to cross-compare the node data association relationship of the target service and the actual node data association relationship through the target test model to obtain a second comparison result; The third comparison unit is used to cross-compare each business module of the target business and the actual business node through the target test model to obtain the third comparison result; The result generation unit is used to obtain dependency test results that match the target service based on the first comparison result, the second comparison result, and the third comparison result.
[0060] Based on the above embodiments, the closed-loop test module 330 includes: The sequence acquisition unit is used to process the business association relationship through the target test model to obtain the execution order of the target business when all the dependency test results of each target business are passed. The test skeleton generation unit is used to generate a target test skeleton based on the execution order of the target services and the node data association relationship of each target service. The test fixture generation unit is used to process the business operation invariants of each business node through the target test model and generate standardized test fixtures. A script generation unit is used to generate a target test script based on the test skeleton and the standardized test fixture; The closed-loop testing unit is used to execute the target test script to perform closed-loop testing on the target function and obtain the target test results.
[0061] Based on the above embodiments, the closed-loop test module 330 further includes: An abnormal service identification unit is used to set the target service as an abnormal service and output the dependency test result of the abnormal service when the dependency test result of any target service fails. The return execution unit is used to respond to the user's modification instruction for the abnormal service, and to return to the execution of the modified target function based on the target test model to process each target service through the target test model.
[0062] Based on the above embodiments, the testing device for the business function further includes: The real-time monitoring module is used to: monitor the change status of each target service in real time; when any target service is detected to be updated, set the target service with the update as the updated service; process the updated service through the target test model to obtain the update dependency test result; when the update dependency test result passes, traverse the service association relationship through the target test model to obtain a list of subordinate services that match the updated service. Using the target test model, a closed-loop test is performed on the target function based on the update dependency test results to obtain the target test results and output the lower-level business list.
[0063] The business function testing device provided in this embodiment of the invention can execute a business function testing method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0064] Example 4 Figure 4 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0065] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0066] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0067] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a testing method for a business function.
[0068] Accordingly, the method includes: Obtain a functional specification that matches the target function, train a pre-configured semantic model based on the functional specification, and obtain a target test model. The target function consists of at least one target business. The target test model is used to process each target service to obtain dependency test results that match each target service. Using the target test model, closed-loop testing is performed on the target function based on the results of each dependency test to obtain the target test results.
[0069] In some embodiments, a testing method for a business function may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the testing method for a business function described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform a testing method for a business function by any other suitable means (e.g., by means of firmware).
[0070] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0071] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0072] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0073] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0074] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0075] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0076] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
Claims
1. A method for testing business functions, characterized in that, include: Obtain a functional specification that matches the target function, train a pre-configured semantic model based on the functional specification, and obtain a target test model. The target function consists of at least one target business. The target test model is used to process each target service to obtain dependency test results that match each target service. Using the target test model, closed-loop testing is performed on the target function based on the results of each dependency test to obtain the target test results.
2. The method according to claim 1, characterized in that, The functional specification includes: business associations matching the target function and at least one target business, business processes matching each target business, business nodes and node data associations matching each business process, business modules and business operation invariants matching each business node respectively.
3. The method according to any one of claims 1-2, characterized in that, The pre-configured semantic model is trained according to the functional specification to obtain the target test model, including: The pre-configured semantic model is used to process the data relationships of each target business, each business process and each node in the functional specification to obtain a standardized directed business dependency graph as a semantic dependency layer. The semantic model is used to process each business node and each business module in the functional specification to obtain code mapping dependencies as a code mapping layer; The semantic model is used to process the invariants of each business operation in the functional specification to obtain the runtime verification dependency relationship as the runtime verification layer. The semantic dependency layer, code mapping layer, and runtime verification layer are associated to obtain the target test model.
4. The method according to any one of claims 1-2, characterized in that, The target test model is used to process each target service to obtain dependency test results that match each target service, including: Obtain the actual operational data for each target business; The actual operational data of the target service is processed by the target test model to obtain the actual business nodes and the data association relationship of the actual nodes of the target service. The first comparison result is obtained by cross-comparing the node data correlation relationship and each business module of the target business through the target test model. The target test model is used to cross-compare the node data association relationship of the target service with the actual node data association relationship to obtain a second comparison result; The target test model is used to cross-compare each business module of the target business with the actual business node to obtain a third comparison result; Based on the first comparison result, the second comparison result, and the third comparison result, a dependency test result matching the target service is obtained.
5. The method according to claim 2, characterized in that, Using the target test model, closed-loop testing is performed on the target function based on the results of each dependency test to obtain the target test results, including: When all the dependency test results for each target service are passed, the service relationships are processed through the target test model to obtain the execution order of the target services; Based on the execution order of the target services and the node data association relationship of each target service, a target test skeleton is generated; The target test model is used to process the business operation invariants of each business node to generate standardized test fixtures. The target test script is obtained based on the test skeleton and the standardized test fixture; The target test script is executed to perform closed-loop testing on the target function, and the target test results are obtained.
6. The method according to any one of claims 1-2, characterized in that, Using the target test model, closed-loop testing of the target function is performed based on the results of each dependency test to obtain the target test results, which also includes: If any dependency test result of a target service fails, the target service is set as an abnormal service, and the dependency test result of the abnormal service is output. In response to the user's instruction to modify the abnormal service, the modified target function is returned to perform the operation of processing each target service through the target test model based on the target test model.
7. The method according to claim 2, characterized in that, The testing methods for the aforementioned business functions also include: Real-time monitoring of changes to the status of each target business; When an update is detected for any target service, the target service with the update is set as the updated service; The update service is processed using the target test model to obtain update dependency test results; When the update dependency test result passes, the business relationship is traversed through the target test model to obtain a list of subordinate businesses that match the updated business. Using the target test model, a closed-loop test is performed on the target function based on the update dependency test results to obtain the target test results and output the lower-level business list.
8. A testing device for business functions, characterized in that, include: The model training module is used to obtain a functional specification that matches the target function, train a pre-configured semantic model according to the functional specification, and obtain a target test model. The target function consists of at least one target business. The result matching module is used to process each target service through the target test model to obtain the dependency test results that match each target service. The closed-loop testing module is used to perform closed-loop testing on the target function based on the results of each dependency test using the target test model, and obtain the target test results.
9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a test method for a business function according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute a test method for implementing a business function according to any one of claims 1-7.
