A test case acquisition method and system
By acquiring and analyzing freight requests and their production data, test cases are automatically built, which solves the problems of high construction costs and low coverage in the existing technology, and achieves efficient and reliable test cases acquisition.
Patent Information
- Application Number
- CN202210345853.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-02
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-04-02
AI Technical Summary
The construction of test cases in the prior art requires a lot of manual participation, which leads to high labor and time costs, and it is difficult to fully cover various functional points combinations, which easily leads to rollback or cancellation of the freight calculation software online.
By obtaining freight requests and production data in the business function point matrix and historical period, calling freight calculation engine to execute freight requests, analyzing the execution of function functions, extracting functional point combinations, and determining whether it covers the functional points in the business function point matrix. If covered, freight requests and production data will be used as test cases.
It realizes automatic crawling of test cases, reduces the cost and time of manual construction, improves the acquisition efficiency and functional point coverage of test cases, enhances the reliability of tests, and avoids invalid testing.
Smart Images

Figure CN114661608B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a test case acquisition method and system. Background Art
[0002] Before the fare calculation software for air tickets is launched, it is usually necessary to test it using test cases in the test case library to measure whether the functions of the fare calculation software meet the actual application requirements.
[0003] At present, the test cases in the test case library are usually constructed manually by testers. The specific workflow for constructing test cases is as follows: Figure 1 As shown. After the product personnel complete the instantiation of the requirements, the testers design test cases based on the instantiation content of the requirements, mainly designing test data, test requests and expected results; specifically, the testers manually construct test data in the freight data publishing tool according to the design documents of the test cases, and construct corresponding test requests and expected results based on the test data. Then, the developer executes the constructed test case in the freight calculation software; if the returned result is consistent with the expected result, it means that the test case is correct, and the test case can be included in the test case library accordingly; if the returned result is inconsistent with the expected result, the tester needs to analyze the test data, test request and expected result in the test case, determine which part has an error, and correct the corresponding content, and then execute the corrected test case in the freight calculation software until the test case is correct.
[0004] The construction of the above test cases all needs to be done manually, and requires cooperation between product personnel, developers and testers. The manpower and time costs are huge, and the efficiency of test case construction is extremely low. In addition, the manual construction of test cases is difficult to fully cover various functional point combinations. It is easy to roll back or cancel the version of the freight rate calculation software being tested because the test cases do not fully cover the core functions. This will seriously restrict the internal production efficiency and affect the delivery cycle of related functions. Summary of the invention
[0005] The embodiments of the present application provide a test case acquisition method and system, which can automatically capture test cases, improve the efficiency of test case acquisition, reduce the cost of test case acquisition, and also improve the coverage of test cases for functional points.
[0006] In view of this, the first aspect of the present application provides a test case acquisition method, the method comprising:
[0007] Obtaining a business function point matrix; the business function point matrix is constructed according to the freight rate product business, and includes the expected values corresponding to various relevant function points of the freight rate product business;
[0008] Obtaining the fare request generated within the reference historical period and its corresponding production data; the fare request includes basic information for air ticket purchase;
[0009] Invoking a freight rate calculation engine to execute the freight rate request, and obtaining information on the execution status of a function in the freight rate calculation engine during the execution of the freight rate request;
[0010] Analyze the execution status information of the function functions in the freight rate calculation engine, extract the function points involved in the freight rate request, and form a function point combination corresponding to the freight rate request;
[0011] Determine whether the function point combination corresponding to the freight rate request covers multiple relevant function points of the freight rate product business; if so, use the freight rate request and its corresponding production data as test cases.
[0012] A second aspect of the present application provides a test case acquisition system, the system comprising:
[0013] A production request capture component is used to capture the freight rate requests generated within the reference historical period, and obtain the production data corresponding to the freight rate requests from the freight rate data cluster;
[0014] A freight rate calculation engine, used to execute the freight rate request;
[0015] An execution path recording component, used for recording the execution status information of the function in the freight rate calculation engine during the process of the freight rate calculation engine executing the freight rate request;
[0016] A function point extraction component is used to analyze the execution status information of the function functions in the freight rate calculation engine, extract the function points involved in the freight rate request to form a function point combination corresponding to the freight rate request;
[0017] The result analysis component is used to determine whether the function point combination corresponding to the freight request covers multiple relevant function points of the freight product business in the business function point matrix; if so, the freight request and its corresponding production data are used as test cases, and the test cases are stored in the test case library.
[0018] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0019] The embodiment of the present application provides a test case acquisition method, in which a business function point matrix is first obtained, and the business function point matrix is constructed according to the fare product business, including the expected values corresponding to various related function points of the fare product business; then, the fare request generated in the reference historical period and the corresponding production data are obtained, and the fare request includes basic information for air ticket purchase; then, the fare calculation engine is called to execute the obtained fare request, and the execution status information of the function function in the fare calculation engine in the process of executing the fare request is obtained; then, the execution status information of the function function in the fare calculation engine is analyzed, and the function points involved in the fare request are extracted to form the function point combination corresponding to the fare request; finally, it is determined whether the function point combination corresponding to the fare request covers the various related function points of the fare product business involved in the business function point matrix, and if so, the fare request and the corresponding production data are used as test cases. The method is based on a specific test case capture strategy, obtains historical freight rate requests as test requests in test cases, and obtains production data corresponding to freight rate requests as test data in test cases. Compared with manually constructing test cases, this automatic test case capture method can greatly reduce the labor cost and time cost required and improve the efficiency of test case acquisition, and can also ensure that the acquired test cases are closely related to the functional points involved in the actual business, improve the coverage of test cases for functional points, and make the freight rate requests and production data in the test cases more in line with the actual business scenarios; thereby, the reliability of tests based on such test cases is improved, and invalid tests are avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of the implementation process of manually constructing test cases in related technologies;
[0021] Figure 2 A flowchart of a test case acquisition method provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of the working principle of the test case acquisition system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0024] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0025] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0026] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0027] The following first introduces the test case acquisition method provided by the embodiment of the present application through a method embodiment. Figure 2 , Figure 2 A flow chart of a test case acquisition method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the method comprises the following steps:
[0028] Step 201: Obtain a business function point matrix; the business function point matrix is constructed according to the freight rate product business, and includes the expected values corresponding to various relevant function points of the freight rate product business.
[0029] In the specific implementation, you can first obtain the business function point matrix constructed by product personnel in combination with the freight product business needs. Specifically, product personnel can transform the freight product business into a structured form of expression, that is, construct a business function point matrix, which includes the expected values corresponding to various related function points of the freight product business; illustratively, each column in the business function point matrix can correspond to a function point, and each element in each row is the expected value corresponding to the same freight product business under each function point. Since different freight product businesses may involve different functional dimensions, different freight products can correspond to different business function point matrices, that is, different business function point matrices can include different combinations of function points.
[0030] Step 202: Obtain the fare request generated within the reference historical period and its corresponding production data; the fare request includes basic information for air ticket purchase.
[0031] In the embodiment of the present application, it is also necessary to obtain the fare request generated within the reference historical period and its corresponding production data. Among them, the fare request refers to the request for calculating the ticket fare generated when purchasing an air ticket, which may include basic information for ticket purchase, such as itinerary information, flight information, sales time, travel time, passenger identity, purchase channel, etc.; the production data corresponding to the fare request refers to the data related to the fare calculated in response to the fare request, such as fare, taxes, agency fees, refund fees, change fees, and additional services. The above-mentioned reference historical period can be, for example, the last two years. Of course, in actual applications, the reference historical period can also be other historical periods, and this application does not impose any restrictions on this.
[0032] In a possible implementation, the freight rate request generated in the reference historical period can be obtained in the following manner: obtaining the production log generated in the reference historical period from the production system; searching the production log for the basic freight rate request related to the freight rate calculation instruction; and then formatting the basic freight rate request to obtain the freight rate request.
[0033] Specifically, after logging into the production system, the production logs of the fare calculation software generated within the reference historical period can be collected in the production system, and the collected production logs can be analyzed to find out the basic fare request related to the fare calculation instruction, and then the found basic fare request can be formatted to obtain the corresponding fare request; illustratively, when formatting the basic fare request, the ticket issuance date information at that time can be added thereto. If dynamic cabin fare is involved, the availability status information of the flight cabin at that time also needs to be integrated.
[0034] Optionally, in an embodiment of the present application, the collected fare requests may be classified according to the basic information of air ticket purchase included in the fare requests, so as to classify each fare request into a corresponding business scenario; then, it is determined whether the number of fare requests under the preset multiple business scenarios reaches a preset number, and if so, the calling of the fare calculation engine to execute the collected fare requests is executed; if not, the fare requests continue to be obtained.
[0035] For example, the collected fare requests can be classified according to the itinerary information, number of flight segments, cabin content, passenger identity, number of passengers, payment method and other factors in the fare request. Each category corresponds to a different business scenario, which can be specifically divided into ordinary adults, special passengers, non-key customer exclusive, key customer exclusive, designated fare basis, one-way direct, one-way connecting, round-trip direct, round-trip connecting, shared flights, large cabin, small cabin, dynamic cabin, team, non-cash payment and other business scenarios. After completing the above classification processing, it can be determined whether the number of fare requests under various business scenarios has reached the preset number; if so, it means that enough fare requests have been obtained, and the obtained fare requests can basically cover the fare product business to be tested, so the subsequent steps can be continued; on the contrary, if not, it means that the current fare requests are not enough, and it is necessary to continue to obtain fare requests.
[0036] Step 203: calling the freight rate calculation engine to execute the freight rate request, and obtaining the execution status information of the functional functions in the freight rate calculation engine during the execution of the freight rate request.
[0037] Furthermore, the freight rate calculation engine is called to batch execute the acquired freight rate requests, and the freight rate calculation results generated by the freight rate calculation engine and the execution status information of each function in the process of executing the freight rate request are obtained. The freight rate calculation results and the execution status information of each function are usually output as a whole in the form of JSON.
[0038] Specifically, each function in the freight rate calculation engine is configured with a corresponding piling function, through which the execution status information of the corresponding freight rate calculation engine can be recorded. Based on this, in the process of executing the freight rate request, the freight rate calculation engine can record the execution status information of the function through the piling function corresponding to the function; accordingly, after the freight rate calculation engine executes the freight rate request, the freight rate calculation result output by the freight rate calculation engine and the execution status information of the function recorded by the piling function corresponding to each function can be obtained.
[0039] Step 204: analyzing the execution status information of the functional functions in the freight rate calculation engine, extracting the functional points involved in the freight rate request, and forming a functional point combination corresponding to the freight rate request.
[0040] After obtaining the execution status information of the function function in the process of executing the freight rate request by the freight rate calculation engine, the execution status information of the function function in the freight rate calculation engine can be analyzed to extract the function points involved in executing the freight rate request and the processing results of each function point. Then, the function points involved in executing the freight rate request are used to form a function point combination corresponding to the freight rate request. Each element in the function point combination can include the name of the function point, the processing result, and the value of the corresponding test data (the test data here is the production data corresponding to the freight rate request).
[0041] Step 205: determine whether the function point combination corresponding to the freight rate request covers multiple relevant function points of the freight rate product business; if so, use the freight rate request and its corresponding production data as test cases.
[0042] For each freight rate request, determine whether the function point combination corresponding to the freight rate request covers multiple relevant function points of the freight rate product business involved in the business function point matrix. If so, the freight rate request and its corresponding production data can be used as test cases.
[0043] Specifically, it is possible to determine whether the function point combination corresponding to the freight request matches the expected value corresponding to each relevant function point in the business function point matrix, that is, to compare the function point combination corresponding to the freight request with each row in the business function point matrix. If the function point combination corresponding to the freight request matches the expected value of a row in the business function point matrix, the freight request and its corresponding production data can be used as positive test cases and included in the test case library. On the contrary, if the function point combination corresponding to the freight request does not completely match the expected value of each row in the business function point matrix, the freight request and its corresponding production data can be used as negative test cases and included in the test case library.
[0044] In the test case acquisition method provided in the embodiment of the present application, a business function point matrix is first obtained, and the business function point matrix is constructed according to the fare product business, including the expected values corresponding to various related function points of the fare product business; then, the fare request generated in the reference historical period and its corresponding production data are obtained, and the fare request includes basic information for ticket purchase; then, the fare calculation engine is called to execute the obtained fare request, and the execution status information of the function function in the fare calculation engine in the process of executing the fare request is obtained; then, the execution status information of the function function in the fare calculation engine is analyzed, and the function points involved in the fare request are extracted to form the function point combination corresponding to the fare request; finally, it is determined whether the function point combination corresponding to the fare request covers the various related function points of the fare product business involved in the business function point matrix. If so, the fare request and its corresponding production data are used as test cases. The method is based on a specific test case capture strategy, obtains historical freight rate requests as test requests in test cases, and obtains production data corresponding to freight rate requests as test data in test cases. Compared with manually constructing test cases, this automatic test case capture method can greatly reduce the labor cost and time cost required and improve the efficiency of test case acquisition, and can also ensure that the acquired test cases are closely related to the functional points involved in the actual business, improve the coverage of test cases for functional points, and make the freight rate requests and production data in the test cases more in line with the actual business scenarios; thereby, the reliability of tests based on such test cases is improved, and invalid tests are avoided.
[0045] Next, the test case acquisition system provided by the embodiment of the present application is introduced through a system embodiment. Figure 3 , Figure 3 A schematic diagram of the working principle of the test case acquisition system provided in the embodiment of the present application is shown in FIG. Figure 3 As shown, the system includes:
[0046] The production request capture component is used to capture the freight rate requests generated within the reference historical period, and obtain the production data corresponding to the freight rate requests from the freight rate data cluster.
[0047] Specifically, the production request capture component is responsible for collecting the production log of the freight calculation software from the production system and analyzing the log content, so as to find the basic freight request related to the freight calculation instruction from the production log, format the basic freight request, and improve the request content according to the actual test requirements to obtain the freight request that can be used in the test process.
[0048] In addition, the production request capture component is also used to classify the captured fare requests according to the basic information of air ticket purchase included in the fare request, so as to classify each captured fare request into the corresponding business scenario; then, it is judged whether the number of fare requests under the preset multiple business scenarios reaches the preset number, if so, the fare calculation engine is called to execute each captured fare request; if not, the fare request is continued to be acquired. That is, the production request capture component can classify each fare request into each business scenario according to the content of the fare request, that is, classify each captured fare request, and each type of fare request corresponds to a business scenario; then, it is judged whether the number of fare requests under each business scenario reaches the preset number, if so, the fare calculation engine is called to execute each captured fare request, if not, the fare request is continued to be captured.
[0049] The freight rate calculation engine is used to execute the freight rate request.
[0050] Specifically, the fare calculation engine can retrieve and calculate fare data in scenarios such as air ticket search, booking, refund and change, based on booking information such as itinerary, flight, cabin, sales time, travel time, passenger identity, and purchase channel, and return qualified fares, taxes, agency fees, refund fees, change fees, and additional services. It mainly involves three main functional modules: fare acquisition, fare verification, and fare calculation. When working, first obtain the fare based on the itinerary information in the fare request, then perform rule verification on sales time, travel time, passenger identity, etc., perform route verification on flights, cabins, etc., and perform permission verification on purchase channels; then, combine and calculate the available fares, and calculate taxes and agency fees to get the final ticket price.
[0051] The execution path recording component is used to record the execution status information of the functional functions in the freight rate calculation engine during the process of the freight rate calculation engine executing the freight rate request.
[0052] Specifically, in the process of the freight rate calculation engine executing the freight rate request, the execution status information of the function function is recorded through the piling function corresponding to the function function. After the freight rate request is executed, the freight rate calculation result output by the freight rate calculation engine and the execution status information of the function function recorded by the piling function corresponding to each function are obtained.
[0053] In other words, the execution path recording component is mainly used to record the execution path of the freight rate calculation request. The piling module of the function function can record the execution status information of the corresponding function function, including request parameters, data information, and processing results. The execution path recording component can integrate the normal freight rate calculation results and the execution status information of each function function, and return them in a formatted form.
[0054] The function point extraction component is used to analyze the execution status information of the function in the freight rate calculation engine, extract the function points involved in the freight rate request to form a function point combination corresponding to the freight rate request.
[0055] The function point extraction component is mainly used to extract the execution information of each function function to prepare for the subsequent function matching. It includes the pile analysis module, information extraction module and formatting module; the pile analysis module is used to analyze the execution information of each function function and identify the executed function points; the information extraction module is used to extract the specific function points and related results when the freight rate calculation engine executes the freight rate request; the formatting module is used to combine the extracted function points and corresponding results and record them in a structured form.
[0056] The result analysis component is used to determine whether the function point combination corresponding to the freight request covers multiple relevant function points of the freight product business in the business function point matrix; if so, the freight request and its corresponding production data are used as test cases, and the test cases are stored in the test case library.
[0057] The business function point matrix is a form of formatting and expressing various freight product businesses by product personnel in combination with business needs. Different freight product businesses may involve different functional dimensions. Therefore, the business function point matrix can correspond to different freight product businesses, that is, to different function point combinations.
[0058] The production data corresponding to the freight rate request can be obtained from the freight rate data cluster, which can include freight rate data, authority data, rule data and route data. Among them, the freight rate data defines what to sell and how much to sell, mainly involving data on airlines, sales time range, origin, destination, cabin, price, freight rate basis and other dimensions. The authority data defines who sells, mainly involving sales channels, groups, terminal configurations, agencies and other dimensions. The rule data and route data define how to sell, to whom, and when to sell, which involve dimensions such as passenger identity, sales week, combination conditions, flights, transfer points, stopover points, and cabin.
[0059] The test case acquisition system is based on a specific test case capture strategy, obtains historical freight rate requests as test requests in test cases, and obtains production data corresponding to freight rate requests as test data in test cases. Compared with manually constructing test cases, the system automatically captures test cases in a way that can greatly reduce the labor cost and time cost required and improve the efficiency of test case acquisition, and can also ensure that the acquired test cases are closely related to the functional points involved in the actual business, improve the coverage of test cases for functional points, and make the freight rate requests and production data in the test cases more in line with actual business scenarios; thereby, the reliability of tests based on such test cases is improved, and invalid tests are avoided.
[0060] In order to facilitate further understanding of the technical solution provided in the embodiments of the present application, the following takes daily flight and weekend flight fare product services as examples to introduce a method for obtaining test cases suitable for testing these two types of fare product services.
[0061] The sales time for daily flights is weekdays, the sales channel is the B2C website, the routes include direct flights from Beijing to Shanghai and direct flights from Shanghai to Guangzhou, and the cabins include K and L; the sales time for weekend flights is weekends, the sales channel is the B2C website, the routes stop in Shanghai or Guangzhou, and the cabins include M, N and Q. The above two freight rate products are formatted into business function point matrices, and the business function point matrix 1 shown in Table 1 and the business function point matrix 2 shown in Table 2 are obtained respectively:
[0062] Table 1
[0063]
[0064] Table 2
[0065]
[0066] Then, we grab the freight request and log in to the production system. The original production log and the formatted freight request are as follows:
[0067] Original production log:
[0068] <fareinterface>
[0069] <input>
[0070] <headerin>
[0071] <syscode> ICS< / syscode>
[0072] <channelid> B2C< / channelid>
[0073] <officeid> XXX123< / officeid>
[0074] <terminalcarrier> XX< / terminalcarrier>
[0075] <pid> 12345< / pid>
[0076] <city> PEK< / city>
[0077] < / headerin>
[0078] <request>
[0079] <pricingrequest>
[0080] <option>A< / option>
[0081] <groupnumber> 0< / groupnumber>
[0082] <isseparatepnr> false< / isseparatepnr>
[0083] <sector>
[0084] <normalsector>
[0085] <carrier> XX< / carrier>
[0086] <flightnumber> 7337< / flightnumber>
[0087] <bookingclass> K< / bookingclass>
[0088] <oriairport> PEK< / oriairport>
[0089] <desairport> SHA< / desairport>
[0090] <reservationstate> HK< / reservationstate>
[0091] <reservationnum> 1< / reservationnum>
[0092] <deptdatetime>
[0093] <date> 22JUN21< / date>
[0094] <time>1000< / time>
[0095] < / deptdatetime>
[0096] <arrivaldatetime>
[0097] <date> 23JUN21< / date>
[0098] <time>1230< / time>
[0099] < / arrivaldatetime>
[0100] <delay> 0< / delay>
[0101] <equipmenttype> 738< / equipmenttype>
[0102] < / normalsector>
[0103] < / sector>
[0104] < / pricingrequest>
[0105] < / request>
[0106]
[0107] < / fareinterface>
[0108] Formatted freight rate request:
[0109] <fareinterface>
[0110] <input>
[0111] <headerin>
[0112] <syscode> ICS< / syscode>
[0113] <channelid> B2C< / channelid>
[0114] <officeid> XXX123< / officeid>
[0115] <terminalcarrier> XX< / terminalcarrier>
[0116] <pid> 12345< / pid>
[0117] <city> PEK< / city>
[0118] < / headerin>
[0119] <request>
[0120] <pricingrequest>
[0121] <option>A< / option>
[0122] <groupnumber> 0< / groupnumber>
[0123] <isseparatepnr> false< / isseparatepnr>
[0124] <sector>
[0125] <normalsector>
[0126] <carrier> XX< / carrier>
[0127] <flightnumber> 7337< / flightnumber>
[0128] <bookingclass> K< / bookingclass>
[0129] <oriairport> PEK< / oriairport>
[0130] <desairport> SHA< / desairport>
[0131] <reservationstate> HK< / reservationstate>
[0132] <reservationnum> 1< / reservationnum>
[0133] <deptdatetime>
[0134] <date> 22JUN21< / date>
[0135] <time>0000< / time>
[0136] < / deptdatetime>
[0137] <arrivaldatetime>
[0138] <date> 23JUN21< / date>
[0139] <time>0000< / time>
[0140] < / arrivaldatetime>
[0141] <delay> 0< / delay>
[0142] <equipmenttype> 738< / equipmenttype>
[0143] < / normalsector>
[0144] < / sector>
[0145] <ticketingdatetime> 01JUN2021< / ticketingdatetime>
[0146] < / pricingrequest>
[0147] < / request>
[0148]
[0149] < / fareinterface>
[0150] In the original production log, the ticket issuance time is added <ticketingdatetime> 01JUN2021< / ticketingdatetime> The freight rate request is for a single direct flight, ordinary adult, non-key customer exclusive, and large cabin space.
[0151] Then, prepare the application environment, synchronize the two years of production data, and enable the function stubbing function.
[0152] Next, execute the production request. Call the freight rate calculation engine to execute the formatted freight rate request above, and obtain the freight rate calculation result and the execution status information of the function stubbing output, as follows:
[0153] <fareinterface>
[0154] <output>
[0155] <pricingresult>
[0156] <fareresult>
[0157] <fareamount> 1540.00< / fareamount>
[0158] <farecomponent>
[0159] <farerph> XX^HAK^XXMNQ^225^0< / farerph>
[0160] <fareamount> 1540.00< / fareamount>
[0161] < / farecomponent>
[0162] < / fareresult>
[0163] <fareresult>
[0164] <fareamount> 1620.00< / fareamount>
[0165] <farecomponent>
[0166] <farerph> XX^HAK^XXMNQ^278^0< / farerph>
[0167] <fareamount> 1620.00< / fareamount>
[0168] < / farecomponent>
[0169] < / fareresult>
[0170] <diagnosticresults>
[0171] <diagnosticresult>
[0172] <farecomponent>
[0173] <routingvalidation>
[0174] <validationinfo>
[0175] <faretype> NET< / faretype>
[0176] <rph> XX^HAK^XXMNQ^225^0< / rph>
[0177] <status> false< / status>
[0178] <routingflag> X< / routingflag>
[0179] <transferpoint> SHA< / transferpoint>
[0180] <transferpoint> CAN< / transferpoint>
[0181] < / validationinfo>
[0182] <validationinfo>
[0183] <faretype> NET< / faretype>
[0184] <rph> XX^HAK^XXKL^278^0< / rph>
[0185] <status> true< / status>
[0186] <routingflag> R< / routingflag>
[0187] <routingpoint> SHA< / routingpoint>
[0188] <routingpoint> CAN< / routingpoint>
[0189] < / validationinfo>
[0190] < / routingvalidation>
[0191] <rulevalidation>
[0192] <validationinfo>
[0193] <rph> XX^HAK^XXMNQ^225^0< / rph>
[0194] <status> false< / status>
[0195] <rulevalidationinfo>
[0196] <typename> SALEWEEKTIME< / typename>
[0197] <fcboundtype> OUT_BOUND< / fcboundtype>
[0198] <requestinfo> weekdayToWeek:2< / requestinfo>
[0199] <dbinfo> restriction:96< / dbinfo>
[0200] < / rulevalidationinfo>
[0201] < / validationinfo>
[0202] <validationinfo>
[0203] <rph> XX^HAK^XXKL^278^0< / rph>
[0204] <status> true< / status>
[0205] <rulevalidationinfo>
[0206] <typename> SALEWEEKTIME< / typename>
[0207] <fcboundtype> OUT_BOUND< / fcboundtype>
[0208] <requestinfo> weekdayToWeek:2< / requestinfo>
[0209] <dbinfo> restriction:31< / dbinfo>
[0210] < / rulevalidationinfo>
[0211] < / validationinfo>
[0212] < / rulevalidation>
[0213] <fareaccessvalidation>
[0214] <netfarevalidation>
[0215] <rph> XX^HAK^XXMNQ^225^0< / rph>
[0216] <status> true< / status>
[0217] <typename> processNetFareAccess< / typename>
[0218] <channelid> B2C< / channelid>
[0219] < / netfarevalidation>
[0220] <netfarevalidation>
[0221] <rph> XX^HAK^XXMNQ^278^0< / rph>
[0222] <status> true< / status>
[0223] <typename> processNetFareAccess< / typename>
[0224] <channelid> B2C< / channelid>
[0225] < / netfarevalidation>
[0226] < / fareaccessvalidation>
[0227] < / farecomponent>
[0228] <classvalidation>
[0229] <validationinfo>
[0230] <faretype> NET< / faretype>
[0231] <rph> XX^HAK^XXMNQ^225^0< / rph>
[0232] <status> false< / status>
[0233] <compareclass>
[0234] <requestrbds> K< / requestrbds>
[0235] <farerbds> MNQ< / farerbds>
[0236] < / compareclass>
[0237] < / validationinfo>
[0238] < / classvalidation>
[0239] <classvalidation>
[0240] <validationinfo>
[0241] <faretype> NET< / faretype>
[0242] <rph> XX^HAK^XXMNQ^278^0< / rph>
[0243] <status> true< / status>
[0244] <compareclass>
[0245] <requestrbds> K< / requestrbds>
[0246] <farerbds> KL< / farerbds>
[0247] < / compareclass>
[0248] < / validationinfo>
[0249] < / classvalidation>
[0250] < / diagnosticresult>
[0251] < / diagnosticresults>
[0252] < / pricingresult>
[0253] < / output>
[0254] < / fareinterface>
[0255] Analyze the execution information of each function of each freight rate request, extract the function point name, processing result and test data value, and count the function point combinations involved to obtain the following content:
[0256] For the freight rate product business "Daily Flight":
[0257] Function point name Processing results The value of the test data Sales time frame Success 31 Sales Channels Success B2C route Success PEK-SHA, PEK-CAN Cabin Success K.L
[0258] The fare request in this example meets the restriction conditions of the "Daily Flight" fare product business. The sales time range in the test data is "31", which is encoded in binary bits. From low to high, it represents Monday to Sunday. Each bit 0 indicates that sales are prohibited, and 1 indicates that sales are allowed. 31 means that sales are allowed from Monday to Friday. The ticketing date (ticketingDateTime) in the fare request is Tuesday, so sales are allowed. The sales channel in the production data is "B2C", which is the same as the sales channel (channelId) in the fare request. The route in the production request is "PEK-SHA", which is consistent with the route in the production request (oriAirport, desAirport in Sector). The class of service in the test data is "K", which is consistent with the class of service (bookingClass) in the production request.
[0259] Regarding the freight rate product business "Weekend Flight":
[0260] Function point name Processing results The value of the test data Sales time frame Fail 96 Sales Channels Success B2C route Fail SHA、CAN Cabin Fail M, N, Q
[0261] The fare request in this example does not meet the restriction conditions of the "weekend flight" fare product. The sales time range in the production data is "96", which means that sales are allowed on Saturdays and Sundays. The ticketing date (ticketingDateTime) in the fare request is Tuesday, so sales are not allowed. The sales channel in the production data is "B2C", which is the same as the sales channel (channelId) in the fare request. The routes in the fare request are "SHA, CAN", and the routes in the fare request (oriAirport, desAirport in Sector) only reach SHA and do not pass through SHA or CAN. The class of service in the production data is "M, N, Q", which is inconsistent with the class of service (bookingClass) in the fare request.
[0262] Finally, the business function point matrix is matched. The freight rate request in the above example involves all dimensions of the two freight rate products "Daily Flight" and "Weekend Flight" during the execution of the freight rate calculation engine. It is a positive example for the "Daily Flight" freight rate product and a negative example for the "Weekend Flight" freight rate product. This freight rate request can be included in the test case library as a test case.
[0263] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0264] Although operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.
[0265] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0266] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0267] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0268] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0269] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0270] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0271] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (full name in English: Read-Only Memory, English abbreviation: ROM), random access memory (full name in English: Random Access Memory, English abbreviation: RAM), disk or optical disk and other media that can store computer programs.
[0272] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0273] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A test case acquisition method, characterized in that: The method comprises: Obtaining a business function point matrix; the business function point matrix is constructed according to the freight rate product business, and includes the expected values corresponding to various relevant function points of the freight rate product business; Obtaining the fare request generated within the reference historical period and its corresponding production data; the fare request includes basic information for air ticket purchase; Invoking a freight rate calculation engine to execute the freight rate request, and obtaining information on the execution status of a function in the freight rate calculation engine during the execution of the freight rate request; Analyze the execution status information of the function functions in the freight rate calculation engine, extract the function points involved in the freight rate request, and form a function point combination corresponding to the freight rate request; It is determined whether the function point combination corresponding to the freight rate request matches the expected values corresponding to the various relevant function points of the freight rate product business in the business function point matrix; if the function point combination corresponding to the freight rate request matches the expected values corresponding to the various relevant function points of any of the freight rate product businesses in the business function point matrix, the freight rate request and its corresponding production data are used as positive test cases; if the function point combination corresponding to the freight rate request does not completely match the expected values corresponding to the various relevant function points of each of the freight rate product businesses in the business function point matrix, the freight rate request and its corresponding production data are used as negative test cases.
2. The method according to claim 1, characterized in that The obtaining of the freight rate request generated in the reference historical period includes: Acquire production logs generated during the reference historical period from the production system; Searching the production log for a basic freight rate request related to the freight rate calculation instruction; The basic freight rate request is formatted to obtain the freight rate request.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Classify the fare request according to the basic air ticket purchase information included in the fare request to classify the fare request into a corresponding business scenario; It is determined whether the number of freight rate requests under the preset multiple business scenarios reaches the preset number. If so, the calling of the freight rate calculation engine to execute the freight rate request is executed; if not, the freight rate request is continued to be obtained.
4. The method according to claim 1, characterized in that: A stubbing function is configured for each function in the freight rate calculation engine; and the obtaining of execution status information of the function in the freight rate calculation engine during the execution of the freight rate request includes: In the process of executing the freight rate request, the execution status information of the function function is recorded through the piling function corresponding to the function function; After executing the freight rate request, the freight rate calculation result and the execution status information of the function functions recorded in the piling function set corresponding to each function function are obtained.
5. A test case acquisition system, characterized in that: The system comprises: A production request capture component is used to capture the freight rate requests generated within the reference historical period, and obtain the production data corresponding to the freight rate requests from the freight rate data cluster; A freight rate calculation engine, used to execute the freight rate request; An execution path recording component, used for recording the execution status information of the function in the freight rate calculation engine during the process of the freight rate calculation engine executing the freight rate request; A function point extraction component is used to analyze the execution status information of the function functions in the freight rate calculation engine, extract the function points involved in the freight rate request to form a function point combination corresponding to the freight rate request; A result analysis component is used to determine whether the function point combination corresponding to the freight rate request matches the expected values corresponding to the various relevant function points of the freight rate product business in the business function point matrix; if the function point combination corresponding to the freight rate request matches the expected values corresponding to the various relevant function points of any of the freight rate product business in the business function point matrix, the freight rate request and its corresponding production data are used as positive test cases, and the positive test cases are stored in a test case library; if the function point combination corresponding to the freight rate request does not completely match the expected values corresponding to the various relevant function points of each of the freight rate product business in the business function point matrix, the freight rate request and its corresponding production data are used as negative test cases, and the negative test cases are stored in the test case library; The business function point matrix is constructed according to the freight rate product business, and includes the expected values corresponding to various relevant function points of the freight rate product business.
6. The system according to claim 5, characterized in that The production request capture component is specifically used for: Acquire production logs generated during the reference historical period from the production system; Searching the production log for a basic freight rate request related to the freight rate calculation instruction; The basic freight rate request is formatted to obtain the freight rate request.
7. The system according to claim 5 or 6, characterized in that: The production request capture component is also used to: Classify the fare request according to the basic air ticket purchase information included in the fare request to classify the fare request into a corresponding business scenario; It is determined whether the number of freight rate requests under the preset multiple business scenarios reaches a preset number. If so, the freight rate calculation engine is called to execute the freight rate request; if not, the freight rate request is continued to be obtained.
8. The system according to claim 5, characterized in that The execution path recording component is specifically used for: In the process of executing the freight rate request, the execution status information of the function function is recorded through the piling function corresponding to the function function; After executing the freight rate request, the freight rate calculation result and the execution status information of the function functions recorded in the piling function set corresponding to each function function are obtained.
Citation Information
Patent Citations
Test case generation method and device, computer equipment and storage medium
CA3131079A1
Test case generation method, device and system
CN108319547A