Search

CN-122019385-A - Application testing method and device, program product and electronic equipment

CN122019385ACN 122019385 ACN122019385 ACN 122019385ACN-122019385-A

Abstract

The invention discloses an application testing method and a device, a program product and electronic equipment thereof, and relates to the field of financial science and technology or other related fields, wherein the testing method comprises the steps of constructing a code relation network of a target application, determining a change link from the code relation network based on a change code to obtain change link information, determining database change information based on the change code, determining interface call information of the target application based on the change code, determining the interface call information of the target application based on the change link information, the database change information and the interface call information, adopting a preset risk identification model to generate code risk information of the target application, generating a testing strategy based on the code risk information, and adopting the testing strategy to test the target application. The invention solves the technical problem of lower accuracy of the application test in the related technology.

Inventors

  • JIANG CHAO
  • GAO ZHENGYU
  • XIE LINJIE
  • LIANG FANG

Assignees

  • 中国工商银行股份有限公司

Dates

Publication Date
20260512
Application Date
20260130

Claims (10)

  1. 1. An application testing method, comprising: constructing a code relation network of a target application, wherein the code relation network is used for representing a calling relation in a code corresponding to the target application; Determining a change link from the code relation network based on a change code to obtain change link information, wherein the change code is used for updating the target application; Determining database change information based on the change code, and determining interface call information of the target application based on the change code; generating code risk information of the target application by adopting a preset risk identification model based on the change link information, the database change information and the interface call information; And generating a test strategy based on the code risk information, and testing the target application by adopting the test strategy.
  2. 2. The method of testing according to claim 1, wherein the step of building a code relationship network of the target application comprises: Acquiring the full code of the target application; analyzing the full code, and determining a first calling relation between code segments and a second calling relation between the code segments and a database; And constructing the code relation network based on the first calling relation and the second calling relation.
  3. 3. The method of testing according to claim 1, wherein the step of determining a change link from the code relationship network based on a change code to obtain change link information comprises: determining all the change codes with code submitting time within a preset time range, wherein each change code corresponds to a change requirement; for each of the change codes, determining all change code segments to which the change code relates; Deriving in the code relationship network to extract a link based on all of the altered code segments; And integrating all the links to obtain the changed link, and determining the changed link information based on all the entity nodes related to the changed link, wherein the entity nodes are nodes represented by code segments or databases.
  4. 4. The method of testing of claim 1, wherein the step of determining database change information based on the change code comprises: determining a first type of code interacting with the database based on the change code; Judging whether the current change involves the operation on the preset data table or not based on the first type code, and acquiring data table operation change information under the condition that the current change involves the operation on the preset data table; judging whether the current change changes the calling frequency of the database based on the first type code, and acquiring calling frequency information under the condition that the current change changes the calling frequency of the database; judging whether the current change changes the storage mode of the database based on the change requirement of the change code, and acquiring storage mode information under the condition that the current change changes the storage mode of the database; and determining the database change information based on the data table operation change information, the calling frequency information and the storage mode information.
  5. 5. The method of testing of claim 1, wherein the step of determining interface call information for the target application based on the change code comprises: judging whether the interface call quantity of the external call interface of the target application is changed or not based on the change code; and determining the interface calling information under the condition that the interface calling quantity of the external calling interface is changed.
  6. 6. The test method according to claim 1, further comprising, before generating code risk information of the target application using a preset risk identification model based on the change link information, the database change information, and the interface call information: acquiring historical change codes and determining risk information corresponding to each historical change code; constructing historical knowledge data based on all the historical change codes and the risk information corresponding to the historical change codes; Training an initial risk identification model based on the historical knowledge data, wherein the initial risk identification model is used for extracting code features of the historical modification codes and obtaining predicted risk information by processing the code features; And under the condition that the similarity between the predicted risk information and the risk information is larger than a preset threshold value, determining that training of the initial risk identification model is completed, and obtaining the preset risk identification model.
  7. 7. The method according to claim 1, wherein the step of generating code risk information of the target application using a preset risk identification model based on the change link information, the database change information, and the interface call information, comprises: Characterizing the change link information, the database change information and the interface call information as reference information; And inputting the change codes and the reference information into the preset risk identification model for processing, and generating the code risk information.
  8. 8. An apparatus for testing an application, comprising: The system comprises a construction unit, a code relation network and a storage unit, wherein the construction unit is used for constructing a code relation network of a target application, and the code relation network is used for representing a calling relation in a code corresponding to the target application; the first determining unit is used for determining a change link from the code relation network based on a change code to obtain change link information, wherein the change code is used for updating the target application; The second determining unit is used for determining database change information based on the change code and determining interface call information of the target application based on the change code; the generation unit is used for generating code risk information of the target application by adopting a preset risk identification model based on the change link information, the database change information and the interface call information; And the testing unit is used for generating a testing strategy based on the code risk information and testing the target application by adopting the testing strategy.
  9. 9. A computer program product comprising a non-volatile computer readable storage medium storing a computer program which, when executed by a processor, implements a test method for an application according to any one of claims 1 to 7.
  10. 10. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of testing for an application of any of claims 1-7.

Description

Application testing method and device, program product and electronic equipment Technical Field The invention relates to the field of financial science and technology, in particular to an application testing method and device, a program product and electronic equipment. Background As various business application architectures become more complex, the architecture changes more frequently, the business demand delivery speed is accelerating, and the demands for performance testing become more urgent and frequent. Currently, there may be omission in identifying performance risks by testers, modification introduction cannot be prevented, and whether the program variations need to be subjected to pressure measurement is confirmed through some fixed rules to ensure production stability. However, the above-mentioned method is not only time-consuming and laborious, but also the pressure measurement range is not evaluated fully, and the pressure measurement range is not accurate, resulting in leakage during the pressure measurement. For the above problems, no effective solution has been proposed at present. Disclosure of Invention The embodiment of the invention provides an application testing method, an application testing device, a program product and electronic equipment, which at least solve the technical problem of low application testing accuracy in the related technology. According to one aspect of the embodiment of the invention, an application testing method is provided, which comprises the steps of constructing a code relation network of a target application, wherein the code relation network is used for representing calling relations in codes corresponding to the target application, determining a change link from the code relation network based on change codes to obtain change link information, wherein the change codes are used for updating the target application, determining database change information based on the change codes and interface calling information of the target application based on the change codes, generating code risk information of the target application by adopting a preset risk identification model based on the change link information, the database change information and the interface calling information, generating a testing strategy based on the code risk information, and testing the target application by adopting the testing strategy. Further, the step of constructing the code relation network of the target application comprises the steps of obtaining the full-quantity code of the target application, analyzing the full-quantity code, determining a first calling relation between code segments and a second calling relation between the code segments and a database, and constructing the code relation network based on the first calling relation and the second calling relation. Further, the step of determining a change link from the code relation network based on the change codes and obtaining change link information comprises the steps of determining all the change codes with code submitting time within a preset time range, wherein each change code corresponds to a change requirement, determining all change code segments related to the change codes for each change code, deriving in the code relation network based on all the change code segments to extract links, integrating all the links to obtain the change link, and determining change link information based on all entity nodes related to the change link, wherein the entity nodes are code segments or nodes represented by a database. Further, the step of determining database change information based on the change codes comprises the steps of determining a first type code interacted with the database based on the change codes, judging whether the current change involves operation on a preset data table based on the first type code, acquiring the data table operation change information when the current change involves operation on the preset data table, judging whether the current change changes the calling frequency of the database based on the first type code, acquiring the calling frequency information when the current change changes the calling frequency of the database, judging whether the current change changes the storage mode of the database based on the change requirements of the change codes, acquiring the storage mode information when the current change changes the storage mode of the database, and determining the database change information based on the data table operation change information, the calling frequency information and the storage mode information. Further, the step of determining the interface call information of the target application based on the change code comprises the steps of judging whether the interface call amount of the external call interface of the target application is changed based on the change code, and determining the interface call information under the condition that the interface call amount of