CN109558313A - Construct the method and device of abnormality test scene - Google Patents

Construct the method and device of abnormality test scene Download PDF

Info

Publication number
CN109558313A
CN109558313A CN201811329188.9A CN201811329188A CN109558313A CN 109558313 A CN109558313 A CN 109558313A CN 201811329188 A CN201811329188 A CN 201811329188A CN 109558313 A CN109558313 A CN 109558313A
Authority
CN
China
Prior art keywords
scene
called
building
called object
abnormal
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
Application number
CN201811329188.9A
Other languages
Chinese (zh)
Other versions
CN109558313B (en
Inventor
何青松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Koubei Shanghai Information Technology Co Ltd
Original Assignee
Koubei Shanghai Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Koubei Shanghai Information Technology Co Ltd filed Critical Koubei Shanghai Information Technology Co Ltd
Priority to CN201811329188.9A priority Critical patent/CN109558313B/en
Publication of CN109558313A publication Critical patent/CN109558313A/en
Application granted granted Critical
Publication of CN109558313B publication Critical patent/CN109558313B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3636Software debugging by tracing the execution of the program

Abstract

The invention discloses a kind of method and device for constructing abnormality test scene, method includes: to receive the scenario building order comprising called object-related information of user's input, and parse to scenario building order, obtains called object-related information;Monitor current test process, when listen to called object it is called when, corresponding intercept process is carried out according to scenario building order, and abnormal scene is constructed based on called object, returns to calling object.The present invention realizes on the basis of not changing existing code, under the premise of not needing project restarting, called object can be intercepted by scenario building order, effectively prevent interrupting in the prior art and a little carry out debugging or directly modification item code and redeploy the problems such as bring frequently dispose test environment, entirety joint debugging is hindered to test.The present invention is realized and is precisely intercepted by the specified called object intercepted of scenario building order.

Description

Construct the method and device of abnormality test scene
Technical field
The present invention relates to software fields, and in particular to a kind of method and device for constructing abnormality test scene.
Background technique
Large-scale software systems are due to its internal logic numerous and complicated, in actual implementation development process, often according to One large-scale software systems is divided into multiple systems by the principle of height polymerization lower coupling.Wherein, each system realizes a tool The function of body.By providing the modes such as interface, monitoring information, the mutual offer serviced between realization system between system.For one Complete software systems are often made of several systems even a systems up to a hundred according to the diversity and complexity of service. These systems can be researched and developed simultaneously after clearly respective traffic border by different team.It is also needed before publication By the joint debugging test between strict system, to ensure that software application system allomeric function meets expected realization.
When between joint debugging is carried out each system, needs to build a whole set of test environment, need between each system by true Service call tested.Only just can ensure that by the test of all scenes can provide after software systems publication it is expected Service.During entire joint debugging, abnormal scrnario testing is very important a ring, and appearance time-out is called to be without response between system Abnormal scrnario testing has to the most important thing considered.It is illustrated for being paid in mobile payment using payment code, user Payment code is illustrated, after businessman scans payment code, server needs to parse payment code, carries out school to the qualification of businessman, user It tests, it is final to carry out fund carrying, i.e., money is removed to Merchant ID from user account.If the last one fund is removed money system and is had occurred Time-out, the up-stream system that calling fund removes money system will be unable to know whether user account has deducted money and whether is Merchant ID Fund has been received, the up-stream system needs for calling fund to remove money system at this time are executed according to system design scheme, do correspondence Data processing and return to exception code.For above-mentioned scene, very rigorous system design, exploitation need to be carried out, and by abundant Test, just can ensure that the fund security of user and businessman.In actual software systems, above-mentioned scene can also involve multiple System, so that very time-consuming in joint debugging test.
The prior art for called between system time-out abnormal scene test, it is very easy and effective there are no one Method.Tester pass through frequently with method there are two main classes:
1) debugging breakpoints are carried out to system under test (SUT) by way of remote debugging.A system called B system movement it Breakpoint is set afterwards to hinder system flow, until A system is to the calling time-out of B system.This method have the defects that two it is great, Firstly, this method can only simulate the successful scene of time-out, but it can not effectively simulate the scene of time-out failure.A system can be simulated It unites and successfully has invoked B system, the scene that can be successfully returned the result after B system time-out, but A system can not be simulated and call B system, B system does not receive the scene that request causes not return the result;Secondly, this method implements very troublesome, and most fields Infeasible under scape, entire joint debugging environment often has multiple systems testing simultaneously, carries out breakpoint setup to some system, can block The joint debugging of all other system is tested.
2) the artificial test code for manufacturing abnormal scene is embedded in code.This method has distorted the generation of tested test system Code causes test result inaccurate;And test different exceptions every time and require to remodify code, deployment test environment is very It is time-consuming.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind State the method and device of the building abnormality test scene of problem.
According to an aspect of the invention, there is provided a kind of method for constructing abnormality test scene comprising:
Receive the scenario building order comprising called object-related information of user's input, and to scenario building order into Row parsing obtains called object-related information;
Monitor current test process, when listen to called object it is called when, phase is carried out according to scenario building order The intercept process answered, and abnormal scene is constructed based on called object, return to calling object.
Optionally, called object-related information includes the object name and method name of called object;Scenario building order Abnormal scene and/or specified Exception Type also comprising specified building;Wherein, abnormal scene include time-out success scene and/ Or overtime failure scene.
Optionally, monitor current test process, when listen to called object it is called when, according to scenario building order Corresponding intercept process is carried out, and abnormal scene is constructed based on called object, returning to calling object further comprises:
The event sniffer of object name and method name comprising called object is constructed to monitor current test process;
Judge whether current test process is being called the object name and method name of called object;
If so, carrying out corresponding intercept process according to scenario building order, and abnormal scene is constructed based on called object, Return to calling object.
Optionally, corresponding intercept process is carried out according to scenario building order, and anomalous field is constructed based on called object Scape, returning to calling object further comprises:
According to the abnormal scene for the specified building that scenario building order is included, the call request to called object is intercepted Or the returning response of the processing result of called object is intercepted, and the specified Exception Type for being included according to scenario building order It is abnormal that assembling obtains corresponding calling;
Exception will be called to return to calling object.
Optionally, the abnormal scene for the specified building for being included according to scenario building order is intercepted to called object The returning response of the processing result of call request or the called object of interception further comprises:
Whether the abnormal scene of the specified building of judgement is time-out success scene;
If so, intercepting the returning response of the processing result of called object;
Whether the abnormal scene of the specified building of judgement is overtime failure scene;
If so, intercepting the call request to called object.
Optionally, call abnormal, operation exception abnormal including null pointer, input and output abnormal and/or time-out exception.
Optionally, method further include:
Setting building switch constructs or closes accordingly building abnormality test scene according to set building switch.
According to another aspect of the present invention, a kind of device for constructing abnormality test scene is provided comprising:
Receiving module, suitable for receiving the scenario building order comprising called object-related information of user's input, and it is right Scenario building order is parsed, and called object-related information is obtained;
Construct module, be adapted for listening for current test process, when listen to called object it is called when, according to scene structure It builds order and carries out corresponding intercept process, and abnormal scene is constructed based on called object, return to calling object.
Optionally, called object-related information includes the object name and method name of called object;Scenario building order Abnormal scene and/or specified Exception Type also comprising specified building;Wherein, abnormal scene include time-out success scene and/ Or overtime failure scene.
Optionally, building module is further adapted for:
The event sniffer of object name and method name comprising called object is constructed to monitor current test process;
Judge whether current test process is being called the object name and method name of called object;If so, Corresponding intercept process is carried out according to scenario building order, and abnormal scene is constructed based on called object, returns to calling pair As.
Optionally, building module is further adapted for:
According to the abnormal scene for the specified building that scenario building order is included, the call request to called object is intercepted Or the returning response of the processing result of called object is intercepted, and the specified Exception Type for being included according to scenario building order It is abnormal that assembling obtains corresponding calling;
Exception will be called to return to calling object.
Optionally, building module is further adapted for:
Whether the abnormal scene of the specified building of judgement is time-out success scene;
If so, intercepting the returning response of the processing result of called object;
Whether the abnormal scene of the specified building of judgement is overtime failure scene;
If so, intercepting the call request to called object.
Optionally, call abnormal, operation exception abnormal including null pointer, input and output abnormal and/or time-out exception.
Optionally, device further include:
Switch module is suitable for setting building switch, constructs or close accordingly building according to set building switch Abnormality test scene.
According to another aspect of the invention, provide a kind of electronic equipment, comprising: processor, memory, communication interface and Communication bus, processor, memory and communication interface complete mutual communication by communication bus;
Memory makes processor execute above-mentioned building abnormality test for storing an at least executable instruction, executable instruction The corresponding operation of the method for scene.
In accordance with a further aspect of the present invention, a kind of computer storage medium is provided, at least one is stored in storage medium Executable instruction, executable instruction make processor execute the corresponding operation of method such as above-mentioned building abnormality test scene.
The method and device of the building abnormality test scene provided according to the present invention, receive user's input includes called The scenario building order of object-related information, and scenario building order is parsed, obtain called object-related information;Prison Listen current test process, when listen to called object it is called when, carried out at corresponding interception according to scenario building order Reason, and abnormal scene is constructed based on called object, return to calling object.The present invention, which realizes, is not changing existing code On the basis of, under the premise of not needing project restarting, called object can be intercepted by scenario building order, is effectively kept away Exempt to interrupt in the prior art and has a little carried out debugging or directly modify item code and redeploy bring frequently to dispose test Environment hinders the problems such as whole joint debugging test.The present invention realizes essence by the specified called object intercepted of scenario building order Standard intercepts.Further, the test process for simulating abnormal scene has no effect for other objects, and the examination of distich commissioning will not generate The problems such as blocking.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows the flow chart of the method for building abnormality test scene according to an embodiment of the invention;
Fig. 2 shows the flow charts of the method for building abnormality test scene in accordance with another embodiment of the present invention;
Fig. 3 a shows the flow chart for calling object normal call to be called object;
Fig. 3 b shows the flow chart for calling object time-out normal call to be called object;
Fig. 3 c shows the flow chart for calling object time-out unsuccessfully to call called object;
Fig. 4 shows the functional block diagram of the device of building abnormality test scene according to an embodiment of the invention;
Fig. 5 shows the structural schematic diagram of a kind of electronic equipment according to an embodiment of the invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
Fig. 1 shows the flow chart of the method for building abnormality test scene according to an embodiment of the invention.Such as Fig. 1 institute Show, the method for building abnormality test scene specifically comprises the following steps:
Step S101 receives the scenario building order comprising called object-related information of user's input, and to scene Building order is parsed, and called object-related information is obtained.
User can imagine institute's abnormal scene to be tested according to the needs currently tested in advance.It is abnormal in the present embodiment Scene is illustrated by taking the scene that time-out is caused as an example.When calling the called object of object reference, called object time-out is returned Processing result is returned, various overtime scenes can be caused.
As current, to imagine institute's scene to be tested be test scene of the account verification in timeout case.Called object is account The account of family system verifies, and the system for calling object that can verify function for calling account, such as fund handling system, which is needed It to execute corresponding fund in the case where account verifies correct situation and carry.It is clear without returning in the account verification of Accounting system Processing result before, fund handling system not can be carried out any fund operation under the premise of, it is also necessary to return information to adjust With the up-stream system of fund handling system, being determined to operate in next step by up-stream system is direct prompt user payment failure, or It initiates to retry in the case where user's unaware, to complete the test to the account verification time-out of Accounting system.For above-mentioned Test scene can use the present embodiment building abnormality test scene.It is being carried out using the abnormality test scene that the present embodiment constructs When test, normal mutually calling between other each systems is not interfered with, carries out portion again without to deployed system Administration.
Specifically, user can first select called object, receive user's input includes called object-related information Scenario building order.Called object-related information includes the object name and method name such as the object that is called, convenient to being adjusted It is positioned etc. with object.Called object-related information can be by being parsed to obtain to scenario building order.For convenience Scenario building order is parsed, the format of scenario building order can be worked out in advance, is parsed to obtain called object phase according to format Information is closed, so as to the called object-related information of subsequent basis, takes corresponding intercept process.Intercept process is based on called pair As relevant information realization, therefore, qualified call object, the abnormality test scene reply that building may be implemented be not different for the present embodiment Object is called to test the calling of called object.
Step S102 monitors current test process, judges whether that listening to called object is called.
The test process being currently executing is monitored, specifically, being carried out for whether called object is called It monitors, when called object is called, executes step S103;Otherwise, without any processing, it continues to execute and is currently executing Test process.
It monitors using individual event sniffer completion is created, does not need to increase any modification, event in existing code Monitor is based on to called object, according to called object-related information, can accurately be established for called object Event sniffer can accurately monitor the calling of called object, not to the execution of business in existing code, operation flow, Proper testing etc. impacts.
Step S103 carries out corresponding intercept process according to scenario building order, and constructs anomalous field for called object Scape returns to calling object.
When listen to called object it is called when, need to carry out intercept process for this calling, allow called object Calling process time-out, and return to the exception of building accordingly to object is called, call that object obtains is an overtime place Reason as a result, call object can based on this time-out processing result continue to execute, so as to test call object obtaining Whether normally execution etc. can be continued when the processing result of time-out.The processing such as above-mentioned intercept process, overtime return, abnormal return are total With the building for completing abnormality test scene.
After listening to called object and being called, so that it may intercept process is executed, and the abnormal return of assembling accordingly, this A little processing can be completely exfoliated with existing code, not need to be modified in existing code.
The method of the building abnormality test scene provided according to the present invention, receive user's input includes called object phase The scenario building order of information is closed, and scenario building order is parsed, obtains called object-related information;It monitors current Test process, when listen to called object it is called when, corresponding intercept process is carried out according to scenario building order, and be Called object constructs abnormal scene, returns to calling object.The present invention realizes on the basis of not changing existing code, Under the premise of not needing project restarting, called object can be intercepted by scenario building order, is effectively prevented existing It is interrupted in technology and a little carries out debugging or directly modification item code and redeploy bring frequently disposing test environment, hindering The problems such as whole joint debugging is tested.The present invention is realized and is precisely intercepted by the specified called object intercepted of scenario building order.Into One step, the test process for simulating abnormal scene have no effect for other objects, and the examination of distich commissioning will not generate blocking etc. and ask Topic.
Fig. 2 shows the flow charts of the method for building abnormality test scene in accordance with another embodiment of the present invention.Such as Fig. 2 Shown, the method for building abnormality test scene specifically comprises the following steps:
It is abnormal to construct or close accordingly building according to set building switch for step S201, setting building switch Test scene.
For convenience of the building of control abnormality test scene, a building switch is set.When open building switch when, it is subsequent can To monitor the calling of called object, according to scenario building order, the building of abnormal scene is completed.When closing building switch, It is subsequent will not the calling again to called object the processing such as monitored, intercepted, allow to it is normally called execute, complete quilt Call the execution logic of object.Building switch can be opened or closed according to order.
The step is optional step, convenient for needing to open or close building switch according to test, so that test in test When can according to set building switch come accordingly construct or close construct abnormality test scene.
Step S202 receives the scenario building order comprising called object-related information of user's input, and to scene Building order is parsed, and called object-related information is obtained.
Scenario building order is in addition to comprising called object-related information, also comprising the specified abnormal scene constructed.This reality Applying abnormal scene in example includes time-out success scene and overtime failure scene.Time-out success scene table during actual test Now cause to return to time-out for called object successful execution but due to executing overlong time, so that object is called to think that it is not held The successful scene of row.Overtime failure scene shows as called object during actual test and executes failure, cannot normally return It returns.Since the above abnormal scene is not frequent occurrence, to lead to not be tested as needed in practice.Therefore, it constructs different Normal test scene is even more important to test.The present embodiment can be according to the time-out success scene shown during actual test With the feature of overtime failure scene, corresponding abnormality test scene is constructed.Further, scenario building order can also be comprising specified Exception Type.Specified Exception Type is according to the abnormal setting that may occur during actual test, as null pointer is abnormal, fortune Row is abnormal, input and output are abnormal, time-out is abnormal etc., is not specifically limited herein.
After receiving the scenario building order comprising called object-related information of user's input, scenario building is ordered Order is parsed, and the information such as called object-related information, the abnormal scene of specified building, specified Exception Type are got. Optionally, building switch can be opened or closed by scenario building order.Such as in user's input comprising opening building switch order Scenario building instruction.Closing building switch order can be inputted or close building switch using shortcut key by closing building switch Deng.
Step S203 constructs the event sniffer of object name and method name comprising called object to monitor current survey Examination process, judges whether current test process is being called the object name and method name of called object.
According to the object name and method name of called object, corresponding event sniffer can be constructed to monitor current survey Examination process.The event of the object name and method name that are such as directed to called object using EventWatchBuilder construction of function is supervised Listen device.When have call object reference be called object when, can accurately learn current test process to called pair The object name and method name of elephant are called, and execute step S204;Otherwise, continue current test process.
Further, the event sniffer for constructing object name and method name comprising called object can be invaded based on nothing in real time Enter AOP frame, such as Sandbox, avoids the modification to existing code.Scenario building order can be according to the different test need of user It asks, every time includes different called object-related informations.After receiving scenario building order, called pair obtained will be parsed The relevant information of elephant passes to EventWatchBuilder function as parameter, may be implemented to utilize EventWatchBuilder The event sniffer of the called object of construction of function difference, accurately determines called object, surveys to meet the different of user Examination demand.
Step S204 carries out corresponding intercept process according to scenario building order, and constructs anomalous field for called object Scape returns to calling object.
According to the abnormal scene for the specified building that scenario building order is included, need to further determine that at specific interception Reason.For calling the normal flow of the called object of object reference, referring to Fig. 3 a, calling inside object includes such as data meter Calculation and the called object of conversion process, calling carry out analysis to the processing result that called object returns and to calling exception It handled, assemble result and export etc..When needing to construct abnormal scene in normal flow, need first to judge specified structure Why the abnormal scene built plants scene.When the abnormal scene for judging specified building scene successful as time-out, that is, need to construct quilt It calls object successful execution but causes to return to time-out due to executing overlong time, so that object is called to think that it is not carried out success Scene.At this point, intercept process should be the returning response for intercepting the processing result of called object.As shown in Figure 3b, it is calling Object reference is called after object, intercepts to the returning response of the processing result of called object, and according to scenario building It orders the specified Exception Type for being included to assemble to obtain corresponding calling exception, exception will be called to return to calling object, and made Executing overlong time at called object leads to the scene for returning to time-out, but calling object is final or called pair available As the normal outcome of return, so that building obtains time-out success scene.When the abnormal scene of the specified building of judgement is a time out failure When scene, that is, needs to construct called object and execute failure, the scene that cannot normally return.At this point, intercept process should be interception Call request to called object.As shown in Figure 3c, before calling the called object of object reference, to the tune of called object Intercepted with request, do not executed the call request of called object, directly according to scenario building order included it is specified Exception Type assembles to obtain corresponding calling exception, exception will be called to return to calling object, called object is caused to execute mistake It loses, the scene that cannot normally return, object is called to be unable to get the normal outcome that called object returns, so that building is surpassed When failure scene.
Further, the specified Exception Type of the abnormal basis of the calling assembled may include as null pointer is abnormal, operation A variety of exceptions such as abnormal, input and output are abnormal, time-out exception, are not specifically limited herein.
The method of the building abnormality test scene provided according to the present invention, setting building switch, according to building switch come phase The building or closing building abnormality test scene answered, use proper testing process that is upper convenient and efficient, and not influencing existing code. Further, the building of abnormality test scene, which breaks to interrupt in the prior art, a little or directly modifies the test that code is just able to achieve Means avoid the modification to code and the influence to whole joint debugging, so that test can be carried out precisely.Based on called object Abnormality test scene is constructed, can be adapted for multiple and different calling objects, and unaffected to each other, joint debugging is more convenient and surveys Examination.
Fig. 4 shows the functional block diagram of the device of building abnormality test scene according to an embodiment of the invention.Such as Fig. 4 Shown, the device of building abnormality test scene includes following module:
Receiving module 410 is suitable for: the scenario building order comprising called object-related information of user's input is received, and Scenario building order is parsed, called object-related information is obtained.
Building module 420 is suitable for: monitor current test process, when listen to called object it is called when, according to field Scape building order carries out corresponding intercept process, and constructs abnormal scene based on called object, returns to calling object.
Optionally, building module 420 is further adapted for: the event of the construction object name comprising called object and method name Monitor monitors current test process;Judge current the test process whether object name to called object and side Religious name is called;If so, carrying out corresponding intercept process according to scenario building order, and abnormal based on called object building Scene returns to calling object.
Optionally, building module 420 is further adapted for: according to the anomalous field for the specified building that scenario building order is included Scape intercepts the call request to called object or intercepts the returning response of the processing result of called object, and according to scene The specified Exception Type that building order is included assembles to obtain corresponding calling exception;Exception will be called to return to calling pair As.
Optionally, building module 420 is further adapted for: whether the abnormal scene of the specified building of judgement is time-out success field Scape;If so, intercepting the returning response of the processing result of called object;Whether the abnormal scene of the specified building of judgement is overtime mistake Lose scene;If so, intercepting the call request to called object.
Optionally, device further include: switch module 430.
Switch module 430 is suitable for: setting building switch constructs or closes accordingly structure according to set building switch Build abnormality test scene.
Corresponding description in the description reference method embodiment of above each module, details are not described herein.
Present invention also provides a kind of nonvolatile computer storage media, the computer storage medium is stored at least The building abnormality test scene in above-mentioned any means embodiment can be performed in one executable instruction, the computer executable instructions Method.
Fig. 5 shows the structural schematic diagram of a kind of electronic equipment according to an embodiment of the invention, and the present invention is specifically real Example is applied not limit the specific implementation of electronic equipment.
As shown in figure 5, the electronic equipment may include: processor (processor) 502, communication interface (Communications Interface) 504, memory (memory) 506 and communication bus 508.
Wherein:
Processor 502, communication interface 504 and memory 506 complete mutual communication by communication bus 508.
Communication interface 504, for being communicated with the network element of other equipment such as client or other servers etc..
Processor 502, for executing program 510, the method that can specifically execute above-mentioned building abnormality test scene is implemented Correlation step in example.
Specifically, program 510 may include program code, which includes computer operation instruction.
Processor 502 may be central processor CPU or specific integrated circuit ASIC (Application Specific Integrated Circuit), or be arranged to implement the integrated electricity of one or more of the embodiment of the present invention Road.The one or more processors that electronic equipment includes can be same type of processor, such as one or more CPU;It can also To be different types of processor, such as one or more CPU and one or more ASIC.
Memory 506, for storing program 510.Memory 506 may include high speed RAM memory, it is also possible to further include Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.
Program 510 specifically can be used for so that the building that processor 502 executes in above-mentioned any means embodiment is surveyed extremely The method of examination hall scape.The specific implementation of each step may refer in the embodiment of above-mentioned building abnormality test scene in program 510 Corresponding steps and unit in corresponding description, this will not be repeated here.It is apparent to those skilled in the art that being Convenienct and succinct, the equipment of foregoing description and the specific work process of module of description, can be with reference in preceding method embodiment Corresponding process description, details are not described herein.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein. Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, such as right As claim reflects, inventive aspect is all features less than single embodiment disclosed above.Therefore, it then follows tool Thus claims of body embodiment are expressly incorporated in the specific embodiment, wherein each claim conduct itself Separate embodiments of the invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention Within the scope of and form different embodiments.For example, in detail in the claims, embodiment claimed it is one of any Can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice Microprocessor or digital signal processor (DSP) realize the device of building abnormality test scene according to an embodiment of the present invention In some or all components some or all functions.The present invention is also implemented as described herein for executing Some or all device or device programs (for example, computer program and computer program product) of method.In this way Realization program of the invention can store on a computer-readable medium, or can have the shape of one or more signal Formula.Such signal can be downloaded from an internet website to obtain, and perhaps be provided on the carrier signal or with any other shape Formula provides.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame Claim.

Claims (10)

1. a kind of method for constructing abnormality test scene comprising:
Receive the scenario building order comprising called object-related information of user's input, and to the scenario building order into Row parsing obtains called object-related information;
Monitor current test process, when listen to called object it is called when, phase is carried out according to the scenario building order The intercept process answered, and abnormal scene is constructed based on the called object, return to calling object.
2. according to the method described in claim 1, wherein, the called object-related information includes the object of called object Name and method name;The scenario building order also includes the specified abnormal scene constructed and/or specified Exception Type;Wherein, The exception scene includes time-out success scene and/or overtime failure scene.
3. described to monitor current test process according to the method described in claim 2, wherein, when listening to called object When called, corresponding intercept process is carried out according to the scenario building order, and abnormal based on the called object building Scene, returning to calling object further comprises:
The event sniffer of object name and method name comprising called object is constructed to monitor current test process;
Judge whether current test process is being called the object name and method name of called object;
If so, carrying out corresponding intercept process according to the scenario building order, and abnormal based on the called object building Scene returns to calling object.
4. according to the method in claim 2 or 3, wherein described to be intercepted accordingly according to the scenario building order Processing, and abnormal scene is constructed based on the called object, returning to calling object further comprises:
According to the abnormal scene for the specified building that the scenario building order is included, the calling to the called object is intercepted Request or intercept the returning response of the processing result of the called object, and the finger for being included according to the scenario building order Fixed Exception Type assembles to obtain corresponding calling exception;
The calling is returned into calling object extremely.
5. according to the method described in claim 4, wherein, the specified building for being included according to the scenario building order Abnormal scene, the return for intercepting the call request to the called object or intercepting the processing result of the called object are rung Should further comprise:
Whether the abnormal scene for judging the specified building is time-out success scene;
If so, intercepting the returning response of the processing result of the called object;
Whether the abnormal scene for judging the specified building is overtime failure scene;
If so, intercepting the call request to the called object.
6. according to the method described in claim 4, wherein, the calling includes that null pointer is abnormal extremely, be operating abnormally, input it is defeated Abnormal out and/or time-out is abnormal.
7. method according to claim 1 to 6, wherein the method also includes:
Setting building switch constructs or closes accordingly building abnormality test scene according to set building switch.
8. a kind of device for constructing abnormality test scene comprising:
Receiving module, suitable for receiving the scenario building order comprising called object-related information of user's input, and to described Scenario building order is parsed, and called object-related information is obtained;
Construct module, be adapted for listening for current test process, when listen to called object it is called when, according to the scene structure It builds order and carries out corresponding intercept process, and abnormal scene is constructed based on the called object, return to calling object.
9. a kind of electronic equipment, comprising: processor, memory, communication interface and communication bus, the processor, the storage Device and the communication interface complete mutual communication by the communication bus;
The memory executes the processor as right is wanted for storing an at least executable instruction, the executable instruction Ask the corresponding operation of method that abnormality test scene is constructed described in any one of 1-7.
10. a kind of computer storage medium, an at least executable instruction, the executable instruction are stored in the storage medium Processor is set to execute the corresponding operation of method such as building abnormality test scene of any of claims 1-7.
CN201811329188.9A 2018-11-09 2018-11-09 Method and device for constructing abnormal test scene Active CN109558313B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811329188.9A CN109558313B (en) 2018-11-09 2018-11-09 Method and device for constructing abnormal test scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811329188.9A CN109558313B (en) 2018-11-09 2018-11-09 Method and device for constructing abnormal test scene

Publications (2)

Publication Number Publication Date
CN109558313A true CN109558313A (en) 2019-04-02
CN109558313B CN109558313B (en) 2021-08-17

Family

ID=65865861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811329188.9A Active CN109558313B (en) 2018-11-09 2018-11-09 Method and device for constructing abnormal test scene

Country Status (1)

Country Link
CN (1) CN109558313B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110162455A (en) * 2019-04-09 2019-08-23 口碑(上海)信息技术有限公司 Joint debugging method and device, storage medium, the electronic device of software
CN112506773A (en) * 2020-12-03 2021-03-16 安徽听见科技有限公司 Abnormal scene testing method, device, equipment and storage medium
CN112860502A (en) * 2019-11-26 2021-05-28 上海哔哩哔哩科技有限公司 Fault simulation method, equipment, server and storage medium
CN113157593A (en) * 2021-05-24 2021-07-23 网易(杭州)网络有限公司 Performance data acquisition method, device, system, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104220993A (en) * 2012-04-20 2014-12-17 惠普发展公司,有限责任合伙企业 Testing system for an integrated software system
CN105786707A (en) * 2016-02-29 2016-07-20 腾讯科技(深圳)有限公司 Method and device for testing program
US20160307264A1 (en) * 2014-01-03 2016-10-20 Tencent Technology (Shenzhen) Company Limited Method and device for processing service request
CN106875184A (en) * 2016-08-10 2017-06-20 阿里巴巴集团控股有限公司 Abnormal scene analogy method, device and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104220993A (en) * 2012-04-20 2014-12-17 惠普发展公司,有限责任合伙企业 Testing system for an integrated software system
US20160307264A1 (en) * 2014-01-03 2016-10-20 Tencent Technology (Shenzhen) Company Limited Method and device for processing service request
CN105786707A (en) * 2016-02-29 2016-07-20 腾讯科技(深圳)有限公司 Method and device for testing program
CN106875184A (en) * 2016-08-10 2017-06-20 阿里巴巴集团控股有限公司 Abnormal scene analogy method, device and equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
雷阳: ""GSM网络基站控制器故障管理分析系统的设计与实现"", 《中国优秀硕士学位论文全文数据库电子期刊 信息科技辑》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110162455A (en) * 2019-04-09 2019-08-23 口碑(上海)信息技术有限公司 Joint debugging method and device, storage medium, the electronic device of software
CN112860502A (en) * 2019-11-26 2021-05-28 上海哔哩哔哩科技有限公司 Fault simulation method, equipment, server and storage medium
CN112506773A (en) * 2020-12-03 2021-03-16 安徽听见科技有限公司 Abnormal scene testing method, device, equipment and storage medium
CN113157593A (en) * 2021-05-24 2021-07-23 网易(杭州)网络有限公司 Performance data acquisition method, device, system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109558313B (en) 2021-08-17

Similar Documents

Publication Publication Date Title
CN109558313A (en) Construct the method and device of abnormality test scene
US11281570B2 (en) Software testing method, system, apparatus, device medium, and computer program product
CN111414172B (en) Automatic deployment and release system and method for application software
US8515876B2 (en) Dry-run design time environment
CN105204916B (en) Project process operation method and device based on environmental variance
Costa et al. Pattern based GUI testing for mobile applications
US20150074647A1 (en) Testing system for an integrated software system
CN102968371B (en) The method of test JAVA API unit component and device
US8661414B2 (en) Method and system for testing an order management system
CN106897223A (en) A kind of software kit delivery method and device based on continuous integrating
US20210365555A1 (en) A method and system for detecting and preventing issues in smart contracts based on historical behavior analysis
CN111159023A (en) Test method, test device, electronic equipment and computer readable storage medium
CN105224457B (en) A kind of test frame implementation method and device
Belli et al. Test generation and minimization with" Basic" statecharts
CN110162310A (en) Application program generation method and device, card i/f test method and device
Suganya et al. A study of object oriented testing techniques: Survey and challenges
Tsai et al. Rapid verification of embedded systems using patterns
Fögen et al. A Case Study on Robustness Fault Characteristics for Combinatorial Testing-Results and Challenges.
CN113468058A (en) Regression testing method and device for software-as-a-service platform and electronic equipment
Sharma et al. Model-based testing: the new revolution in software testing
De Angelis et al. Inferring relations among test programs in microservices applications
CN110659215A (en) Open type industrial APP rapid development and test verification method
Ahmed et al. An Adaptation Model for Android Application Testing with Refactoring
Petrenko et al. Problem of the" digital bombs" neutralization
US11847393B2 (en) Computing device and method for developing a system model utilizing a simulation assessment module

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