CN117493159A - Application testing method and device, electronic equipment and readable storage medium - Google Patents

Application testing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN117493159A
CN117493159A CN202310787446.2A CN202310787446A CN117493159A CN 117493159 A CN117493159 A CN 117493159A CN 202310787446 A CN202310787446 A CN 202310787446A CN 117493159 A CN117493159 A CN 117493159A
Authority
CN
China
Prior art keywords
application
test
identifier
environment
tested
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310787446.2A
Other languages
Chinese (zh)
Inventor
王镇航
赵国庆
蒋宁
吴鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mashang Xiaofei Finance Co Ltd
Original Assignee
Mashang Xiaofei Finance Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mashang Xiaofei Finance Co Ltd filed Critical Mashang Xiaofei Finance Co Ltd
Priority to CN202310787446.2A priority Critical patent/CN117493159A/en
Publication of CN117493159A publication Critical patent/CN117493159A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The disclosure provides an application testing method, an application testing device, electronic equipment and a readable storage medium, which are used for improving testing efficiency and accuracy. The method comprises the following steps: acquiring an application identifier to be tested contained in an application test request, inquiring a preset application environment mapping table, and determining an atomic environment identifier corresponding to the application identifier to be tested; acquiring an image file set corresponding to the atomic environment identifier from an image data warehouse, carrying out instantiation processing on each image file contained in the image file set, generating a test environment corresponding to the application identifier to be tested according to an instantiation result, and deploying the application to be tested into the test environment; and acquiring test input data corresponding to the application identifier to be tested from the data simulation application, and testing the application to be tested according to the test input data. The method can simulate the external application depending on the test process and provide the test input data required by the test for the application to be tested, thereby ensuring that the test process can be automatically realized.

Description

Application testing method and device, electronic equipment and readable storage medium
Technical Field
The disclosure relates to the field of testing technologies, and in particular, to an application testing method, an application testing device, an electronic device and a readable storage medium.
Background
Application testing refers to: and (3) operating the application program under the specified conditions to find out program errors, measuring the application quality and evaluating whether the application program can meet the design requirements. Automated testing is a process that converts human-driven testing behavior into machine execution, namely: and simulating a manual testing step, namely automatically testing the application software by executing a testing script compiled by a programming language. Therefore, the automatic test is an important capability in the modern application software engineering implementation, can effectively save test resources and improve test capability.
In the related art, the implementation preconditions for automated testing are: the test environment is built in advance in a manual mode, and various data operations required in the test environment are simulated manually. However, under the conditions that the number of applications to be tested is large and the test environment is complex and changeable, the test environment needs to be built again in each test process, so that the test efficiency is low, and the rapid test for a large number of applications cannot be realized efficiently.
Disclosure of Invention
The disclosure provides an application testing method, an application testing device, electronic equipment and a readable storage medium, which are used for improving testing efficiency so as to efficiently realize rapid testing for a large number of applications.
In a first aspect, the present disclosure provides an application testing method, including the steps of:
acquiring an application identifier to be tested contained in an application test request, inquiring a preset application environment mapping table, and determining an atomic environment identifier corresponding to the application identifier to be tested;
acquiring an image file set corresponding to the atomic environment identifier from an image data warehouse, carrying out instantiation processing on each image file contained in the image file set, generating a test environment corresponding to the application identifier to be tested according to an instantiation result, and deploying the application to be tested into the test environment;
and acquiring test input data corresponding to the application identifier to be tested from the data simulation application, and testing the application to be tested according to the test input data to obtain a test result.
In a second aspect, the present disclosure provides an application testing apparatus comprising:
the acquisition module is suitable for acquiring an application identifier to be tested contained in an application test request, inquiring a preset application environment mapping table and determining an atomic environment identifier corresponding to the application identifier to be tested;
the deployment module is suitable for acquiring an image file set corresponding to the atomic environment identifier from an image data warehouse, carrying out instantiation processing on each image file contained in the image file set, generating a test environment corresponding to the application identifier to be tested according to an instantiation result, and deploying the application to be tested into the test environment;
The test module is suitable for acquiring test input data corresponding to the application identifier to be tested from the data simulation application, and testing the application to be tested according to the test input data to obtain a test result.
In a third aspect, the present disclosure provides an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, one or more of the computer programs being executable by the at least one processor to enable the at least one processor to perform the above-described method.
In a fourth aspect, the present disclosure provides a computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor/processing core implements the above-described method.
In the embodiment provided by the disclosure, on one hand, the mapping relation between the application identifier to be tested and the atomic environment identifier corresponding to the application identifier is stored in advance through the application environment mapping table, and the image file set related to the atomic environment corresponding to the original environment identifier is stored in the image data warehouse, so that the test environment corresponding to the atomic environment is quickly generated according to the image file set, the generation efficiency of the test environment is improved, the atomic environment for generating the test environment can be reused for multiple times, and the defect that the test environment needs to be manually built for each test is avoided. On the other hand, by means of the data simulation application, the external application relied on in the test process can be simulated, so that test input data required in the test process is provided for the application to be tested, and the test process can be automatically realized.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure, without limitation to the disclosure. The above and other features and advantages will become more readily apparent to those skilled in the art by describing in detail exemplary embodiments with reference to the attached drawings, in which:
FIG. 1 is a flow chart of an application testing method provided by one embodiment of the present disclosure;
FIG. 2 shows a flow diagram of one specific example of an application test method of the present application;
FIG. 3 is a block diagram of an application testing apparatus provided by an embodiment of the present disclosure;
fig. 4 is a block diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
For a better understanding of the technical solutions of the present disclosure, exemplary embodiments of the present disclosure will be described below with reference to the accompanying drawings, in which various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Embodiments of the disclosure and features of embodiments may be combined with each other without conflict.
As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The application testing method according to the embodiments of the present disclosure may be performed by an electronic device such as a terminal device or a server, and the terminal device may be a vehicle-mounted device, a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or the like; the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing service. The method may in particular be implemented by means of a processor calling a computer program stored in a memory.
In the related art, the implementation preconditions for automated testing are: the test environment is built in advance in a manual mode, and various data operations required in the test environment are simulated manually. However, under the conditions that the number of applications to be tested is large and the test environment is complex and changeable, the test environment needs to be built again in each test process, so that the test efficiency is low, and the rapid test for a large number of applications cannot be realized efficiently. In order to solve the problems, the application testing method is provided, on the one hand, the mapping relation between the application identifier to be tested and the atomic environment identifier corresponding to the application identifier is prestored through the application environment mapping table, and the image file set related to the atomic environment corresponding to the original environment identifier is stored in the image data warehouse, so that the testing environment corresponding to the atomic environment is quickly generated according to the image file set, the generating efficiency of the testing environment is improved, the atomic environment for generating the testing environment can be reused for multiple times, and the defect that the testing environment needs to be manually built for each test is avoided. On the other hand, by means of the data simulation application, the external application relied on in the test process can be simulated, so that test input data required in the test process is provided for the application to be tested, and the test process can be automatically realized.
Fig. 1 is a flowchart of an application test method according to an embodiment of the present disclosure. Referring to fig. 1, the method includes:
step S110: and acquiring an application identifier to be tested contained in the application test request, inquiring a preset application environment mapping table, and determining an atomic environment identifier corresponding to the application identifier to be tested.
The application test request can be sent by a tester or automatically triggered by a test platform. The application test request may specifically be a request input through an instruction code, or may be a request input through an input port included in a test interface, and the application is not limited to a specific format and a triggering manner of the application test request. The application test request contains an application identifier to be tested, and the application identifier to be tested can specifically include a type identifier and/or a version identifier of the application to be tested, so long as the application to be tested can be uniquely identified.
Correspondingly, the mapping relation between the application identifier to be detected and the atomic environment identifier corresponding to the application identifier is prestored in the application environment mapping table. The application environment mapping table may be created in advance by the user, or may be dynamically created during the test process of each application to be tested. Under the condition of dynamic creation, when an application to be tested is tested for the first time, a corresponding atomic environment identifier cannot be queried in an application environment mapping table, so that a corresponding atomic environment and an identifier thereof need to be temporarily created; when the application to be tested is tested again, the corresponding atomic environment identifier can be quickly obtained according to the application environment mapping table.
Step S120: acquiring an image file set corresponding to the atomic environment identifier from an image data warehouse, carrying out instantiation processing on each image file contained in the image file set, generating a test environment corresponding to the application identifier to be tested according to an instantiation result, and deploying the application to be tested into the test environment.
The mirror image data warehouse is used for storing mirror image file sets corresponding to the atomic environment identifiers. One atomic environment identifier corresponds to one atomic environment. An atomic environment is a complete set of software environment information used to implement software testing. For example, an atomic environment refers to: the external data, message middleware, database and snapshot information such as the data state of the database, etc. on which a certain software version depends are combined together to be called an atomic environment. It follows that the atomic environment contains all the environmental information that is relied upon during the test. The image file set corresponding to the atomic environment identifier of one atomic environment contains a plurality of image files, each image file corresponds to a different data item in the atomic environment, for example, the image files contained in the image file set include: an image file corresponding to external data, an image file corresponding to message middleware, an image file corresponding to a data state of a database, and the like.
Therefore, the image file set corresponding to the atomic environment identifier of one atomic environment comprises a plurality of image files for representing the omnibearing feature of the corresponding atomic environment. However, since the image files are static files, in order to implement the test process, instantiation processing is required for each image file, so that a test environment corresponding to the identifier of the application to be tested is generated according to the instantiation result, so that the application to be tested is deployed in the test environment. The process of the instantiation process may be implemented in a container manner or a virtual machine manner, so long as a static file can be deployed in a dynamic process manner.
In a word, this step aims at setting up the test environment fast through mirror image data warehouse, because all kinds of static information that test environment needs have all been stored through the form of mirror image file, therefore can promote the efficiency of setting up of test environment.
Step S130: and acquiring test input data corresponding to the application identifier to be tested from the data simulation application, and testing the application to be tested according to the test input data to obtain a test result.
The data simulation application is an application service for simulating an external application on which an application to be tested depends. Because the application to be tested may need to receive the request data or the response data from the external application in the test process, in this embodiment, the external application is simulated to send the required test input data to the application to be tested through the data simulation application, thereby implementing the test automation process.
Therefore, in the mode, on one hand, the mapping relation between the application identifier to be tested and the atomic environment identifier corresponding to the application identifier is stored in advance through the application environment mapping table, and the image file set related to the atomic environment corresponding to the original environment identifier is stored in the image data warehouse, so that the test environment corresponding to the atomic environment is quickly generated according to the image file set, the generation efficiency of the test environment is improved, the atomic environment for generating the test environment can be reused for multiple times, and the defect that the test environment needs to be manually built for each test is avoided. On the other hand, by means of the data simulation application, the external application relied on in the test process can be simulated, so that test input data required in the test process is provided for the application to be tested, and the test process can be automatically realized.
Various modifications and alterations to the above described embodiments will be apparent to those skilled in the art, and the specific implementation details of the above described embodiments are not intended to be limiting.
In an alternative implementation, to facilitate testing of various functions, multiple test cases are created in advance and stored in a case database in a unified manner. Each test case is used for realizing different test functions, for example, for the same version of application software, a plurality of test cases corresponding to multiple functions such as a query function, a delete function, a modify function and the like can be respectively set. Each test case corresponds to at least one case file for storing various data required in the test process. Correspondingly, before test input data corresponding to the application identifier to be tested is acquired from the data simulation application, the following operations are further executed: for any test case in the case database, analyzing the case file of the test case, determining test input data corresponding to the test case according to the analysis result, and storing the test input data and the case identification of the corresponding test case in a simulation database corresponding to the data simulation application in an associated manner. Wherein, the test input data refers to: the external data required in the test process of the test case can specifically include: data input into the application to be tested and data sent to the application to be tested. Correspondingly, when test input data corresponding to the application identifier to be tested is obtained from the data simulation application, the target test case corresponding to the test process is specifically required to be obtained from the case database, the case identifier of the target test case is sent to the data simulation application, and the test input data corresponding to the case identifier of the target test case, which is returned by the data simulation application, is obtained. The data simulation application is used for inquiring test input data corresponding to the case identification of the target test case according to the simulation database.
In an alternative implementation, the test input data includes: local input data, and/or external input data. Wherein, the local input data means: the data content of the application to be tested is directly input locally. The external input data means: the data content which is required to be sent to the application to be tested by the external application, such as a request message which is actively sent to the application to be tested by the external application, or a response message which is passively returned to the application to be tested by the external application, and the like.
Correspondingly, when test input data corresponding to the case identifier of the target test case returned by the data simulation application is acquired, the method is specifically realized by the following steps:
and aiming at the local input data, acquiring the local input data corresponding to the use case identifier of the target test case returned by the data simulation application, determining an application input interface corresponding to the local input data in the application to be tested, and inputting the local input data into the application to be tested through the application input interface. The local input data may be expected input data in the current test process, and is specifically determined according to the setting information in the test case.
For external input data, receiving the external input data sent by a data simulation application through a data receiving interface in the application to be tested; the data simulation application is used for determining external input data corresponding to the case identifier of the target test case and an external application corresponding to the external input data, and simulating the external application to send the external input data. When the external application is simulated to send external input data to the application to be tested, on one hand, a data receiving interface for receiving the external input data in the application to be tested needs to be determined, for example, an API function of the data receiving interface is determined, and the purpose of sending the external input data to the application to be tested is achieved by calling the API function of the data receiving interface. On the other hand, an application identifier or a data transmission interface of an external application for transmitting the external input data needs to be determined, and the purpose of simulating the external application to transmit the external input data is achieved by adding the application identifier of the external application to the external input data; or simulating the external application to send the external input data by calling the data sending interface of the external application. In a word, the method aims at flexibly simulating various external applications required in the test process through unified data simulation application, so that various dependency relationships required in the test process can be rapidly realized through the data simulation application without butting various external applications one by one, and further the test efficiency is improved.
In an optional implementation manner, when the preset application environment mapping table is queried to determine the atomic environment identifier corresponding to the application identifier to be tested, the method is specifically implemented by the following steps:
if the atomic environment identifier corresponding to the application identifier to be tested exists in the preset application environment mapping table, the atomic environment corresponding to the application identifier to be tested is proved to be successfully built in advance, and correspondingly, the atomic environment identifier corresponding to the application identifier to be tested is directly obtained from the application environment mapping table.
If the atomic environment identifier corresponding to the application identifier to be tested does not exist in the preset application environment mapping table, it is indicated that the atomic environment corresponding to the application identifier to be tested is not yet built, therefore, the atomic environment identifier corresponding to the application identifier to be tested needs to be generated, the corresponding relation between the application identifier to be tested and the generated atomic environment identifier is stored in the application environment mapping table, and the image file set corresponding to the atomic environment identifier is stored in the image data warehouse.
Specifically, before generating an atomic environment identifier corresponding to an application identifier to be tested, firstly, determining a target database, a message middleware and an associated application corresponding to the application identifier to be tested, namely: determining external dependency information associated with the application identification to be tested; then, creating an atomic environment containing a target database, message middleware and associated applications; wherein the atomic environment corresponds to the atomic environment identifier described above. And storing in the mirrored data repository a set of mirrored files corresponding to the atomic environment identifier by: first, a database image file corresponding to a target database, a message image file corresponding to a message middleware, and an associated application image file corresponding to an associated application are acquired. The mirror image file is used for storing a copy of the current state so as to realize the functions of data backup and recovery. And then obtaining an image file set corresponding to the atomic environment identifier according to the database image file, the message image file and the associated application image file.
In an optional implementation manner, when each image file contained in the image file set is subjected to instantiation processing, each image file contained in the image file set is specifically sent to an environment deployment platform; and respectively downloading each image file into a container corresponding to the image file through the environment deployment platform, and realizing the instantiation processing of each image file through the container. The container is used for realizing the mirror image example, the mirror image file is a static file, and the container is a dynamic process, so that the instantiation processing of the mirror image file can be quickly realized by means of container technology. In addition, in the embodiment, the instantiation deployment of the mirror image file is realized through the unified environment deployment platform, so that the processing efficiency can be improved.
In yet another alternative implementation manner, when the application to be tested is tested according to the test input data, a test result is obtained, specifically by the following manner: firstly, obtaining a target test result corresponding to a target test case from a case database; the target test result is also called an expected output result, and corresponds to expected input data stored in the test case, and represents a result which theoretically should occur when the expected input data is input. And then, acquiring an actual test result obtained by the application to be tested according to the test input data. The actual test result is the test result actually obtained in the test process. Finally, matching the actual test result with the target test result; if the actual test result is matched with the target test result, the normal function of the application to be tested is indicated, and the test result is determined to be successful; and if the actual test result is not matched with the target test result, indicating that the function of the application to be tested is abnormal, and determining that the test result is failure.
Optionally, the application identifier to be tested includes: application type identification and application version identification. The application type identifier may further include various information such as an application name, an application ID, and an application type. The application version identifier is used for representing the version iteration condition of the application to be tested. The application environment mapping table is used for storing the corresponding relation between each application identifier to be tested and the atomic environment identifiers, wherein any atomic environment identifier corresponds to at least one application identifier to be tested. For example, one atomic environment identifier may correspond to a plurality of application identifiers under test, while one application identifier under test typically corresponds to only one atomic environment identifier.
In summary, in the foregoing embodiment, on the one hand, the mapping relationship between the application identifier to be tested and the atomic environment identifier corresponding to the application identifier is stored in advance through the application environment mapping table, and the image file set related to the atomic environment corresponding to the original environment identifier is stored in the image data warehouse, so that the test environment corresponding to the atomic environment is quickly generated according to the image file set, thereby improving the generation efficiency of the test environment, and the atomic environment for generating the test environment can be reused for multiple times, so that the defect that the test environment needs to be manually built for each test is avoided. On the other hand, by means of the data simulation application, the external application relied on in the test process can be simulated, so that test input data required in the test process is provided for the application to be tested, and the test process can be automatically realized. In this embodiment, various external applications required in the testing process are flexibly simulated through unified data simulation application, so that each external application does not need to be docked one by one, each dependency relationship required in the testing process can be quickly realized through the data simulation application, and testing efficiency is further improved. In addition, the instantiation deployment of the mirror image file is realized through the unified environment deployment platform, so that the processing efficiency can be improved.
For easy understanding, specific implementation details of the application test method in the present application will be described in detail below by taking this example as an example:
the automatic test is an important function in the modern software engineering implementation, can effectively save test resources and improve test capability, however, the implementation of the automatic test depends on long-term tracking, effective interface maintenance and frequent updating of scripts, and even if some automatic test cases have higher requirements on the data scene, so that the effective automatic test cannot be performed, further sloughing is a manual test depending on testers, the efficiency is low, and the possibility of errors exists, and version management also becomes complicated to a certain extent. With the development of technology, hardware storage is now becoming easier, but through cloud service and container image file management technologies, snapshot management can be effectively performed by using a small amount of disks, external resources, middleware and the like on which test scenes depend, and then the current database scene snapshot, message middleware scene snapshot and current version information can be rapidly stored. Correspondingly, in the example, the aim of improving the automatic testing efficiency and version management capability is fulfilled by constructing an automatic testing system based on cloud services and container image files.
First, explanation is made with respect to some basic concepts mentioned in this example:
cloud service: using the container approach, individual deployment examples are managed quickly, and each container's snapshot may generate a corresponding image file, each with its unique code.
Simulation data: any system has data input and output, and the external data simulation service can simulate the input of an external system, so that the external dependence of the whole test environment is reduced.
Test cases: each test case comprises definition of corresponding atomic environment (corresponding mirror image coding information), corresponding simulation data, corresponding test input data and a script of a database verification test result.
Atomic environment: some version-dependent external data, message middleware, database, and snapshot information such as data states of the database are combined together to be called an atomic environment.
External simulation service: under modern software architecture, many single services are very complex in external dependence, and if the whole is difficult to mirror package or recover, unified simulation is performed on specific return information or input required to be performed in the whole data flow by the external service, and the simulation service is the external simulation service.
Expected input data: each test case requires a specific input called expected input data.
Expected outcome data: each test case requires a particular output result, which in this example includes output data for the system, database data for system changes, a particular critical log of system outputs, etc.
Fig. 2 shows a system configuration diagram of the automated test system in this specific example, and as shown in fig. 2, the automated test system includes: the system comprises a mirror image data warehouse, an automatic deployment platform, a cloud service platform, a data simulation application, a use case management platform, a use case execution platform and an execution result tracking module. The mirror image data warehouse is used for storing mirror image file sets corresponding to the atomic environment identifiers. The automatic deployment platform is used for deploying corresponding test environments according to the mirror image file set in the mirror image data warehouse. The cloud service platform is also called a test platform and is used for being linked with external applications such as a mirror image data warehouse, an automatic deployment platform, a data simulation application and the like to jointly realize a test process. The case management platform is used for uniformly managing each test case, and the case execution platform is used for realizing the execution of the test cases, and can integrate the cloud service platform, the case management platform and the case execution platform together and be collectively called as a test platform when in specific implementation. In addition, the data simulation application is also called an external simulation service, and is used for simulating an external application associated with the test process, so that the external application is replaced by returning required data information to the test platform.
The example specifically comprises two parts of use case creation and use case test, and the following description is respectively carried out for each part:
use case creation flow:
first, a user operates the case management platform, and calls the cloud service platform through the case management platform to create a dependent database, message middleware, and external simulation service (i.e., data simulation application). Alternatively, the replication may be performed according to an atomic environment created previously, and it may be decided whether to modify the replicated atomic environment as needed.
Then, after the creation of the atomic environment is completed, a save operation is performed to save the created atomic environment to the mirror data repository. Next, after the test is passed, performing environment confirmation, and in the use case management platform, recording the unique number of the current atomic environment and the unique code (image id) of the corresponding mirror image as the atomic environment for subsequent automatic verification, and simultaneously recording the software version number after the version test is passed for subsequent tracking identification. For example, if the corresponding scene problem needs to be reproduced, the matching image id can be found directly according to the recorded software version number, and the then-current software and hardware environment can be quickly built for secondary test verification.
The use case test flow is as follows:
first, a user operates an example management platform, selects an image id set corresponding to an atomic environment, and selects a required software version number. Then, the use case management platform calls the cloud service platform to deploy the atomic environment.
Then, the use case management platform calls an automatic deployment platform, deploys software to be tested through the automatic deployment platform, and deploys the software to be tested through one step more than an atomic environment, because the test software cannot store image files in advance, the software to be tested needs to be constructed and packaged in advance based on branch software with version numbers, then the software to be tested is packaged into a new image file again based on a packaged deployment program by using a basic image file, then the new image file is downloaded into a corresponding container, and the image in the container is started, so that the deployment can be completed. The specific reasons are as follows: the image file is relatively large and, from a storage cost standpoint, it is not necessary to store the file directly since it can be reconstructed from a version of the software code.
Then, the case management platform reads the case to be tested, and if no case exists, new construction is carried out. The use case management platform gradually inputs external simulation data, expected input data and expected output results according to the use case list, and the process is actually a process for perfecting the use cases, and a complete use case at least comprises the external simulation data, the expected input data and the expected output results. And storing complete input and output to form an effective automatic test case, wherein external simulation data is the output of an external system on which the simulated application to be tested depends.
And finally, the use case management platform detects that the execution result passes, the personnel to be tested manually verifies and records the test result, and whether the verification scene test passes or not can be judged according to the matching of the result when the automatic test is performed next time.
After the test is confirmed to pass, the case management platform automatically records the test result, the corresponding atomic environment and the software version number corresponding to the case. It should be noted that, the atomic environments may correspond to a plurality of software version numbers, but one software version number may only correspond to one atomic environment, if it is found that the software version number is already related to a certain atomic environment, the latest atomic environment is used for replacing, and the corresponding test example will be reserved, that is, the external simulation data, the expected input data, and the expected output result will be reserved and related to the new atomic environment.
In summary, the functions carried by each service in fig. 2 are as follows:
automated deployment platform: and the software to be tested is pulled and packaged into the corresponding mirror image for deployment.
Mirror data warehouse (Image Repository): is responsible for storing the corresponding images.
Cloud service platform: and the system is responsible for specific automation operations of pulling, storing and deploying the images, and provides specific environment resources which need to be deployed for each image.
External simulation service (i.e., data simulation application): and managing external analog data and managing interface definition of data thereof, wherein the interface definition specifically needs pushing and investigation.
And the use case management platform: and managing the atomic environment, namely the corresponding mirror image, the deployment environment, the dependent data simulation version and the software version to be tested, and testing the tested data verification script.
Use case execution platform: and automatically pulling the mirror image of each use case, deploying the mirror image to a corresponding environment, pushing dependent data, then performing data script verification, and providing an adding, deleting and checking interface of corresponding operation.
And an execution result tracking module: a service is provided for executing the data validation script.
In the prior art, only test cases can be unilaterally managed, and the existing test scenes often depend on the input of external data and the state of internal data, so that a tester is required to manually construct a proper scene in many times, and manpower is wasted very much. Moreover, the prior art cannot actively use upstream analog data.
In summary, by the way in this example, at least the following beneficial effects can be achieved:
first, the corresponding test environment, data, and external dependencies are quickly generated. And secondly, the environment, data and external dependence corresponding to the test scene can be repeatedly used, so that the cost of the environment re-establishment of the tester is reduced. And the external simulation data of the software version, the external dependence data and the internal dependence data and the test cases are fused to form an integral automatic test scheme, so that the software version can be conveniently tracked. In addition, each atomic environment may be associated with a plurality of different software versions until the atomic environment needs to be updated and changed. Finally, the method can realize execution result tracking: by using the execution result tracking of the system, the judgment and verification of the data state of the database can be automated, and the abnormal information in the log can be quickly tracked and counted, so that the energy of a tester is greatly saved.
Fig. 3 shows a block diagram of an application testing apparatus provided by an embodiment of the present disclosure.
Referring to fig. 3, an embodiment of the present disclosure provides an application testing apparatus 30, the application testing apparatus 30 including:
the acquiring module 31 is adapted to acquire an application identifier to be tested contained in an application test request, query a preset application environment mapping table, and determine an atomic environment identifier corresponding to the application identifier to be tested;
the deployment module 32 is adapted to acquire an image file set corresponding to the atomic environment identifier from an image data warehouse, perform instantiation processing on each image file contained in the image file set, generate a test environment corresponding to the application identifier to be tested according to an instantiation result, and deploy the application to be tested into the test environment;
the test module 33 is adapted to obtain test input data corresponding to the application identifier to be tested from the data simulation application, and test the application to be tested according to the test input data to obtain a test result.
In an alternative implementation, the test module is further adapted to:
analyzing a case file of a test case aiming at any test case in a case database, determining test input data corresponding to the test case according to an analysis result, and storing the test input data and a case identifier of the corresponding test case in a simulation database corresponding to the data simulation application in an associated manner;
The test module is specifically adapted to:
acquiring a target test case corresponding to the current test process from the case database;
the case identification of the target test case is sent to the data simulation application, and test input data corresponding to the case identification of the target test case, which is returned by the data simulation application, is obtained; the test input data are data which are queried by the data simulation application according to the simulation database and correspond to the case identification of the target test case.
In an alternative implementation, the test input data includes: local input data, and/or external input data;
the test module is specifically adapted to:
acquiring local input data corresponding to the use case identifier of the target test case returned by the data simulation application, determining an application input interface corresponding to the local input data in the application to be tested, and inputting the local input data into the application to be tested through the application input interface; and/or the number of the groups of groups,
receiving external input data sent by the data simulation application through a data receiving interface in the application to be tested; the data simulation application is used for determining external input data corresponding to the case identifier of the target test case and an external application corresponding to the external input data, and simulating the external application to send the external input data.
In an alternative implementation, the obtaining module is specifically adapted to:
if the atomic environment identifier corresponding to the application identifier to be tested exists in the preset application environment mapping table, acquiring the atomic environment identifier corresponding to the application identifier to be tested from the application environment mapping table;
if the atomic environment identifier corresponding to the application identifier to be detected does not exist in the preset application environment mapping table, generating an atomic environment identifier corresponding to the application identifier to be detected, storing a corresponding relation between the application identifier to be detected and the generated atomic environment identifier in the application environment mapping table, and storing a mirror image file set corresponding to the atomic environment identifier in the mirror image data warehouse.
In an alternative implementation, the acquisition module is further adapted to:
determining a target database, message middleware and associated applications corresponding to the application identifier to be tested;
creating an atomic environment containing the target database, message middleware and associated applications; wherein the atomic environment corresponds to the atomic environment identifier;
acquiring a database image file corresponding to the target database, a message image file corresponding to the message middleware and an associated application image file corresponding to the associated application;
And obtaining the image file set corresponding to the atomic environment identifier according to the database image file, the message image file and the associated application image file.
In an alternative implementation, the test module is specifically adapted to:
obtaining a target test result corresponding to the target test case from the case database;
matching an actual test result with the target test result, wherein the actual test result is obtained by testing the application to be tested according to the test input data;
if the actual test result is matched with the target test result, determining that the test result is successful; and if the actual test result is not matched with the target test result, determining that the test result is failed.
In an alternative implementation, the deployment module is specifically adapted to:
sending each image file contained in the image file set to an environment deployment platform;
and respectively downloading each image file into a container corresponding to the image file through the environment deployment platform, and realizing the instantiation processing of each image file through the container.
In an alternative implementation, the application identifier to be tested includes: an application type identifier and an application version identifier; the application environment mapping table is used for storing the corresponding relation between each application identifier to be tested and the atomic environment identifier, wherein any atomic environment identifier corresponds to at least one application identifier to be tested.
Fig. 4 is a block diagram of an electronic device according to an embodiment of the present disclosure.
An embodiment of the present disclosure provides an electronic device with reference to fig. 4, including: at least one processor 501; at least one memory 502, and one or more I/O interfaces 503, coupled between the processor 501 and the memory 502; wherein the memory 502 stores one or more computer programs executable by the at least one processor 501, the one or more computer programs being executed by the at least one processor 501 to perform the application testing method described above.
The disclosed embodiments also provide a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor/processing core, implements the application testing method described above. The computer readable storage medium may be a volatile or nonvolatile computer readable storage medium.
Embodiments of the present disclosure also provide a computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an electronic device, performs the above application test method.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between the functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer-readable storage media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable program instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, random Access Memory (RAM), read Only Memory (ROM), erasable Programmable Read Only Memory (EPROM), static Random Access Memory (SRAM), flash memory or other memory technology, portable compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical disc storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and may include any information delivery media.
The computer readable program instructions described herein may be downloaded from a computer readable storage medium to a respective computing/processing device or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers and/or edge servers. The network interface card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing/processing device.
Computer program instructions for performing the operations of the present disclosure can be assembly instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, c++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present disclosure are implemented by personalizing electronic circuitry, such as programmable logic circuitry, field Programmable Gate Arrays (FPGAs), or Programmable Logic Arrays (PLAs), with state information of computer readable program instructions, which can execute the computer readable program instructions.
The computer program product described herein may be embodied in hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is embodied as a computer storage medium, and in another alternative embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), or the like.
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium having the instructions stored therein includes an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted in a generic and descriptive sense only and not for purpose of limitation. In some instances, it will be apparent to one skilled in the art that features, characteristics, and/or elements described in connection with a particular embodiment may be used alone or in combination with other embodiments unless explicitly stated otherwise. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the disclosure as set forth in the appended claims.

Claims (10)

1. An application testing method, comprising:
acquiring an application identifier to be tested contained in an application test request, inquiring a preset application environment mapping table, and determining an atomic environment identifier corresponding to the application identifier to be tested;
acquiring an image file set corresponding to the atomic environment identifier from an image data warehouse, carrying out instantiation processing on each image file contained in the image file set, generating a test environment corresponding to the application identifier to be tested according to an instantiation result, and deploying the application to be tested into the test environment;
And acquiring test input data corresponding to the application identifier to be tested from the data simulation application, and testing the application to be tested according to the test input data to obtain a test result.
2. The method of claim 1, further comprising, prior to obtaining test input data corresponding to the application identifier under test from a data simulation application:
analyzing a case file of a test case aiming at any test case in a case database, determining test input data corresponding to the test case according to an analysis result, and storing the test input data and a case identifier of the corresponding test case in a simulation database corresponding to the data simulation application in an associated manner;
the step of obtaining the test input data corresponding to the application identifier to be tested from the data simulation application comprises the following steps:
acquiring a target test case corresponding to the current test process from the case database;
and sending the case identifier of the target test case to the data simulation application, and acquiring test input data corresponding to the case identifier of the target test case returned by the data simulation application, wherein the test input data is data corresponding to the case identifier of the target test case, which is inquired by the data simulation application according to the simulation database.
3. The method of claim 2, wherein the test input data comprises: local input data, and/or external input data;
the step of obtaining the test input data corresponding to the case identifier of the target test case returned by the data simulation application includes: acquiring local input data corresponding to the case identifier of the target test case returned by the data simulation application; and/or the number of the groups of groups,
receiving external input data sent by the data simulation application through a data receiving interface in the application to be tested; the data simulation application is used for determining external input data corresponding to the case identifier of the target test case and an external application corresponding to the external input data, and simulating the external application to send the external input data.
4. The method of claim 1, wherein the querying a preset application environment mapping table, and determining an atomic environment identifier corresponding to the application identifier to be tested comprises:
if the atomic environment identifier corresponding to the application identifier to be tested exists in the preset application environment mapping table, acquiring the atomic environment identifier corresponding to the application identifier to be tested from the application environment mapping table;
And if the atomic environment identifier corresponding to the application identifier to be detected does not exist in the preset application environment mapping table, generating the atomic environment identifier corresponding to the application identifier to be detected.
5. The method of claim 4, further comprising, prior to generating the atomic environment identifier corresponding to the application identifier under test:
determining a target database, message middleware and associated applications corresponding to the application identifier to be tested;
creating an atomic environment containing the target database, the message middleware and the associated application; wherein the atomic environment corresponds to the atomic environment identifier;
the storing, in the image data repository, an image file set corresponding to the atomic environment identifier includes:
acquiring a database image file corresponding to the target database, a message image file corresponding to the message middleware and an associated application image file corresponding to the associated application;
and determining to obtain the image file set corresponding to the atomic environment identifier according to the database image file, the message image file and the associated application image file.
6. The method according to claim 2, wherein the testing the application under test according to the test input data, to obtain a test result, comprises:
obtaining a target test result corresponding to the target test case from the case database;
matching an actual test result with the target test result, wherein the actual test result is obtained by testing the application to be tested according to the test input data;
if the actual test result is matched with the target test result, determining that the test result is successful;
and if the actual test result is not matched with the target test result, determining that the test result is failed.
7. The method of claim 1, wherein instantiating each image file included in the set of image files comprises:
sending each image file contained in the image file set to an environment deployment platform;
and respectively downloading each image file into a container corresponding to the image file through the environment deployment platform, and realizing the instantiation processing of each image file through the container.
8. An application testing apparatus, comprising:
the acquisition module is suitable for acquiring an application identifier to be tested contained in an application test request, inquiring a preset application environment mapping table and determining an atomic environment identifier corresponding to the application identifier to be tested;
the deployment module is suitable for acquiring an image file set corresponding to the atomic environment identifier from an image data warehouse, carrying out instantiation processing on each image file contained in the image file set, generating a test environment corresponding to the application identifier to be tested according to an instantiation result, and deploying the application to be tested into the test environment;
the test module is suitable for acquiring test input data corresponding to the application identifier to be tested from the data simulation application, and testing the application to be tested according to the test input data to obtain a test result.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores one or more computer programs executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the method according to any of claims 1-7.
CN202310787446.2A 2023-06-29 2023-06-29 Application testing method and device, electronic equipment and readable storage medium Pending CN117493159A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310787446.2A CN117493159A (en) 2023-06-29 2023-06-29 Application testing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310787446.2A CN117493159A (en) 2023-06-29 2023-06-29 Application testing method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117493159A true CN117493159A (en) 2024-02-02

Family

ID=89669646

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310787446.2A Pending CN117493159A (en) 2023-06-29 2023-06-29 Application testing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117493159A (en)

Similar Documents

Publication Publication Date Title
US11144439B2 (en) Emulation-based testing of a microservices architecture
CN108964968B (en) Service access management method and system in container cloud environment
CN115039084A (en) Unit testing of components of a dataflow graph
CN113434158A (en) User-defined management method, device, equipment and medium for big data component
WO2015096661A1 (en) Project creation method and device based on configuration system, project test method and device, and background test method and device for configuration system
US20210048999A1 (en) Automated generation of status chains for software updates
CN109739704A (en) A kind of interface test method, server-side and computer readable storage medium
CN112702195A (en) Gateway configuration method, electronic device and computer readable storage medium
CN116257438A (en) Updating method of interface test case and related equipment
CN115658496A (en) Extensible Web automatic test method, system, equipment and storage medium
CN112286543B (en) Application service deployment method and device
US6980916B1 (en) Mechanism for graphical test exclusion
CN110147313B (en) Log output method and device
CN114500348B (en) CDN gateway testing method and system
CN117493159A (en) Application testing method and device, electronic equipment and readable storage medium
CN110750310A (en) Binary and source code switching method based on IOS system componentization development
CN109814911A (en) Method, apparatus, computer equipment and storage medium for Manage Scripts program
CN114115982A (en) Code issuing method, device, equipment and storage medium
CN111400243B (en) Development management system based on pipeline service and file storage method and device
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
CN114416163A (en) Product management method, system, storage medium and electronic equipment
US20160275002A1 (en) Image capture in application lifecycle management for documentation and support
CN112667491A (en) Function test method and device of virtual machine
CN112306723A (en) Operation information acquisition method and device applied to small program
CN111198721A (en) Application program running method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination