CN115185841A - System reconfiguration test method, device, equipment and storage medium - Google Patents
System reconfiguration test method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115185841A CN115185841A CN202210809361.5A CN202210809361A CN115185841A CN 115185841 A CN115185841 A CN 115185841A CN 202210809361 A CN202210809361 A CN 202210809361A CN 115185841 A CN115185841 A CN 115185841A
- Authority
- CN
- China
- Prior art keywords
- result
- service
- attribute information
- request
- call
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/368—Test management for test version control, e.g. updating test cases to a new software version
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- 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—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a system reconfiguration test method, a device, equipment and a storage medium, wherein the method comprises the steps of initiating a flow request of an original version system service, analyzing attribute information of the flow request, constructing a first HTTP call corresponding to the original version system service based on the attribute information and acquiring a first call result; constructing a second HTTP call corresponding to the reconstructed system service and acquiring a second call result based on the attribute information and the target service parameter; and comparing whether the first calling result and the second calling result are consistent to determine a test result of the reconstructed system service, converting the service flow request into HTTP calling of the original version development language and HTTP calling of the reconstructed version development language by initiating the service flow request of the original version system, returning 2 calling results and comparing, and quickly verifying whether the logic and returned data and result after reconstruction are correct according to the comparison result, thereby facilitating comparison of data difference of the systems of the versions before and after reconstruction, reducing manual participation and improving test efficiency and effect.
Description
Technical Field
The application relates to the technical field of computers, in particular to the technical field of system reconfiguration, and provides a system reconfiguration test method, a device, equipment and a computer storage medium.
Background
A software is always created to solve a specific requirement, and the era is developing and the business of customers is changing. Some of the demands are relatively stable, some of the demands change more severely, and other demands have disappeared or are converted into other demands. In this case, the software must be adapted accordingly to reconfigure the system to improve the system's processing performance and stability, e.g., qps, cpu, disaster recovery, degradation, throttling, scalability, maintainability, etc. Besides dealing with a large number of concurrent requests, the system must also support various service requirements quickly to enhance the user experience.
The reconstructed business system version can be used after passing the test, the business system reconstruction may need to change the development language, in the process of reconstructing the historical language system by the new development language, developers may not be familiar with the historical business or the historical development language, whether the codes reconstructed by the developers are correct or not cannot be judged, the reconstructed interface is a simple self-test interface, the test is submitted without problems in the general flow, the detailed problems are difficult to find, and even if the problems exist, an automatic reminding mechanism does not exist, so that the reconstruction logic is easy to be incorrect.
Moreover, whether the reconstructed scene is covered completely or not cannot be known, if testers need to deeply understand historical services, logic is combed for each interface, test cases of all scenes are compiled, testing is time-consuming and labor-consuming, and the effect is still difficult to guarantee.
Disclosure of Invention
In order to solve the above problems, an object of the present invention is to provide a method, an apparatus, a computer device and a computer readable storage medium for testing system reconfiguration, which can quickly verify whether the logic of the system after reconfiguration is correct and whether the returned data is correct, thereby facilitating comparison of data differences before and after reconfiguration and reducing manual comparison.
Based on this, the invention provides a system reconfiguration test method, which comprises the following steps:
a traffic request for the original version of the system service is initiated,
analyzing the attribute information of the flow request, constructing a first HTTP call corresponding to the original version system service based on the attribute information, and acquiring a first call result;
constructing a second HTTP call corresponding to the reconstructed system service and acquiring a second call result based on the attribute information and the target service parameter;
and comparing whether the first calling result and the second calling result are consistent or not to determine the test result of the reconstructed system service.
Further, after the step of initiating a traffic request of the original version system service, the method further comprises:
obtaining a traffic retry comparison configuration parameter, judging whether the traffic request needs to be forwarded according to the configuration, if so, obtaining attribute information of the traffic request and encapsulating the attribute information in a message body; if not, directly returning the response result of the flow request.
Further, the step of analyzing the attribute information of the traffic request, constructing a first HTTP call corresponding to the original version system service based on the attribute information, and obtaining a first call result includes:
analyzing the attribute information in the message body;
firstly constructing an HTTP request of the original version system service based on the attribute information;
and executing the first HTTP request to obtain a first calling result.
Further, after the determining that the traffic request needs to be forwarded according to the traffic retry comparison configuration parameter, the method further includes:
and setting a sampling rate, and calculating whether the generated random hash value of the flow request is in a sampling rate range.
Further, after the step of parsing the attribute information in the message body, the method further includes:
and checking and filtering the analyzed data.
Further, the step of constructing a second HTTP call corresponding to the reconstructed system service and obtaining a second call result based on the attribute information and the target service parameter includes:
resetting the flow request and analyzing the attribute information of the flow request again;
acquiring target service parameters;
constructing a second HTTP call corresponding to the reconstructed system service according to the attribute information and the target service parameter;
and executing the second HTTP call to obtain a second call result.
Further, the step of comparing whether the first calling result and the second calling result are consistent to determine the test result of the restructuring system service includes:
performing json comparison on the first calling result and the second calling result;
obtaining a comparison result according to a preset comparison rule;
and recording the comparison result.
The invention also provides a system reconfiguration test device, which comprises:
the service initiating unit is used for initiating a flow request of the original version system service;
the flow retry unit is used for analyzing the attribute information of the flow request, constructing a first HTTP call corresponding to the system service of the original version based on the attribute information and acquiring a first call result; and
constructing a second HTTP call corresponding to the reconstructed system service and acquiring a second call result based on the attribute information and the target service parameter;
and the result comparison unit is used for comparing whether the first calling result and the second calling result are consistent or not to determine the test result of the reconstructed system service.
The invention also provides computer equipment which comprises a memory, a processor and a network interface, wherein the memory stores computer programs, and the processor realizes the steps of the network car-booking platform risk assessment method when executing the computer programs.
The invention also provides a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the system reconfiguration test method.
The invention provides a system reconfiguration test method, which comprises the steps of initiating a flow request of an original version system service, analyzing attribute information of the flow request, constructing a first HTTP call corresponding to the original version system service based on the attribute information and acquiring a first call result; constructing a second HTTP call corresponding to the reconstructed system service and acquiring a second call result based on the attribute information and the target service parameter; and comparing whether the first calling result and the second calling result are consistent or not to determine the test result of the reconstructed system service. The method and the device have the advantages that the service flow request of the original version system is initiated, the service flow request is converted into the HTTP call of the original version development language and the HTTP call of the reconstructed version development language before the request returns the result, 2 call results are returned and compared, whether the logic after reconstruction is correct or not and whether the returned data is correct or not are quickly verified according to the comparison result, the data difference of the system before and after reconstruction is conveniently compared, the manual participation is reduced, and the test efficiency and the test effect are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 2 is a schematic diagram of an application scenario of the reconstruction system testing method according to the embodiment of the present invention;
FIG. 3 is a flowchart of a reconfiguration system test method according to an embodiment of the present invention;
FIG. 4 is a vertical frame flow chart of a reconstruction system testing method according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a reconfiguration system test apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. In the present application, the embodiments and features of the embodiments may be arbitrarily combined with each other without conflict. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
For the convenience of understanding the technical solutions provided by the embodiments of the present application, some key terms used in the embodiments of the present application are explained first:
and (3) reconstruction: the quality and performance of the software are improved by adjusting the program codes, so that the design mode and the architecture of the program are more reasonable, and the expansibility and the maintainability of the software are improved. The reconstruction does not change the external functions of the system, and only rearranges the internal structure, so that the system has stronger adaptability to the change of the requirement all the time. The reconstruction can reduce the coupling degree of the project, so that the project is more modularized, and the development efficiency and the later maintenance of the project are facilitated. Reconfiguration may include protocol reconfiguration in the background of the business system, addition of new functionality, or other version reconfiguration.
Flow rate: the access amount of the system, the request of the user to the system and the request among the internal services of the system can be obtained through the online flow. Through online flow analysis, developers can quickly know and know a list of services and interfaces to be reconstructed, and the coverage rate of a test scene is high.
HTTP call: the calling of the API interface is to send an HTTP request to a server address of the container service, and add corresponding request parameters to the request according to the interface description to form a message body in a specific form, and the system returns a processing result after calling. Both the request and the return result are encoded using the UTF-8 character set.
Taking a network car booking system as an example, when a service is reconfigured, it is generally required to ensure that the execution logic of a new version system is consistent with an old version. In the related art, when the reconstructed version of the network car booking system is manually tested, developers need to comb all business logics and compile test cases of all scenes, the efficiency of manual testing is extremely low, mistakes are easy to occur, and the testing effect cannot be guaranteed.
In view of this, the embodiment of the present application provides a system reconfiguration test method, in the method, by initiating a service traffic request of an original version system, before requesting a return result, the service traffic request is converted into an HTTP call of an original version development language and an HTTP call of a reconfigured version development language, 2 call results are returned and compared, whether a reconfigured logic is correct and returned data is correct are quickly verified according to a comparison result, so that a data difference between the systems of the previous and subsequent versions before and after reconfiguration is conveniently compared, manual participation is reduced, and test efficiency and effect are improved.
In addition, in the embodiment of the application, no matter the pertinence test on a specific interface of a configuration system or the self-test order of a developer at ordinary times, as long as the traffic retry comparison configuration on a certain original version system service is configured, the result of the order of the company at ordinary times can be recorded, which is equivalent to improving the coverage rate of a test scene.
After introducing the design concept of the embodiment of the present application, some simple descriptions are provided below for application scenarios to which the technical solution of the embodiment of the present application can be applied, and it should be noted that the application scenarios described below are only used for describing the embodiment of the present application and are not limited. In a specific implementation process, the technical scheme provided by the embodiment of the application can be flexibly applied according to actual needs.
The scheme provided by the embodiment of the application can be applied to a test scenario in which most versions are reconstructed, as shown in fig. 1, an application scenario diagram provided by the embodiment of the application can include a terminal device 101, a server 102, a test device 103, and a database 104 in the scenario.
The terminal device 101 and the testing device 103 may be devices such as a tablet Computer (PAD), a mobile phone, a notebook Computer, or a Personal Computer (PC), and of course, may also be other possible devices, which is not limited in this embodiment of the present invention. The terminal device 101 is installed with a client of the tested service system, and can initiate a target service from the client. Specifically, the service system service in the original version is accessed, and a traffic request of the target service is initiated.
A test client may be installed on the test equipment 103. In practical application, for convenience of testing, the client on the terminal device 101 may control the automatic initiation of the service through the testing device 103, that is, after the testing device 103 starts testing, the client may be automatically controlled to initiate the target service. Of course, the terminal device 101 and the testing device 103 may also be configured as the same device, and the original version service may be called by the testing client, for example, when the service system is a network car-booking system, a traffic request of the system service may be initiated in a car-booking application of the network car-booking system, so that the traffic request may be converted into a corresponding HTTP call according to traffic retry configuration to obtain a call result.
The test equipment 103 may include one or more processors, memory, I/O interfaces to interact with the server 102 and the terminal equipment 101, display panels, and the like. The memory of the testing device 103 may store program instructions of the comparison method provided in the embodiment of the present application, and when the program instructions are executed by the processor, the program instructions can be used to implement the steps of the version reconfiguration testing method of the business system provided in the embodiment of the present application, so as to perform the comparison test on the old and new versions of the business system.
The server 102 may be a background server of the service system, and when initiating a service, the server may correspondingly initiate a service request to the server 102, and the server 102 may implement a corresponding service and return a service response. Meanwhile, the service system may synchronously generate operation logs when executing the target service, for example, in order to implement the target service, the server 102 needs to execute the service logic of the target service, that is, needs to call a protocol interface related to the service to implement the whole process, and the generated logs may be stored in the database 104.
In a possible implementation manner, a test client installed on the test device 103 may implement visual interaction of a tester, and the test logic may be deployed on the server, and implement the test logic using computing resources of the server, that is, the tester may initiate a test remotely through the test client, so that a test tool deployed on the server starts a test, that is, corresponding data is read from the database 104, an original version system and a reconstructed version system are invoked to obtain an invocation result, and it is determined whether logic of a new version is consistent with logic of an old version, whether an execution result is consistent, and the like according to comparison of an invocation return result, and the test client may synchronously display a test process.
The various devices described above may be communicatively coupled directly or indirectly through one or more networks. The network may be a wired network or a Wireless network, for example, the Wireless network may be a mobile cellular network, or may be a Wireless-Fidelity (WIFI) network, and of course, may also be other possible networks, which is not limited in this embodiment of the present application.
Of course, the method provided in the embodiment of the present application is not limited to be used in the application scenario shown in fig. 1, and may also be used in other possible application scenarios, and the embodiment of the present application is not limited. The functions that can be implemented by each device in the application scenario shown in fig. 1 will be described in the following method embodiments, and will not be described in detail herein.
Before describing the flow of the testing method, first, the architecture of the testing client provided in the embodiment of the present application is described. As shown in fig. 2, a schematic diagram of a test architecture of a test client is shown, in which the architecture mainly includes the following modules:
(1) Terminal device
The terminal equipment mainly comprisesCommunication interfaceThe control device is combined with a special or selected input/output device, and is equipment which can carry out system service data processing operation between a user and an application system in a man-machine interaction or conversation mode. The terminal device may be a client or a test device, and an application system in the terminal device is an original version system and is used for inputting a job instruction and/or a request parameter and initiating a traffic request so as to capture the traffic request in the following.
(2) apollo configuration
The apollo configuration provides a unified interface for centralized management of configurations of different environments (environments), different clusters (clusters) and different namespaces (namespaces), and can conveniently support the original version system and the reconstructed version system to share the same configuration through the namespaces (namespaces), and simultaneously allow applications of two versions to cover the shared configuration.
In some possible embodiments of the present application, the apollo configures the destination interface of the reconstruction system, the sampling rate, and the like to reconstruct parameter information of the system.
(3) Third party services
The third-party service is an own server of the reconstruction system and is used for capturing the flow of the terminal equipment, the user requests the system, the requests among the services in the system can be obtained through the flow on the third-party service line, the user flow serves as a regression test case of the system level, and the flow among the services in the system can serve as the regression test case of the service level. The flow sampling at each time can control the interface coverage rate and the test magnitude as required, and provides convenience for automatic regression testing.
And the third-party service judges whether the request interface needs to perform traffic retry comparison according to the apollo configuration, and encapsulates information such as request parameters, method names, url, request modes and the like of the traffic request initiated by the terminal equipment into the message packet if the request interface needs to perform traffic retry comparison. The third-party service is also used for comparing the calling result of the original version system with the calling result of the reconstructed version for the calling comparison tool and recording the comparison result.
(4) Message queue
The flow request message initiated by the terminal equipment is sent to a message queue, and the message queue is used as a message middleware and used for storing the flow request sent by the terminal equipment and realizing the communication between the third-party service and the terminal equipment.
In some possible embodiments of the present application, the message queue is Kafka, and each message has a unique offset to indicate the corresponding position of the message in the partition. It also has the notion of offset for the consumer, who uses it to indicate where a message is consumed into a partition.
(5) Tool module
The tool module comprises a plurality of tools involved in the test process, and each tool is called to realize corresponding functions. For example, the tool module may include a parsing tool, a packaging tool, a remote control tool, an encryption/decryption tool, a format conversion tool, and a comparison tool, and of course, other possible tools may also be included, which is not limited in this embodiment.
The analysis tool is used for analyzing the messages and the message data acquired from the message queue.
And the packaging tool is used for packaging the data analyzed by the analysis tool into an HTTP calling request according to a preset format or rule, executing the HTTP request and acquiring a calling result.
The remote control tool may assist in implementing remote control functions, and may be, for example, a secure shell Protocol (SSH Client) tool.
The encryption/decryption tool (Encrypt Manager) is used to Encrypt and decrypt the content to be transmitted, and in the embodiment of the present application, is mainly used to parse the message data in the message queue.
The format conversion (convert) tool is used for storing the format set by the log data obtained by analysis, and may be stored according to a JSON (Java Script Object notification) format, for example, which is a lightweight data representation method and is more intuitive and concise by recording data in a key-value manner.
And the comparison tool (Compare Manager) is used for comparing the log analysis files of the two versions according to the set comparison rule at the comparison stage of the log analysis files.
Referring to fig. 3, a schematic flow chart of a system reconfiguration testing method provided in an embodiment of the present application may be executed through the application scenario shown in fig. 1, and a flow of the method is described as follows.
Step 301: a traffic request of the original version system service is initiated.
Step 302: and decomposing attribute information of the analysis flow request, constructing a first HTTP call corresponding to the original version system service based on the attribute information, and acquiring a first call result.
Step 303: and constructing a second HTTP call corresponding to the reconstructed system service and acquiring a second call result based on the attribute information and the target service parameter.
Step 304: and comparing whether the first calling result and the second calling result are consistent or not to determine the test result of the reconstructed system service.
In the embodiment of the application, the traffic request is a service request in an original version system, the traffic request is a service request of the original system, before being responded by the original system, retry comparison configuration parameters are read, whether the traffic request needs to be forwarded or not is judged, the traffic request is added to a comparison service, if the traffic request needs to be compared, parameters such as request parameters, a Uniform Resource Locator (URL), a response result and the like of the traffic request are packaged in a message body, and a message is forwarded to a message queue. And if the flow comparison is not needed, directly returning a response result.
Specifically, in the embodiment of the present application, an apollo configuration is adopted to set retry comparison configuration parameters, and after the reconfiguration system initiates the traffic request, the retry comparison configuration parameters are read from the apollo configuration to determine whether the traffic request needs traffic forwarding.
In other embodiments, the retry comparison configuration parameter may be set when the terminal device initiates a traffic request, for example, a parameter instruction is input when initiating a traffic request, which is not limited in this embodiment of the present application.
Furthermore, because of large traffic, the apollo configuration further includes a sampling rate, supports traffic sampling, dynamically adjusts what percentage of traffic can be sent to the reconfiguration system, and calculates whether the generated random hash value of the traffic request is within the sampling rate range. When the retry comparison configuration parameters need retry comparison and the current flow request falls in a sampling space, adding the current flow request into a comparison service, packaging key parameters of the flow request, such as request parameters, URL (uniform resource locator), response results and the like, in a message body, and pushing the key parameters to a message queue by an original version system.
It should be noted that, the message queue described in the embodiment of the present application is kafka, and has high throughputDistributed typeThe publishing and subscribing message queue can process all action flow data of the consumers in the website, and after the messages are published to the topic, the messages are only delivered to one consumer in each consuming group subscribed to the message queue, and different consuming groups are not influenced mutually.
In one embodiment of the present application, kafka receives a message body pushed by an original system in a Point-to-Point (P2P) mode and a publish/subscribe (Pub/Sub) mode. Where the point-to-point schema is queue based, the message body encapsulated by the original version system is pushed into kafka, from which the message consumer can receive it. The publish-subscribe pattern defines how to publish and subscribe to the message body information of the traffic request to a Topic (Topic) of a content node, which may be considered as an intermediary for message delivery, where message publishers publish messages to a Topic and message subscribers subscribe to messages from the Topic. The topic enables the subscribers and publishers of messages to remain independent of each other, and message delivery can be guaranteed without contact, and the publish/subscribe mode is employed during one-to-many broadcast of messages.
Further, each consumer has a corresponding consumption group. According to the default rule of Kafka, each consumer is assigned to 1 partition, and each consumer can only consume the message body in the assigned partition. In other words, each partition can only be consumed by one consumer in one consumption group.
Further, the Message body is packaged by using a map (Message Application Part) structure, and encapsulates attribute information of the traffic request, where the attribute information includes key parameter data such as a request parameter, a method name, a URL, a response result, and the like of the traffic request, so that a subsequent call obtains an accurate result.
It should be noted that after consuming the information body in kafka, parsing the attribute information encapsulated in the information body, constructing a first HTTP request of the original version system service based on the data information, and executing the first HTTP request to obtain a first invocation result.
It should be noted that the analyzed data is subjected to preprocessing such as data verification and filtering, so as to improve the data accuracy and improve the test effect.
It should be noted that the target service parameters include a target server and a target interface, and are used to specify the target server and the interface ID of the reconfiguration system, so that no matter the pertinence test on a specific interface of the reconfiguration system or the self-test waybill of a developer at ordinary times, as long as the traffic retry comparison configuration on a certain original system is configured, the waybill result of an ordinary company can be recorded, which is equivalent to improving the coverage rate of a test scenario, and improving the test efficiency.
In an embodiment of the present application, the target service parameter is set in a polo configuration, and when the traffic request needs to be forwarded, it is specified that when an interface of an original version system of the traffic request is requested, traffic is required to retry to an interface corresponding to a reconfiguration system.
It should be noted that, in the embodiment of the present application, the flow request is reset, re-analyzed based on the processed data information, then a second HTTP request for reconstructing a version system service is constructed according to the target service parameter information, and the second HTTP request is executed to obtain a second call result.
And further, comparing the two returned calling results, obtaining a comparison result through a preset comparison mode and a comparison rule, and recording the comparison result into a database. Whether the logics are consistent or not before and after application reconstruction and whether the returned data are correct or not can be clearly analyzed through comparison, manual intervention operation is not needed, and the testing efficiency is greatly improved.
Further, when the comparison result is inconsistent, a message needs to be sent to notify development and testing personnel in time, specifically, the enterprise office software such as a flybook, a nail, an enterprise WeChat, a mailbox or other internal office programs can be used for notifying, and the different reconstruction interfaces can be processed in time through a notification mechanism of the comparison result, so that the problem can be found in the first time, and the problem brought on line can be avoided.
In summary, the testing scheme of the embodiment of the application does not need manual intervention, testing of the reconstructed version is completed quickly and efficiently, and subsequent non-reconstructed versions are tested, so that errors can be found quickly, testing efficiency is improved, and a complete parameter request example is provided for writing automation.
Referring to fig. 4, a vertical cross-function flowchart of a system reconfiguration testing method according to another embodiment of the present application is provided, in which an APP is a network appointment application of a terminal device or a test and setup device, an original system is developed in a PHP language, and a reconfiguration system is developed based on a JAVA language. In other possible implementation modes, the method is also suitable for other language development systems, such as a test scenario of a reconstruction system between language systems of go, python, C + +, C #, and the like, a terminal APP application program is installed on test equipment, a service flow request of an original language system is initiated, HTTP call results of two languages of the original system and the reconstruction system are obtained for comparison, whether a service logic of the reconstruction system is correct is confirmed according to a comparison result, and whether a return result is accurate.
In an embodiment of the present application, the reconstruction testing method includes the following steps:
the php service sends the message in kafka.
2. And (4) comparing newly-built traffic retry with the kafka message consumed by the service, analyzing the message and carrying out preprocessing such as data verification, filtering and the like.
3. And the flow retry comparison is carried out on the data reanalyzed by the service to construct an http request requesting the php service, and the request is initiated to obtain a first response result.
4. And the flow retry comparison is carried out on data reanalyzed by the service, the configuration of a target interface which is required to be requested to the target java service by the php interface is read, an http request for requesting the java service is constructed, the request is initiated, and a second response result is obtained.
5. And performing json comparison on the first response result and the second response result, obtaining a comparison result according to a comparison mode set by the service, neglecting configuration of a comparison field and the like, and recording a database.
It should be noted that, in this embodiment, the reconstructed third party service of the JAVA system service captures a traffic request of the original PHP system, and when the original PHP system initiates a request and generates access traffic, before the traffic request returns a response result, a retry comparison configuration parameter is obtained.
It should be noted that, in the embodiment of the present application, an on-end APP initiates a request to request a certain PHP service in the original system, for example, a driver or a passenger initiates an order request to generate a flow to the original system PHP service, after the original system PHP service is processed by a service logic, before responding to the request, a retry comparison configuration parameter of the flow request is obtained, it is determined whether the flow request needs retry comparison, if not, a response result of the flow request is directly returned, and the comparison service is ended. And if the flow is compared, adding the flow request into a comparison service, sending the flow request to a kafka message queue, analyzing parameters or data such as request parameters, method names and URLs in the message by consuming the message in the kafka message queue, constructing a first HTTP call requesting the original PHP service based on the analyzed parameters or data, executing the first HTTP call and acquiring a first call result.
Further, the flow request is reset, a second HTTP call of the JAVA service is constructed according to the ID or other identification codes of the target JAVA server and the target interface which are required to be forwarded to the reconstruction system when the flow request is obtained, the second HTTP call is executed, and a second call result is obtained.
Further, comparing the first calling result of the PHP service with the second calling result of the JAVA service, obtaining a comparison result according to a preset comparison mode and a comparison rule, and recording a database. For example, json comparison is performed on the first call result and the J second call result, and a comparison result is determined according to a comparison mode set by the service itself, a comparison field that can be ignored, and the like. For example, a strict checking mode or a loose checking mode may be set, the degree of loose verification of some fields or information in the returned result may be set, or the returned reset for some fields in the reconfiguration system may need to be ignored, or the field ordering result may be ignored.
The following are some examples and illustrations of comparison strategies for setting the degree of looseness of comparison results according to these parameters:
{
"match _ mode" "," STRICT "",// STRICT, LENIENT, NON _ EXTENSIBLE, STRICT _ ORDER alignment patterns
"ignore field" [ "a.b.c", "a.b.d" ]// ignore field
"ignore_array_value":[{"path":"b.a","value":"a[*].id"}}]
}
Description of the mode:
STRICT: and (6) strictly checking. Not expandable (field name and number are exactly the same), and array order strict LENIENT: and (5) loose checking. Extensible (field names and numbers may be different), non-strict array ordering
NON _ EXTENSIBLE: non-extensible checking. Not expandable and not strict array ordering
STRICT _ ORDER: strict sequence checking. Scalable and strict array order
It should be noted that, when determining whether the traffic request of the PHP service needs to retry comparison, the scheme further sets a sampling rate, calculates whether the current request falls in a sampling space, and adds the current traffic request to the comparison service in a sampling interval.
It should be noted that when it is determined that the traffic request needs to retry comparison and send a message to a message queue, the traffic request is analyzed, a traffic request parameter, a method name, a URL, a response result, and the like are encapsulated in a message body, and attribute information and data of the traffic request are analyzed by consuming the message in the message body.
Further, the structure of the message body is packaged by adopting a map structure, and mainly comprises the following attribute information:
from-representing the source of the message, i.e. php service
method-controller method name representing request
version-stands for specific method name in controller
url-a Path url representing a request
req _ type-represents whether the request type is post or get
post _ body-represents the requestor when req _ type is post
driver _ id-represents the driver's primary key in the business, and uses its own primary key in different company businesses as appropriate
event _ type-represents a message type, and the following implementation code representing this message for playback in this service is a specific example:
{
from bfe-dapppweb-api, -message origin
The name of the method, the term of the controller method
"version" index "- - -specific method name
"url":"/index.php/?_m=recruit&_a=index&token=3843D545FDA75CF64F60D4B1BF642AD24BDBE74B4C68E0504D73EBB23CA06023AA1C47297ABEC4FB4644EFB904958CCB&driver_md5=d0ffadd4b0285b51b97ba41c0f662b85&revision=6152&client_type=ios_app&_su=1637822513414616060",--url
"req_type":"post",
"post_body":"xxxx",
"driver_id":2135,
"event_type":"dtool_replay"
}
It is necessary to say that the comparison result is stored in a database. The database creates a playback configuration table and a playback record table of the service request, the playback configuration table including the following attributes: the method comprises the following steps of identifying attribute information of a primary key id, a source php service method name, a source php service specific method name, a target java service, a target service controller, a target service specific method name, a comparison strategy, creation time, update time and the like. The playback recording table comprises attribute information such as a primary key id, an original recording id, a configuration id (corresponding to the primary key id of the playback configuration table), url in a message body, source response (response of php service), target response (response of java service), whether the comparison result is successful or not, and the details of the comparison result.
Referring to fig. 5, based on the same inventive concept, an embodiment of the present application further provides a reconfiguration system testing apparatus 500, including:
a service initiating unit 501, configured to initiate a traffic request of an original version system service;
a traffic retry unit 502, configured to parse attribute information of the traffic request, construct a first HTTP call corresponding to an original version system service based on the attribute information, and obtain a first call result; and
constructing a second HTTP call corresponding to the reconstructed system service and acquiring a second call result based on the attribute information and the target service parameter;
a result comparing unit 503, configured to compare whether the first calling result and the second calling result are consistent to determine a test result of the reconfigured system service.
The testing apparatus 500 further comprises a display module (not shown) for displaying the service request processing interface of the testing apparatus 500.
The reconfiguration system test apparatus 500 may further include an input module (not shown), the input module is connected to the display module, the input module may include a key for inputting information such as an account number, a password, and a name of a user id, the software development process operation page may be displayed on the display module in the software development apparatus, and the display module may further display other information of the user and store the information, so that the user may view the information at any time.
The reformulation system testing apparatus 500 may also include an interactive module (not shown) that provides a user with a method of selecting functions, communicating the relationship between a directed element and its directed content, and providing a medium for the driver user and the passenger user to contact.
It should be noted that the reconfiguration system test apparatus 500 of the present embodiment has the same concept as that of the method embodiment, and specific implementation processes thereof are detailed in the method embodiment, and technical features in the method embodiment are all applicable in the present embodiment, and are not described herein again.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 6, fig. 6 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 6 comprises a memory 61, a processor 62, a network interface 63 communicatively connected to each other via a system bus. It is noted that only a computer device 6 having components 61-63 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 61 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the computer device 6. Of course, the memory 61 may also comprise both an internal storage unit of the computer device 6 and an external storage device thereof. In this embodiment, the memory 61 is generally used for storing an operating system and various types of application software installed on the computer device 6, such as program codes of a system reconfiguration test method. Further, the memory 61 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 62 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 62 is typically used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is configured to execute the program code stored in the memory 61 or process data, for example, execute the program code of the system reconfiguration test method.
The network interface 63 may comprise a wireless network interface or a wired network interface, and the network interface 63 is typically used for establishing a communication connection between the computer device 6 and other electronic devices.
Embodiments of the present invention also provide a storage medium having a computer program stored thereon, where the program is executed by a processor to implement the steps of the network appointment platform risk assessment method.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and substitutions can be made without departing from the technical principle of the present invention, and these modifications and substitutions should also be regarded as the protection scope of the present invention.
Claims (10)
1. A system reconfiguration test method, the test method comprising:
a traffic request for the original version of the system service is initiated,
analyzing attribute information of the flow request, constructing a first HTTP call corresponding to the original version system service based on the attribute information, and acquiring a first call result;
constructing a second HTTP call corresponding to the reconstructed system service and acquiring a second call result based on the attribute information and the target service parameter;
and comparing whether the first calling result and the second calling result are consistent or not to determine the test result of the reconstructed system service.
2. The system reconfiguration test method according to claim 1, wherein after said step of initiating a traffic request for an original version of a system service, said method further comprises:
obtaining a traffic retry comparison configuration parameter, judging whether the traffic request needs to be forwarded according to the configuration, if so, obtaining attribute information of the traffic request and encapsulating the attribute information in a message body; if not, directly returning the response result of the flow request.
3. The method according to claim 2, wherein the step of parsing the attribute information of the traffic request, constructing a first HTTP call corresponding to an original version of the system service based on the attribute information, and obtaining a first call result comprises:
analyzing the attribute information in the message body;
firstly constructing an HTTP request of the original version system service based on the attribute information;
and executing the first HTTP request to obtain a first calling result.
4. The method according to claim 2, wherein after determining that the traffic request needs to be forwarded according to the traffic retry comparison configuration parameter, the method further comprises:
and setting a sampling rate, and calculating whether the generated random hash value of the flow request is in a sampling rate range.
5. The method for system reconfiguration testing according to claim 3, wherein said step of parsing attribute information in said message body further comprises:
and checking and filtering the analyzed data.
6. The method according to claim 2, wherein the step of constructing a second HTTP call corresponding to the reconfigured system service and obtaining a second call result based on the attribute information and the target service parameter comprises:
resetting the flow request and analyzing the attribute information of the flow request again;
acquiring target service parameters;
constructing a second HTTP call corresponding to the reconstructed system service according to the attribute information and the target service parameter;
and executing the second HTTP call to obtain a second call result.
7. The method for system reconfiguration testing according to claim 1, wherein said step of comparing whether said first call result and said second call result are identical to determine a test result of said reconfiguration system service comprises:
performing json comparison on the first calling result and the second calling result;
obtaining a comparison result according to a preset comparison rule;
and recording the comparison result.
8. A system reconfiguration testing apparatus, said apparatus comprising:
the service initiating unit is used for initiating a flow request of the original version system service;
the flow retry unit is used for analyzing the attribute information of the flow request, constructing a first HTTP call corresponding to the system service of the original version based on the attribute information and acquiring a first call result; and
constructing a second HTTP call corresponding to the reconstructed system service and acquiring a second call result based on the attribute information and the target service parameter;
and the result comparison unit is used for comparing whether the first calling result and the second calling result are consistent or not to determine the test result of the reconstructed system service.
9. A computer device comprising a memory, a processor and a network interface, wherein the memory stores a computer program and the processor implements the steps of a system reconfiguration test method when executing the computer program.
10. A computer storage medium having computer program instructions stored thereon, wherein,
the computer program instructions, when executed by a processor, implement the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210809361.5A CN115185841A (en) | 2022-07-11 | 2022-07-11 | System reconfiguration test method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210809361.5A CN115185841A (en) | 2022-07-11 | 2022-07-11 | System reconfiguration test method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115185841A true CN115185841A (en) | 2022-10-14 |
Family
ID=83516992
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210809361.5A Pending CN115185841A (en) | 2022-07-11 | 2022-07-11 | System reconfiguration test method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115185841A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117009112A (en) * | 2023-08-31 | 2023-11-07 | 深圳市小赢信息技术有限责任公司 | Service processing method, device, intelligent equipment and storage medium |
-
2022
- 2022-07-11 CN CN202210809361.5A patent/CN115185841A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117009112A (en) * | 2023-08-31 | 2023-11-07 | 深圳市小赢信息技术有限责任公司 | Service processing method, device, intelligent equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107370786B (en) | General information management system based on micro-service architecture | |
CN111083225B (en) | Data processing method and device in Internet of things platform and Internet of things platform | |
CN108415832B (en) | Interface automation test method, device, equipment and storage medium | |
CN108874558B (en) | Message subscription method of distributed transaction, electronic device and readable storage medium | |
US20170149915A1 (en) | System and method of feed data transmission | |
WO2015074554A1 (en) | Method and device for message synchronization | |
CN112051993A (en) | State machine template generation and task processing method, device, medium and equipment | |
CN111556158A (en) | Access method, access device, access equipment and storage medium of Internet of things platform | |
CN111858727A (en) | Multi-data-source data export system and method based on template configuration | |
CN111507439A (en) | User information checking method and system based on information code | |
CN115185841A (en) | System reconfiguration test method, device, equipment and storage medium | |
CN117111926A (en) | Design draft data processing method and system, electronic equipment and storage medium | |
US20230267430A1 (en) | Data processing method and device, and computer-readable storage medium | |
CN115328997B (en) | Data synchronization method, system, device and storage medium | |
KR20140037605A (en) | Method for active processing ami using cim schema and system topology information | |
CN114500268B (en) | Method and device for deploying char resources, server and storage medium | |
CN111294404A (en) | Processing method and device, computer equipment and medium suitable for various external short message services | |
CN110990280A (en) | Automatic test data generation system and method | |
CN113031960B (en) | Code compiling method, device, server and storage medium | |
WO2020053635A1 (en) | Resource recommendation method in near-field transmission and apparatus therefor | |
Gao | On Provisioning and configuring ensembles of IoT, network functions and cloud resources | |
CN111723088B (en) | Method and device for pushing summary layer table | |
CN116805974A (en) | Media asset data distribution method and device, storage medium and electronic equipment | |
CN111949472A (en) | Method and device for recording application logs | |
CN115914053A (en) | MQTT protocol-based interface testing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |