CN113220573B - Test method and device for micro-service architecture and electronic equipment - Google Patents
Test method and device for micro-service architecture and electronic equipment Download PDFInfo
- Publication number
- CN113220573B CN113220573B CN202110519591.3A CN202110519591A CN113220573B CN 113220573 B CN113220573 B CN 113220573B CN 202110519591 A CN202110519591 A CN 202110519591A CN 113220573 B CN113220573 B CN 113220573B
- Authority
- CN
- China
- Prior art keywords
- service module
- test
- module
- flow data
- change
- 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.)
- Active
Links
- 238000010998 test method Methods 0.000 title claims description 23
- 238000012360 testing method Methods 0.000 claims abstract description 170
- 238000001914 filtration Methods 0.000 claims abstract description 11
- 230000008859 change Effects 0.000 claims description 71
- 230000004044 response Effects 0.000 claims description 24
- 238000000034 method Methods 0.000 claims description 23
- 238000012545 processing Methods 0.000 claims description 13
- 230000002159 abnormal effect Effects 0.000 claims description 4
- 230000000737 periodic effect Effects 0.000 claims description 2
- 238000004519 manufacturing process Methods 0.000 description 24
- 238000004590 computer program Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 238000011056 performance test Methods 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The disclosure discloses a testing method for a micro-service architecture, relates to the technical field of cloud computing, and further relates to the technical field of distributed systems. The specific implementation scheme is as follows: acquiring flow data generated on line; identifying read flow data generated by a read operation in the acquired flow data; filtering flow data except read flow data in the acquired flow data to obtain a test data set; and testing the business modules in the micro-service architecture by using the test data set. The disclosure also discloses an apparatus for testing of a micro-service architecture, an electronic device, a non-transitory computer-readable storage medium storing computer instructions.
Description
Technical Field
The disclosure relates to the technical field of cloud computing, and further relates to the technical field of distributed systems. The present disclosure provides a test method for a micro-service architecture, a test apparatus for a micro-service architecture, an electronic device, a non-transitory computer-readable storage medium storing computer instructions, a computer program product.
Background
The service modules in the micro-service architecture need to be tested after being changed and before being brought online. In a conventional testing scenario, a set of off-line environments similar to the production environment may be provided for testing. The data for the test may be constructed manually or generated by on-line drainage.
Disclosure of Invention
The present disclosure provides a test method, apparatus, device, computer readable storage medium and computer program product for a micro-service architecture.
According to a first aspect, there is provided a test method for a micro-service architecture, comprising: acquiring flow data generated on line; identifying read flow data generated by a read operation in the acquired flow data; filtering flow data except read flow data in the acquired flow data to obtain a test data set; and testing the business modules in the micro-service architecture by using the test data set.
According to a second aspect, there is provided a test apparatus for a micro-service architecture, comprising: the acquisition module is used for acquiring flow data generated on line as a test data set; the identification module is used for identifying read flow data generated by a read operation in the acquired flow data; the filtering module is used for filtering flow data except the read flow data in the acquired flow data to obtain test data; and the test module is used for testing the service module in the micro-service architecture by using the test data.
According to a third aspect, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executable by the at least one processor to enable the at least one processor to perform the method.
According to a fourth aspect, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer as described above to perform the method as described above.
According to a fifth aspect, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method described above.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram of an exemplary system architecture to which a test method for a micro-service architecture may be applied, according to one embodiment of the present disclosure;
FIG. 2 is a flow chart of a test method for a micro-service architecture according to one embodiment of the present disclosure;
FIG. 3 is a flow chart of a method for testing a business module according to another embodiment of the present disclosure;
FIGS. 4A and 4B are schematic diagrams of a testing method for a micro-service architecture according to one embodiment of the present disclosure;
FIG. 5 is a block diagram of a test apparatus for a micro-service architecture according to one embodiment of the present disclosure;
Fig. 6 is a block diagram of an electronic device for a test method of a micro-service architecture according to one embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the technical scheme of the disclosure, the related data (such as flow data) is recorded, stored and applied, and the like, which all conform to the regulations of related laws and regulations and do not violate the popular regulations of the public order.
The business modules contained in an online system employing a micro-service architecture can be up to hundreds. The change of the business module is in the unit level of day. Before the changed module is on line, performance test and regression test are needed to be carried out on the changed module so as to reduce possible stability and speed risk brought by the change of the module to the on-line system, wherein the regression test is to carry out the test again on the changed new version module by a pointer so as to confirm that no new error is introduced in the modification or other code errors are caused. The performance test or the regression test needs to provide test data to the changed service module, and then the changed service module executes corresponding operation in the test environment to obtain a test result.
In the traditional test scene, the test environment can be a set of off-line environment similar to the production environment, and the problems of insufficient simulation, high maintenance cost and the like exist.
In a conventional test scenario, the test data may be generated by selecting a manual configuration or an on-line drainage mode. Manually constructed data has significant drawbacks such as high maintenance costs and insufficient data diversity to reflect an online real use scenario. In addition, by adopting an on-line drainage mode, the write operation is required to be isolated, so that pollution to production environment data is avoided.
Embodiments of the present disclosure provide a test method for a micro-service architecture. The real flow data generated on the line is obtained as a test data set, and the data in the test data set is labeled to filter out the write flow data generated by the write operation, so that the accuracy of the test data is improved, and the accuracy of the test is improved.
Fig. 1 is a schematic diagram of an exemplary system architecture to which a test method for a micro-service architecture may be applied, according to one embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include a micro-service architecture 110 and a test management platform 120.
The micro service architecture 110 includes a service layer 111, and a plurality of business modules, such as a business module 1111 and a business module 1112, are included in the service layer 111. The environment in which the business module operates may be referred to as a production environment. The micro service architecture 110 may also include an access layer, an interface layer, and a storage layer (not shown in fig. 1). The micro-service architecture can be a cloud native architecture, so that the micro-service architecture has the characteristics of resource isolation and containerization under the cloud native application.
Illustratively, the micro service architecture 110 may be a service architecture that provides various services, such as a background management service architecture that provides support for websites or client applications that users browse with terminal devices. The service architecture may be deployed at a cloud server. The cloud server is also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service ("Virtual PRIVATE SERVER", virtual special server or simply "VPS") are overcome. The server may also be a server of a distributed system or a server that incorporates a blockchain.
The test management platform 120 may obtain online data from a production environment, generate a test data set according to the online data, and also may obtain artificially constructed data to generate a test data set. When the service module needs to be tested, the test management platform 120 may deploy the service module to be tested in a production environment, for example, the service layer 111, or may deploy the service module to be tested in a simulation environment built by simulating the production environment. After deployment, testing the service module to be tested by using the test data set to obtain a test result. When the service module to be tested is deployed to the micro-service architecture, the micro-service architecture can be a cloud native architecture, and the service module to be tested is isolated from other service modules when corresponding operation is executed, so that the stability of the original system is not affected when the service module to be tested is tested in the production environment.
Fig. 2 is a flow chart of a test method for a micro-service architecture according to one embodiment of the present disclosure.
As shown in fig. 2, the test method 200 for a micro service architecture may include operations S210 to S240. A flowchart of a test method for a micro-service architecture according to one embodiment of the present disclosure will be described in detail with reference to fig. 2.
In operation S210, flow data generated on a line is acquired.
For example, traffic data generated in an on-line production environment may be recorded over a period of time (e.g., 0.5 hours or 1 hour), or all data generated by the on-line production environment may be recorded.
For example, the traffic data may include historical traffic peaks for traffic modules. The historical traffic peak may be used as a traffic QPS (query-per-second) for the test traffic module.
It should be appreciated that the data recorded from the production environment may be desensitized, which is data from which user sensitive information has been removed.
In operation S220, read flow data generated by a read operation among the acquired flow data is identified.
The traffic data may have therein read traffic data resulting from a read operation and write traffic data resulting from a write operation. The flow data generated by the read operation is processed multiple times without affecting the production environment. The processing of the traffic data generated by the write operation multiple times can affect the stability of the production environment, possibly resulting in system errors.
For example, the user searches for the commodity, and the corresponding service module returns the commodity list and the commodity introduction, and the flow data generated in the production environment at this time is read. When the user purchases commodity and settles, the corresponding service module deducts the corresponding fee from the balance of the user, and the flow data generated in the production environment is written.
In operation S230, flow data other than the read flow data in the acquired flow data is filtered out, so as to obtain a test data set.
The stability of the system is not affected by executing the operation according to the read flow data, so that data except the read flow data can be filtered out, and the set of the read flow data is used as a test data set.
For example, the flow data generated by deducting the corresponding fees from the balance of the user when the user purchases the commodity and settles the settlement can be filtered out, and only the flow data generated by returning the commodity list and the commodity introduction when the user searches the commodity by the corresponding service module in the production environment is reserved.
In operation S240, the service modules in the micro service architecture are tested using the test data set.
For example, a test data set only including read flow data is input into the service module, and a test result obtained by the service module executing corresponding operation according to the test data set is obtained. For example, a test data set only including read flow data is input into a service module, and the service module is tested according to the flow QPS at the same time, so as to obtain a test result obtained by the service module executing corresponding operation according to the test data set under the condition of a certain flow QPS.
According to the embodiment of the disclosure, the real flow data generated on line is used as the test data set, and the write flow data generated by the write operation is filtered, so that the accuracy of the test data is improved, and the accuracy of the test is improved.
As an alternative embodiment of the present disclosure, identifying read traffic data resulting from a read operation in the acquired traffic data includes tagging the identified read traffic data.
For example, data may be recorded when a user searches for a commodity, and after the corresponding service module returns a commodity list and a commodity introduction, a tag may be added to the flow data generated in the production environment recorded at this time.
The labels are added for reading the flow data, so that the write flow data without the labels can be filtered out rapidly, and the generation efficiency of the test data set is improved.
As an alternative embodiment of the present disclosure, the acquiring the on-line generated traffic data as the test data set includes periodically acquiring the on-line generated traffic data.
For example, traffic data generated in a production environment may be recorded at intervals. For example, at intervals of 0.5 hours, or at intervals of 1 hour. For example, traffic data generated in the production environment within 0.5 hours is recorded every 0.5 hours, or traffic data generated in the production environment within 1 hour is recorded every 1 hour.
Fig. 3 is a flow chart of a method for testing a business module according to another embodiment of the present disclosure.
As shown in fig. 3, the test method 340 for the micro-service architecture includes operations S341 to S346. Those skilled in the art will appreciate that operations S341-S346 are one example implementation of operation S240 in a test method such as that described with reference to fig. 2, in order to test traffic modules in the micro-service architecture described above using a test data set. A flowchart of a method of testing a business module according to another embodiment of the present disclosure will be described in detail with reference to fig. 3.
In operation S341, in response to the service module being changed, the changed service module after the change and the service module before the change, which are the changed service module and the original service module, are deployed, respectively.
The change of the service module may be in days. In response to a change in a business module, the test management platform deploys the changed business module and the business module before the change into a production environment, for example, into a service layer. After deployment is completed, the changed service module is a changed service module, and the service module before the change is an original service module.
For example, the on-line version of the business module is v1 (i.e., business module v 1), and after the developer performs the function upgrade on the business module, the process iterates to version v2 (i.e., business module v 2). The test management platform responds to the change of the service module, deploys the service module v1 and the service module v2 into a service layer of the micro-service architecture, wherein the service module v1 is the original service module, and the service module v2 is the changed service module.
In operation S342, the change service module and the original service module are tested using the test data set, so as to obtain a test result.
And the change service module and the original service module execute related operations according to the test data set to respectively obtain the output (test result) of the change service module and the output (original output result) of the original service module.
For example, the change service module and the original service module perform a commodity search operation according to the test data set. The test data set includes keywords of the goods searched for in a certain time. After the commodity searching operation is executed by the change service module and the original service module, the test result and the original output result are respectively returned. The test result and the original output result both comprise the searched commodity list and the commodity introduction.
For example, the change service module and the original service module perform a commodity search operation according to the test data set. And simultaneously, testing the change service module and the original service module according to the flow QPS. The test data set includes keywords of the searched commodity, and the data amount in the test data set is adapted to the flow rate QPS. After the commodity searching operation is executed by the change service module and the original service module, the test result and the original output result are respectively returned. The test result and the original output result both comprise the searched commodity list and the commodity introduction.
For example, the test results may be stored in a designated location of the test management platform for a developer to view detailed information of the test through the test management platform.
In operation S343, it is determined whether the test result meets a predetermined condition, and it is determined whether the change service module passes the test.
The predetermined condition may include at least one of: the difference between the response content of the change service module to the request and the response content of the original service module to the request is within a preset range; the response time of the change service module to the request is smaller than or equal to the response time of the original service module to the request; the change service module does not occupy abnormal resources; and the change service module does not have a processing interrupt.
For example, when the test data set contains keywords of the user searching for the commodity, the change service module and the original service module respond to the commodity searching request, execute commodity searching operation according to the keywords of the user searching for the commodity, and respectively return the test result and the original output result after respective response time. The test result and the original output result both comprise a commodity list and a commodity introduction. For example, the predetermined condition may be that the difference between the test result and the list of goods in the original output result is within a predetermined range. For example, the predetermined condition may be that the time for the change service module to respond to the commodity search request is less than the time for the original service module to respond to the commodity search request. For example, the predetermined condition is that the change service module is normal to the occupation condition of the system resource after responding to the commodity searching operation. For example, the predetermined condition is that after the change business module responds to the commodity searching operation, each processing procedure in the commodity searching operation is complete and continuous, and no interruption phenomenon occurs.
For example, during testing, the change service module and the original service module may perform testing operations under a certain flow QPS condition. For example, the change service module and the original service module respond to the commodity searching request, execute commodity searching operation according to the keyword of the user searching for the commodity under the condition of a certain flow QPS, and respectively return the test result and the original output result after respective response time. For example, the predetermined condition may be: under the condition of the flow QPS, the occupation condition of the system resources after the change service module responds to commodity searching operation is normal. For example, the predetermined condition may be: under the condition of the flow QPS, after the change business module responds to the commodity searching operation, each processing process in the commodity searching operation is complete and continuous, and no interruption phenomenon or breakdown phenomenon occurs. For example, the predetermined condition may be: under the condition of the flow rate QPS, the difference between the test result and the commodity list in the original output result is within a preset range. For example, the predetermined condition may be: under the condition of the flow QPS, the time of the change service module responding to the commodity searching request is smaller than the time of the original service module responding to the commodity searching request. The change service module and the original service module are tested according to a certain flow QPS to examine whether the change service module can adapt to a certain access pressure.
Further, for example, in a case where it is determined that the test result meets a predetermined condition, it is determined that the change service module passes the test.
Further, for example, in a case where it is determined that the test result does not meet a predetermined condition, it is determined that the change service module fails the test. Further, for example, when it is determined that the change service module fails the test, the change service module that fails the test may be prevented from being online.
After the test result is obtained, the change service module and the original service module are deleted in operation S346.
For example, after obtaining the test result according to the output results of the change service module and the original service module, the test management platform deletes the change service module and the original service module from the service layer. The occupied space of the micro-service architecture can be released, and the resource utilization efficiency is improved.
It should be noted that, in the embodiment of the present disclosure, the operations described above may be performed sequentially, may be performed in parallel, or may be performed in a different order. For example, operation S346 may also be performed after operation S342 and before operation S343; or operation S346 may be also performed in parallel with operations S343 to S345.
Fig. 4A and 4B are schematic diagrams of a test method for a micro-service architecture according to one embodiment of the present disclosure. The principle of a test method for a micro service architecture according to one embodiment of the present disclosure will be described in detail with reference to fig. 4A and 4B.
As shown in fig. 4A, the micro service architecture 110 includes a service layer 111, and a plurality of service modules, such as a service module 1111 and a service module 1112, run within the service layer 111. The operation environment of the service module is a production environment, and flow data can be generated in the production environment in the operation process of the service module.
Test management platform 120 includes a test data layer 121 and a test deployment layer 122, test data layer 121 including a traffic recording module 1211, a traffic filtering module 1212, and a test data set storage module 1213. The flow recording module 1211 records flow data from the production environment. When the recorded flow data passes through the flow filtering module 1212, the read flow data is tagged, then the read flow data in the flow data is retained, and the write flow data is filtered. The test data set storage module 1213 stores read traffic data with tags forming a test data set.
As shown in fig. 4B, in response to a service module change, test management platform 120, test deployment layer 122 deploys change service module 1221 and original service module 1222 to service layer 111. The change service module 1221 and the original service module 1222 respectively acquire test data sets from the test data set storage module 1213, and perform related operations according to the test data sets. After the operation is finished, the change service module 1221 generates a test result, and the original service module 1222 generates an original output result. The test management platform 120 determines whether the test passes according to the test result. After obtaining the test result, the test deployment layer 122 may delete the changed service module 1221 and the original service module 1222 deployed in the service layer 111.
Fig. 5 is a block diagram of a testing apparatus for a micro-service architecture according to one embodiment of the present disclosure.
As shown in fig. 5, a test apparatus 500 for a micro-service architecture may include an acquisition module 510, an identification module 520, a filtering module 530, and a test module 540.
An acquisition module 510 is configured to acquire flow data generated on-line as a test data set.
The identification module 520 is configured to identify read traffic data generated by a read operation from the acquired traffic data.
And the filtering module 530 is configured to filter out flow data other than the read flow data in the acquired flow data, so as to obtain test data.
And the testing module 540 is configured to test the service modules in the micro service architecture by using the testing data.
As an optional embodiment of the disclosure, the identification module includes: and a tagging unit for tagging the identified read traffic data.
As an alternative embodiment of the present disclosure, the test module includes: the deployment unit is used for responding to the change of the service module, deploying the changed service module after the change and the service module before the change, and respectively serving as a changed service module and an original service module; and the testing unit is used for testing the change service module and the original service module by using the testing data set to obtain a testing result.
As an optional embodiment of the disclosure, the system further includes a determining module, configured to determine that the change service module passes the test if the test result meets a predetermined condition; the predetermined condition includes at least one of: the difference between the response content of the change service module to the request and the response content of the original service module to the request is within a preset range; the response time of the change service module to the request is smaller than or equal to the response time of the original service module to the request; the change service module does not occupy abnormal resources; and the change service module does not have a processing interrupt.
As an optional embodiment of the disclosure, the system further includes a deleting module, configured to delete the change service module and the original service module after obtaining the test result.
As an optional embodiment of the disclosure, the acquiring module includes a periodic acquiring unit configured to periodically acquire flow data generated on-line.
It should be understood that, in the embodiments of the apparatus portion of the present disclosure, the embodiments of the method portion of the present disclosure are the same or similar, and the technical problems to be solved and the technical effects to be achieved are also the same or similar, which are not described herein in detail.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
As shown in fig. 6, fig. 6 is a block diagram of an electronic device for a test method of a micro-service architecture according to one embodiment of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the device 600 may also be stored. The computing unit 601, ROM602, and RAM603 are connected to each other by a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Various components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, mouse, etc.; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 601 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as testing methods for micro-service architecture. For example, in some embodiments, the test method for a micro-service architecture may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into RAM 603 and executed by computing unit 601, one or more steps of the test method for micro-service architecture described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the test method for the micro-service architecture by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the disclosure, real flow data generated on the line are obtained to serve as a test data set, and data in the test data set are labeled to filter write flow data generated due to write operation; thereby improving the accuracy of the test data and thus the accuracy of the test.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present application may be performed in parallel or sequentially or in a different order, provided that the desired results of the disclosed embodiments are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.
Claims (12)
1. A test method for a micro-service architecture, comprising:
acquiring flow data generated on line;
identifying read flow data generated by a read operation in the acquired flow data, wherein the read flow data comprises a commodity list returned by a service module in response to the operation of searching commodities by a user;
Filtering flow data except read flow data in the acquired flow data to obtain a test data set, wherein the test data set comprises keywords of searched commodities; and
Testing the business modules in the micro-service architecture by using a test data set;
wherein the testing of the business modules in the micro-business architecture using the test dataset comprises:
In response to the service module being changed, deploying a changed service module and a changed service module before being changed as a changed service module and an original service module respectively;
Performing commodity searching operation according to a test data set by using the change service module and the original service module to respectively obtain a test result and an original output result, wherein the test result and the original output result both comprise searched commodity lists;
And under the condition that the test result meets a preset condition, determining that the change service module passes the test, wherein the preset condition comprises that the difference between the commodity list in the test result and the commodity list in the original output result is in a preset range.
2. The method of claim 1, wherein the identifying read traffic data resulting from a read operation in the acquired traffic data comprises:
The identified read traffic data is tagged.
3. The method of claim 1, wherein the predetermined condition further comprises at least one of:
the difference between the response content of the change service module to the request and the response content of the original service module to the request is within a preset range;
The response time of the change service module to the request is smaller than or equal to the response time of the original service module to the request;
The change service module does not occupy abnormal resources; and
The change service module does not experience a processing interrupt.
4. The method of claim 1, further comprising deleting the change service module and the original service module after the test result is obtained.
5. The method of claim 1, wherein the acquiring the on-line generated traffic data as a test data set comprises periodically acquiring the on-line generated traffic data.
6. A test apparatus for a micro-service architecture, comprising:
the acquisition module is used for acquiring flow data generated on line;
The identification module is used for identifying read flow data generated by a read operation in the acquired flow data, wherein the read flow data comprises a commodity list returned by the service module in response to the operation of searching commodities by a user;
the filtering module is used for filtering flow data except the read flow data in the acquired flow data to obtain a test data set, wherein the test data set comprises keywords of searched commodities; and
The testing module is used for testing the business modules in the micro-service architecture by using the testing data set;
Wherein, the test module includes:
The deployment unit is used for responding to the change of the service module, deploying the changed service module after the change and the service module before the change, and respectively serving as a changed service module and an original service module;
the testing unit is used for executing commodity searching operation according to the testing data set by using the change service module and the original service module to respectively obtain a testing result and an original output result, wherein the testing result and the original output result both comprise searched commodity lists;
and the test result determining unit is used for determining that the change service module passes the test under the condition that the test result accords with a preset condition, wherein the preset condition comprises that the difference between the commodity list in the test result and the commodity list in the original output result is in a preset range.
7. The apparatus of claim 6, wherein the identification module comprises:
And a tagging unit for tagging the identified read traffic data.
8. The apparatus of claim 6, wherein the predetermined condition further comprises at least one of:
the difference between the response content of the change service module to the request and the response content of the original service module to the request is within a preset range;
The response time of the change service module to the request is smaller than or equal to the response time of the original service module to the request;
The change service module does not occupy abnormal resources; and
The change service module does not experience a processing interrupt.
9. The apparatus of claim 6, further comprising:
and the deleting module is used for deleting the change service module and the original service module after the test result is obtained.
10. The apparatus of claim 6, wherein the acquisition module comprises:
And the periodic acquisition unit is used for periodically acquiring the flow data generated on the line.
11. An electronic device, comprising:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110519591.3A CN113220573B (en) | 2021-05-12 | 2021-05-12 | Test method and device for micro-service architecture and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110519591.3A CN113220573B (en) | 2021-05-12 | 2021-05-12 | Test method and device for micro-service architecture and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113220573A CN113220573A (en) | 2021-08-06 |
CN113220573B true CN113220573B (en) | 2024-06-25 |
Family
ID=77095415
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110519591.3A Active CN113220573B (en) | 2021-05-12 | 2021-05-12 | Test method and device for micro-service architecture and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113220573B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113795027A (en) * | 2021-08-09 | 2021-12-14 | 信通院车联网创新中心(成都)有限公司 | A C-V2X Test System |
CN114064475B (en) * | 2021-11-11 | 2024-08-20 | 中国联合网络通信集团有限公司 | Cloud native application testing method, device, equipment and storage medium |
US12056042B2 (en) * | 2022-03-15 | 2024-08-06 | Accenture Global Solutions Limited | System and method for serverless application testing |
US20240272954A1 (en) * | 2023-02-15 | 2024-08-15 | International Business Machines Corporation | Dynamic reconfiguration of microservice test environment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107273252A (en) * | 2017-06-13 | 2017-10-20 | 北京小度信息科技有限公司 | Method of testing and device |
CN109614307A (en) * | 2018-09-29 | 2019-04-12 | 阿里巴巴集团控股有限公司 | The method, apparatus and server of pressure test on the line of operation system |
CN112100070A (en) * | 2020-09-15 | 2020-12-18 | 北京三快在线科技有限公司 | Version defect detection method and device, server and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105915406B (en) * | 2016-04-12 | 2019-10-18 | 北京齐尔布莱特科技有限公司 | A kind of test method, device and calculate equipment |
CN106533804A (en) * | 2016-12-22 | 2017-03-22 | 成都西加云杉科技有限公司 | Network operation support system |
CN110543413A (en) * | 2019-07-22 | 2019-12-06 | 深圳壹账通智能科技有限公司 | Business system testing method, device, equipment and storage medium |
CN112631920A (en) * | 2020-12-28 | 2021-04-09 | 广州品唯软件有限公司 | Test method, test device, electronic equipment and readable storage medium |
-
2021
- 2021-05-12 CN CN202110519591.3A patent/CN113220573B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107273252A (en) * | 2017-06-13 | 2017-10-20 | 北京小度信息科技有限公司 | Method of testing and device |
CN109614307A (en) * | 2018-09-29 | 2019-04-12 | 阿里巴巴集团控股有限公司 | The method, apparatus and server of pressure test on the line of operation system |
CN112100070A (en) * | 2020-09-15 | 2020-12-18 | 北京三快在线科技有限公司 | Version defect detection method and device, server and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113220573A (en) | 2021-08-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113220573B (en) | Test method and device for micro-service architecture and electronic equipment | |
CN114816393B (en) | Information generation method, device, equipment and storage medium | |
US11243742B2 (en) | Data merge processing based on differences between source and merged data | |
CN115080307A (en) | Mounting recovery method and device, electronic equipment and readable storage medium | |
CN115598505A (en) | Chip detection method, device, equipment and storage medium | |
CN115099175B (en) | Method and device for acquiring time sequence netlist, electronic equipment and storage medium | |
CN113127357A (en) | Unit testing method, device, equipment, storage medium and program product | |
CN113190746B (en) | Recommendation model evaluation method and device and electronic equipment | |
CN114490408A (en) | Test case generation method, device, equipment, storage medium and product | |
CN116126719A (en) | Interface testing method and device, electronic equipment and storage medium | |
CN115454971A (en) | Data migration method and device, electronic equipment and storage medium | |
CN115390992A (en) | Virtual machine creating method, device, equipment and storage medium | |
CN114912582A (en) | Model production method, model production device, electronic device, and storage medium | |
CN113900734A (en) | Application program file configuration method, device, equipment and storage medium | |
CN113656268A (en) | Performance test method and device of business service, electronic equipment and storage medium | |
CN113032251A (en) | Method, device and storage medium for determining service quality of application program | |
CN106528577B (en) | Method and device for setting file to be cleaned | |
CN118568006B (en) | Application interface awakening method, device, equipment, storage medium and program product | |
CN114816758B (en) | Resource allocation method and device | |
CN114546859B (en) | A performance test data separation method, device, equipment and medium | |
CN115222041B (en) | Graph generation method and device for model training, electronic equipment and storage medium | |
CN116471268A (en) | Delivery method and device of private cloud project, electronic equipment and readable storage medium | |
CN115827588A (en) | Method, device, equipment and storage medium for generating business global serial number | |
CN115408195A (en) | Batch task management method, equipment and storage medium for heterogeneous platform | |
CN115437957A (en) | Test information determination method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |