Object testing method and system, and device, medium and program product
By obtaining the index values of the object to be tested and the test scenario, and determining the key indicators, the problem of difficulty in overall performance testing with existing technology is solved, and the comprehensiveness and accuracy of the object test are achieved.
Patent Information
- Application Number
- PCT/CN2024/090026
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-27
- Filing Date
- 2024-04-26
- Publication Date
- 2024-10-31
AI Technical Summary
When the existing technology is used for object testing, it is difficult to test the overall performance of the object to be tested, cannot meet business needs, and can usually only solve single-layer problems.
By obtaining the object to be tested and the test scenario, the current and historical index values of multiple test indicators are obtained, at least one key indicator is determined, and the test results are obtained based on the key indicators to improve the comprehensiveness and accuracy of the object test.
It achieves accurate testing of the overall performance of the test object in different test scenarios, meets different business needs, and improves the comprehensiveness and accuracy of object testing.
Smart Images

Figure CN2024090026_31102024_PF_FP_ABST
Abstract
Description
Object testing methods, systems, equipment and media, and program products
[0001] This application claims priority to Chinese Patent Application No. 202310476796.7 filed on April 27, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field
[0002] Embodiments of the present disclosure relate to an object testing method, system, electronic device, computer-readable storage medium, and computer program product. Background Art
[0003] With the rapid development of computer technology, a wide variety of applications (APPs) have emerged. For example, to meet the online shopping needs of diverse users, various e-commerce (e-commerce) applications, such as cross-border e-commerce and self-operated e-commerce, have emerged. Another example is the emergence of various long and short video applications to meet the leisure and entertainment needs of diverse users.
[0004] During operation, these applications may experience significant impacts on user experience. For example, during large-scale promotional events, e-commerce applications may experience system overloads and downtime due to traffic surges, making it difficult to guarantee a guaranteed user experience. Another example is when live streaming video applications are used, poor network quality may cause lags and excessive delays, impacting the user experience.
[0005] At present, the industry mainly uses a layered approach to test applications (also known as object testing). Taking the e-commerce application as an example, when the user clicks the order control to trigger the order operation, the order scenario is entered. In the order scenario, the client generates an order event, which goes through a long link, such as the cache layer, database layer, network layer, and application layer. When performing object testing, object testing is also performed in layers to obtain single-layer test results. However, the above-mentioned object testing method usually solves the problem of a single layer and cannot test the overall performance of the object to be tested, making it difficult to meet business needs.
[0006] Summary of the Invention
[0007] This disclosure provides an object testing method. This method can test a target object in different test scenarios, obtain the overall performance of the target object in different test scenarios, improve the accuracy of the object testing, and meet different business needs. This disclosure also provides a system, electronic device, computer-readable storage medium, and computer program product corresponding to the above method.
[0008] In a first aspect, the present disclosure provides an object testing method. The method comprises:
[0009] Get the object to be tested and the test scenario;
[0010] Testing the object to be tested in the test scenario to obtain current indicator values of multiple test indicators;
[0011] Determining at least one key indicator from the multiple test indicators according to current indicator values of the multiple test indicators and historical indicator values of the multiple test indicators when the object to be tested runs in the test scenario;
[0012] A test result of the object to be tested in the test scenario is obtained according to the at least one key indicator.
[0013] In some possible implementations, determining at least one key indicator from the multiple test indicators based on current indicator values of the multiple test indicators and historical indicator values of the multiple test indicators when the object to be tested is running in the test scenario includes:
[0014] Determining, based on the current index values of the plurality of test indicators and the historical index values of the plurality of test indicators, similarities between the current index values of the plurality of test indicators and the historical index values of the plurality of test indicators;
[0015] Determine the test indicators whose similarity meets the set conditions as candidate indicators;
[0016] At least one key indicator is determined from the candidate indicators according to the labels of the candidate indicators, where the labels of the candidate indicators are used to describe historical test results of the candidate indicators.
[0017] In some possible implementations, determining, based on the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators, the similarity between the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators includes:
[0018] Mapping the current index values of the plurality of test indicators and the historical index values of the plurality of test indicators to vector spaces respectively;
[0019] The similarity is determined according to the distance between the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators in the vector space.
[0020] In some possible implementations, obtaining a test result of the object to be tested in the test scenario according to the at least one key indicator includes:
[0021] Determining a reference value set for the at least one key indicator based on a historical indicator value of the at least one key indicator;
[0022] A test result of the object to be tested in the test scenario is obtained according to the current indicator value of the at least one key indicator and the reference value set.
[0023] In some possible implementations, obtaining a test result of the object to be tested in the test scenario based on the current indicator value of the at least one key indicator and the reference value set includes:
[0024] When the current indicator value of the at least one key indicator matches the reference value set, it is determined that the test result of the object to be tested in the test scenario is normal; or
[0025] The score of the at least one key indicator is determined based on whether the current indicator value of the at least one key indicator hits the reference value set. When the sum of the scores of the at least one key indicator is greater than the preset score, it is determined that the test result of the object to be tested in the test scenario is normal.
[0026] In some possible implementations, determining a reference value set for the at least one key indicator based on a historical indicator value of the at least one key indicator includes:
[0027] Based on the historical indicator value of the at least one key indicator and the key events during the operation of the object to be tested in the test scenario, a fitting analysis is performed on the relationship between the state of the object to be tested and the key indicators to determine a reference value set of the at least one key indicator, where the key event is an event that characterizes a change in the state of the object to be tested.
[0028] In some possible implementations, the method further includes:
[0029] Determining a change trend of the test results of the object to be tested in the test scenario according to the test results of the object to be tested in multiple cycles;
[0030] If the change trend of the test result meets the set conditions, a prompt message is sent.
[0031] In a second aspect, the present disclosure provides an object testing system. The system comprises:
[0032] An acquisition unit, used to acquire the object to be tested and the test scenario;
[0033] A testing unit, configured to test the object to be tested in the test scenario and obtain current indicator values of a plurality of test indicators;
[0034] a determining unit, configured to determine at least one key indicator from the multiple test indicators based on current indicator values of the multiple test indicators and historical indicator values of the multiple test indicators when the object to be tested runs in the test scenario;
[0035] The determining unit is further configured to obtain a test result of the object to be tested in the test scenario based on the at least one key indicator.
[0036] In some possible implementations, the determining unit is specifically configured to:
[0037] Determining, based on the current index values of the plurality of test indicators and the historical index values of the plurality of test indicators, similarities between the current index values of the plurality of test indicators and the historical index values of the plurality of test indicators;
[0038] Determine the test indicators whose similarity meets the set conditions as candidate indicators;
[0039] At least one key indicator is determined from the candidate indicators according to the labels of the candidate indicators, where the labels of the candidate indicators are used to describe historical test results of the candidate indicators.
[0040] In some possible implementations, the determining unit is specifically configured to:
[0041] Mapping the current index values of the plurality of test indicators and the historical index values of the plurality of test indicators to vector spaces respectively;
[0042] The similarity is determined according to the distance between the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators in the vector space.
[0043] In some possible implementations, the determining unit is specifically configured to:
[0044] Determining a reference value set for the at least one key indicator based on a historical indicator value of the at least one key indicator;
[0045] A test result of the object to be tested in the test scenario is obtained according to the current indicator value of the at least one key indicator and the reference value set.
[0046] In some possible implementations, the determining unit is specifically configured to:
[0047] When the current indicator value of the at least one key indicator matches the reference value set, it is determined that the test result of the object to be tested in the test scenario is normal; or
[0048] The score of the at least one key indicator is determined based on whether the current indicator value of the at least one key indicator hits the reference value set. When the sum of the scores of the at least one key indicator is greater than the preset score, it is determined that the test result of the object to be tested in the test scenario is normal.
[0049] In some possible implementations, the determining unit is specifically configured to:
[0050] Based on the historical indicator value of the at least one key indicator and the key events during the operation of the object to be tested in the test scenario, a fitting analysis is performed on the relationship between the state of the object to be tested and the key indicators to determine a reference value set of the at least one key indicator, where the key event is an event that characterizes a change in the state of the object to be tested.
[0051] In some possible implementations, the determining unit is further configured to:
[0052] Determining a change trend of the test results of the object to be tested in the test scenario according to the test results of the object to be tested in multiple cycles;
[0053] The system further comprises:
[0054] The prompt unit is used to send a prompt message if the change trend of the test result meets the set conditions.
[0055] In a third aspect, the present disclosure provides an electronic device comprising a processor and a memory. The processor and the memory communicate with each other. The processor is configured to execute instructions stored in the memory to cause the electronic device to perform the object testing method according to the first aspect or any implementation of the first aspect.
[0056] In a fourth aspect, the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, wherein the instructions instruct an electronic device to execute the object testing method described in the first aspect or any implementation of the first aspect.
[0057] In a fifth aspect, the present disclosure provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the object testing method described in the first aspect or any one of the implementations of the first aspect.
[0058] Based on the implementations provided in the above aspects, the present disclosure can be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical methods of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments.
[0060] FIG1 is an architecture diagram of an object testing system provided by an embodiment of the present disclosure;
[0061] FIG2 is a flow chart of an object testing method provided by an embodiment of the present disclosure;
[0062] FIG3 is a schematic structural diagram of an object testing system provided by an embodiment of the present disclosure; and
[0063] FIG4 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0064] The terms "first" and "second" in the embodiments of the present disclosure are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Therefore, the terms "first" and "second" may explicitly or implicitly include one or more of the features.
[0065] First, some technical terms involved in the embodiments of the present disclosure are introduced.
[0066] Object testing refers to the process of testing the object to be tested. Specifically, it can be the process of testing multiple functional modules and operating processes of the object to be tested to determine whether the object to be tested is in a normal state. Among them, the object to be tested can be a computer program that provides services to users. For example, the object to be tested can include one or more of an application (APP), a cloud service, and a plug-in.
[0067] The following example uses an application as the object to be tested. An application is a computer program written to meet a user's specific needs. Applications can be divided into different types based on different user needs. For example, based on the user's entertainment, e-commerce, and social needs, applications can be divided into multiple types, such as entertainment, e-commerce, and social. Each type can include different applications. For example, e-commerce applications can include cross-border e-commerce, self-operated e-commerce, and idle transaction e-commerce applications. For another example, entertainment applications can include long video, short video, and audiobook applications.
[0068] During the operation of the application, many situations that affect the user experience may occur. Taking e-commerce applications as an example, e-commerce applications include a large number of corporate users and personal users. At the same time, e-commerce applications have a high frequency of large-scale promotions (abbreviated as big promotions). During the big promotions, a large number of users can trigger corresponding operations (such as purchase operations) at a specific time point (for example, 0 o'clock, 8 o'clock, 14 o'clock or 20 o'clock when the big promotion is started). In the face of sudden traffic, e-commerce applications may experience system overloads, downtime, etc., making it difficult to guarantee the user's product purchasing experience. Taking entertainment applications as an example, entertainment applications can provide users with video live broadcast functions. When users are broadcasting videos, if the network quality is poor, entertainment applications may experience long delays, freezes, etc., affecting the audience's audio-visual experience.
[0069] Considering the above situation, application providers or operators can test the application to timely obtain events that may occur during the application operation and affect the user experience, and then upgrade or update the application. Currently, application providers or operators usually adopt a layered approach to test the objects to be tested, including the application.
[0070] Specifically, a user's triggering action in the client can generate a corresponding event. For example, a user's purchase action in an e-commerce application client can generate a purchase event. This event undergoes data processing through a longer chain to obtain a processing result. This chain can include multiple layers of technical components, specifically cache, database, network, or application layers. These multiple layers of technical components can process data at different levels, thus enabling hierarchical data processing and improving application maintainability.
[0071] When performing object testing, application providers or operators can test a specific layer of technical components to obtain test results for that layer. For example, an application provider or operator can perform object testing on the network layer. By observing network-layer-related metrics such as bandwidth, latency, and bandwidth-delay product, they can determine the operating status of the network layer and obtain test results for the network layer.
[0072] However, the method of using a layered approach to perform object testing usually solves the problems of a single layer and cannot test the overall performance of the object to be tested, making it difficult to meet business needs.
[0073] In view of this, the present disclosure provides an object testing method. Specifically, the method first obtains a to-be-tested object and a test scenario, tests the to-be-tested object in the test scenario, obtains current values of multiple test indicators, then determines at least one key indicator from the multiple test indicators based on the current values of the multiple test indicators and historical values of the multiple test indicators when the to-be-tested object is running in the test scenario, and obtains a test result of the to-be-tested object in the test scenario based on the at least one key indicator.
[0074] This method supports overall testing of the object to be tested in the test scenario, and determines the key indicators under the test scenario based on the current indicator values and historical indicator values of the test indicators. In this way, based on the key indicators under the test scenario, the overall test results of the object to be tested in the test scenario are obtained. Compared with the test results of the object to be tested at a certain layer, this method improves the comprehensiveness and accuracy of the object test and can meet different business needs.
[0075] In order to make the technical solution of the present disclosure clearer and easier to understand, the system architecture of the object testing method provided by the embodiment of the present disclosure is introduced below with reference to the accompanying drawings.
[0076] Referring to the architectural diagram of the object testing system shown in FIG1 , the object testing system 10 is used to perform object testing on the object to be tested. The object testing system 10 can be a software system, which can be deployed in a server, and the server executes the object testing method provided by the embodiment of the present disclosure by executing the program code of the software system. In some possible implementations, the object testing system 10 can also be a hardware system with an object testing function, and when the hardware system is running, it executes the object testing method provided by the embodiment of the present disclosure. For example, the object testing system 10 can be a server with an object testing function. The server can be a cloud server, such as a central server in a central cloud computing cluster, or an edge server in an edge cloud computing cluster. Of course, the server can also be a server in a local data center. A local data center refers to a data center directly controlled by a user.
[0077] Specifically, the object testing system 10 can obtain a test object and a test scenario, test the test object in the test scenario, and obtain the current indicator values of multiple test indicators. The test scenario is a business scenario corresponding to the user's trigger operation. The test scenario can be an actual business scenario during the operation of the test object or a business scenario before the test object is launched. This is not limited in the present embodiment.
[0078] In some possible implementations, the object testing system 10 can be connected to the terminal 20, so as to obtain the object to be tested and the test scenario through the terminal 20. The terminal 20 includes but is not limited to a smart phone, a tablet computer, a laptop computer, a personal digital assistant (PDA) or a smart wearable device. Specifically, the terminal 20 can provide a test configuration interface to the user (for example, a tester), and the tester can select the object to be tested and the test scenario in the test configuration interface. In response to the tester's selection operation, the terminal 20 sends the selected object to be tested and the test scenario to the object testing system 10, so that the object testing system 10 tests the object to be tested in the test scenario and obtains the current indicator values of multiple test indicators.
[0079] Furthermore, the object testing system 10 can be connected to a database 30, which includes historical operating data of the test object and key events during the test object's operation. Specifically, the historical operating data may include operating data of the test object during a historical period of time in at least one test scenario, and key events may be events that indicate a change in the test object's state during its operation. The object testing system 10 can determine at least one key indicator from the multiple test indicators based on the current values of the multiple test indicators and the historical values of the multiple test indicators when the test object was operating in the test scenario.
[0080] In this way, the object testing system 10 can obtain the test result of the object to be tested in the test scenario according to at least one key indicator. Furthermore, the object testing system 10 can also send the test result to the terminal 20 to show the test result to the tester.
[0081] In some possible implementations, the object testing system 10 may also test the object under test over multiple cycles to obtain test results for the object under test over multiple cycles, thereby determining a trend in the test results for the object under test under the test scenario. In this manner, when the trend in the test results meets a set condition, a prompt message is sent so that the tester can promptly handle the object under test.
[0082] In the embodiment of the present disclosure, the object testing system 10 can test the object to be tested in different test scenarios. By determining the key indicators in the test scenarios, the overall test results of the object to be tested in different test scenarios can be obtained, thereby improving the comprehensiveness and accuracy of the object test.
[0083] The object testing system 10 for executing the object testing method is introduced above. Next, the object testing method provided by the embodiment of the present disclosure is described in detail.
[0084] Referring to the flow chart of the object testing method shown in FIG2 , the method includes:
[0085] S201: Obtain the object to be tested and the test scenario.
[0086] The object to be tested refers to the object waiting to be tested, which can be a computer program that can provide services to users, including but not limited to one or more of applications, cloud services, and plug-ins. In specific implementation, the object after version iteration can be determined as the object to be tested. Taking e-commerce applications as an example, during the promotion period, e-commerce applications can undergo version iteration, specifically including updating the user interface (UI) of the application and other interactive features to cooperate with the promotion activities. Before the new version goes online, the new version of the application can be tested as the object to be tested to ensure the availability of the new version of the application.
[0087] The object to be tested can provide a variety of business scenarios. During the operation of the object to be tested, the user can trigger an operation to enter the business scenario corresponding to the trigger operation, thereby completing the corresponding business in the business scenario. Different types of objects to be tested can provide different business scenarios. For example, in an e-commerce application, the user can trigger a product purchase operation by clicking the purchase control and enter the purchase scene to complete the product purchase. For another example, in a video application, the user can trigger a video playback operation by touching the play control and enter the playback scene to complete the video playback.
[0088] A test scenario can be one or more business scenarios provided by the object under test during operation. For example, a test scenario can typically be a business scenario provided by the object under test in response to high-frequency triggering operations during operation. This method can make the test scenarios of the object test more targeted by identifying business scenarios corresponding to high-frequency triggering operations such as purchase operations and resource collection operations (such as coupon collection and red envelope collection) as test scenarios.
[0089] Furthermore, the embodiments of the present disclosure support testing the object to be tested in a single test scenario or a combined test scenario. Among them, the combined test scenario refers to a test scenario that includes multiple business scenarios. Depending on the test scenario, the test frequency of the object to be tested may also be different. Since the combined test scenario includes multiple business scenarios, it takes more resources to test the object to be tested in the combined test scenario. Therefore, the test frequency of the object to be tested in the combined test scenario can be appropriately reduced. For example, the test frequency of the object to be tested in a single test scenario is 2 times / week, and the test frequency of the object to be tested in the combined test scenario can be 2 times / month. In this way, on the basis of saving resources, the object to be tested can be tested in different test scenarios to enrich the test results of the object to be tested.
[0090] Compared to traditional layered object testing, testing the object under test within test scenarios is a user-centric approach. In other words, object testing isn't limited to a single technical component. Instead, it simulates specific user actions during the operation of the object under test, testing the object within test scenarios. This allows us to assess the overall performance of the object under test across different test scenarios.
[0091] S202: Testing the test object in the test scenario to obtain current indicator values of multiple test indicators.
[0092] A test indicator is a performance indicator used to characterize the operating state of the object to be tested in a test scenario. Depending on the test scenario, the test indicator may be different. In some embodiments, the test indicator may be obtained from a scenario model corresponding to the test scenario. The scenario model may be generated when the test scenario is created, and a plurality of indicators may be defined in the scenario model. The plurality of indicators may be used as test indicators under the test scenario. For example, for an e-commerce application to be tested in a purchase scenario, a user (e.g., a tester) may create the purchase scenario as a test scenario and configure the purchase scenario accordingly. In response to the tester's configuration operation, a scenario model corresponding to the purchase scenario may be generated. The scenario model may define multiple performance indicators such as response time, remote dictionary server (Redis) capacity, and network bandwidth. The test indicator may be response time, Redis capacity, and network bandwidth. In this way, the scenario model may be used to achieve unified management of the test scenario and multiple test indicators under the test scenario.
[0093] In a specific implementation, the current index values of multiple test indicators can be determined based on the test duration of the test object within a cycle. For example, when the test object is tested within a cycle, the index values of multiple test indicators can be continuously obtained, and the average of the index values of the multiple test indicators can be determined based on the index values of the multiple test indicators and the test duration, and the average of the index values of the multiple test indicators can be used as the current index value of the multiple test indicators. The test duration of a cycle can be set according to the actual needs of the test object and the test scenario, and the embodiments of the present disclosure do not impose any restrictions on this.
[0094] In some embodiments, a logical isolation tool can be used to control the scope of influence of object testing. That is, through the logical isolation tool, the object test is controlled to only affect the test scenario, without affecting other business scenarios. In this way, the blast radius of the object test is effectively controlled. Specifically, the logical isolation tool can be deployed within the multi-layer technical components involved in the test scenario. For example, the logical isolation tool can be deployed in the form of a plug-in, and the plug-in is used to identify the test scenario, so that the object test focuses on the test scenario and does not affect other business scenarios.
[0095] S203: Determine at least one key indicator from the multiple test indicators according to the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators when the object to be tested runs in the test scenario.
[0096] The historical indicator value refers to the historical operating data of the test object when it was running within the historical time period. The historical operating data may specifically include the operating data of the test object when it was running in at least one test scenario within the historical time period. The historical time period may be the time period from the completion of the test object's development to the present, or the time period from the official launch of the test object to the present, or a time period set by the user (e.g., a tester) based on actual testing requirements, and the embodiments of the present disclosure do not impose any restrictions on this.
[0097] In specific implementations, historical operation data can be obtained using data collection tools, including but not limited to data collectors, log collectors, and link data tracking. Furthermore, to facilitate the storage of historical operation data, historical operation data can also be pre-processed, including but not limited to data cleaning, data consistency checking, and processing of invalid and missing values.
[0098] Since the historical operation data includes the operation data of the test object when it runs in different test scenarios, the historical operation data can be filtered according to the current test scenario to obtain historical indicator values of multiple test indicators when the test object runs in the test scenario.
[0099] In the embodiments of the present disclosure, the state of the object under test during testing or operation in a test scenario (also referred to as the scenario state) can be represented by the indicator values of multiple test indicators. For example, the current scenario state of the object under test can be represented by the current indicator values of multiple test indicators, and the historical scenario state of the object under test can be represented by the historical indicator values of multiple test indicators.
[0100] Furthermore, if the similarity between the indicator values of different multiple test indicators is high, it indicates that different scenario states are relatively similar. For example, when the object to be tested is running in the test scenario, the historical indicator values of multiple test indicators may include a first historical indicator value and a second historical indicator value. If the similarity between the first historical indicator value and the second historical indicator value is high, it can be indicated that the first historical scenario state corresponding to the first historical indicator value is relatively similar to the second historical scenario state corresponding to the second historical indicator value. Thus, a historical scenario state that is relatively similar to the current scenario state can be determined from the historical scenario states of the object to be tested, thereby determining at least one key indicator based on the relatively similar historical scenario states.
[0101] Specifically, the similarity between the current indicator values of multiple test indicators and the historical indicator values of multiple test indicators can be determined based on the current indicator values of multiple test indicators and the historical indicator values of multiple test indicators, and the test indicators whose similarity meets the set conditions are determined as candidate indicators. According to the labels of the candidate indicators, at least one key indicator is determined from the candidate indicators.
[0102] In some embodiments, the similarity between the current index values of the multiple test indicators and the historical index values of the multiple test indicators can be represented by the distance between the current index values of the multiple test indicators and the historical index values of the multiple test indicators in a vector space. Specifically, the current index values of the multiple test indicators and the historical index values of the multiple test indicators can be mapped to the vector space respectively, and the similarity can be determined based on the distance between the current index values of the multiple test indicators and the historical index values of the multiple test indicators in the vector space.
[0103] Distances in vector space include, but are not limited to, cosine distance, Euclidean distance, Manhattan distance, and Minkowski distance. Below, Euclidean distance is used as an example for illustration.
[0104] This test was conducted on e-commerce applications in a purchasing scenario, using multiple test metrics including response time, Redis capacity, and network bandwidth. The current values for response time were 500 milliseconds, Redis capacity was 100 gigabytes (GB), and network bandwidth was 100 megabytes.
[0105] Since the dimensions of multiple test indicators may be different, the current indicator values of multiple test indicators can be normalized and converted into dimensionless scalars to facilitate calculation. In some embodiments, the current indicator values of multiple test indicators can be converted into values between 0 and 1. The current indicator value of response time is converted to 0.88, the current indicator value of Redis capacity is converted to 0.3, and the current indicator value of network bandwidth is converted to 0.46. In this way, the coordinates of the current indicator values of multiple test indicators mapped to the vector space can be (0.88, 0.3, 0.46).
[0106] Similarly, the above conversion and mapping processes can be performed on the historical indicator values of multiple test indicators to obtain the coordinates of the historical indicator values of the multiple test indicators in the vector space. For example, the coordinates mapped to the vector space for the historical indicator values of multiple test indicators may be (0.79, 0.41, 0.4).
[0107] According to the coordinates of the current index values of multiple test indicators in the vector space and the coordinates of the historical index values of multiple test indicators in the vector space, the Euclidean distance between the current index values of multiple test indicators and the historical index values of multiple test indicators in the vector space can be determined. The specific formula is as follows:
[0108] Among them, ρ represents the Euclidean distance, (x1, y1, z1) represents the coordinates of the current indicator values of multiple test indicators in the vector space, and (x2, y2, z2) represents the coordinates of the historical indicator values of multiple test indicators in the vector space.
[0109] It should be noted that the embodiment of the present disclosure uses three test indicators as an example for description. In other embodiments, the multiple test indicators may include n test indicators. In this case, the Euclidean distance can be determined by the following formula:
[0110] Where ρ represents the Euclidean distance, (a1, a2, ..., a n ) represents the coordinates of the current index values of multiple test indicators in the vector space, (b1, b2, ..., b n ) represents the coordinates of the historical indicator values of multiple test indicators in the vector space.
[0111] Based on the above steps, the calculated Euclidean distance may be used as the similarity between the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators.
[0112] Next, test indicators whose similarity meets set conditions, such as those with a similarity greater than a set threshold, can be identified as candidate indicators. In this way, through spatial measurement, based on the similarity between the current indicator values of multiple test indicators and the historical indicator values of multiple test indicators, historical scene states that are more similar to the current scene state can be determined.
[0113] At least one key indicator can be determined from the candidate indicators using the labels of the candidate indicators. The labels of the candidate indicators are used to describe the historical test results of the candidate indicators. In some embodiments, the labels of the candidate indicators can be represented by "0" and "1". The label of the candidate indicator is "0", indicating that the historical test results of the candidate indicator are normal, for example, the historical indicator value of the candidate indicator meets the reference range of the candidate indicator. The label of the candidate indicator is "1", indicating that the historical test results of the candidate indicator are abnormal, for example, the historical indicator value of the candidate indicator does not meet the reference range of the candidate indicator.
[0114] Furthermore, at least one key indicator can be a candidate indicator labeled "1." In other words, at least one key indicator can be a test indicator with abnormal historical test results in historical scenario states that are similar to the current scenario state, so that the key indicator represents the test indicator that requires special attention in the current scenario state. This eliminates the need to analyze a large number of test indicators; by observing key indicators, efficient and targeted object testing can be achieved.
[0115] S204: Obtaining a test result of the object to be tested in a test scenario according to at least one key indicator.
[0116] In specific implementation, by observing at least one key indicator, the current indicator value of at least one key indicator can be obtained, and based on the current indicator value of at least one key indicator and the reference value set of at least one key indicator, the test result of the object to be tested in the test scenario can be obtained.
[0117] The reference value set of at least one key indicator is used to describe the indicator value of at least one key indicator when the object to be tested is in a normal state. In some possible implementations, the reference value set of at least one key indicator can be determined based on the historical indicator value of at least one key indicator.
[0118] Specifically, a fitting analysis can be performed on the relationship between the state of the test object and the key indicator based on the historical indicator value of at least one key indicator and key events during the test object's operation in the test scenario, thereby determining a reference value set for at least one key indicator. Key events are events that indicate a change in the state of the test object, and the state of the test object can specifically include normal and abnormal states.
[0119] In some embodiments, based on the historical indicator value of at least one key indicator, a trend graph of the historical indicator value of at least one key indicator changing over time can be obtained, and then based on the time point corresponding to the key event (i.e., the time point when the state of the object to be tested changes), the time set when the object to be tested is in a normal state is determined from the trend graph, and the historical indicator value of at least one key indicator corresponding to the time set when the object to be tested is in a normal state is determined as the reference value set of at least one key indicator.
[0120] In other embodiments, the state of the test object can be determined based on key events of the test object. For example, for a key event in which the test object changes from a normal state to an abnormal state, the test object is in a normal state before the key event and in an abnormal state after the key event. In this way, the state of the test object can be fitted with the historical indicator value of at least one key indicator, thereby determining the historical indicator value of the at least one key indicator when the test object is in a normal state as a reference value set.
[0121] Furthermore, a test result can be obtained based on the current indicator value of at least one key indicator and a reference value set. In some embodiments, when the current indicator value of at least one key indicator hits the reference value set, the test result of the test object under test in the test scenario is determined to be normal. In other words, the test result of the test object under test in the test scenario is normal only when the current indicator values of the key indicators all hit the reference value set, thereby achieving object testing with more stringent evaluation criteria.
[0122] In other embodiments, the score of at least one key indicator can be determined based on whether the current indicator value of at least one key indicator hits the reference value set. When the sum of the scores of at least one key indicator is greater than a preset score, the test result of the object to be tested in the test scenario is determined to be normal. For example, if the current indicator value of the key indicator hits the reference value set, the score of the key indicator can be 1. If the current indicator value of the key indicator does not hit the reference value set, the score of the key indicator can be determined based on the current indicator value of the key indicator and the upper bound or lower bound of the reference value set.
[0123] Take the response time as an example of a key indicator. The current indicator value of the response time is 70 milliseconds, and the reference value set of the response time is 10 milliseconds to 50 milliseconds. At this time, the current indicator value is greater than the upper limit of the reference value set. Therefore, the score of the response time can be determined based on the current indicator value and the upper limit of the reference value set. Specifically, the ratio of the difference between the current indicator value and the upper limit of the reference value set and the upper limit of the reference value set can be determined first, and then the difference between 1 (that is, the score when the current indicator value of the response time hits the reference value set) and the ratio is determined as the score of the response time, that is, 1-(70-50) / 50=0.6. In this way, the score of at least one key indicator is obtained. If the sum of the scores of at least one key indicator is greater than the preset score, it is determined that the test result of the object to be tested in the test scenario is normal.
[0124] In some possible implementations, a weight can also be assigned to at least one key indicator. The total score of the object to be tested in the test scenario can be determined based on a linear combination of the score and weight of the at least one key indicator. For example, if the score of the first key indicator is x1, the weight of the first key indicator is a1, and the score of the second key indicator is x2, and the weight of the second key indicator is a2, then the total score can be a1x1+a2x2. The test result is determined by comparing the total score with the preset score. In this way, the importance of at least one key indicator is taken into account when determining the test result, meeting the testing requirements of different objects.
[0125] In the embodiment of the present disclosure, by determining a historical scene state that is relatively similar to the current scene state, key indicators can be determined based on the similar historical scene state, and thus test results can be obtained based on the key indicators. Therefore, when multiple tests are performed on the object to be tested in the test scene, for example, when the object to be tested is tested in multiple cycles, since the current scene state corresponding to each test can be different, the historical scene state that is relatively similar to the current scene state can also be different, and thus the key indicators determined can also be different. In this way, the test results can be updated based on the different key indicators in multiple cycles, so as to accurately judge the state of the object to be tested.
[0126] Furthermore, the change trend of the test results of the object to be tested in the test scenario can be determined based on the test results of the object to be tested in multiple cycles. If the change trend of the test results meets the set conditions, a prompt message is sent.
[0127] Among them, the changing trend of the test results can be determined by the hit situation of at least one key indicator in the reference value set under multiple cycles. In some embodiments, the changing trend of the test results can be determined by determining the number of times that at least one key indicator misses the reference value set (also referred to as the number of misses), and according to the changing trend of the number of misses over multiple cycles. In other embodiments, the changing trend of the test results can be determined by determining the sum of the scores of at least one key indicator, and according to the changing trend of the sum of the scores of at least one key indicator over multiple cycles. In this way, if the changing trend of the test results meets the set conditions, such as the number of misses is on an increasing trend or the sum of the scores of at least one key indicator is on a decreasing trend, a prompt message can be sent to enable the user (for example, a tester) to pay attention to the state changes of the object to be tested in the test scenario, so as to facilitate timely manual intervention.
[0128] Based on the above description, an embodiment of the present disclosure provides an object testing method. The method first obtains a to-be-tested object and a test scenario, tests the to-be-tested object in the test scenario, obtains current values of multiple test indicators, then determines at least one key indicator from the multiple test indicators based on the current values of the multiple test indicators and historical values of the multiple test indicators when the to-be-tested object is running in the test scenario, and obtains a test result of the to-be-tested object in the test scenario based on the at least one key indicator.
[0129] This method supports overall testing of the object to be tested in the test scenario, and determines the key indicators under the test scenario based on the current indicator values and historical indicator values of the test indicators. In this way, based on the key indicators under the test scenario, the overall test results of the object to be tested in the test scenario are obtained. Compared with the test results of the object to be tested at a certain layer, this method improves the comprehensiveness and accuracy of the object test and can meet different business needs.
[0130] The object testing method provided by the embodiment of the present disclosure is described in detail above with reference to FIG. 1 and FIG. 2 . The system and electronic device provided by the embodiment of the present disclosure will be described below with reference to the accompanying drawings.
[0131] Referring to the structural diagram of the object testing system shown in FIG3 , the object testing system may be a software system deployed in a server to implement the object testing method corresponding to the embodiment shown in FIG2 . In some embodiments, the object testing system may also be a hardware system. The system 10 includes:
[0132] An acquisition unit 101 is used to acquire an object to be tested and a test scenario;
[0133] The testing unit 102 is configured to test the object to be tested in the test scenario and obtain current indicator values of multiple test indicators;
[0134] A determining unit 103 is configured to determine at least one key indicator from the multiple test indicators based on current indicator values of the multiple test indicators and historical indicator values of the multiple test indicators when the object to be tested runs in the test scenario;
[0135] The determining unit 103 is further configured to obtain a test result of the object to be tested in the test scenario according to the at least one key indicator.
[0136] In some possible implementations, the determining unit 103 is specifically configured to:
[0137] Determining, based on the current index values of the plurality of test indicators and the historical index values of the plurality of test indicators, similarities between the current index values of the plurality of test indicators and the historical index values of the plurality of test indicators;
[0138] Determine the test indicators whose similarity meets the set conditions as candidate indicators;
[0139] At least one key indicator is determined from the candidate indicators according to the labels of the candidate indicators, where the labels of the candidate indicators are used to describe historical test results of the candidate indicators.
[0140] In some possible implementations, the determining unit 103 is specifically configured to:
[0141] Mapping the current index values of the plurality of test indicators and the historical index values of the plurality of test indicators to vector spaces respectively;
[0142] The similarity is determined according to the distance between the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators in the vector space.
[0143] In some possible implementations, the determining unit 103 is specifically configured to:
[0144] Determining a reference value set for the at least one key indicator based on a historical indicator value of the at least one key indicator;
[0145] A test result of the object to be tested in the test scenario is obtained according to the current indicator value of the at least one key indicator and the reference value set.
[0146] In some possible implementations, the determining unit 103 is specifically configured to:
[0147] When the current indicator value of the at least one key indicator matches the reference value set, it is determined that the test result of the object to be tested in the test scenario is normal; or
[0148] The score of the at least one key indicator is determined based on whether the current indicator value of the at least one key indicator hits the reference value set. When the sum of the scores of the at least one key indicator is greater than the preset score, it is determined that the test result of the object to be tested in the test scenario is normal.
[0149] In some possible implementations, the determining unit 103 is specifically configured to:
[0150] Based on the historical indicator value of the at least one key indicator and the key events during the operation of the object to be tested in the test scenario, a fitting analysis is performed on the relationship between the state of the object to be tested and the key indicators to determine a reference value set of the at least one key indicator, where the key event is an event that characterizes a change in the state of the object to be tested.
[0151] In some possible implementations, the determining unit 103 is further configured to:
[0152] Determining a change trend of the test results of the object to be tested in the test scenario according to the test results of the object to be tested in multiple cycles;
[0153] The system further comprises:
[0154] The prompt unit 104 is configured to send a prompt message if the change trend of the test result meets a set condition.
[0155] According to the embodiment of the present disclosure, the object testing system 10 may correspond to executing the method described in the embodiment of the present disclosure, and the above-mentioned and other operations and / or functions of each module / unit of the object testing system 10 are respectively for implementing the corresponding processes of each method in the embodiment shown in FIG. 2 , which will not be repeated here for the sake of brevity.
[0156] The embodiment of the present disclosure further provides an electronic device 40. The electronic device 40 is specifically configured to implement the functions of the object testing system 10 in the embodiment shown in FIG3.
[0157] FIG4 provides a schematic diagram of the structure of an electronic device 40. As shown in FIG4 , the electronic device 40 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. Various programs and data required for the operation of the electronic device 40 are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0158] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 40 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 4 illustrates the electronic device 40 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0159] The present disclosure also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device, or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the object testing method applied to the object testing system 10.
[0160] The present disclosure also provides a computer program product comprising one or more computer instructions that, when loaded and executed on a computing device, fully or partially generate the process or function described in the present disclosure.
[0161] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, or data center to another website, computer, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0162] When the computer program product is executed by a computer, the computer performs any of the aforementioned methods for displaying a page. The computer program product may be a software installation package, and when any of the aforementioned methods for displaying a page is needed, the computer program product may be downloaded and executed on the computer.
[0163] The descriptions of the processes or structures corresponding to the above figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
Claims
1. An object testing method, comprising: Get the object to be tested and the test scenario; Testing the object to be tested in the test scenario to obtain current indicator values of multiple test indicators; Determine at least one key indicator from the multiple test indicators according to current indicator values of the multiple test indicators and historical indicator values of the multiple test indicators when the object to be tested runs in the test scenario; A test result of the object to be tested in the test scenario is obtained according to the at least one key indicator.
2. The method according to claim 1, wherein: The determining at least one key indicator from the multiple test indicators according to the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators when the object to be tested runs in the test scenario includes: Determine, according to the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators, the similarity between the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators; Determine the test indicators whose similarity meets the set conditions as candidate indicators; At least one key indicator is determined from the candidate indicators according to the labels of the candidate indicators, wherein the labels of the candidate indicators are used to describe historical test results of the candidate indicators.
3. The method according to claim 2, wherein: The determining, according to the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators, the similarity between the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators comprises: Mapping the current index values of the multiple test indexes and the historical index values of the multiple test indexes to vector spaces respectively; The similarity is determined according to the distance between the current indicator values of the multiple test indicators and the historical indicator values of the multiple test indicators in the vector space.
4. The method according to any one of claims 1 to 3, wherein: The obtaining, according to the at least one key indicator, a test result of the object to be tested in the test scenario includes: Determine the at least one key indicator based on the historical indicator value of the at least one key indicator A reference value set for According to the current indicator value of the at least one key indicator and the reference value set, a test result of the object to be tested in the test scenario is obtained.
5. The method according to claim 4, wherein: The obtaining, according to the current indicator value of the at least one key indicator and the reference value set, a test result of the object to be tested in the test scenario, comprises: When the current indicator value of the at least one key indicator matches the reference value set, it is determined that the test result of the object to be tested in the test scenario is normal; or, The score of the at least one key indicator is determined based on whether the current indicator value of the at least one key indicator hits the reference value set. When the sum of the scores of the at least one key indicator is greater than a preset score, it is determined that the test result of the object to be tested in the test scenario is normal.
6. The method according to claim 4, wherein: The determining, according to the historical indicator value of the at least one key indicator, a reference value set of the at least one key indicator comprises: Based on the historical indicator value of the at least one key indicator and the key events during the operation of the object to be tested in the test scenario, a fitting analysis is performed on the relationship between the state of the object to be tested and the key indicators, and a reference value set of the at least one key indicator is determined, wherein the key event is an event that characterizes a change in the state of the object to be tested.
7. The method according to any one of claims 1 to 6, further comprising: Determining a change trend of the test results of the object to be tested in the test scenario according to the test results of the object to be tested in multiple cycles; If the change trend of the test result meets the set conditions, a prompt message is sent.
8. The method according to any one of claims 1 to 7, wherein: The step of testing the object to be tested in the test scenario to obtain current indicator values of multiple test indicators includes: Testing the object to be tested within a cycle, and continuously obtaining indicator values of multiple test indicators; According to the indicator values of the multiple test indicators and the test duration, the average of the indicator values of the multiple test indicators is determined, and the average of the indicator values of the multiple test indicators is used as the current indicator value of the multiple test indicators.
9. The method according to any one of claims 1 to 3, wherein: The obtaining, according to the at least one key indicator, a test result of the object to be tested in the test scenario includes: Assigning a weight to the at least one key indicator, and determining a total score of the object to be tested in the test scenario according to a linear combination of the score of the at least one key indicator and the weight; The test result is determined by comparing the total score with a preset score.
10. The method according to claim 6, wherein: The performing fitting analysis on the relationship between the state of the object to be tested and the key indicator according to the historical indicator value of the at least one key indicator and the key events during the operation of the object to be tested in the test scenario to determine the reference value set of the at least one key indicator includes: Obtaining, according to the historical indicator value of the at least one key indicator, a trend graph of the historical indicator value of the at least one key indicator changing over time; According to the time points corresponding to the key events, determining from the trend graph a time set during which the object to be tested is in a normal state; The historical indicator value of the at least one key indicator corresponding to the time set when the object to be tested is in a normal state is determined as a reference value set of the at least one key indicator.
11. The method according to claim 7, wherein: The determining, according to the test results of the object to be tested in a plurality of cycles, a change trend of the test results of the object to be tested in the test scenario includes: Determine the number of the at least one key indicator miss reference value set, and determine the change trend of the test result according to the change trend of the miss number in multiple cycles; or, The sum of the scores of the at least one key indicator is determined, and the change trend of the test result is determined according to the change trend of the sum of the scores of the at least one key indicator in multiple cycles.
12. An object testing system, comprising: An acquisition unit, configured to acquire an object to be tested and a test scenario; A testing unit is configured to test the object to be tested in the test scenario and obtain current indicator values of multiple test indicators; a determining unit configured to determine at least one key indicator from the multiple test indicators according to current indicator values of the multiple test indicators and historical indicator values of the multiple test indicators when the object to be tested runs in the test scenario; The determination unit is further configured to obtain a test result of the object to be tested in the test scenario according to the at least one key indicator.
13. An electronic device comprising a processor and a memory; wherein: The processor is configured to execute instructions stored in the memory so that the electronic device performs the method according to any one of claims 1 to 11.
14. A computer-readable storage medium comprising instructions, wherein: The instruction instructs the electronic device to execute the method according to any one of claims 1 to 11.
15. A computer program product, wherein: When the computer program product is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Performance measuring method and terminal of application program
CN104166619A
Multi-version performance test method and apparatus
CN106201856A
Application performance test method and device, medium and computer program product
CN113656270A
Application program testing method and device, computer readable storage medium and equipment
CN114860563A
Method and apparatus for determining coping capability boundary information of an unmanned vehicle and electronic device
US20200019659A1
