CN109840196A - The method and apparatus for testing service logic - Google Patents
The method and apparatus for testing service logic Download PDFInfo
- Publication number
- CN109840196A CN109840196A CN201711228914.3A CN201711228914A CN109840196A CN 109840196 A CN109840196 A CN 109840196A CN 201711228914 A CN201711228914 A CN 201711228914A CN 109840196 A CN109840196 A CN 109840196A
- Authority
- CN
- China
- Prior art keywords
- case
- default processing
- processing rule
- rule
- default
- 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.)
- Granted
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the present application discloses the method and apparatus of test service logic.One specific embodiment of method includes: to obtain the default processing result of default processing rule and corresponding default processing rule;When reading source data object using default processing rule, the sampling use-case of source data object is added to temporary object queue;After using default processing rule process source data object, by treated, sampling use-case is added to temporary object queue;Using the difference set of asynchronous task calculate in temporary object queue that treated sampling use-case and use-case of sampling, by difference set labeled as the use-case processing result of corresponding default processing rule;Based on use-case processing result and default processing result, determine whether the service logic of default processing rule is accurate.This embodiment improves the accuracys rate of test big data.
Description
Technical field
The invention relates to field of computer technology, and in particular to technical field of the computer network, more particularly to survey
The method and apparatus for trying service logic.
Background technique
Currently, still being continued to use when whether the service logic of big data of the test based on default processing rule process is accurate
Test method before builds different surveys for example, by using equivalence class classifying method, boundary value analysis method and cause effect graph etc.
Data are tried, to cover corresponding test case.
Summary of the invention
The embodiment of the present application proposes a kind of method and apparatus for testing service logic.
In a first aspect, the embodiment of the present application provides a kind of method for testing service logic, comprising: obtain default processing rule
The then default processing result regular with corresponding default processing;When reading source data object using default processing rule, by source number
Temporary object queue is added to according to the sampling use-case of object;After using default processing rule process source data object, it will handle
Sampling use-case afterwards is added to temporary object queue;Using asynchronous task calculate temporary object queue in treated sampling use-case
With the difference set of sampling use-case, difference set is labeled as to the use-case processing result of corresponding default processing rule;Based on use-case processing result
With default processing result, determine whether the service logic of default processing rule is accurate.
In some embodiments, based on use-case processing result and default processing result, the business of default processing rule is determined
If whether logic accurately includes: that use-case processing result is consistent with default processing result, it is determined that the business in default processing rule
Logic is accurate;If use-case processing result and default processing result are inconsistent, it is determined that the service logic in default processing rule is not
Accurately.
In some embodiments, it includes following one or more for presetting processing rule: query processing rule, filtration treatment rule
It is then regular with Screening Treatment.
In some embodiments, method further include: using asynchronous task in response to difference set is preset processing labeled as corresponding
The use-case processing result of rule deletes the sampling use-case of the source data object in temporary object queue.
In some embodiments, method further include: using asynchronous task in response to only including one in temporary object queue
Temporary object terminates asynchronous task.
In some embodiments, presetting processing rule includes: multiple serial default processing rules;By source data object
If it includes: the in the not multiple serial default processing rules of default processing rule that sampling use-case, which is added to temporary object queue,
One default processing rule, then using the sampling use-case after upper one in temporary object queue default processing rule process as current
The sampling use-case of the source data object of default processing rule.
Second aspect, the embodiment of the present application provide a kind of device for testing service logic, comprising: rules results obtain single
Member, for obtaining the default processing result of default processing rule and corresponding default processing rule;Sampling use-case adding unit, is used for
When reading source data object using default processing rule, the sampling use-case of source data object is added to temporary object queue;
Processing result adding unit, for after using default processing rule process source data object, sampling use-case to add by treated
Add to temporary object queue;Asynchronous task computing unit, for being calculated in temporary object queue using asynchronous task, treated
The difference set of sampling use-case and use-case of sampling, by difference set labeled as the corresponding use-case processing result for presetting processing rule;Service logic
Determination unit, for determining whether the service logic of default processing rule is quasi- based on use-case processing result and default processing result
Really.
In some embodiments, service logic determination unit is further used for: if use-case processing result and default processing knot
Fruit is consistent, it is determined that the service logic in default processing rule is accurate;If use-case processing result and default processing result are inconsistent,
Then determine the service logic inaccuracy in default processing rule.
In some embodiments, the default processing rule in rules results acquiring unit includes following one or more: being looked into
Ask processing rule, filtration treatment rule and Screening Treatment rule.
In some embodiments, device further include: asynchronous task deletes unit, for using asynchronous task in response to will be poor
Collection labeled as the corresponding default use-case processing result for handling rule, use by the sampling for deleting the source data object in temporary object queue
Example.
In some embodiments, device further include: asynchronous task end unit, for using asynchronous task in response to interim
Only include a temporary object in object queue, terminates asynchronous task.
In some embodiments, the default processing rule in rules results acquiring unit includes: multiple serial default places
Reason rule;Sampling use-case adding unit is further used for: if in the not multiple serial default processing rules of default processing rule
First default processing rule, then using the sampling use-case after upper one in temporary object queue default processing rule process as
The sampling use-case of the source data object of current preset processing rule.
The third aspect, the embodiment of the present application provide a kind of equipment, comprising: one or more processors;Storage device is used
In the one or more programs of storage;When one or more programs are executed by one or more processors, so that at one or more
The method that reason device realizes any one test service logic as above.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey
Sequence, which realizes any one test service logic as above method when being executed by processor.
The method and apparatus of test service logic provided by the embodiments of the present application, it is regular and corresponding to obtain default processing first
The default processing result of default processing rule;Later, when reading source data object using default processing rule, by source data pair
The sampling use-case of elephant is added to temporary object queue;Later, it after using default processing rule process source data object, will handle
Sampling use-case afterwards is added to temporary object queue;Later, it is taken out using treated in asynchronous task calculating temporary object queue
The difference set of sample use-case and sampling use-case, by difference set labeled as the use-case processing result of corresponding default processing rule;Finally, based on using
Example processing result and default processing result determine whether the service logic of default processing rule is accurate.In this course, due to
It is whether accurate to verify the service logic of default processing rule whether to meet default processing result using use-case processing result, mentions
The high accuracy rate of test big data.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the embodiment of the present application
Other features, objects and advantages will become more apparent upon:
Fig. 1 is shown can be using the implementation of the device of the method or test service logic of the test service logic of the application
The exemplary system architecture figure of example;
Fig. 2 is the schematic flow chart according to one embodiment of the method for the test service logic of the embodiment of the present application;
Fig. 3 is the schematic flow according to an application scenarios of the method for the test service logic of the embodiment of the present application
Figure;
Fig. 4 is the exemplary block diagram according to one embodiment of the device of the test service logic of the embodiment of the present application;
Fig. 5 is adapted for the structural schematic diagram of the computer system for the terminal device or server of realizing the application.
Specific embodiment
The embodiment of the present application is described in further detail with reference to the accompanying drawings and examples.It is understood that this
Locate described specific embodiment and is used only for explaining related invention, rather than the restriction to the invention.Further need exist for explanation
It is to illustrate only part relevant to related invention for ease of description, in attached drawing.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the embodiment of the present application
It can be combined with each other.The embodiment of the present application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the implementation of the device of the method or test service logic of the test service logic of the application
The exemplary system architecture 100 of example.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105,
106.Network 104 between terminal device 101,102,103 and server 105,106 to provide the medium of communication link.Net
Network 104 may include various connection types, such as wired, wireless communication link or fiber optic cables etc..
User 110 can be used terminal device 101,102,103 and be interacted by network 104 with server 105,106, to connect
Receive or send message etc..Various telecommunication customer end applications, such as search engine can be installed on terminal device 101,102,103
Class application, shopping class application, instant messaging tools, mailbox client, social platform software, video playback class application etc..
Terminal device 101,102,103 can be the various electronic equipments with display screen, including but not limited to intelligent hand
Machine, tablet computer, E-book reader, MP3 player (Moving Picture Experts Group Audio Layer
III, dynamic image expert's compression standard audio level 3), MP4 (Moving Picture Experts Group Audio
Layer IV, dynamic image expert's compression standard audio level 4) player, pocket computer on knee and desktop computer etc.
Deng.
Server 105,106 can be to provide the server of various services, such as provide terminal device 101,102,103
The background server of support.Background server such as can be stored or be calculated to the data of terminal at the processing, and will storage or meter
It calculates result and is pushed to terminal device.
It should be noted that in the application the method for test service logic provided by embodiment generally by server 105,
106 execute, and correspondingly, the device for testing service logic is generally positioned in server 105,106.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, Fig. 2 shows the processes according to one embodiment of the method for the test service logic of the application
200.The method of the test service logic, comprising the following steps:
In step 210, the default processing result of default processing rule and corresponding default processing rule is obtained.
In the present embodiment, electronic equipment (such as the electronic equipment shown in Fig. 1 of the method for operation test service logic
105,106) in true big data treatment process, when obtaining default processing rule, the default processing rule of available correspondence
Default processing result.
Illustratively, it may include following one or more for presetting processing rule: query processing rule, filtration treatment rule
With Screening Treatment rule.
In a step 220, when reading source data object using default processing rule, by the sampling use-case of source data object
It is added to temporary object queue.
In the present embodiment, the object type of source data object can be various data sets, be not limited to elasticity distribution formula
Data set RDD, data frame Dataframe, independent data set DataSet etc..The electronics of the method for operation test service logic
For equipment when using default processing rule process big data, it is interim right that the sampling use-case in the source data object of reading is added to
As queue.Here sampling use-case can be sample use-case or the sampling use-case according to pre-defined rule extraction randomly selected, this
Application is not construed as limiting this.
In step 230, after using default processing rule process source data object, by treated, sampling use-case is added
To temporary object queue.
In the present embodiment, the electronic equipment of the method for operation test service logic is big using default processing rule process
After data, by treated, sampling use-case is added to temporary object queue.
In step 240, using asynchronous task calculate temporary object queue in treated sampling use-case and sampling use-case
Difference set, by difference set be labeled as use-case processing result.
In the present embodiment, asynchronous task can from temporary object queue value, taken out when getting that treated simultaneously
Sample use-case and sampling use-case when, calculate obtain treated sampling use-case and sample use-case difference set, and by difference set labeled as use
Example processing result, it is whether accurate for testing the regular service logic of default processing.
In some optional implementations of the present embodiment, the above-mentioned method for testing service logic can also include:
Using asynchronous task in response to the use-case processing result by difference set labeled as corresponding default processing rule, temporary object queue is deleted
The sampling use-case of middle data source object.
In this implementation, the sampling use-case in temporary object queue is emptied in time by using asynchronous task, it can be with
The system resource for saving electronic equipment, improves the system operations speed of electronic equipment.
In some optional implementations of the present embodiment, the above-mentioned method for testing service logic can also include:
Using asynchronous task in response to only including a temporary object in temporary object queue, terminate asynchronous task.
In this implementation, the electronic equipment of the method for operation test service logic is using default processing rule process
After big data, meeting event notifies asynchronous task, informs when the length of temporary object queue is 1, terminates asynchronous task.Later,
Asynchronous task can terminate asynchronous task, set to improve electronics in response to only including a temporary object in temporary object queue
Standby resource utilization ratio.
In step 250, based on use-case processing result and default processing result, the service logic of default processing rule is determined
It is whether accurate.
It in the present embodiment, can be based at use-case when discovery has the use-case processing result of default processing rule to generate
It manages result and whether default processing result is consistent, to verify default processing rule to the processing result of the source data object of big data
Whether the service logic of preset processing rule is met.
In some optional implementations of the present embodiment, based on use-case processing result and default processing result, determine pre-
If whether the service logic of processing rule accurately may include: if that use-case processing result is consistent with default processing result, it is determined that
Service logic in default processing rule is accurate;If use-case processing result and default processing result are inconsistent, it is determined that default place
Service logic inaccuracy in reason rule.
In some optional implementations of the present embodiment, default processing rule may include: multiple serial default places
Reason rule;And if it may include: that default processing rule is not that the sampling use-case of source data object, which is added to temporary object queue,
First default processing rule in multiple serial default processing rules, then by upper one in temporary object queue default processing
Sampling use-case after rule process handles the sampling use-case of the source data object of rule as current preset.
In this implementation, for multiple serial default processing rules, only handled by first default processing rule
Source data object be the source data object read, the sampling use-case of source data object is the source data from reading to being taken out in picture
The sampling use-case taken;And from second default processing rule to the last one default processing rule, each default processing rule
Handled source data object is respectively the source data object after upper one default processing rule process, sampling of the source data to picture
Use-case is respectively the sampling use-case in temporary object queue after upper one default processing rule process.
The method for the test service logic that the above embodiments of the present application provide, can not influence big data calculating speed
Under scene, difference set of the asynchronous task acquisition before and after default processing rule process is introduced, and whether met by use-case processing result
Whether default processing result is accurate come the service logic for verifying default processing rule, improves the accuracy rate of test big data.
Below in conjunction with Fig. 3, the exemplary application scene of the method for the test service logic of the application is described.
As shown in figure 3, Fig. 3 shows the signal of an application scenarios of the method for the test service logic according to the application
Property flow chart.
As shown in figure 3, the method 300 of test service logic is run in electronic equipment 320, may include:
Firstly, obtaining the default processing result 302 of default processing rule 301 and corresponding default processing rule.
Later, when reading source data object 303 using default processing rule 301, the sampling of source data object 303 is used
Example 304 is added to temporary object queue 305.
Illustratively, source data object 303 derives from a Zhang Yuanbiao (category), and emphasis key record is as follows in table
Table:
Wherein, categroyid indicates category id, and fathercategoryid indicates parent id, if parent id=0, table
Show level-one category.In this example, it can be combined into source data object using 4 grades of classification collection, using the sampling in 4 grades of classification set
Use-case is the sampling use-case of source data object 303.
Later, after using default 301 processing sampling use-case 304 of processing rule, by treated, sampling use-case 306 is added
To temporary object queue 305.
Illustratively, after handling former table using default processing rule 301, the category relation table that obtains that treated
(categoryRela):
id1 | id2 | id3 | level | is_over | id |
1 | null | null | 1 | 0 | 1 |
1 | 2 | null | 2 | 0 | 2 |
1 | 2 | 3 | 3 | 0 | 3 |
1 | 2 | 3 | 4 | 0 | 4 |
1 | 2 | 3 | 5 | 1 | 5 |
1 | 21 | 0 | 2 | 1 | 21 |
Wherein, id1, id2 and id3 respectively indicate the corresponding level-one of category id, second level and three-level category id;Level is indicated
The corresponding category series of category id, level-one category are 1, and it be 3,4 grades of categories is that 4,5 grades of categories are that second level category, which is 2,3 grades of categories,
5;Is_over indicates whether id category is final stage category, if being then 1, no is 0;Id indicates category id.
In this example, the corresponding 4 grades of classifications of 5 grades of classifications are using after default processing rule process in 4 grades of classification set
Source data object 303, use it is default processing rule process after sampling use-case 306 for the pumping of the corresponding 4 grades of classifications of 5 grades of classifications
Sample use-case, can by this treated sampling use-case 306 be added to temporary object queue 305.
Later, use-case 306 of sampling using treated in the calculating temporary object queue 305 of asynchronous task 307 is used with sampling
The difference set 308 of example 304, by difference set 308 labeled as the use-case processing result 309 of corresponding default processing rule.
It should be appreciated that for the above-mentioned default processing rule for generating category relation table from former table, the content for needing to verify is covered
Lid final stage classification and non-final stage classification.Final stage classification can subtract the corresponding current classification of next stage classification using current classification,
Its difference set is the current classification as final stage classification, such as 4 grades of classification set subtract the corresponding 4 grades of classification set of 5 grades of classifications, etc.
In 4 grades of classification set as final stage classification.So, when verifying the default processing rule, 4 grades of classification collection are arranged in we
It is combined into data source object, 4 grades of classification collection belonging to 5 grades of classifications are combined into that treated data source object, using default processing rule
The difference set for handling the sampling use-case obtained before and after 4 grades of classifications (namely is used based on the sampling in temporary object queue 305 before and after the processing
The use-case processing result 309 that example obtains), judge whether it meets default processing result, namely whether be 4 grades of final stage classifications, i.e.,
Can determine whether the service logic of default processing rule is accurate.Similarly, the method for the test service logic, it is extensible to be generalized to it
On its adjacent classification.
Later, based on use-case processing result 309 and default processing result 302, the service logic of default processing rule is determined
Whether 310 is accurate.
When whether the service logic 310 for determining default processing rule is accurate, if use-case processing result and default processing knot
Fruit is consistent, it is determined that the service logic in default processing rule is accurate;If use-case processing result and default processing result are inconsistent,
Then determine the service logic inaccuracy in default processing rule.
It should be appreciated that the method for testing service logic shown in above-mentioned Fig. 3, only tests the method for service logic
Exemplary embodiment does not represent the restriction to the embodiment of the present application.For example, obtaining use-case processing result using asynchronous task
After 309, temporary object queue can be deleted in response to the use-case processing result by difference set labeled as corresponding default processing rule
The sampling use-case of middle data source object.In another example being adopted after the sampling use-case of data source object in deleting temporary object queue
It can terminate asynchronous task in response to only including a temporary object in temporary object queue with asynchronous task.
The method of the test service logic provided in the above-mentioned application scenarios of the embodiment of the present application can not influence to use
Under the scene of default processing rule process big data, introduces an asynchronous task and obtain the default difference handled before and after rule process
Collection, divides data by the legitimate reading in calculating process, comes whether the default processing rule of verify data meets expected result, drops
The degree-of-difficulty factor of the service logic of the default processing rule of low test big data, covers the checkout area in big data calculating
Scape.
With further reference to Fig. 4, as an implementation of the above method, this application provides a kind of devices for testing service logic
One embodiment, the method for the embodiment of the device of the test service logic and Fig. 1 to test service logic shown in Fig. 3
Embodiment is corresponding, and operation and the feature for testing the method description of service logic into Fig. 3 above with respect to Fig. 1 as a result, are equally suitable
For testing the device 400 and unit wherein included of service logic, details are not described herein.
As shown in figure 4, the device 400 of the test service logic may include: rules results acquiring unit 410, for obtaining
Take the default processing result of default processing rule and corresponding default processing rule;Sampling use-case adding unit 420, for using
When default processing rule reads source data object, the sampling use-case of source data object is added to temporary object queue;Processing knot
Fruit adding unit 430, for after using default processing rule process source data object, sampling use-case to be added to by treated
Temporary object queue;Asynchronous task computing unit 440, for being taken out using treated in asynchronous task calculating temporary object queue
The difference set of sample use-case and sampling use-case, by difference set labeled as the use-case processing result of corresponding default processing rule;Service logic is true
Order member 450, for determining whether the service logic of default processing rule is quasi- based on use-case processing result and default processing result
Really.
In some optional implementations of the present embodiment, service logic determination unit 450 is further used for: if at use-case
It is consistent with default processing result to manage result, it is determined that the service logic in default processing rule is accurate;If use-case processing result and
Default processing result is inconsistent, it is determined that the service logic inaccuracy in default processing rule.
Default processing rule packet in some optional implementations of the present embodiment, in rules results acquiring unit 410
It includes following one or more: query processing rule, filtration treatment rule and Screening Treatment rule.
In some optional implementations of the present embodiment, device further include: asynchronous task deletes unit 460, for adopting
With asynchronous task in response to the use-case processing result by difference set labeled as corresponding default processing rule, delete in temporary object queue
Source data object sampling use-case.
In some optional implementations of the present embodiment, device further include: asynchronous task end unit 470, for adopting
With asynchronous task in response to only including a temporary object in temporary object queue, terminate asynchronous task.
Default processing rule packet in some optional implementations of the present embodiment, in rules results acquiring unit 410
It includes: multiple serial default processing rules;Sampling use-case adding unit 420 is further used for: if default processing rule is not more
First default processing rule in a serial default processing rule, then by upper one in temporary object queue default processing rule
The sampling use-case for the sampling use-case source data object regular as current preset processing that then treated.
Present invention also provides a kind of embodiments of equipment, comprising: one or more processors;Storage device, for depositing
Store up one or more programs;When one or more programs are executed by one or more processors, so that one or more processors
The method for realizing test service logic described in any one as above.
Present invention also provides a kind of embodiments of computer readable storage medium, are stored thereon with computer program, should
The method of test service logic described in any one as above is realized when program is executed by processor.
Below with reference to Fig. 5, it illustrates the calculating of the terminal device or server that are suitable for being used to realize the embodiment of the present application
The structural schematic diagram of machine system 500.Terminal device shown in Fig. 5 is only an example, should not be to the function of the embodiment of the present application
Any restrictions can be brought with use scope.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in
Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and
Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data.
CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always
Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.;
And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because
The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon
Computer program be mounted into storage section 508 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, the computer program includes the program code for method shown in execution flow chart.Such
In embodiment, which can be downloaded and installed from network by communications portion 509, and/or is situated between from detachable
Matter 511 is mounted.When the computer program is executed by central processing unit (CPU) 501, the method that executes the embodiment of the present application
The above-mentioned function of middle restriction.
It should be noted that computer-readable medium described in the embodiment of the present application can be computer-readable signal media
Or computer readable storage medium either the two any combination.Computer readable storage medium for example can be with
System, device or the device of --- but being not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or it is any more than
Combination.The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires
Electrical connection, portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type are programmable
Read-only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic are deposited
Memory device or above-mentioned any appropriate combination.In the embodiment of the present application, computer readable storage medium can be any
Include or the tangible medium of storage program, the program can be commanded execution system, device or device and use or tie with it
It closes and uses.And in the embodiment of the present application, computer-readable signal media may include in a base band or as carrier wave one
The data-signal that part is propagated, wherein carrying computer-readable program code.The data-signal of this propagation can use
Diversified forms, including but not limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal is situated between
Matter can also be that any computer-readable medium other than computer readable storage medium, the computer-readable medium can be sent out
It send, propagate or transmits for by the use of instruction execution system, device or device or program in connection.It calculates
The program code for including on machine readable medium can transmit with any suitable medium, including but not limited to: wireless, electric wire, light
Cable, RF etc. or above-mentioned any appropriate combination.
Flow chart and block diagram in attached drawing illustrate system, method and meter according to the various embodiments of the embodiment of the present application
The architecture, function and operation in the cards of calculation machine program product.In this regard, each box in flowchart or block diagram
A part of a unit, program segment or code can be represented, a part of the unit, program segment or code includes one
Or multiple executable instructions for implementing the specified logical function.It should also be noted that in some implementations as replacements, side
The function of being marked in frame can also occur in a different order than that indicated in the drawings.For example, two sides succeedingly indicated
Frame can actually be basically executed in parallel, they can also be executed in the opposite order sometimes, this according to related function and
It is fixed.It is also noted that the group of each box in block diagram and or flow chart and the box in block diagram and or flow chart
It closes, can be realized with the dedicated hardware based system for executing defined functions or operations, or specialized hardware can be used
Combination with computer instruction is realized.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard
The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet
Rules results acquiring unit, sampling use-case adding unit, processing result adding unit, asynchronous task computing unit and business is included to patrol
Determination unit is collected, the title of these units does not constitute the restriction to the unit itself under certain conditions, for example, rules results
Acquiring unit is also described as " obtaining the list of the default processing result of default processing rule and corresponding default processing rule
Member ".
As on the other hand, the embodiment of the present application also provides a kind of nonvolatile computer storage medias, this is non-volatile
Property computer storage medium can be nonvolatile computer storage media included in device described in above-described embodiment;?
It can be individualism, without the nonvolatile computer storage media in supplying terminal.Above-mentioned non-volatile computer storage
Media storage has one or more program, when one or more of programs are executed by an equipment, so that described set
It is standby: to obtain the default processing result of default processing rule and corresponding default processing rule;Regular reading source is being handled using default
When data object, the sampling use-case of source data object is added to temporary object queue;Using default processing rule process source
After data object, by treated, sampling use-case is added to temporary object queue;Temporary object queue is calculated using asynchronous task
In treated sampling use-case and use-case of sampling difference set, the use-case by difference set labeled as corresponding default processing rule handles knot
Fruit;Based on use-case processing result and default processing result, determine whether the service logic of default processing rule is accurate.
Above description is only the preferred embodiment of the embodiment of the present application and the explanation to institute's application technology principle.This field
It will be appreciated by the skilled person that invention scope involved in the embodiment of the present application, however it is not limited to the specific group of above-mentioned technical characteristic
Technical solution made of conjunction, at the same should also cover do not depart from foregoing invention design in the case where, by above-mentioned technical characteristic or its
Equivalent feature carries out any combination and other technical solutions for being formed.Such as disclosed in features described above and the embodiment of the present application
(but being not limited to) have the technical characteristic of similar functions replaced mutually and the technical solution that is formed.
Claims (14)
1. a kind of method for testing service logic, comprising:
Obtain the default processing result of default processing rule and the corresponding default processing rule;
When reading source data object using the default processing rule, the sampling use-case of the source data object is added to and is faced
When object queue;
After using source data object described in the default processing rule process, by treated, the sampling use-case is added to institute
State temporary object queue;
Using asynchronous task calculate described in the temporary object queue that treated the sampling use-case and the sampling use-case
Difference set, by the difference set labeled as the use-case processing result of the corresponding default processing rule;
Based on the use-case processing result and the default processing result, whether the regular service logic of the default processing is determined
Accurately.
It is described based on the use-case processing result and the default processing knot 2. according to the method described in claim 1, wherein
Fruit, determine it is described it is default processing rule service logic whether accurately include:
If the use-case processing result is consistent with the default processing result, it is determined that the service logic in default processing rule is quasi-
Really;
If the use-case processing result and the default processing result are inconsistent, it is determined that the service logic in default processing rule
Inaccuracy.
3. according to the method described in claim 1, wherein, the default processing rule includes following one or more: Directory Enquiries
Reason rule, filtration treatment rule and Screening Treatment rule.
4. according to the method described in claim 1, wherein, the method also includes:
Using the asynchronous task in response to the difference set is labeled as the regular use-case processing result of the corresponding default processing,
Delete the sampling use-case of the source data object in the temporary object queue.
5. according to the method described in claim 4, wherein, the method also includes: using the asynchronous task in response to described
Only include a temporary object in temporary object queue, terminates the asynchronous task.
6. method described in -5 any one according to claim 1, wherein the default processing rule includes: multiple serial
Default processing rule;
If it is described by the sampling use-case of the source data object be added to temporary object queue include: the default processing rule simultaneously
First default processing rule in non-the multiple serial default processing rule, then will be upper one in the temporary object queue
The sampling use-case of source data object of the sampling use-case as current preset processing rule after a default processing rule process.
7. a kind of device for testing service logic, comprising:
Rules results acquiring unit, for obtaining the default processing knot of default processing rule and the corresponding default processing rule
Fruit;
Sampling use-case adding unit is used for when reading source data object using the default processing rule, by the source data
The sampling use-case of object is added to temporary object queue;
Processing result adding unit is used for after using source data object described in the default processing rule process, after processing
The sampling use-case be added to the temporary object queue;
Asynchronous task computing unit, for using the asynchronous task pumping that calculates described in the temporary object queue that treated
The difference set of sample use-case and the sampling use-case, the use-case by the difference set labeled as the corresponding default processing rule handle knot
Fruit;
Service logic determination unit, for determining described default based on the use-case processing result and the default processing result
Whether the service logic for handling rule is accurate.
8. device according to claim 7, wherein the service logic determination unit is further used for:
If the use-case processing result is consistent with the default processing result, it is determined that the service logic in default processing rule is quasi-
Really;
If the use-case processing result and the default processing result are inconsistent, it is determined that the service logic in default processing rule
Inaccuracy.
9. device according to claim 7, wherein the default processing rule packet in the rules results acquiring unit
It includes following one or more: query processing rule, filtration treatment rule and Screening Treatment rule.
10. device according to claim 7, wherein described device further include:
Asynchronous task deletes unit, for using the asynchronous task in response to the difference set is labeled as the corresponding default place
The use-case processing result for managing rule, deletes the sampling use-case of the source data object in the temporary object queue.
11. device according to claim 10, wherein described device further include:
Asynchronous task end unit, for being faced using the asynchronous task in response to only including one in the temporary object queue
When object, terminate the asynchronous task.
12. according to device described in claim 7-11 any one, wherein described pre- in the rules results acquiring unit
If processing rule includes: multiple serial default processing rules;
Sampling use-case adding unit is further used for: if not the multiple serial default processing rule of the default processing rule
First default processing rule in then, then by the sampling after upper one in the temporary object queue default processing rule process
Sampling use-case of the use-case as the source data object of current preset processing rule.
13. a kind of equipment, comprising:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
The now method of the test service logic as described in any one of claim 1-6.
14. a kind of computer readable storage medium, is stored thereon with computer program, realized such as when which is executed by processor
The method of test service logic described in any one of claim 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711228914.3A CN109840196B (en) | 2017-11-29 | 2017-11-29 | Method and device for testing business logic |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711228914.3A CN109840196B (en) | 2017-11-29 | 2017-11-29 | Method and device for testing business logic |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109840196A true CN109840196A (en) | 2019-06-04 |
CN109840196B CN109840196B (en) | 2022-08-12 |
Family
ID=66882364
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711228914.3A Active CN109840196B (en) | 2017-11-29 | 2017-11-29 | Method and device for testing business logic |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109840196B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120173557A1 (en) * | 2008-05-12 | 2012-07-05 | Expressor Software | Method and system for executing a data integration application using executable units that operate independently of each other |
US20140365827A1 (en) * | 2011-06-15 | 2014-12-11 | Amazon Technologies, Inc. | Architecture for end-to-end testing of long-running, multi-stage asynchronous data processing services |
US20150020049A1 (en) * | 2013-07-09 | 2015-01-15 | International Business Machines Corporation | Test framework for computing jobs |
US20150193474A1 (en) * | 2014-01-07 | 2015-07-09 | International Business Machines Corporation | Performing logical validation on loaded data in a database |
CN105787089A (en) * | 2016-03-15 | 2016-07-20 | 国家电网公司 | Power distribution network scheduling foundation data integrating method |
US20170139816A1 (en) * | 2015-11-17 | 2017-05-18 | Alexey Sapozhnikov | Computerized method and end-to-end "pilot as a service" system for controlling start-up/enterprise interactions |
CN106776280A (en) * | 2016-11-24 | 2017-05-31 | 上海携程商务有限公司 | Configurable performance test device |
CN107133342A (en) * | 2017-05-16 | 2017-09-05 | 广州舜飞信息科技有限公司 | A kind of IndexR real-time data analysis storehouse |
CN107145432A (en) * | 2017-03-30 | 2017-09-08 | 华为技术有限公司 | A kind of method and client for setting up model database |
US20170293508A1 (en) * | 2016-03-22 | 2017-10-12 | Tata Consultancy Services Limited | Systems and methods for generating real time events |
-
2017
- 2017-11-29 CN CN201711228914.3A patent/CN109840196B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120173557A1 (en) * | 2008-05-12 | 2012-07-05 | Expressor Software | Method and system for executing a data integration application using executable units that operate independently of each other |
US20140365827A1 (en) * | 2011-06-15 | 2014-12-11 | Amazon Technologies, Inc. | Architecture for end-to-end testing of long-running, multi-stage asynchronous data processing services |
US20150020049A1 (en) * | 2013-07-09 | 2015-01-15 | International Business Machines Corporation | Test framework for computing jobs |
US20150193474A1 (en) * | 2014-01-07 | 2015-07-09 | International Business Machines Corporation | Performing logical validation on loaded data in a database |
US20170139816A1 (en) * | 2015-11-17 | 2017-05-18 | Alexey Sapozhnikov | Computerized method and end-to-end "pilot as a service" system for controlling start-up/enterprise interactions |
CN105787089A (en) * | 2016-03-15 | 2016-07-20 | 国家电网公司 | Power distribution network scheduling foundation data integrating method |
US20170293508A1 (en) * | 2016-03-22 | 2017-10-12 | Tata Consultancy Services Limited | Systems and methods for generating real time events |
CN106776280A (en) * | 2016-11-24 | 2017-05-31 | 上海携程商务有限公司 | Configurable performance test device |
CN107145432A (en) * | 2017-03-30 | 2017-09-08 | 华为技术有限公司 | A kind of method and client for setting up model database |
CN107133342A (en) * | 2017-05-16 | 2017-09-05 | 广州舜飞信息科技有限公司 | A kind of IndexR real-time data analysis storehouse |
Non-Patent Citations (4)
Title |
---|
YURIDEMCHENKO等: ""Chapter 2 - Cloud Computing Infrastructure for Data Intensive Applications"", 《BIG DATA ANALYTICS FOR SENSOR-NETWORK COLLECTED INTELLIGENCE》, 10 February 2017 (2017-02-10), pages 21 - 62 * |
汪璐: ""面向海量数据的实时计算一致性研究"", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》, no. 04, 15 April 2016 (2016-04-15), pages 137 - 16 * |
王晓光 等: "基于RPC的通用数据库性能测试工具构架", 《计算机工程》 * |
王晓光 等: "基于RPC的通用数据库性能测试工具构架", 《计算机工程》, no. 01, 5 January 2011 (2011-01-05), pages 40 - 41 * |
Also Published As
Publication number | Publication date |
---|---|
CN109840196B (en) | 2022-08-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107944481B (en) | Method and apparatus for generating information | |
CN108776692A (en) | Method and apparatus for handling information | |
CN110929136A (en) | Personalized recommendation method and device | |
CN110929799A (en) | Method, electronic device, and computer-readable medium for detecting abnormal user | |
CN113592535B (en) | Advertisement recommendation method and device, electronic equipment and storage medium | |
CN110209658A (en) | Data cleaning method and device | |
CN109241722A (en) | For obtaining method, electronic equipment and the computer-readable medium of information | |
CN110019263A (en) | Information storage means and device | |
CN108512674B (en) | Method, device and equipment for outputting information | |
CN109614549B (en) | Method and apparatus for pushed information | |
CN109885564A (en) | Method and apparatus for sending information | |
CN109492687A (en) | Method and apparatus for handling information | |
JP2023523191A (en) | ACCOUNT IDENTIFICATION METHODS, DEVICES, ELECTRONIC DEVICES AND COMPUTER-READABLE MEDIA | |
CN109426998A (en) | Information-pushing method and device | |
CN108062576B (en) | Method and apparatus for output data | |
CN110633411A (en) | Method and device for screening house resources, electronic equipment and storage medium | |
CN108537786A (en) | For handling image method and device | |
CN109948636A (en) | Data fusion method and device | |
CN109840196A (en) | The method and apparatus for testing service logic | |
CN110019531A (en) | A kind of method and apparatus obtaining analogical object set | |
CN110110197A (en) | Information acquisition method and device | |
CN111898027A (en) | Method, device, electronic equipment and computer readable medium for determining feature dimension | |
CN109634827A (en) | Method and apparatus for generating information | |
CN109388753A (en) | Method and apparatus for handling information | |
CN112529646A (en) | Commodity classification 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |