CN117762797A - Method, device, medium and equipment for testing function switch release - Google Patents

Method, device, medium and equipment for testing function switch release Download PDF

Info

Publication number
CN117762797A
CN117762797A CN202311790449.8A CN202311790449A CN117762797A CN 117762797 A CN117762797 A CN 117762797A CN 202311790449 A CN202311790449 A CN 202311790449A CN 117762797 A CN117762797 A CN 117762797A
Authority
CN
China
Prior art keywords
test
switch
switch state
state identifier
data
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
CN202311790449.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.)
Douyin Vision Co Ltd
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Douyin Vision Co Ltd
Beijing Zitiao 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 Douyin Vision Co Ltd, Beijing Zitiao Network Technology Co Ltd filed Critical Douyin Vision Co Ltd
Priority to CN202311790449.8A priority Critical patent/CN117762797A/en
Publication of CN117762797A publication Critical patent/CN117762797A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The disclosure relates to a method, a device, a medium and equipment for testing release of a function switch, wherein the method comprises the following steps: acquiring test data of a corresponding test case group issued by a functional switch, wherein the test data comprises a switch state identifier and test case data corresponding to the test case group, and the switch state identifier is used for indicating the state of each functional switch in a target application service; determining a test result corresponding to the switch state identifier based on test data under the test case group corresponding to the switch state identifier aiming at each switch state identifier; and determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier.

Description

Method, device, medium and equipment for testing function switch release
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a testing method, a device, a medium and equipment for issuing a function switch.
Background
With the rapid development of internet services, the more frequent each service module iterates, the key is how to guarantee the quality of the tens of millions of flow infrastructure products. In the related art, in order to ensure the security and effectiveness of application upgrade, a new version of an application may be released in a plurality of release manners. For example, the release of the new version may be performed by scroll release, canary gray release, function switch release, or the like.
The canary gray level release and rolling release are corresponding to version management, environment deployment, upgrading, gray level and automatic detection integrated schemes, and no corresponding test detection scheme exists in the current release process of the functional switch.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a method for testing a function switch release, the method comprising:
acquiring test data of a corresponding test case group issued by a functional switch, wherein the test data comprises a switch state identifier and test case data corresponding to the test case group, and the switch state identifier is used for indicating the state of each functional switch in a target application service;
determining a test result corresponding to the switch state identifier based on test data under the test case group corresponding to the switch state identifier aiming at each switch state identifier;
And determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier.
In a second aspect, the present disclosure provides a test apparatus for function switch release, the apparatus comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring test data of a corresponding test case group issued by a functional switch, the test data comprises a switch state identifier and test case data, the switch state identifier is used for indicating the state of each functional switch in a target application service, and the switch state identifier is used for indicating the state of each functional switch in the target application service;
the first determining module is used for determining a test result corresponding to each switch state identifier based on test data under the test case group corresponding to the switch state identifier;
and the second determining module is used for determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier.
In a third aspect, the present disclosure provides a computer readable medium having stored thereon a computer program which when executed by a processing device performs the steps of the method of the first aspect.
In a fourth aspect, the present disclosure provides an electronic device comprising:
A storage device having a computer program stored thereon;
processing means for executing said computer program in said storage means to carry out the steps of the method of the first aspect.
Therefore, through the technical scheme, the switch state identification is added in the test data, so that different states of each function switch of the test data can be clarified when the target application service is tested, the code version accessed by the test data can be determined based on the states of the function switches in the test process, the directional test of the test data when the function switches release gray scales is realized, and the code version upgrading gray scales and automatic test are realized. And the abnormal codes can be determined based on the summarization of the test results corresponding to different switch state identifiers, so that the safety and stability of the upgrading and releasing of the target application service are ensured.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale. In the drawings:
Fig. 1 is a flow chart of a method of testing functional switch release provided in accordance with one embodiment of the present disclosure.
Fig. 2 is a schematic diagram of a test scenario for functional switch release provided in accordance with one embodiment of the present disclosure.
Fig. 3 is a block diagram of a test apparatus for functional switch release provided in accordance with one embodiment of the present disclosure.
Fig. 4 shows a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations.
For example, in response to receiving an active request from a user, a prompt is sent to the user to explicitly prompt the user that the operation it is requesting to perform will require personal information to be obtained and used with the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server or a storage medium for executing the operation of the technical scheme of the present disclosure according to the prompt information.
As an alternative but non-limiting implementation, in response to receiving an active request from a user, the manner in which the prompt information is sent to the user may be, for example, a popup, in which the prompt information may be presented in a text manner. In addition, a selection control for the user to select to provide personal information to the electronic device in a 'consent' or 'disagreement' manner can be carried in the popup window.
It will be appreciated that the above-described notification and user authorization process is merely illustrative and not limiting of the implementations of the present disclosure, and that other ways of satisfying relevant legal regulations may be applied to the implementations of the present disclosure.
Meanwhile, it can be understood that the data (including but not limited to the data itself, the acquisition or the use of the data) related to the technical scheme should conform to the requirements of the corresponding laws and regulations and related regulations.
Fig. 1 is a flowchart of a testing method for issuing a function switch according to an embodiment of the disclosure, and as shown in fig. 1, the method includes:
in step 11, test data of a corresponding test case group issued by a functional switch is obtained, wherein the test data includes a switch state identifier and test case data corresponding to the test case group, and the switch state identifier is used for indicating the state of each functional switch in a target application service.
The function switch release can be supported by configuring the management and control center, and the release scene is controlled by the function switch of the management and control center. One function switch controls one use scene, and a plurality of function switches of the configuration center can control different use scenes. When the target application service is updated, a developer can develop a new version code, and the code of the current application can be used as an old version code. On the code side, when the function switch is released, the new version code and the old version code can exist in the code of the target application service at the same time, if the function switch is not opened, the old version code is used for providing the service, and if the function switch is opened, the new version code is used for providing the service.
In the actual test scenario, when the function switch issues to perform gray scale, the gray scale can be performed through dimensions such as user identifier, device identifier, session identifier, and the like, that is, based on the dimensions, which part adopts the new version code to provide service and which part provides service through the old version code, so as to perform gray scale on the function switch issues. However, before the target application service performs gray level release, the tester cannot perceive which dimension of the feature is based on which gray level is performed. Therefore, the test data constructed during the test process carries userid, deviceid and other information, and if the userid in the test data is not gray or is not within the initialized userid range, the logic of the new version code cannot be verified based on the test data, so that it is difficult to verify the logic of the new version code by pre-constructing test line data automation.
Based on this, in the present disclosure, a switch state identifier is included in the test data to identify a code version for providing a service in the target application service when the test data is tested, so that code logic for testing based on the test data is predetermined when the test data is constructed.
In step 12, for each switch state identifier, a test result corresponding to the switch state identifier is determined based on the test data under the test case group corresponding to the switch state identifier.
In this embodiment, the test data includes a switch state identifier, and when testing is performed based on the test data, the switch state identifier may be used to identify, so as to determine which version of code corresponds to each function switch in the target application service to perform testing when the test data performs testing, so as to implement pre-binding of the test data to the test code corresponding to the function switch, so that whether which version of code has an abnormality can be determined by which version branch of the function switch the test data walks to obtain a test result.
In step 13, based on the test results corresponding to the switch state identifiers, the test results issued by the function switch of the target application service are determined.
In order to further ensure that each new version code can be tested, and in order to quickly locate which new version code has a problem when a fault is found, not each functional switch corresponds to the new version code in the test process, but the combination states of a plurality of different functional switches can be tested through test data corresponding to different switch state identifiers, so that the test results corresponding to the combination of the plurality of different new version codes and old version codes can be combined and summarized, the new version code causing the abnormality in the test abnormality is determined, and the test on the release of the functional switches is realized. The test results may include abnormal function switches. The old version code is an online version of the current application, and when the function switch is abnormal, the new version code corresponding to the function switch can be considered to be abnormal. In this scenario, a push message may be generated to prompt a maintainer of the new version code of the function switch so that it may perform the maintenance of the abnormal code in time.
Therefore, through the technical scheme, the switch state identification is added in the test data, so that different states of each function switch of the test data can be clarified when the target application service is tested, the code version accessed by the test data can be determined based on the states of the function switches in the test process, the directional test of the test data when the function switches release gray scales is realized, and the code version upgrading gray scales and automatic test are realized. And the abnormal codes can be determined based on the summarization of the test results corresponding to different switch state identifiers, so that the safety and stability of the upgrading and releasing of the target application service are ensured.
In one possible embodiment, an exemplary implementation of the acquiring function switch to issue test data of a corresponding test case group may include:
and inquiring a data mapping table according to the switch state identifiers and the test case group identifiers aiming at each switch state identifier, and determining test case data corresponding to each test case group, wherein the different switch state identifiers and the test case data corresponding to the test case group identifiers in the data mapping table are mutually exclusive.
The switch state identifier may correspond to a plurality of test case groups, and as an example, each test case group may be used for testing an application scenario, for example, may include a closed loop scenario case group, a field check case group, an assertion check case group, a global variable check case group, and the like, which may be divided and configured according to an actual application scenario. And the number and types of the test case groups corresponding to the different switch state identifiers are the same. I.e. test case groups for testing M scenes can be set, the test data corresponding to the switch state identifier K0 includes test case groups corresponding to M scenes, and the test data corresponding to the switch state identifier K1 also includes test case groups corresponding to M scenes.
Then the test data under the same switch state identification needs to be isolated in order to improve the test efficiency of the test data. The same scene case group under different switch state identifiers also needs to be isolated by test data, otherwise, the same test data executing different logics at the same time can interfere with each other.
Therefore, in this embodiment, the data mapping table may be preset to perform the relationship mapping by the switch state identification, the test case group identification, and the test case data. To facilitate data querying and storage in the data mapping table, the data mapping table may be generated by an index of switch state identifiers, test case group identifiers, and test case data. As an example, the data mapping table is as follows:
the foregoing only represents the test case data of the M test case groups corresponding to the switch state identifier K1, and the test case data of the M test case groups corresponding to the other switch state identifiers are represented in the data mapping table in the same manner, which is not described herein.
The data mapping table is preset, and the test case data corresponding to different switch state identifiers and test case group identifiers in the data mapping table are mutually exclusive, so that different test case data can be free from interference when test verification is carried out.
And then, generating test data of the test case group corresponding to the switch state identifier based on the test case data corresponding to the test case group and the switch state identifier.
For example, if test data corresponding to the switch state identifier K1 is to be obtained, the data mapping table may be queried based on the K1 and the test case group identifier 1 to obtain test case data 1, the data mapping table may be queried based on the K1 and the test case group identifier 2 to obtain test case data 2, and so on, the data mapping table may be queried based on the K1 and the test case group identifier M to obtain test case data M. The queried test case data 1 to test case data M may be respectively used as test case data of M test case groups corresponding to the switch state identifier K1, and then the test case data of M groups and the switch state identifier K1 are combined to obtain test data corresponding to the switch state identifier K1.
Therefore, through the technical scheme, the test case data corresponding to each test case group under each switch state identifier can be preset, and the determined test data of different switch state identifiers and test case groups are ensured to have no interference with each other during testing, so that the accuracy of a test result is improved.
In one possible embodiment, the test data under the test case group corresponding to each of the switch state identifiers is tested in parallel.
As an example, in the publishing process in the related art, the M test case groups need to be executed once for about 15-20 minutes, and for a product published by the function switch, the test needs to be performed for the case of different combinations of the function switch, that is, the test data corresponding to each switch state identifier needs to be executed once, and if the related switch state identifiers exceed 30, the test data needs to be executed serially for at least 7.5 hours (15×30 minutes).
Accordingly, the determined test data of different switch state identifiers and test case groups have no interference with each other during the test, and the test data corresponding to the different switch state identifiers can be tested in parallel, so that the time required by the test case groups is close to the time required by the test case groups to be executed once no matter how many different combinations of the function switches are.
Therefore, through the technical scheme, the test data under the multiple switch state identifiers are executed in parallel, so that the time required by the test can be effectively reduced, and the test efficiency is improved.
In a possible embodiment, the determining, based on the test data under the test case group corresponding to the switch state identifier, a test result corresponding to the switch state identifier may include:
Accessing the target application service based on the test data under the test case group;
and determining the test result based on the execution result of the test data executed by the target application service, wherein the switch state identification in the test data is used for determining the corresponding access version codes corresponding to the function switches in the target application service so as to determine the execution result of the test case data executed by the test data based on the access version codes.
In this embodiment, each test data includes a corresponding switch state identifier, and before the test data is executed based on the target application service, the switch state identifier in the test data may be obtained first to analyze, so as to determine a code version in the target application service for responding to the test data.
The test result can be determined based on the test mode passing in the field, if there is return data, whether the return data is consistent with the standard return value corresponding to the test data can be determined by comparing the return data with the standard return value corresponding to the test data. Such as whether the test data implements the corresponding function or not during the function test, which may be set based on the actual application scenario, which is not limited in this disclosure.
In the related art, when a function switch release of a target application service is tested based on test data, if the function switch release is gray-scale by userid, whether to access a new version code or an old version code is determined based on userid for the test data, so that a response is made based on the determined code. I.e. it is not known which part of the code the test data will test before the test data performs the test.
Each function switch corresponds to an old version code used currently and a new version code to be updated;
accordingly, the access version code corresponding to the function switch is determined by the following method:
and determining an identification value corresponding to each functional switch based on the switch state identification.
In this embodiment, the switch state identifier performs test data orientation, and as an example, the switch state identifier in the test data may be obtained, for example, as follows:
{
{“F1”:1},
{“F2”:0},
{“F3”:1},
……
{“Ft”:0},
}
the function switches include t function switches such as F1-Ft, and the identification value of each function switch can be obtained through the switch state identification, for example, the identification value of the function switch F1 is 1, and the identification value of the function switch F2 is 0.
Then, for each function switch, if the identification value indicates a new version code, the new version code corresponding to the function switch is used as an access version code corresponding to the function switch; and if the identification value indicates the old version code, taking the old version code corresponding to the function switch as the access version code corresponding to the function switch.
The code version corresponding to the identification value can be preset, if the identification value is 1, the function switch is turned on, namely, a new version code is adopted, and if the identification value is 0, the function switch is turned off, namely, an old version code is adopted. Then following the above example, the identification value of each function switch may be traversed in turn to determine the code of the target application service corresponding to the test data.
If the identification value of the function switch F1 indicates a new version code, the new version code corresponding to the function switch is used as an access version code corresponding to the function switch, and if the identification value of the function switch F2 indicates a new version code, the old version code corresponding to the function switch is used as the access version code corresponding to the function switch until the identification value of the function switch is traversed, and then the codes corresponding to the function switches when testing based on the test data can be respectively determined.
Therefore, based on the technical scheme, the code corresponding to the target application service when the test data is executed can be determined by analyzing the switch state identifier carried in the test data, the directional test of the code version by the test data can be realized, and the part of the new version code can be determined to be tested by the test data before the test data is executed, so that the full coverage test on the release of the function switch can be realized by constructing the test data, the accuracy of a test result is ensured, and the support is provided for realizing the automatic test on the release of the function switch.
In a possible embodiment, the implementation manner of determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier may include:
if the test result indicates abnormality, determining a test function switch corresponding to the test result based on a switch state identifier corresponding to the test result, wherein the test function switch is a function switch applying a new version code to be updated.
The old version code is the code which is currently in use and is online after passing the test. In this embodiment, when the test result is abnormal, it is considered as an abnormality caused by the new version code applied therein. Correspondingly, if the test result is abnormal, the corresponding switch state identification is obtained, so that the determination of which new version codes are accessed to obtain the test result can be based on the switch state identification. Illustratively, if it is determined that the new version code of the function switch F1, F2, F3 is accessed by the obtained test result based on the switch state identification of the abnormal test result, the function switch F1, F2, F3 may be used as the test function switch to further determine the code in which the abnormality is tested.
And determining a candidate switch state identifier from switch state identifiers indicating normal test results, wherein at least one test function switch in the candidate switch state identifiers indicates that a new version code is applied.
And acquiring each test result indicating normal, wherein the test result is that the code corresponding to the switch state identifier corresponding to the test result is normal, and the code corresponding to the switch state identifier is not abnormal. The switch state identification indicating the normal test result may be analyzed to obtain a switch state identification containing a new version code of at least one of F1, F2, F3 as a candidate switch state identification.
As an example, the candidate switch state identification indicates that F1 and F2 use new version codes and F3 uses old version codes.
And determining a test result issued by the function switch based on the switch state identifier corresponding to the abnormal test result and the candidate switch state identifier, wherein the test result comprises the abnormal function switch.
The above examples are combined to determine that the test results corresponding to the case that the new version codes are adopted by all of F1, F2 and F3 indicate abnormality, the test results corresponding to the case that the new version codes are adopted by F1 and F2 and the old version codes are adopted by F3 indicate normal, and in this scenario, the abnormality caused by the new version codes corresponding to the function switch F3 can be considered, and then the function switch F3 can be used as an abnormal function switch.
As another example, the test result may also include a test case group identifier that fails the test in the test data.
Therefore, through the technical scheme, the scenes of the test case groups contained in the test data corresponding to the different switch state identifiers are consistent, namely, the same test is carried out on the target application service corresponding to the different switch state identifiers, the summarization judgment can be carried out based on the test results corresponding to the different switch state identifiers, the new version code causing the abnormal test is determined, the automatic test on the release of the function switch is realized, the workload of manual analysis is reduced, the release safety of the function switch can be ensured, and the fault risk in the upgrading process of the target application service is reduced.
In a possible embodiment, before determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier, the method may further include:
if the test result corresponding to the switch state identifier indicates abnormality, a retry test is performed based on the test data under the test case group corresponding to the switch state identifier, and a new test result corresponding to the switch state identifier is obtained.
In this embodiment, if the test result corresponding to the switch state identifier indicates abnormality, a retry test may be performed based on the test data to obtain a new test result, so as to further improve accuracy of the test result corresponding to each switch state identifier, and provide accurate data support for analysis of the test result issued by the function switch.
Fig. 2 is a schematic diagram of a test scenario of a functional switch release according to an embodiment of the present disclosure. As shown in fig. 2, the control center may be used to configure the gray scale released by the function switch. The platform center may contain a Gitlab, project and code hosting for targeted application services, and the management center may contain version management, coverage monitoring, cluster management, etc. The Gitlab may contain new version code and old version code corresponding to the function switch. The publication monitoring module may include a test environment deployment module to determine data for configuring the data mapping table. The detection service can be used for executing the testing method of the function switch release provided by the present disclosure, the reconfiguration switch state identifier can determine the combination mode of each function switch used for testing, and the combination mode can determine the used new version code and old version code through the analysis of the switch state identifier, so that the corresponding code version in the Gitlab can be accessed. The test case platform is used for configuring and managing the test cases, wherein the data management module can be used for managing the switch state identifiers, the task management module can be used for managing test tasks executed based on the test data, the test case management module can be communicated with the data management module to acquire the switch state identifiers so as to generate the test data, and the test case management module and the test data distribution module can be communicated so as to acquire mutually exclusive test case data. The module for scheduling parallel communication with the module for task management triggers parallel execution of test data, and the module for monitoring execution/retry communication with the module for task management to periodically scan task state and determine whether the test task corresponding to the test data is completed or whether retry execution is required. The module for merging the test results can summarize the test results corresponding to the switch state identifiers to determine the test results issued by the functional switch of the target application service, generate a test report and send the test report to the module for test report management, and simultaneously can send alarm information to a user based on an abnormally pushed model. Therefore, through the flow, the automatic gray scale testing process can be realized when the function switch is released, and the safety of the releasing process is ensured.
Based on the same inventive concept, the present disclosure provides a testing device for issuing a function switch, as shown in fig. 3, the device 10 includes:
the acquiring module 100 is configured to acquire test data of a test case group corresponding to the function switch release, where the test data includes a switch state identifier and test case data corresponding to the test case group, where the switch state identifier is used to represent a state of each function switch in the target application service;
a first determining module 200, configured to determine, for each switch state identifier, a test result corresponding to the switch state identifier based on test data under a test case group corresponding to the switch state identifier;
and the second determining module 300 is configured to determine a test result issued by the function switch of the target application service based on the test result corresponding to each switch state identifier.
Optionally, the acquiring module includes:
the first determining submodule is used for inquiring a data mapping table according to the switch state identifiers and the test case group identifiers aiming at each switch state identifier, and determining test case data corresponding to each test case group, wherein different switch state identifiers and test case data corresponding to the test case group identifiers in the data mapping table are mutually exclusive;
And the generating sub-module is used for generating the test data of the test case group corresponding to the switch state identifier based on the test case data corresponding to the test case group and the switch state identifier.
Optionally, the first determining module includes:
the test sub-module is used for accessing the target application service based on the test data in the test case group;
and the second determining submodule is used for determining the test result based on the execution result of the test data executed by the target application service, wherein the switch state identification in the test data is used for determining the corresponding access version code corresponding to each function switch in the target application service so as to determine the execution result of the test case data executed in the test data based on each access version code.
Optionally, each function switch corresponds to an old version code currently used and a new version code to be updated;
the access version code corresponding to the function switch is determined by the following method:
determining an identification value corresponding to each functional switch based on the switch state identification;
for each function switch, if the identification value indicates a new version code, the new version code corresponding to the function switch is used as an access version code corresponding to the function switch; and if the identification value indicates the old version code, taking the old version code corresponding to the function switch as the access version code corresponding to the function switch.
Optionally, the second determining module includes:
a third determining submodule, configured to determine, if the test result indicates abnormality, a test function switch corresponding to the test result based on a switch state identifier corresponding to the test result, where the test function switch is a function switch to which a new version code to be updated is applied;
a fourth determining submodule, configured to determine a candidate switch state identifier from switch state identifiers indicating normal test results, where at least one of the test function switches in the candidate switch state identifiers indicates application of a new version code;
and a fifth determining submodule, configured to determine a test result issued by the function switch based on a switch state identifier corresponding to the abnormal test result and the candidate switch state identifier, where the test result includes the abnormal function switch.
Optionally, the test data under the test case group corresponding to each switch state identifier is executed in parallel.
Optionally, the apparatus further comprises:
and the retry module is used for carrying out retry test based on the test data under the test case group corresponding to the switch state identifier to obtain a new test result corresponding to the switch state identifier if the test result corresponding to the switch state identifier indicates abnormality before the second determination module determines the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier.
Referring now to fig. 4, a schematic diagram of an electronic device (e.g., a terminal device or server) 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 4, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having 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. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring test data of a corresponding test case group issued by a functional switch, wherein the test data comprises a switch state identifier and test case data corresponding to the test case group, and the switch state identifier is used for indicating the state of each functional switch in a target application service; determining a test result corresponding to the switch state identifier based on test data under the test case group corresponding to the switch state identifier aiming at each switch state identifier; and determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute 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).
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 code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, 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.
The modules described in the embodiments of the present disclosure may be implemented in software or hardware. The name of the module is not limited to the module itself in some cases, and for example, the acquisition module may also be described as "a module that acquires test data of the corresponding test case group issued by the function switch".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable 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. 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.
In accordance with one or more embodiments of the present disclosure, example 1 provides a method of testing a function switch release, the method comprising:
acquiring test data of a corresponding test case group issued by a functional switch, wherein the test data comprises a switch state identifier and test case data corresponding to the test case group, and the switch state identifier is used for indicating the state of each functional switch in a target application service;
determining a test result corresponding to the switch state identifier based on test data under the test case group corresponding to the switch state identifier aiming at each switch state identifier;
and determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier.
According to one or more embodiments of the present disclosure, example 2 provides the method of example 1, wherein the acquiring the test data of the corresponding test case group issued by the function switch includes:
inquiring a data mapping table according to the switch state identifiers and the test case group identifiers aiming at each switch state identifier, and determining test case data corresponding to each test case group, wherein the different switch state identifiers and the test case data corresponding to the test case group identifiers in the data mapping table are mutually exclusive;
And generating test data of the test case group corresponding to the switch state identifier based on the test case data corresponding to the test case group and the switch state identifier.
According to one or more embodiments of the present disclosure, example 3 provides the method of example 1, wherein the determining, based on the test data under the test case group corresponding to the switch state identifier, the test result corresponding to the switch state identifier includes:
accessing the target application service based on the test data under the test case group;
and determining the test result based on the execution result of the test data executed by the target application service, wherein the switch state identification in the test data is used for determining the corresponding access version codes corresponding to the function switches in the target application service so as to determine the execution result of the test case data executed by the test data based on the access version codes.
Example 4 provides the method of example 3, wherein each of the function switches corresponds to an old version code currently in use and a new version code to be updated, according to one or more embodiments of the present disclosure;
the access version code corresponding to the function switch is determined by the following method:
Determining an identification value corresponding to each functional switch based on the switch state identification;
for each function switch, if the identification value indicates a new version code, the new version code corresponding to the function switch is used as an access version code corresponding to the function switch; and if the identification value indicates the old version code, taking the old version code corresponding to the function switch as the access version code corresponding to the function switch.
According to one or more embodiments of the present disclosure, example 5 provides the method of example 1, wherein the determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier includes:
if the test result indicates abnormality, determining a test function switch corresponding to the test result based on a switch state identifier corresponding to the test result, wherein the test function switch is a function switch applying a new version code to be updated;
determining a candidate switch state identification from switch state identifications indicating normal test results, wherein at least one test function switch in the candidate switch state identification indicates application of a new version code;
And determining a test result issued by the function switch based on the switch state identifier corresponding to the abnormal test result and the candidate switch state identifier, wherein the test result comprises the abnormal function switch.
Example 6 provides the method of example 1, wherein each of the switch state identifiers performs the test in parallel with test data under a corresponding set of test cases, according to one or more embodiments of the present disclosure.
According to one or more embodiments of the present disclosure, example 7 provides the method of example 1, wherein, before the determining the test result issued by the functional switch of the target application service based on the test result corresponding to the respective switch state identifiers, the method further includes:
if the test result corresponding to the switch state identifier indicates abnormality, a retry test is performed based on the test data under the test case group corresponding to the switch state identifier, and a new test result corresponding to the switch state identifier is obtained.
Example 8 provides a test apparatus for function switch release, according to one or more embodiments of the present disclosure, the apparatus comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring test data of a corresponding test case group issued by a functional switch, the test data comprises a switch state identifier and test case data, the switch state identifier is used for indicating the state of each functional switch in a target application service, and the switch state identifier is used for indicating the state of each functional switch in the target application service;
The first determining module is used for determining a test result corresponding to each switch state identifier based on test data under the test case group corresponding to the switch state identifier;
and the second determining module is used for determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier.
According to one or more embodiments of the present disclosure, example 9 provides a computer-readable medium having stored thereon a computer program which, when executed by a processing device, implements the steps of the method of any of examples 1-7.
In accordance with one or more embodiments of the present disclosure, example 10 provides an electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to implement the steps of the method of any one of examples 1-7.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims. The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.

Claims (10)

1. A method for testing the release of a functional switch, the method comprising:
acquiring test data of a corresponding test case group issued by a functional switch, wherein the test data comprises a switch state identifier and test case data corresponding to the test case group, and the switch state identifier is used for indicating the state of each functional switch in a target application service;
determining a test result corresponding to the switch state identifier based on test data under the test case group corresponding to the switch state identifier aiming at each switch state identifier;
and determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier.
2. The method of claim 1, wherein the acquiring the test data of the corresponding set of test cases issued by the function switch comprises:
inquiring a data mapping table according to the switch state identifiers and the test case group identifiers aiming at each switch state identifier, and determining test case data corresponding to each test case group, wherein the different switch state identifiers and the test case data corresponding to the test case group identifiers in the data mapping table are mutually exclusive;
And generating test data of the test case group corresponding to the switch state identifier based on the test case data corresponding to the test case group and the switch state identifier.
3. The method of claim 1, wherein the determining the test result corresponding to the switch state identifier based on the test data under the test case group corresponding to the switch state identifier comprises:
accessing the target application service based on the test data under the test case group;
and determining the test result based on the execution result of the test data executed by the target application service, wherein the switch state identification in the test data is used for determining the corresponding access version codes corresponding to the function switches in the target application service so as to determine the execution result of the test case data executed by the test data based on the access version codes.
4. A method according to claim 3, wherein each of the function switches corresponds to an old version code currently in use and a new version code to be updated;
the access version code corresponding to the function switch is determined by the following method:
Determining an identification value corresponding to each functional switch based on the switch state identification;
for each function switch, if the identification value indicates a new version code, the new version code corresponding to the function switch is used as an access version code corresponding to the function switch; and if the identification value indicates the old version code, taking the old version code corresponding to the function switch as the access version code corresponding to the function switch.
5. The method according to claim 1, wherein the determining the test result issued by the function switch of the target application service based on the test result corresponding to each switch state identifier includes:
if the test result indicates abnormality, determining a test function switch corresponding to the test result based on a switch state identifier corresponding to the test result, wherein the test function switch is a function switch applying a new version code to be updated;
determining a candidate switch state identification from switch state identifications indicating normal test results, wherein at least one test function switch in the candidate switch state identification indicates application of a new version code;
And determining a test result issued by the function switch based on the switch state identifier corresponding to the abnormal test result and the candidate switch state identifier, wherein the test result comprises the abnormal function switch.
6. The method of claim 1, wherein the test data under each set of test cases corresponding to each of the switch state identifiers is tested in parallel.
7. The method of claim 1, wherein prior to determining the test result published by the functional switch of the target application service based on the test result corresponding to each switch state identification, the method further comprises:
if the test result corresponding to the switch state identifier indicates abnormality, a retry test is performed based on the test data under the test case group corresponding to the switch state identifier, and a new test result corresponding to the switch state identifier is obtained.
8. A test device for functional switch release, the device comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring test data of a corresponding test case group issued by a functional switch, the test data comprises a switch state identifier and test case data, the switch state identifier is used for indicating the state of each functional switch in a target application service, and the switch state identifier is used for indicating the state of each functional switch in the target application service;
The first determining module is used for determining a test result corresponding to each switch state identifier based on test data under the test case group corresponding to the switch state identifier;
and the second determining module is used for determining the test result issued by the functional switch of the target application service based on the test result corresponding to each switch state identifier.
9. A computer readable medium on which a computer program is stored, characterized in that the program, when being executed by a processing device, carries out the steps of the method according to any one of claims 1-7.
10. An electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing said computer program in said storage means to carry out the steps of the method according to any one of claims 1-7.
CN202311790449.8A 2023-12-22 2023-12-22 Method, device, medium and equipment for testing function switch release Pending CN117762797A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311790449.8A CN117762797A (en) 2023-12-22 2023-12-22 Method, device, medium and equipment for testing function switch release

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311790449.8A CN117762797A (en) 2023-12-22 2023-12-22 Method, device, medium and equipment for testing function switch release

Publications (1)

Publication Number Publication Date
CN117762797A true CN117762797A (en) 2024-03-26

Family

ID=90323493

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311790449.8A Pending CN117762797A (en) 2023-12-22 2023-12-22 Method, device, medium and equipment for testing function switch release

Country Status (1)

Country Link
CN (1) CN117762797A (en)

Similar Documents

Publication Publication Date Title
CN111679990B (en) Test data generation method and device, readable medium and electronic equipment
CN112597047A (en) Test method, test device, electronic equipment and computer readable medium
CN110275723A (en) Obtain method, apparatus, electronic equipment and the readable medium of resource
CN110390493B (en) Task management method and device, storage medium and electronic equipment
CN113485918B (en) Test method, test device, electronic equipment and storage medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN112988494A (en) Abnormity testing method and device and electronic device
CN110221857A (en) The problem of application program restorative procedure, device, electronic equipment and storage medium
CN113392018B (en) Traffic distribution method and device, storage medium and electronic equipment
CN111190657A (en) Activity configuration method and device, readable medium and electronic equipment
CN114095899A (en) Communication signal detection method and device, electronic equipment and computer readable medium
CN112882948A (en) Stability testing method, device and system for application and storage medium
CN112884376A (en) Work order processing method and device, electronic equipment and computer readable storage medium
CN117762797A (en) Method, device, medium and equipment for testing function switch release
CN111625326B (en) Task pipeline execution method and device and electronic equipment
CN110489341B (en) Test method and device, storage medium and electronic equipment
CN112379967B (en) Simulator detection method, device, equipment and medium
CN115705258A (en) Test method, test device, storage medium and electronic equipment
CN111382057B (en) Test case generation method, test method and device, server and storage medium
CN111382056B (en) Service testing method and device, server and storage medium
CN112487416A (en) Business process verification method and device and electronic equipment
CN114398098B (en) Application script execution method, device, electronic equipment and computer readable medium
CN115842819B (en) Automatic driving system test data downloading method, device and equipment
CN116545729A (en) Multi-application security test method, device, electronic equipment and computer readable medium
CN116319322B (en) Power equipment node communication connection method, device, equipment and computer 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