Search

CN-122019381-A - Interface dependency relationship-oriented software test case generation method and system

CN122019381ACN 122019381 ACN122019381 ACN 122019381ACN-122019381-A

Abstract

The invention relates to the technical field of software automation test and use case generation, and discloses a method and a system for generating a software test use case oriented to interface dependency relationship, wherein the method comprises the steps of obtaining interface call log data and tenant configuration data of a target system, and extracting a call record sequence with tenant labels and a tenant-compliance label attribution table; the method comprises the steps of generating a tenant-level interface dependency directed graph based on a weighted dependency intensity matrix of each tenant, generating a tenant-level dependency graph set with a compliance label propagation path label, carrying out rule verification on each boundary crossing point based on a tenant compliance boundary mapping matrix, generating a tenant compliance conflict risk point set, generating a test case aiming at the tenant compliance conflict risk point set, and outputting a multi-tenant interface dependency chain test case set. The method solves the technical defects that the prior method can not differentially identify the dependence characteristics of each tenant and can not find the interaction problem of tenant isolation and compliance propagation.

Inventors

  • SUN TAO
  • ZHAO JUNMIN
  • CHEN ZIHAO
  • Zheng Xuye
  • MOU LILI
  • WAN LEI

Assignees

  • 武汉明合永安科技有限公司

Dates

Publication Date
20260512
Application Date
20260128

Claims (10)

  1. 1. The method for generating the software test case facing the interface dependency relationship is characterized by comprising the following steps of: acquiring interface call log data and tenant configuration data of a target system, and extracting a call record sequence with tenant labels and a tenant-compliance label attribution table; grouping according to tenant identification based on the call record sequence with the tenant label, respectively calculating an interface call frequency matrix aiming at the call record subsequence of each tenant, and generating a weighted dependency intensity matrix of each tenant by combining with the tenant priority weight coefficient; Generating a tenant compliance boundary mapping matrix based on the tenant-compliance label attribution table and interface definition data, wherein the tenant compliance boundary mapping matrix takes a tenant as a row index and a compliance label type as a column index, and a unit grid value comprises access rights and conversion rules; Generating a tenant-level interface dependency directed graph based on the weighted dependency intensity matrix of each tenant, and tracking the transmission path of the compliance label along the data flow direction to generate a tenant-level dependency graph set with the compliance label transmission path label; identifying boundary crossing points of data crossing tenant isolation boundaries by utilizing a boundary crossing detection algorithm aiming at the tenant-level dependency graph set, and carrying out rule verification on each boundary crossing point based on the tenant compliance boundary mapping matrix to generate a tenant compliance conflict risk point set; and generating test cases aiming at the tenant compliance conflict risk point set, and outputting a multi-tenant interface dependency chain test case set.
  2. 2. The method for generating the software test case for the interface dependency according to claim 1, wherein the calculating the interface call frequency matrix for the call record subsequence of each tenant includes: dividing a time range of calling the record subsequence into a plurality of time windows; counting the calling times of each interface pair aiming at each time window to form a calling frequency matrix of the time window; And averaging the calling frequency matrixes of all the time windows to generate an interface calling frequency matrix of each tenant.
  3. 3. The method for generating the software test case for the interface dependency relationship according to claim 1, wherein the generating the weighted dependency strength matrix of each tenant by combining the tenant priority weight coefficients comprises: Acquiring service level protocol data of each tenant, and extracting tenant priority weight coefficients; multiplying the tenant priority weight coefficient with the interface call frequency matrix of the tenant to generate a weighted dependency intensity matrix of the tenant.
  4. 4. The interface dependency relationship oriented software test case generation method according to claim 1, wherein the generating a tenant compliance boundary mapping matrix based on the tenant-compliance label home table and interface definition data comprises: Acquiring interface definition data, and identifying data access range attributes of each interface, wherein the data access range attributes comprise three types of single tenant, cross tenant and sharing, and an interface tenant isolation level table is generated; analyzing input and output parameter definitions of each interface, identifying the positions of the compliance tag fields in the parameters, establishing the corresponding relation between the compliance tag fields and the data fields, and generating an interface compliance tag mapping table; Generating a tenant compliance boundary mapping matrix based on the tenant-compliance label attribution table, the interface tenant isolation level table and the interface compliance label mapping table, wherein a unit lattice value is a triplet, and the triplet comprises access authority of a tenant to the compliance type data, constraint rules to be followed when the compliance type data is processed and conversion rules of the compliance labels when the data flows from other tenants.
  5. 5. The method for generating interface dependency-oriented software test cases according to claim 1, wherein the generating a tenant-level interface dependency directed graph based on the weighted dependency intensity matrix of each tenant comprises: aiming at the weighted dependency intensity matrix of each tenant, generating a tenant-level interface dependency directed graph by taking an interface as a node and taking a calling relationship as an edge, wherein the edge weight is the value of a corresponding element in the weighted dependency intensity matrix; comparing the structural differences of the tenant dependency graphs, marking edges existing in a single tenant dependency graph as unique dependency edges of tenants, and marking edges existing in a plurality of tenant dependency graphs as shared dependency edges.
  6. 6. The method for generating an interface dependency-oriented software test case according to claim 1, wherein the following a data flow to trace a transfer path of a compliance tag includes: determining the mapping relation between the compliance label field in the output parameter of the upstream interface and the compliance label field in the input parameter of the downstream interface based on the interface compliance label mapping table aiming at each directed edge in the dependency graph; If the mapping relation exists, labeling the propagation attribute of the compliance label on the edge with the mapping relation; traversing all paths in the dependency graph, and connecting the propagation attributes of the compliance labels on each side of the paths to form a complete propagation path of the compliance labels.
  7. 7. The method for generating the software test case for the interface dependency according to claim 1, wherein the identifying the boundary crossing point of the data crossing the tenant isolation boundary by using the boundary crossing detection algorithm comprises: Screening an interface set with shared tenant isolation level as a boundary crossing candidate point based on the interface tenant isolation level table; identifying a dependency path passing through the boundary crossing candidate points for the dependency graph of each tenant; And checking whether an upstream interface and a downstream interface of the path belong to different tenant isolation domains according to each dependent path passing through the boundary crossing candidate points, and if so, marking the candidate points of the upstream interface and the downstream interface of the path belonging to different tenant isolation domains as boundary crossing points.
  8. 8. The method for generating the software test case for the interface dependency relationship according to claim 1, wherein the rule verification is performed on each boundary crossing point based on the tenant compliance boundary mapping matrix to generate the tenant compliance conflict risk point set, and the method comprises the following steps: Acquiring a tenant to which an upstream interface of a boundary crossing point belongs and a compliance label carried by the tenant; Acquiring a tenant to which a downstream interface of a boundary crossing point belongs; querying a corresponding unit grid value in the tenant compliance boundary mapping matrix, and acquiring the access right and conversion rule of a downstream tenant to upstream compliance type data; If the access right is forbidden or the conversion rule is blocked, the corresponding boundary crossing point is marked as a compliance constraint conflict point; and merging all the conflict points of the compliance constraint and the label conversion risk points to generate a tenant compliance conflict risk point set.
  9. 9. The method for generating the software test case for the interface dependency relationship according to claim 1, wherein the generating the test case for the tenant compliance conflict risk point set includes: Constructing a test scene for triggering data to flow across tenants aiming at each risk point in the tenant compliance conflict risk point set, wherein the test scene comprises test input data carrying specific compliance labels, an interface calling sequence for triggering the data to flow through boundary crossing points, and verification assertion for verifying whether the compliance labels are correctly converted or blocked; Aiming at interfaces which are shared in tenant isolation level and relate to data aggregation operation, constructing multi-tenant data input with different compliance labels, and verifying that the compliance labels which are asserted as aggregated output data meet the strictest label inheritance principle; aiming at the dependency paths marked as the special tenant in each tenant dependency graph, test cases are generated according to descending order based on tenant priority weight coefficients.
  10. 10. An interface dependency-oriented software test case generation system for executing the interface dependency-oriented software test case generation method according to any one of claims 1 to 9, comprising: The data acquisition module is used for acquiring interface call log data and tenant configuration data of the target system and extracting a call record sequence with tenant labels and a tenant-compliance label attribution table; the dependence intensity calculation module is used for grouping according to tenant identifications based on the call record sequence with the tenant label and respectively calculating a weighted dependence intensity matrix for each tenant; the boundary mapping matrix generation module is used for generating a tenant compliance boundary mapping matrix based on the tenant-compliance label attribution table and interface definition data; The dependence graph generation module is used for generating a tenant-level dependence graph set with a compliance label propagation path label based on the weighted dependence intensity matrix of each tenant; The risk point identification module is used for generating a tenant compliance conflict risk point set by utilizing a boundary crossing detection algorithm and a rule verification algorithm aiming at the tenant-level dependency graph set; And the test case generation module is used for generating a multi-tenant interface dependency chain test case set aiming at the tenant compliance conflict risk point set.

Description

Interface dependency relationship-oriented software test case generation method and system Technical Field The invention relates to the technical field of software automation test and use case generation, in particular to a method and a system for generating a software test use case oriented to an interface dependency relationship. Background With the development of cloud computing technology, a multi-tenant SaaS (Software AS A SERVICE) platform has become a mainstream deployment mode of enterprise-level Software. In a multi-tenant architecture, multiple tenants share the same set of software system and infrastructure, and data of each tenant is distinguished by a logical isolation mode. In particular in SaaS platforms operated across the country, different tenants may belong to different jurisdictions whose data need to comply with data protection regulations of the respective region. When the interface test is performed on the multi-tenant SaaS platform, test cases need to be generated based on the dependency relationship between interfaces. Interface dependencies are typically quantified by analyzing the call frequency in the interface call log, with higher call frequency dependency paths typically having higher test priorities. However, in a multi-tenant environment, because of the difference between the service scale and the usage pattern of each tenant, the interface call thermal distribution (i.e., the distribution of call frequencies between each interface pair) of different tenants presents a significant difference. The existing interface test case generation method has the following technical defects when processing a multi-tenant scene: first, the traditional thermodynamic distribution calculation method combines and processes the call log data of all tenants, and the generated dependency weight reflects the average value of the call modes of each tenant. The processing mode causes that the key service dependence path of the large customer tenant is possibly diluted due to the difference from the calling modes of other tenants, the special calling mode of the small tenant is submerged due to the small data volume, and the finally generated test case cannot cover the core service dependence path of each tenant in a targeted manner. Second, the tenant isolation mechanism and the data compliance propagation mechanism are typically verified separately as two independent test dimensions. The tenant isolation test focuses on the attribution correctness of the data, namely, verifies that the data of the tenant A cannot flow into the processing link of the tenant B, and the compliance propagation test focuses on the processing constraint correctness of the data, namely, verifies that the compliance label can be correctly propagated when the data carrying the specific compliance label is transferred in the interface call chain. However, when the shared service interface processes data of multiple tenants simultaneously, there is a crossover risk that in a data aggregation scenario, data from different tenants and carrying different compliance tags may be mixed, resulting in confusion or loss of the compliance tags, and in a tenant switching scenario, the compliance tags of the data may not be migrated correctly with the data to a new tenant processing link. Because the two tests are independently carried out by the existing method, the cross risk points of the tenant isolation boundary and the propagation of the compliance beam cannot be found, so that the defects under certain boundary conditions cannot be covered by the test. Therefore, a method for generating a software test case facing to an interface dependency relationship is needed, which can differentially identify the dependency characteristics of each tenant in a multi-tenant scenario, and perform association analysis on tenant isolation boundaries and compliance bundle propagation, so as to generate a test case capable of simultaneously covering a tenant specific service path and tenant-compliance cross risk points. Disclosure of Invention The invention provides a method and a system for generating a software test case facing an interface dependency relationship, which solve the technical problems that the conventional method in the related technology submerges tenant characteristics caused by combining and processing multi-tenant call logs, and the conventional method cannot differentially identify the dependency characteristics of each tenant and cannot find the interaction problem of tenant isolation and compliance propagation. The invention provides a method for generating a software test case facing an interface dependency relationship, which comprises the following steps: acquiring interface call log data and tenant configuration data of a target system, and extracting a call record sequence with tenant labels and a tenant-compliance label attribution table; grouping according to tenant identification based on the call record sequence wit