CN116431499A - Automatic test method and device, electronic equipment and storage medium - Google Patents

Automatic test method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116431499A
CN116431499A CN202310398775.8A CN202310398775A CN116431499A CN 116431499 A CN116431499 A CN 116431499A CN 202310398775 A CN202310398775 A CN 202310398775A CN 116431499 A CN116431499 A CN 116431499A
Authority
CN
China
Prior art keywords
test
target
case
instance
information
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
CN202310398775.8A
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.)
Dawning Network Technology Co ltd
Original Assignee
Dawning Network Technology 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 Dawning Network Technology Co ltd filed Critical Dawning Network Technology Co ltd
Priority to CN202310398775.8A priority Critical patent/CN116431499A/en
Publication of CN116431499A publication Critical patent/CN116431499A/en
Pending legal-status Critical Current

Links

Images

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/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3696Methods or tools to render software testable
    • 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)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention discloses an automatic test method, an automatic test device, electronic equipment and a storage medium, wherein the automatic test method comprises the following steps: responding to the test item information configured by a target user through the automatic test platform, and determining idle test resources matched with the test item information according to a test instance state table; generating a target test instance matched with a target user according to the test item information and the idle test resources, and operating the target test instance; and acquiring target operation information corresponding to the target test case in real time, storing the target operation information into a test case state table, and removing the target operation information from the test case state table after the completion of the operation of the target test case is detected. The technical scheme of the embodiment of the invention can reduce the maintenance cost of the automatic test platform and realize unified scheduling of the test resources occupied by a plurality of test projects.

Description

Automatic test method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to an automatic testing method, an automatic testing device, an electronic device, and a storage medium.
Background
With diversity and complexity of network devices, corresponding test demands are increasing, and an automatic test platform is used as a tool for satisfying multi-user parallel test and is widely applied to the fields of device test and software test.
In the prior art, there are two ways to perform a test by an automatic test platform: the user deploys the automatic test platform on a local computer or a server, and the test process is executed through the locally deployed automatic test platform: or the environment and the resources on which the automatic test platform depends are deployed on one server, different users can copy the codes or tools of the automatic test platform through clients, and then the server is remotely connected and then the test process is independently executed.
However, the existing approaches have the following drawbacks: the codes of the automatic test platform are required to be copied by a plurality of users, extra maintenance cost is introduced when the codes are updated, and the process of submitting the test cases by the users through the local server is troublesome and is not beneficial to maintenance; secondly, the test resources called in the automatic test process are complex, and if a certain test resource is called by different test projects at the same time, corresponding users are required to coordinate the resource occupation condition, so that the communication cost among the users is increased.
Disclosure of Invention
The invention provides an automatic test method, an automatic test device, electronic equipment and a storage medium, which can reduce the maintenance cost of an automatic test platform and realize unified scheduling of test resources occupied by a plurality of test projects.
According to an aspect of the present invention, there is provided an automatic test method applied to a unified automatic test platform, including:
responding to test item information configured by a target user through the automatic test platform, and determining idle test resources matched with the test item information according to a pre-generated test instance state table;
wherein, the test case state table stores operation information corresponding to a plurality of test cases respectively;
generating a target test instance matched with a target user according to the test item information and the idle test resources, and operating the target test instance;
and acquiring target operation information corresponding to a target test case in real time, storing the target operation information into a test case state table, and removing the target operation information from the test case state table after the completion of the operation of the target test case is detected.
Optionally, responding to the test item information configured by the target user through the automatic test platform comprises:
Responding to a login request triggered by a target user through the automatic test platform, and checking the identity information of the target user according to the login request;
if the identity information of the target user is successfully checked, a plurality of alternative test cases matched with the identity information are provided for the target user;
and responding to a target test case selected by a target user from a plurality of alternative test cases and resource information configured by the target user through the automatic test platform, and taking the target test case and the resource information as test item information.
Optionally, the test item information includes a test mode; the running the target test case comprises the following steps:
and operating the target test case according to the test mode included in the test item information.
Optionally, the running the target test case according to the test mode included in the test item information includes:
if the test mode is a debug mode, acquiring a target case code corresponding to a target test case from a preset test case library;
storing the target use case code into a cache directory corresponding to the target user, so that the target user modifies the target use case code in the cache directory;
And updating the target test case according to the modified target case code, and running the updated target test case.
Optionally, the target operation information includes a test identifier, a process identifier and a test resource corresponding to the target test instance;
after storing the target operation information in the test case state table, the method further comprises:
if the abnormal end of the current test process corresponding to the target test instance is detected, eliminating the test resources occupied by the current test process in the test instance state table according to the test identifier corresponding to the target test instance and the process identifier of the current test process.
Optionally, the target operation information further includes test item information;
after eliminating the test resources occupied by the current test process in the test instance state table according to the test identifier corresponding to the target test instance and the process identifier of the current test process, the method further comprises the following steps:
detecting whether the abnormally-ended test process meets the re-operation condition in real time;
if yes, the test process is restarted according to the test item information and the idle test resources.
According to another aspect of the present invention, there is provided an automatic test equipment for use in a unified automatic test platform, the equipment comprising:
the resource determining module is used for responding to the test item information configured by the target user through the automatic test platform and determining idle test resources matched with the test item information according to a pre-generated test instance state table;
wherein, the test case state table stores operation information corresponding to a plurality of test cases respectively;
the instance running module is used for generating a target test instance matched with a target user according to the test item information and the idle test resources and running the target test instance;
the information processing module is used for acquiring target operation information corresponding to a target test case in real time, storing the target operation information into a test case state table, and eliminating the target operation information in the test case state table after the completion of the operation of the target test case is detected.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
The memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the automatic test method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute the automatic test method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the automatic test method according to any of the embodiments of the present invention.
According to the technical scheme provided by the embodiment of the invention, by responding to the test item information configured by the target user, determining idle test resources according to the test item state table, generating the target test instance according to the test item information and the idle test resources, operating the target test instance, acquiring the target operation information corresponding to the target test instance in real time, storing the target operation information into the test instance state table, and removing the target operation information in the test instance state table after the completion of the operation of the target test instance is detected, the maintenance cost of the automatic test platform can be reduced, and unified scheduling of the test resources occupied by a plurality of test items is realized; technical leakage caused by the fact that all test cases are opened to all users can be avoided, a large number of test projects can be managed conveniently, and the safety of an automatic test process is improved; the storage space of the test case state table can be saved, and the space utilization rate of the test case state table is improved; the testing requirements of users are fully met, and the flexibility of the automatic testing process and the degree of freedom of the testing requirements of the users are improved; the complexity of the project debugging process can be reduced, and the debugging efficiency is improved; the integrity of the automatic test process is ensured, and the effectiveness and reliability of the automatic test result are improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an automatic test method provided according to an embodiment of the present invention;
FIG. 2 is a flow chart of another automatic test method provided in accordance with an embodiment of the present invention;
FIG. 3 is a flow chart of another automatic test method provided in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of an automatic test equipment according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing an automatic test method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of an automatic test method provided in an embodiment of the present invention, where the embodiment is applicable to a case of automatically testing network devices or software, the method may be performed by an automatic test device, where the automatic test device may be implemented in the form of hardware and/or software, and the automatic test device may be configured in a unified automatic test platform, and the automatic test platform may be deployed in an electronic device (for example, a terminal or a server) with a data processing function. As shown in fig. 1, the method includes:
step 110, responding to the test item information configured by the target user through the automatic test platform, and determining idle test resources matched with the test item information according to a pre-generated test instance state table.
In this embodiment, the automatic test platform may be a software platform with a relevant test environment for satisfying the test requirement of multiple users on network devices or software. The target user can be a user triggering a test request for the automatic test platform at the current time.
In a specific embodiment, before responding to the test item information configured by the target user through the automatic test platform, different users can be registered in advance through the automatic test platform, and identity information (such as login account numbers and passwords and the like) of each user for the automatic test platform is stored.
Optionally, if the target user has a test requirement, the target user may log in to the automatic test platform according to the preset identity information, and then trigger the test request. After detecting that the target user triggers a test request through the automatic test platform, a preset visual interface can be provided for the target user, so that the target user configures test item information through the visual interface. Specifically, the test item information may include the name of the item to be tested, a logic script required in the test process, and an execution node involved in the test process.
In this step, after receiving the test item information configured by the target user, the test item information may be stored in a cache directory corresponding to the target user, so as to obtain the test item information at any time according to the cache directory. After the test item information configured by the target user is obtained, the target test resource matched with the test item information can be determined first, then the resource occupation information matched with the target test resource is queried in the test case state table, and finally the idle test resource is determined in the resource library according to the resource occupation information.
In a specific embodiment, the test case state table stores operation information corresponding to each of the plurality of test cases, where the operation information may include test resources occupied by each test case in a test process. The resource library can comprise various test resources involved in the network equipment test or software test process, such as a server, auxiliary test software, a test instrument and meter and the like.
And 120, generating a target test instance matched with a target user according to the test item information and the idle test resources, and operating the target test instance.
In this embodiment, optionally, the test item information may be combined with an idle test resource to obtain a target test case matched with the target user, and then the idle test resource is called to run the target test case.
130, acquiring target operation information corresponding to a target test case in real time, storing the target operation information into a test case state table, and rejecting the target operation information in the test case state table after the completion of the operation of the target test case is detected.
In this embodiment, in the process of running the target test case, a preset monitoring thread may be invoked to obtain running information (i.e., target running information) of the target test case in real time, and then the target running information is stored in a test case state table. Optionally, the test case state table may include a case identifier corresponding to the target test case, and after the target running information is obtained, the target running information may be stored in a directory corresponding to the case identifier. The target operation information may include the operation condition (such as operation result, operation status identifier, and test resources occupied by the target test case) of the target test case.
After the target operation information is stored in the test case state table, whether the target test case is operated is judged according to the target operation information in the test case state table, and if yes, the target operation information is removed from the test case state table.
In this embodiment, if multiple users have test requirements at the same time, relevant test item information can be configured on a unified automatic test platform respectively, and each test instance is operated by the unified automatic test platform, without the need for the users to copy codes of the automatic test platform, thereby avoiding additional maintenance cost introduced in the code updating process; secondly, idle resource information is determined through a pre-generated test case state table, and target operation information is stored in the test case state table, so that unified scheduling of test resources occupied by a plurality of test projects can be realized, and the coordination of users on resource occupation conditions is not required, thereby reducing the communication cost among users; finally, if the completion of the operation of the target test case is detected, the target operation information is removed from the test case state table, so that on one hand, the test resources can be released in time, on the other hand, the storage space of the test case state table can be saved, and the space utilization rate of the test case state table is improved.
In this embodiment, by responding to the test item information configured by the target user through the automatic test platform, determining the idle test resources matched with the test item information according to the test item information and the idle test resources, generating the target test instance matched with the target user according to the test item information and the idle test resources, operating the target test instance, acquiring the target operation information corresponding to the target test instance in real time, storing the target operation information into the test instance state table, and removing the target operation information from the test instance state table after the completion of the operation of the target test instance is detected, the maintenance cost of the automatic test platform can be reduced, and unified scheduling of the test resources occupied by a plurality of test items is realized.
Fig. 2 is a flowchart of another automatic testing method according to an embodiment of the present invention, as shown in fig. 2, the method includes:
step 210, responding to a login request triggered by a target user through the automatic test platform, and checking the identity information of the target user according to the login request.
In this embodiment, if the target user has a test requirement, the automatic test platform may be logged in, and after detecting that the target user triggers a login request through the automatic test platform, identity information (such as a login account number and a password) of the target user may be obtained.
In this step, after the identity information of the target user in the current login process is obtained, the current identity information of the target user may be compared with each standard identity information stored in the database. If the standard identity information consistent with the current identity information exists in the database, the successful verification of the identity information of the target user can be determined; otherwise, if the standard identity information consistent with the current identity information does not exist in the database, the identity information verification failure of the target user can be determined.
Step 220, if the identity information of the target user is successfully verified, providing a plurality of alternative test cases matched with the identity information for the target user.
In this embodiment, before responding to a login request triggered by a target user through an automatic test platform, multiple users may be registered in advance through the automatic test platform, and corresponding usage rights may be allocated to different users according to identity information of the different users. The use permission is used for restricting the test cases which can be checked by the user.
In the step, if the identity information of the target user is successfully checked, the use permission corresponding to the target user can be determined according to the identity information of the target user, and a plurality of alternative test cases viewable by the target user can be displayed to the target user through a visual interface according to the use permission.
And 230, responding to a target test case selected by a target user from a plurality of alternative test cases and resource information configured by the target user through the automatic test platform, and taking the target test case and the resource information as test item information.
In this embodiment, the target user may select a test case related to the test item (i.e., a target test case) from a plurality of candidate test cases, and configure specific resource information (e.g., resource type, name, model, etc.).
After receiving the target test case and the resource information, the target test case and the resource information can be used as test item information corresponding to a target user.
The method has the advantages that the corresponding use permission is distributed to different users, a plurality of alternative test cases matched with the user identity information are provided for the users, technical leakage caused by the fact that all the test cases are opened to all the users can be avoided, management of a large number of test items is facilitated, and safety of an automatic test process is improved.
Step 240, determining idle test resources matched with the test item information according to a pre-generated test case state table.
And 250, generating a target test instance matched with a target user according to the test item information and the idle test resources, and operating the target test instance.
Step 260, obtaining the target operation information corresponding to the target test case in real time, storing the target operation information into a test case state table, and rejecting the target operation information in the test case state table after the completion of the operation of the target test case is detected.
In one implementation manner of this embodiment, the target running information includes a test identifier, a process identifier, and a test resource corresponding to the target test case. After storing the target operation information in the test case state table, the method further comprises: if the abnormal end of the current test process corresponding to the target test instance is detected, eliminating the test resources occupied by the current test process in the test instance state table according to the test identifier corresponding to the target test instance and the process identifier of the current test process.
In this embodiment, the test identifier is unique and is used to characterize different test cases. The target test case can comprise a plurality of test processes, and each test process corresponds to a process identifier and corresponding test resources. After the target running information is stored in the test case state table, the running information (such as a running result, a running progress and the like) of the current test process can be obtained in real time according to the test case state table, if the running of the current test process is detected to be ended and the running result is wrong, the abnormal ending of the current test process can be determined, and the test resources occupied by the current test process are removed from the test case state table.
The method has the advantages that the test resources can be released in time, the resources can be conveniently scheduled by other test items, the storage space of the test case state table can be saved, and the space utilization rate of the test case state table is improved.
According to the technical scheme provided by the embodiment of the invention, the identity information of the target user is verified through the login request triggered by the automatic test platform in response to the target user, if the identity information of the target user is successfully verified, a plurality of alternative test cases matched with the identity information are provided for the target user, the target test cases and the resource information selected by the target user are used as test item information in response to the target test cases and the configured resource information, idle test resources matched with the test item information are determined according to the test case state table, the target test cases matched with the target user are generated, the target test cases are operated, the target operation information of the target test cases is acquired in real time, the target operation information is stored in the test case state table, and after the completion of the operation of the target test cases is detected, the target operation information is removed in the test case state table, so that the maintenance cost of the automatic test platform can be reduced, and unified scheduling of the test resources occupied by a plurality of test items is realized.
Fig. 3 is a flowchart of another automatic testing method according to an embodiment of the present invention, as shown in fig. 3, the method includes:
step 310, in response to the test item information configured by the target user through the automatic test platform, determining idle test resources matched with the test item information according to a pre-generated test instance state table.
In this embodiment, the test item information may further include a test mode. Alternatively, the test mode may include a single test, a plurality of tests, a debug mode, a standard mode, or the like, which is not limited in this embodiment.
And 320, generating a target test instance matched with the target user according to the test item information and the idle test resources.
And 330, operating the target test case according to the test mode included in the test item information.
In this step, optionally, if the test mode is a plurality of tests, the target test case may be run according to the number of tests specified by the target user.
The method has the advantages that the testing requirements of the user can be fully met by acquiring the testing mode configured by the user and operating the testing instance according to the testing mode, and the flexibility of the automatic testing process and the degree of freedom of the testing requirements of the user are improved.
In one implementation manner of the present embodiment, the running the target test case according to the test mode included in the test item information includes: if the test mode is a debug mode, acquiring a target case code corresponding to a target test case from a preset test case library; storing the target use case code into a cache directory corresponding to the target user so that the target user modifies the target use case code in the cache directory; and updating the target test case according to the modified target case code, and running the updated target test case.
In this embodiment, a large number of different test cases and application case codes corresponding to the test cases are stored in the test case library. If the test mode is the debug mode, the target test case can be determined first, then the case code (namely, the target case code) of the target test case is copied in the test case library, and the copied target case code is stored in a cache directory corresponding to the target user.
After the target user is detected to modify the target use case code, the target test case can be updated according to the modified target use case code, and the updated target test case is operated, so that debugging or fault positioning of the test item is realized. If the target user determines that the target use case code is not modified any more, the latest target use case code can be submitted to the auditing node through the automatic test platform, after the auditing node is detected to complete auditing of the target use case code, the latest target use case code can be stored in the test use case library, and the target use case code in the cache directory is removed.
The method has the advantages that the target case codes are stored in the cache catalogue corresponding to the target user, so that the target case codes can be conveniently modified by the user at any time, an effective mode for debugging or positioning faults of test items is provided, the complexity of the item debugging process can be reduced, and the debugging efficiency is improved.
In another implementation of this embodiment, if the test mode is the standard mode, the target case code may be directly called from the test case library according to the target test case, and the target test case is run. The setting has the advantages that the target case codes do not need to be stored in the cache catalogs corresponding to the target users, so that the storage space occupied by the cache catalogs can be saved, and the space utilization rate of the cache catalogs is improved.
Step 340, obtaining target operation information corresponding to a target test case in real time, storing the target operation information into a test case state table, and rejecting the target operation information in the test case state table after the completion of the operation of the target test case is detected.
In one implementation of this embodiment, the target operation information further includes test item information. After the target operation information is stored in the test case state table, if the abnormal end of the current test process corresponding to the target test case is detected, according to the test identifier corresponding to the target test case and the process identifier of the current test process, eliminating the test resources occupied by the current test process in the test case state table, and detecting whether the abnormally ended test process meets the re-operation condition in real time after eliminating; if yes, the test process is restarted according to the test item information and the idle test resources.
In a specific embodiment, optionally, after detecting the abnormally ended test process, the target user may be prompted to modify the test case code corresponding to the test process, and if the modification of the target user is detected to be completed, it may be determined that the test process meets a rerun condition, and the test process is rerun according to the test item information and the idle test resources.
The advantage of this arrangement is that the integrity of the automatic test process can be ensured, and the validity and reliability of the automatic test result can be improved.
According to the technical scheme provided by the embodiment of the invention, by responding to the test item information configured by a target user through the automatic test platform, according to the pre-generated test item state table, idle test resources matched with the test item information are determined, a target test instance is generated according to the test item information and the idle test resources, the target test instance is operated according to the test mode included in the test item information, the target operation information corresponding to the target test instance is acquired in real time, the target operation information is stored in the test instance state table, and after the completion of the operation of the target test instance is detected, the target operation information is removed from the test instance state table, so that the maintenance cost of the automatic test platform can be reduced, and the unified scheduling of the test resources occupied by a plurality of test items is realized.
Fig. 4 is a schematic structural diagram of an automatic test device according to an embodiment of the present invention, where the device is applied to a unified automatic test platform. As shown in fig. 4, the apparatus includes: a resource determination module 410, an instance execution module 420, and an information processing module 430.
The resource determining module 410 is configured to determine, in response to test item information configured by a target user through the automatic test platform, an idle test resource matched with the test item information according to a pre-generated test case state table; the test case state table stores operation information corresponding to a plurality of test cases respectively;
the instance running module 420 is configured to generate a target test instance matched with a target user according to the test item information and the idle test resources, and run the target test instance;
the information processing module 430 is configured to obtain, in real time, target operation information corresponding to a target test case, store the target operation information in a test case state table, and reject the target operation information in the test case state table after detecting that the operation of the target test case is completed.
According to the technical scheme provided by the embodiment of the invention, by responding to the test item information configured by the target user through the automatic test platform, according to the pre-generated test item state table, idle test resources matched with the test item information are determined, according to the test item information and the idle test resources, a target test instance matched with the target user is generated, the target test instance is operated, target operation information corresponding to the target test instance is obtained in real time, the target operation information is stored in the test instance state table, and after the completion of the operation of the target test instance is detected, the target operation information is removed in the test instance state table, so that the maintenance cost of the automatic test platform can be reduced, and unified scheduling of the test resources occupied by a plurality of test items is realized.
On the basis of the above embodiment, the test item information includes a test pattern. The target operation information comprises a test identifier, a process identifier and a test resource corresponding to the target test instance. The target operation information also comprises test item information.
The resource determination module 410 includes:
the identity verification unit is used for responding to a login request triggered by a target user through the automatic test platform and verifying the identity information of the target user according to the login request;
the alternative case providing unit is used for providing a plurality of alternative test cases matched with the identity information for the target user if the identity information of the target user is successfully checked;
the project information determining unit is used for responding to a target test case selected by a target user from a plurality of candidate test cases and resource information configured by the target user through the automatic test platform, and taking the target test case and the resource information as test project information.
The example run module 420 includes:
the target instance operation unit is used for operating the target test instance according to the test mode included in the test item information;
The code acquisition unit is used for acquiring a target case code corresponding to a target test case from a preset test case library if the test mode is a debug mode;
the code storage unit is used for storing the target use case code into a cache directory corresponding to the target user so as to enable the target user to modify the target use case code in the cache directory;
and the instance updating unit is used for updating the target test instance according to the modified target use-instance code and running the updated target test instance.
The information processing module 430 includes:
the resource eliminating unit is used for eliminating the test resources occupied by the current test process in the test instance state table according to the test identifier corresponding to the target test instance and the process identifier of the current test process if the abnormal end of the current test process corresponding to the target test instance is detected;
the abnormal process detection unit is used for detecting whether the abnormally-ended test process meets the rerun condition in real time; if yes, the test process is restarted according to the test item information and the idle test resources.
The device can execute the method provided by all the embodiments of the invention, and has the corresponding functional modules and beneficial effects of executing the method. Technical details not described in detail in the embodiments of the present invention can be found in the methods provided in all the foregoing embodiments of the present invention.
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as an automatic test method.
In some embodiments, the automated test methods may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the automatic test method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the automatic test method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. An automatic test method, which is applied to a unified automatic test platform, comprising:
responding to test item information configured by a target user through the automatic test platform, and determining idle test resources matched with the test item information according to a pre-generated test instance state table;
wherein, the test case state table stores operation information corresponding to a plurality of test cases respectively;
Generating a target test instance matched with a target user according to the test item information and the idle test resources, and operating the target test instance;
and acquiring target operation information corresponding to a target test case in real time, storing the target operation information into a test case state table, and removing the target operation information from the test case state table after the completion of the operation of the target test case is detected.
2. The method of claim 1, wherein responding to test item information configured by a target user through the automated test platform comprises:
responding to a login request triggered by a target user through the automatic test platform, and checking the identity information of the target user according to the login request;
if the identity information of the target user is successfully checked, a plurality of alternative test cases matched with the identity information are provided for the target user;
and responding to a target test case selected by a target user from a plurality of alternative test cases and resource information configured by the target user through the automatic test platform, and taking the target test case and the resource information as test item information.
3. The method of claim 1, wherein the test item information includes a test pattern; the running the target test case comprises the following steps:
and operating the target test case according to the test mode included in the test item information.
4. A method according to claim 3, wherein running the target test case according to the test pattern included in the test item information comprises:
if the test mode is a debug mode, acquiring a target case code corresponding to a target test case from a preset test case library;
storing the target use case code into a cache directory corresponding to the target user, so that the target user modifies the target use case code in the cache directory;
and updating the target test case according to the modified target case code, and running the updated target test case.
5. The method of claim 1, wherein the target operation information includes a test identifier, a process identifier, and a test resource corresponding to a target test instance;
after storing the target operation information in the test case state table, the method further comprises:
If the abnormal end of the current test process corresponding to the target test instance is detected, eliminating the test resources occupied by the current test process in the test instance state table according to the test identifier corresponding to the target test instance and the process identifier of the current test process.
6. The method of claim 5, wherein the target operation information further comprises test item information;
after eliminating the test resources occupied by the current test process in the test instance state table according to the test identifier corresponding to the target test instance and the process identifier of the current test process, the method further comprises the following steps:
detecting whether the abnormally-ended test process meets the re-operation condition in real time;
if yes, the test process is restarted according to the test item information and the idle test resources.
7. An automatic test equipment, characterized in that it is applied to a unified automatic test platform, said equipment includes:
the resource determining module is used for responding to the test item information configured by the target user through the automatic test platform and determining idle test resources matched with the test item information according to a pre-generated test instance state table;
Wherein, the test case state table stores operation information corresponding to a plurality of test cases respectively;
the instance running module is used for generating a target test instance matched with a target user according to the test item information and the idle test resources and running the target test instance;
the information processing module is used for acquiring target operation information corresponding to a target test case in real time, storing the target operation information into a test case state table, and eliminating the target operation information in the test case state table after the completion of the operation of the target test case is detected.
8. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the automatic test method of any one of claims 1-6.
9. A computer readable storage medium storing computer instructions for causing a processor to execute the automatic test method of any one of claims 1-6.
10. A computer program product, characterized in that it comprises a computer program which, when executed by a processor, implements the automatic test method according to any of claims 1-6.
CN202310398775.8A 2023-04-11 2023-04-11 Automatic test method and device, electronic equipment and storage medium Pending CN116431499A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310398775.8A CN116431499A (en) 2023-04-11 2023-04-11 Automatic test method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310398775.8A CN116431499A (en) 2023-04-11 2023-04-11 Automatic test method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116431499A true CN116431499A (en) 2023-07-14

Family

ID=87081110

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310398775.8A Pending CN116431499A (en) 2023-04-11 2023-04-11 Automatic test method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116431499A (en)

Similar Documents

Publication Publication Date Title
CN110688305B (en) Test environment synchronization method, device, medium and electronic equipment
CN116702668A (en) Regression testing method and device, electronic equipment and storage medium
CN116303069A (en) Test method, device, upper computer, system and medium of vehicle-mounted terminal
CN116467161A (en) Application testing method and device, electronic equipment and storage medium
CN116431499A (en) Automatic test method and device, electronic equipment and storage medium
CN114003497A (en) Method, device and equipment for testing service system and storage medium
CN111737129A (en) Service control method, service control device, computer readable medium and electronic equipment
CN116401113B (en) Environment verification method, device and medium for heterogeneous many-core architecture acceleration card
CN111240990A (en) ISMCLI command line testing method, system, terminal and storage medium
CN116521536A (en) Code coverage rate determining method and device, electronic equipment and storage medium
CN112650679B (en) Test verification method, device and computer system
CN115374010A (en) Function testing method, device, equipment and storage medium
CN115599682A (en) Environment availability detection method, device, equipment and storage medium
CN116303098A (en) Application testing method and device, electronic equipment and storage medium
CN115391227A (en) Fault testing method, device, equipment and medium based on distributed system
CN117632726A (en) Test case validity detection method and device, electronic equipment and storage medium
CN117971640A (en) Method, device, equipment and medium for testing embedded software
CN117609064A (en) Unit test method and device, electronic equipment and storage medium
CN117520200A (en) Object testing method based on test adaptation system
US20200210324A1 (en) System program change detection via parallel monitoring techniques
CN115794609A (en) Script sharing method and device, electronic equipment and storage medium
CN116483566A (en) Resource processing method and device for server, electronic equipment and storage medium
CN116955201A (en) Data development test method, device, equipment and medium
CN115794525A (en) BMC (baseboard management controller) pressure testing method, device, equipment and storage medium
CN116991825A (en) Database flashback method, device, equipment and storage medium

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