CN110515827A - Automated testing method, device, computer equipment and storage medium - Google Patents

Automated testing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN110515827A
CN110515827A CN201910606069.1A CN201910606069A CN110515827A CN 110515827 A CN110515827 A CN 110515827A CN 201910606069 A CN201910606069 A CN 201910606069A CN 110515827 A CN110515827 A CN 110515827A
Authority
CN
China
Prior art keywords
test
assignment information
chain
code
content
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910606069.1A
Other languages
Chinese (zh)
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN201910606069.1A priority Critical patent/CN110515827A/en
Publication of CN110515827A publication Critical patent/CN110515827A/en
Pending legal-status Critical Current

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/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The application is based on big data and discloses a kind of automated testing method, device, computer equipment and storage medium, is related to data processing field, wherein the described method includes: obtaining test assignment information, wherein the test assignment information includes integration servers chain;When receiving test edit instruction, the corresponding test content of the test assignment information is parsed, and test content is sent to the editor position of test assignment information direction, so that management end writes test code according to the test content;When receiving test execution instruction, the test code and the integration servers chain is tested, and export test report, reduce the workload of tester, to improve testing efficiency.

Description

Automated testing method, device, computer equipment and storage medium
Technical field
This application involves software test fields more particularly to automated testing method, device, computer equipment and storage to be situated between Matter.
Background technique
The exploitation of a usual software systems is made of several project tasks, needs when test to exist according to project task Execution sequence in software systems carries out, and when the test result and desired value difference of some intermediate project task, leads to back Project task to be measured since the test result of a upper project task is not by that can not continue to execute test, so as to cause whole The test process of a software systems is in paralyzed state.In addition, needing to be manually entered the ginseng that test needs to use in test process The sentences such as number, function increase the workload of tester, have seriously affected testing efficiency.
Summary of the invention
The purpose of the embodiment of the present application is to propose a kind of automated testing method, solves that current testing efficiency is low to ask Topic.
In order to solve the above-mentioned technical problem, the embodiment of the present application provides a kind of automated testing method, includes the following steps:
Obtain test assignment information, wherein the test assignment information includes integration servers chain;
When receiving test edit instruction, the corresponding test content of the test assignment information is parsed, and will be in test Hold the editor position for being sent to test assignment information direction, so that management end writes test code according to the test content;
When receiving test execution instruction, the test code and the integration servers chain are tested, and exports Test report.
Further, automated testing method further include:
Whether the basic information that the user is detected in login interface is pre-stored rights account information;
If the basic information is the rights account information, log-in interface is jumped into test interface;
When test interface receives test request instruction, the target interface pair that the test request instruction is directed toward is obtained The interface IP address and task parameters answered.
Further, automated testing method further include:
Obtain task parameters, wherein the task parameters include the identifier of code block to be tested;
Code block to be tested is identified by the identifier of code block to be tested, is generated according to the code block to be tested integrated Task chain;
The data format that the integration servers chain turns is changed into the data format of default automatic test requirement.
Further, automated testing method further include:
Create global identifier;
The identifier of each code block to be tested is together in series according to connection relationship by the global identifier, To generate the integration servers chain.
Further, automated testing method further include:
The test assignment information is parsed by reflection dynamical fashion;
Obtain the corresponding test content of test assignment information described in test database;
The test content is sent to the test interface according to preset sortord, so that management end is according to Test content writes test code.
Further, automated testing method further include:
Obtain the corresponding status information of each testing progress of the test code and the integration servers chain;
The status information is generated in preset test template, to obtain the test report.
Further, automated testing method further include:
When parsing to the target interface, the corresponding attribute of the target interface and method are identified;
According to the corresponding attribute of the target interface and method, the attribute is searched in test database and method is right respectively The test content answered.
In order to solve the above-mentioned technical problem, the embodiment of the present application also provides a kind of automatic test device, the automation Test device includes:
Module is obtained, for obtaining test assignment information, wherein the test assignment information includes integration servers chain;
Processing module, for parsing in the corresponding test of the test assignment information when receiving test edit instruction Hold, and test content is sent to the editor position of test assignment information direction, so that management end is compiled according to the test content Write test code;
Execution module, for when receiving test execution instruction, to the test code and the integration servers chain into Row test, and export test report.
Further, automatic test device further include:
Detection module, whether the basic information for detecting the user in login interface is pre-stored rights account Information;
Log-in interface is jumped to test if being the rights account information for the basic information by jump module Interface;
First obtains module, for obtaining the test request and referring to when test interface receives test request instruction Enable the corresponding interface IP address of target interface being directed toward and task parameters.
Further, module is obtained further include:
Second acquisition submodule, for obtaining task parameters, wherein the task parameters include the mark of code block to be tested Know symbol;
Submodule is generated, for identifying code block to be tested by the identifier of code block to be tested, according to described to be measured It tries code block and generates integrated task chain;
Transform subblock, the data lattice for requiring the Data Format Transform of the integration servers chain at automatic test Formula.
Further, submodule is generated further include:
Creating unit, for creating global identifier;
Series unit, for the identifier of each code block to be tested to be connected by the global identifier Come, to generate the integration servers chain.
Further, processing module further include:
Submodule is reflected, for parsing the test assignment information by reflection dynamical fashion;
Third acquisition submodule, for obtaining the corresponding test content of test assignment information described in test database;
Sending submodule, for the test content to be sent to the test interface according to preset sortord, with Management end is set to write test code according to the test content.
Further, execution module further include:
4th acquisition submodule, each testing progress for obtaining the test code and the integration servers chain are corresponding Status information;
Submodule is reported, for the status information to be generated in preset test template, to obtain the test report It accuses.
Further, submodule is reflected further include:
Subelement is identified, for when parsing to the target interface, identifying the corresponding attribute of the target interface And method;
Subelement is searched, for according to the corresponding attribute of the target interface and method, searching in test database should Attribute and the corresponding test content of method.
In order to solve the above-mentioned technical problem, the embodiment of the present application also provides a kind of computer equipment, including memory and place Device is managed, computer program is stored in the memory, the processor is realized above-mentioned automatic when executing the computer program The step of changing test method.
In order to solve the above-mentioned technical problem, the embodiment of the present application also provides a kind of computer readable storage medium, the meter It is stored with computer program on calculation machine readable storage medium storing program for executing, the computer program is realized above-mentioned automatic when being executed by processor The step of changing test method.
Compared with prior art, the embodiment of the present application mainly has following the utility model has the advantages that obtaining test assignment information, wherein The test assignment information includes integration servers chain;When receiving test edit instruction, the test assignment information pair is parsed The test content answered, and test content is sent to the editor position that test assignment information is directed toward, so that management end is according to Test content writes test code;When receiving test execution instruction, to the test code and the integration servers chain into Row test, and test report is exported, it can be employed directly in test code, that is, reduce due to parsing obtained test content Management end writes the workload of test code, decreases the form error problem for artificially writing code.In addition, integration servers Chain is conducive to the quick positioning to fault test, to substantially increase testing efficiency.
Detailed description of the invention
It, below will be to needed in the embodiment of the present application description in order to illustrate more clearly of the scheme in the application Attached drawing makees a simple introduction, it should be apparent that, the accompanying drawings in the following description is some embodiments of the present application, for this field For those of ordinary skill, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow chart of one embodiment of the automated testing method of the application;
Fig. 2 is the schematic diagram that integrated task chain is generated in the embodiment of the present application;
Fig. 3 is the structural schematic diagram of one embodiment of the automatic test device in the embodiment of the present application;
Fig. 4 is the structural schematic diagram of one embodiment of the computer equipment in the embodiment of the present application.
Specific embodiment
Unless otherwise defined, all technical and scientific terms used herein and the technical field for belonging to the application The normally understood meaning of technical staff is identical;It is specific that description is intended merely in the term used in the description of application herein Embodiment purpose, it is not intended that in limitation the application;The description and claims of this application and above-mentioned Detailed description of the invention In term " includes " and " having " and their any deformation, it is intended that cover and non-exclusive include.The application's says Bright book and claims or term " first " in above-mentioned attached drawing, " second " etc. rather than are used for distinguishing different objects In description particular order.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and Implicitly understand, embodiment described herein can be combined with other embodiments.
Those skilled in the art of the present technique are appreciated that " terminal " used herein above, " terminal device " both include wireless communication The equipment of number receiver, only has the equipment of the wireless signal receiver of non-emissive ability, and including receiving and emitting hardware Equipment, have on bidirectional communication link, can execute two-way communication reception and emit hardware equipment.This equipment It may include: honeycomb or other communication equipments, shown with single line display or multi-line display or without multi-line The honeycomb of device or other communication equipments;PCS (Personal Communications Service, PCS Personal Communications System), can With combine voice, data processing, fax and/or communication ability;PDA (Personal Digital Assistant, it is personal Digital assistants), it may include radio frequency receiver, pager, the Internet/intranet access, web browser, notepad, day It goes through and/or GPS (Global Positioning System, global positioning system) receiver;Conventional laptop and/or palm Type computer or other equipment, have and/or the conventional laptop including radio frequency receiver and/or palmtop computer or its His equipment." terminal " used herein above, " terminal device " can be it is portable, can transport, be mounted on the vehicles (aviation, Sea-freight and/or land) in, or be suitable for and/or be configured in local runtime, and/or with distribution form, operate in the earth And/or any other position operation in space." terminal " used herein above, " terminal device " can also be communication terminal, on Network termination, music/video playback terminal, such as can be PDA, MID (Mobile Internet Device, mobile Internet Equipment) and/or mobile phone with music/video playing function, it is also possible to the equipment such as smart television, set-top box.
The terminal of the user referred in the present embodiment is above-mentioned terminal.
Specifically, referring to Fig. 1, Fig. 1 is the basic procedure schematic diagram of automated testing method provided in this embodiment.
As shown in Figure 1, the automated testing method, comprising the following steps:
S101: test assignment information is obtained, wherein the test assignment information includes integration servers chain.
Wherein, test assignment information includes the task parameters of management end selected target interface and configuration, and target interface exists It is interface to be tested in the present embodiment, target interface includes but is not limited to target interface title, the corresponding interface of target interface Address or the attribute information of target interface etc..Task parameters can be the image parameter of interface to be tested, wherein management end can To be test administrator.
Specifically, when detecting that test administrator submits test information in test interface, test information can be life At the task parameters of integration servers chain, integrated task chain is generated according to task parameters, and obtain including integration servers chain Test assignment information.
In some optional implementations, above-mentioned steps S101 obtains test assignment information, and above-mentioned electronic equipment can To execute following steps:
Obtain task parameters, wherein the task parameters include the identifier of code block to be tested;
Code block to be tested is identified by the identifier of code block to be tested, is generated according to the code block to be tested integrated Task chain;
The data format that the Data Format Transform of the integration servers chain is required at automatic test.
Specifically, task parameters are obtained when receiving input instruction, wherein input instruction refers to that test administrator is being surveyed The instruction that incoming task parameter before test assignment information is submitted in interface is tried, the mode that task parameters are arranged can pass through EL (method of simplified expression in Expression Language, JSP) expression formula is configured.EL expression formula be mainly used to by Attribute in field object is output to the page, and the method for EL access variable data is very simple, such as: $ { username } indicates to take out The variable of entitled username in a certain range, when inputting username in test interface due to test administrator, and When which range is not specifically designated, the default value of username can be looked for first from Page (universe object) domain, if it exists Page It searches less than then sequentially arrive Request (request object) domain again, Session (session control object) domain, Application (are answered With object) it searches in domain, it directly returns after finding username, is returned to if also can not find in the domain Application One empty string, does not continue to look for down, but if just returns null (sky) when whole domains are not all found.
Further, the identifier of code block to be tested is unique identifier, and the code block to be tested can be to be measured The corresponding code block of the target interface of examination, wherein code block includes target interface address, the supplemental characteristic lattice that target interface requires The codes such as the attribute of formula or target interface, the identifier of code block to be tested for identification join by the code block to be tested, task Number further includes the connection relationship between code block to be tested.
Further, the code block to be tested identifier recognized generates integrated task chain, connection according to connection relationship Relationship can be the ordinal relation of connection, parallel relationship etc..Wherein, integration servers chain is the connection relationship according to testing process, The testing process that multiple testing processs are formed.For example, the premise for being successfully tested the link of accessing system is that user inputs just True account (such as identifier is A), password (such as identifier is B) the two links, testing process at this time should be based on Whether extremely the successful execution of two links in front could detect accessing system link (such as identifier is C), therefore the collection generated It is A- > B- > C at task chain, i.e. the integration servers chain has called directly the corresponding code block to be tested of A, B and C.
Since integration servers chain is formed by 1 to multiple code blocks to be tested, the parameter number of each code block transmission to be tested According to format difference, it is unfavorable for the data format requirement of automatic test.Therefore, format is preset to each code block to be tested Transition components, by format transition components by the data in each of integration servers chain code block to be tested by filtering, turning The data format that automatic test requires is formed after change.For example, http transport protocol conversion is https transport protocol or by IP Message format is converted to TCP message format or the data of unencryption is encrypted.
In the embodiment of the present application, by obtaining task parameters, integrated task chain is generated according to task parameters, is appointed integrated Business chain is converted into preset data format, so that management end when to process testing process, is generated integrated by task parameters Task chain completes the editor to test case, no longer inputs to the code block of each link one by one, reduces test administrator Workload, improve testing efficiency.
S102: when receiving test edit instruction, the corresponding test content of the test assignment information is parsed, and will survey Examination content is sent to the editor position of test assignment information direction, so that management end writes test generation according to the test content Code.
Specifically, when receiving test edit instruction, i.e., when test administrator clicks the edit item in test interface, make to survey Try changing interface be editable state when, when detect user in the test code of test interface editor's test assignment information, By reflecting dynamic method resolution test assignment information, and the test assignment information after parsing is called into test data in the background Test content in library, and test content is sent to the editor position that test assignment information is directed toward, it is management end automatic prompt Relevant test content, such as test content prompt can be test grammer prompt.
It should be noted that test content is arranged according to preset sortord, and by the dependence test after sequence Content is sent in test interface according to preset quantity, for example, only showing 3-5 dependence test content, is shown in dependence test The type of appearance can be test variable title, test variable type, test file title or test code statement etc..
Further, integration servers chain is editor of the management end to test case, and test content herein is for test Certain test codes in use-case, such as test is to sentence, test variable name, test environment etc., the i.e. base in integration servers chain The editor of test code is improved on plinth.Test is keyed in the corresponding code block to be tested of integration servers chain according to parsing management end It when mission bit stream, reads and identifies the relevant test content of test assignment information, and show relevant test content, so that management End, which does not need completely to input entire test code, can complete correct editor to test content, input to improve and test code Efficiency.
S103: when receiving test execution instruction, testing the test code and the integration servers chain, and Export test report.
Wherein, test execution instruction is executes the instruction tested to the test code write, so that according to test code Dependence test is carried out to test macro.
In some optional implementations of the present embodiment, step S103 is i.e. described ought to receive test execution instruction When, the test code and the integration servers chain are tested, and export test report, above-mentioned electronic equipment can also be held Row following steps:
Obtain the corresponding status information of each testing progress of the test code and the integration servers chain;
The status information is generated in preset test template, to obtain the test report.
It specifically, can be certainly according to testing requirement information using test code and integrated task chain as testing requirement information The dynamic test code block that obtains is in the status information at each moment, i.e. testing progress, comprising: program development state, loophole (bug) are repaired Multiple situation, demand increase the information of situation and currently tested integration servers chain newly, analyzed by testing requirement information, It after arrangement, and is updated in preset test template, to automatically generate test report.Wherein, preset test template is one Kind normative document, the fields such as test object, test purpose, test result recorded including needs, status information is generated to In corresponding field, to obtain test report, the step of test report includes test crash, time etc., when recognizing failure When step, using special marking mark test crash the step of, facilitate test administrator to check test crash in test report The step of.
In the embodiment of the present application, by obtaining test assignment information, when receiving test edit instruction, the survey is parsed The corresponding test content of mission bit stream is tried, so that management end writes test code according to the test content, is tested when receiving When executing instruction, the test code and the integration servers chain are tested, and export test report, since parsing obtains Test content can be employed directly test code in, that is, reduce test administrator write test code workload, Decrease the form error problem for artificially writing code.In addition, integration servers chain is conducive to the quick positioning to fault test, To substantially increase testing efficiency.
In some optional implementations of the present embodiment, before step S101, i.e., test ought be received described When edit instruction, before parsing the corresponding test content of the test assignment information, above-mentioned electronic equipment can also be performed following Step:
Whether the basic information that the user is detected in login interface is pre-stored rights account information;
If the basic information is the rights account information, log-in interface is jumped into test interface;
When test interface receives test request instruction, the target interface pair that the test request instruction is directed toward is obtained The interface IP address and task parameters answered.
Wherein, login interface is the login interface of test macro, before starting test system and test operation, is needed to pipe It manages end and carries out Authority Verification, i.e., had permission by the management end of Authority Verification using test macro, safeguarded by Authority Verification The safety of test macro, economic loss problem caused by avoiding because of safety issue.Authority Verification includes the power of authentic administrator Account information is limited, the rights account information of at least one is stored in advance in the authority list of test macro, rights account information can With but be not limited to include test macro number, login account and the corresponding password of login account etc..
Specifically, when terminal device receives log-in instruction, current rights account information is obtained from login interface, Whether login account and password in detection permission account information are preset rights account information in authority list, wherein Log-in instruction is the instruction that terminal device receives that management end submits rights account information;If inquiring login account in authority list Number password corresponding with login account is rights account information, then login interface is jumped to test interface, wherein test circle Face includes parameter configuration item, interface options to be measured and execution task panel;When receiving test request instruction, that is, receive pipe When the instruction of test assignment information is submitted at reason end in test interface, it is corresponding to obtain the target interface that test request instruction is directed toward Interface IP address and task parameters.
It in the embodiment of the present application, whether is pre-stored permission by the basic information for detecting user in login interface Account information;If basic information is rights account information, log-in interface is jumped into test interface;When receiving test request When instruction, the corresponding interface IP address of target interface and task parameters that test request instruction is directed toward, verifying authorization account letter are obtained Breath is to improve the safety of test macro, avoids illegal invasion person malice from changing economic loss brought by test macro and ask Topic.
In some optional implementations, the step of integrating task chain is generated according to the task parameters and is specifically included:
Create global identifier;
The identifier of each code block to be tested is together in series according to connection relationship by the global identifier, To generate the integration servers chain.
Specifically, a global identifier represents a test request, for by the identifier of each code block to be tested It is together in series.Other than global identifier, it is also necessary to which span mark calls set membership for recording.Each service will record down Father's mark and span mark can organize the set membership of primary complete call chain by father's mark and span mark.One does not have There is the span mark of father's mark using root mark as call chain entrance.All these marks can use 64 globally unique integer tables Show;Each request will pass through transmitting global identifier and Span identifier during entire call chain.
Further, each test request records this and requests subsidiary global identifier and subsidiary Span identifier work For father's mark, while also the Span generated at this mark being recorded, in order to when checking certain complete call chain, All records corresponding with global identifier can be found according to global identifier, and then entire father's mark can be learnt by record Know and span identifies the entire calling set membership organized.
Fig. 2 is the schematic diagram that integrated task chain is generated in the embodiment of the present application, as shown in Fig. 2, global identifier defines The connection relationship of the identifier of each code block to be tested, i.e., a kind of relation identifier, for example, global identifier can require respectively Identifier i, i+1 ... the i+n of a code block to be tested is attached according to the sequence size of identifier, when according to each to be measured When examination code block identifier series connection generates integrated task chain, by the first parameter biography of itself since first is tested code block i Pass next test code block i+1, test code block i+1 is according to the first parameter the second parameter of generation received, and by the Two parameters are sent to test code block i+2, according to from the request previous step or former steps for testing code block as a result, making For the mode of the required parameter of next test code block, it is ultimately delivered to the final test code block i+n of user's input, is realized The merging of several interfaces, to generate integrated task chain, integration servers chain herein can be used as integration events.Wherein, i is positive whole Number, the first parameter are the necessary test parameter for meeting next test code block requirement, and the second parameter is according to the first parameter and this The parameter that the parameter of test code block is configured, so that the second parameter obtains required for being sent in next test code block To test parameter.
It should be noted that the purpose for generating integrated task chain is that a request call process is completely together in series, The monitoring for calling path to test request is realized, fault fast positioning is convenient for.In addition, to a certain target detection code block is tested Without being passed to the parameter of all code blocks to be tested, only by that can complete to adjust according to the parameter of previous step or former steps With simultaneously test target code block to be tested.
Such as: it includes: creation model -> acquisition model that the reply comment function of one model of test, which needs the process passed through, Comment -> submission comment -> reply comment is filled in list -> model that click has just created ->, when the parameter that the comment of submission generates When only passing to reply comment, test could further be executed by replying comment.Here each step has an interface, by these Combination of interfaces forms an integration servers chain, and each interface in integration servers chain sends parameter to adjacent next generation to be tested Code block.
In the embodiment of the present application, by creating global identifier, by global identifier by each code block to be tested Identifier is together in series, and to generate the integration servers chain, realizes the monitoring that path is called to test request, fast convenient for failure Speed positioning, meanwhile, the code input service amount to each test code block is reduced, testing efficiency is improved.
In some optional implementations of the present embodiment, step S102 when receiving test edit instruction, is solved The corresponding test content of the test assignment information is analysed, following steps can also be performed in above-mentioned electronic equipment:
The test assignment information is parsed by reflection dynamical fashion;
Obtain the corresponding test content of test assignment information described in test database;
The test content is sent to the test interface according to preset sortord, so that management end is according to Test content writes test code.
Wherein, reflection dynamical fashion refers in test macro operating status, for an arbitrary class, can obtain To all properties relevant to this class and method, a class can be called to appoint by reflection mechanism any one object The function of meaning method, i.e., this dynamic acquisition category information and dynamic call class object method is also referred to as the reflection mechanism of java.
Specifically, the selected target interface and configuration of the management end in test assignment information is parsed by reflection dynamical fashion Task parameters include: the corresponding attribute of identification target interface and method when being parsed to target interface;It is connect according to target The corresponding attribute of mouth and method search the attribute and the corresponding test content of method in test database;According to preset Sortord sorts test content, and sends test interface for the test content of sequence number, sortord can according to object, Attribute classification or the sequence of method classification;When detecting that test administrator writes survey according to the test content pushed in test interface When trying code, for example, choosing objective attribute target attribute from test content, the objective attribute target attribute chosen is filled into test case automatically and is directed toward Editor position.
Wherein, test content includes writing all related datas of entire test case, for example, test content may include But it is not limited to url, parameter, return value, grammer code and various tool methods etc..
For example, complete url is named as/serviceName/moduleName/functionName, tested when detecting When administrator writes url, for example, when writing service can automatic prompt to serviceName.
Further, the data source of concrete syntax code is realized, comprising: gateway will by collecting test environmental data Data transmission subscribes to message system (kafaka) to distributed post, and distributed post subscribes to root when message system saves message Sorted out according to publication classification (Topic), sending message person becomes message generator (Producer), and message recipient becomes and disappears It ceases consumer (Consumer), the cluster that furthermore distributed post subscribes to message system has multiple distributed posts to subscribe to message system Example composition in system, each example (server) become caching agent (broker).Either distributed post subscribes to message The cluster or producer (thread pool) of system and message consumer all rely on zookeeper (distributed application program association It is taken after mixing with liquid business) guarantee that system availability cluster saves some meta information (metamessage).One publication classification may be considered one Class message, each publication classification will be divided into multiple areas, and each area is append log (additional log) file in storage level. Any message for being published to this area can all be directly appended to the tail portion of log file, and the position of every message hereof is known as Offset (offset), offset are that a long type is digital (elongated), it is uniquely tagged a piece of news.
Therefore, it in the embodiment of the present application, is matched in test database and test by the test assignment information after parsing The corresponding test content of mission bit stream, and test content is pushed to test interface, so that management end is according to current checkout area Scape selects suitable test content as current test case, under conditions of not needing largely to write test code statement, Writing for test code can be completed only by test assignment information, to substantially increase testing efficiency, decrease people For the form error problem for writing code.
In some optional implementations of the present embodiment, when receiving test edit instruction, the test is parsed The corresponding test content of mission bit stream, so that the method is also after management end writes test code according to the test content Include:
When receiving preservation instruction, the test case in the test code is saved in the test database.
It should be noted that management end can need dynamic expansion systems approach according to test, it is random to form such as production The test contents such as several, production special scenes, and test content is stored in test database, facilitate the same test of subsequent use The related data of test content may be reused when use-case.
Further, due to write test case be for some special objective and work out one group of test input, execute item Part and expected results are to test some Program path or to verify whether meet some particular demands.And each test case is anti- Different test scenes, condition or the flow of event via product are reflected, therefore different types of test case is stored automatically in test In database, in case can reuse in other same test scene, the time for updating test case is reduced.Wherein, Test scene includes scene properties, scrnario testing use-case, scrnario testing data, context restrictions;The scene properties are for retouching State all attributes of test scene;Scrnario testing data are that data relevant with test scene combine;Scrnario testing use-case is to survey The test case that examination hall scape includes;Context restrictions are to describe the executive mode and sequence that test scene includes test case operation.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, which can be stored in a computer-readable storage and be situated between In matter, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, storage medium above-mentioned can be The non-volatile memory mediums such as magnetic disk, CD, read-only memory (Read-Only Memory, ROM) or random storage note Recall body (Random Access Memory, RAM) etc..
It should be understood that although each step in the flow chart of attached drawing is successively shown according to the instruction of arrow, These steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly stating otherwise herein, these steps Execution there is no stringent sequences to limit, can execute in the other order.Moreover, at least one in the flow chart of attached drawing Part steps may include that perhaps these sub-steps of multiple stages or stage are not necessarily in synchronization to multiple sub-steps Completion is executed, but can be executed at different times, execution sequence, which is also not necessarily, successively to be carried out, but can be with other At least part of the sub-step or stage of step or other steps executes in turn or alternately.
With further reference to Fig. 3, as the realization to method shown in above-mentioned Fig. 1, this application provides a kind of automatic tests One embodiment of device, the Installation practice is corresponding with embodiment of the method shown in FIG. 1, which specifically can be applied to In various electronic equipments.
As shown in figure 3, automatic test device described in the present embodiment include: obtain module 301, processing module 302 with And execution module 303.Wherein:
Module 301 is obtained, for obtaining test assignment information, wherein the test assignment information includes integration servers chain;
Processing module 302, for parsing the corresponding test of the test assignment information when receiving test edit instruction Content, and test content is sent to the editor position that test assignment information is directed toward, so that management end is according to the test content Write test code;
Execution module 303, for when receive test execution instruction when, to the test code and the integration servers chain It is tested, and exports test report.
Further, automatic test device further include:
Detection module, whether the basic information for detecting the user in login interface is pre-stored rights account Information;
Log-in interface is jumped to test if being the rights account information for the basic information by jump module Interface;
First obtains module, for obtaining the test request and referring to when test interface receives test request instruction Enable the corresponding interface IP address of target interface being directed toward and task parameters.
Further, module is obtained further include:
Second acquisition submodule, for obtaining task parameters, wherein the task parameters include the mark of code block to be tested Know symbol;
Submodule is generated, for identifying code block to be tested by the identifier of code block to be tested, according to described to be measured It tries code block and generates integrated task chain;
Transform subblock, the data lattice for requiring the Data Format Transform of the integration servers chain at automatic test Formula.
Further, submodule is generated further include:
Creating unit, for creating global identifier;
Series unit, for the identifier of each code block to be tested to be connected by the global identifier Come, to generate the integration servers chain.
Further, processing module further include:
Submodule is reflected, for parsing the test assignment information by reflection dynamical fashion;
Third acquisition submodule, for obtaining the corresponding test content of test assignment information described in test database;
Sending submodule, for the test content to be sent to the test interface according to preset sortord, with Management end is set to write test code according to the test content.
Further, execution module further include:
4th acquisition submodule, each testing progress for obtaining the test code and the integration servers chain are corresponding Status information;
Submodule is reported, for the status information to be generated in preset test template, to obtain the test report It accuses.
Further, submodule is reflected further include:
Subelement is identified, for when parsing to the target interface, identifying the corresponding attribute of the target interface And method;
Subelement is searched, for according to the corresponding attribute of the target interface and method, searching in test database should Attribute and the corresponding test content of method.
About automatic test device in above-described embodiment, the concrete mode that wherein modules execute operation is having It closes and is described in detail in the embodiment of this method, no detailed explanation will be given here.
In order to solve the above technical problems, the embodiment of the present application also provides computer equipment.It is this referring specifically to Fig. 4, Fig. 4 Embodiment computer equipment basic structure block diagram.
The computer equipment 4 includes that connection memory 41, processor 42, network interface are in communication with each other by system bus 43.It should be pointed out that the computer equipment 4 with component 41-43 is illustrated only in figure, it should be understood that simultaneously should not Realistic to apply all components shown, the implementation that can be substituted is more or less component.Wherein, those skilled in the art of the present technique It is appreciated that computer equipment here is that one kind can be automatic to carry out numerical value calculating according to the instruction for being previously set or storing And/or the equipment of information processing, hardware include but is not limited to microprocessor, specific integrated circuit (Application Specific Integrated Circuit, ASIC), programmable gate array (Field-Programmable Gate Array, FPGA), digital processing unit (Digital Signal Processor, DSP), embedded device etc..
The computer equipment can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.The computer equipment can carry out people by modes such as keyboard, mouse, remote controler, touch tablet or voice-operated devices with user Machine interaction.
The memory 41 include at least a type of readable storage medium storing program for executing, the readable storage medium storing program for executing include flash memory, It is hard disk, multimedia card, card-type memory (for example, SD or D automatic test memory etc.), random access storage device (RAM), quiet State random access storage device (SRAM), electrically erasable programmable read-only memory (EEPROM), can be compiled read-only memory (ROM) Journey read-only memory (PROM), magnetic storage, disk, CD etc..In some embodiments, the memory 41 can be institute State the internal storage unit of computer equipment 4, such as the hard disk or memory of the computer equipment 4.In further embodiments, institute State the grafting being equipped on the External memory equipment that memory 41 is also possible to the computer equipment 4, such as the computer equipment 4 Formula hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Certainly, the memory 41 can also both include the internal storage unit of the computer equipment 4 or wrap Include its External memory equipment.In the present embodiment, the memory 41 is installed on the behaviour of the computer equipment 4 commonly used in storage Make system and types of applications software, such as the program code of automated testing method etc..In addition, the memory 41 can also be used In temporarily storing the Various types of data that has exported or will export.
The processor 42 can be in some embodiments central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chips.The processor 42 is commonly used in the control meter Calculate the overall operation of machine equipment 4.In the present embodiment, the processor 42 is for running the program generation stored in the memory 41 Code or processing data, such as run the program code of the automated testing method.
The network interface 43 may include radio network interface or wired network interface, which is commonly used in Communication connection is established between the computer equipment 4 and other electronic equipments.
Present invention also provides another embodiments, that is, provide a kind of computer readable storage medium, the computer Readable storage medium storing program for executing is stored with automatic test program, and the automatic test program can be executed by least one processor, with Execute at least one described processor such as the step of above-mentioned automated testing method.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, the technical solution of the application substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the application.
Obviously, embodiments described above is merely a part but not all of the embodiments of the present application, attached The preferred embodiment of the application is given in figure, but is not intended to limit the scope of the patents of the application.The application can be with many differences Form realize, on the contrary, purpose of providing these embodiments is keeps the understanding to disclosure of this application more thorough Comprehensively.Although the application is described in detail with reference to the foregoing embodiments, for coming for those skilled in the art, Can still modify to technical solution documented by aforementioned each specific embodiment, or to part of technical characteristic into Row equivalence replacement.All equivalent structures done using present specification and accompanying drawing content, are directly or indirectly used in other Relevant technical field, similarly within the application scope of patent protection.

Claims (10)

1. a kind of automated testing method, which is characterized in that include the following steps:
Obtain test assignment information, wherein the test assignment information includes integration servers chain;
When receiving test edit instruction, the corresponding test content of the test assignment information is parsed, and test content is sent out The editor position being directed toward to test assignment information is sent, so that management end writes test code according to the test content;
When receiving test execution instruction, the test code and the integration servers chain are tested, and export test Report.
2. automated testing method according to claim 1, which is characterized in that in the step for obtaining test assignment information Before rapid, the method also includes:
Whether the basic information that the user is detected in login interface is pre-stored rights account information;
If the basic information is the rights account information, log-in interface is jumped into test interface;
When test interface receives test request instruction, it is corresponding to obtain the target interface that the test request instruction is directed toward Interface IP address and task parameters.
3. automated testing method according to claim 2, which is characterized in that the step of the acquisition test assignment information It specifically includes:
Obtain task parameters, wherein the task parameters include the identifier of code block to be tested;
Code block to be tested is identified by the identifier of code block to be tested, and integration servers are generated according to the code block to be tested Chain;
The data format that the Data Format Transform of the integration servers chain is required at automatic test.
4. automated testing method according to claim 3, which is characterized in that described raw according to the code block to be tested It is specifically included at the step of integration servers chain:
Create global identifier;
The identifier of each code block to be tested is together in series according to connection relationship by the global identifier, with life At the integration servers chain.
5. automated testing method according to claim 2, which is characterized in that described to receive test edit instruction When, the step of parsing the test assignment information corresponding test content, specifically includes:
The test assignment information is parsed by reflection dynamical fashion;
Obtain the corresponding test content of test assignment information described in test database;
The test content is sent to the test interface according to preset sortord, so that management end is according to the test Content writes test code.
6. automated testing method according to claim 1 or 5, which is characterized in that described to refer to when receiving test execution When enabling, the test code and the integration servers chain are tested, and the step of exporting test report specifically includes:
Obtain the corresponding status information of each testing progress of the test code and the integration servers chain;
The status information is generated in preset test template, to obtain the test report.
7. automated testing method according to claim 5, which is characterized in that the test assignment information further includes target Interface, it is described that the test assignment information is parsed by reflection dynamical fashion, obtain the letter of test assignment described in test database The step of ceasing corresponding test content include:
When parsing to the target interface, the corresponding attribute of the target interface and method are identified;
According to the corresponding attribute of the target interface and method, the attribute is searched in test database and method is corresponding Test content.
8. a kind of automatic test device characterized by comprising
Module is obtained, for obtaining test assignment information, wherein the test assignment information includes integration servers chain;
Processing module, for parsing the corresponding test content of the test assignment information when receiving test edit instruction, and Test content is sent to the editor position of test assignment information direction, so that management end writes test according to the test content Code;
Execution module, for being surveyed to the test code and the integration servers chain when receiving test execution instruction Examination, and export test report.
9. a kind of computer equipment, including memory and processor, computer program, the processing are stored in the memory The step of device realizes the automated testing method as described in any one of claims 1 to 7 when executing the computer program.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes the automatic test side as described in any one of claims 1 to 7 when the computer program is executed by processor The step of method.
CN201910606069.1A 2019-07-05 2019-07-05 Automated testing method, device, computer equipment and storage medium Pending CN110515827A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910606069.1A CN110515827A (en) 2019-07-05 2019-07-05 Automated testing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910606069.1A CN110515827A (en) 2019-07-05 2019-07-05 Automated testing method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110515827A true CN110515827A (en) 2019-11-29

Family

ID=68622550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910606069.1A Pending CN110515827A (en) 2019-07-05 2019-07-05 Automated testing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110515827A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111627489A (en) * 2020-04-20 2020-09-04 珠海妙存科技有限公司 Flash memory characteristic analysis method and system
CN112817847A (en) * 2021-01-28 2021-05-18 杭州网易再顾科技有限公司 Data processing task testing method and device, electronic equipment and storage medium
CN113268408A (en) * 2020-12-28 2021-08-17 上海能链众合科技有限公司 Automatic testing method facing open permission chain
CN113535533A (en) * 2020-04-15 2021-10-22 百度在线网络技术(北京)有限公司 Method, apparatus, device and storage medium for testing code
CN113706110A (en) * 2021-08-30 2021-11-26 航天中认软件测评科技(北京)有限责任公司 FPGA test tool integrated test management platform
CN114579467A (en) * 2022-03-18 2022-06-03 山东云海国创云计算装备产业创新中心有限公司 Smoking test system and method based on release subscription mechanism

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750606A (en) * 2015-03-03 2015-07-01 北京空间飞行器总体设计部 Reflection-based automated testing method
CN108255709A (en) * 2017-12-26 2018-07-06 平安壹钱包电子商务有限公司 Script tests method, apparatus, terminal device and the storage medium of written in code
CN109710508A (en) * 2018-08-20 2019-05-03 平安普惠企业管理有限公司 Test method, test device, test equipment and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750606A (en) * 2015-03-03 2015-07-01 北京空间飞行器总体设计部 Reflection-based automated testing method
CN108255709A (en) * 2017-12-26 2018-07-06 平安壹钱包电子商务有限公司 Script tests method, apparatus, terminal device and the storage medium of written in code
CN109710508A (en) * 2018-08-20 2019-05-03 平安普惠企业管理有限公司 Test method, test device, test equipment and computer readable storage medium

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535533A (en) * 2020-04-15 2021-10-22 百度在线网络技术(北京)有限公司 Method, apparatus, device and storage medium for testing code
CN113535533B (en) * 2020-04-15 2024-04-05 百度在线网络技术(北京)有限公司 Method, apparatus, device and storage medium for testing code
CN111627489A (en) * 2020-04-20 2020-09-04 珠海妙存科技有限公司 Flash memory characteristic analysis method and system
CN111627489B (en) * 2020-04-20 2023-09-29 珠海妙存科技有限公司 Flash memory characteristic analysis method and system
CN113268408A (en) * 2020-12-28 2021-08-17 上海能链众合科技有限公司 Automatic testing method facing open permission chain
CN113268408B (en) * 2020-12-28 2023-11-28 上海零数众合信息科技有限公司 Automatic testing method for open license chain
CN112817847A (en) * 2021-01-28 2021-05-18 杭州网易再顾科技有限公司 Data processing task testing method and device, electronic equipment and storage medium
CN113706110A (en) * 2021-08-30 2021-11-26 航天中认软件测评科技(北京)有限责任公司 FPGA test tool integrated test management platform
CN113706110B (en) * 2021-08-30 2022-07-15 航天中认软件测评科技(北京)有限责任公司 FPGA test tool integrated test management platform
CN114579467A (en) * 2022-03-18 2022-06-03 山东云海国创云计算装备产业创新中心有限公司 Smoking test system and method based on release subscription mechanism
CN114579467B (en) * 2022-03-18 2024-04-02 山东云海国创云计算装备产业创新中心有限公司 Smoking testing system and method based on publish-subscribe mechanism

Similar Documents

Publication Publication Date Title
CN110515827A (en) Automated testing method, device, computer equipment and storage medium
WO2022160707A1 (en) Human-machine interaction method and apparatus combined with rpa and ai, and storage medium and electronic device
CN110716910B (en) Log management method, device, equipment and storage medium
CN108628748B (en) Automatic test management method and automatic test management system
US8504543B1 (en) Automatic API generation for a web application
CN1668998A (en) Application generator
CN111782546B (en) Automatic interface testing method and device based on machine learning
CN109670259A (en) A kind of design drawing check of drawings method, system and server
CN111694547A (en) Automatic coding data processing application design tool based on data state change
CN110011875A (en) Dial testing method, device, equipment and computer readable storage medium
CN104899134A (en) Automatic domain name registration server testing system and method
CN112540924A (en) Interface automation test method, device, equipment and storage medium
CN103326930A (en) Automatic patrolling method and system for open platform interface
CN111814449A (en) Form analysis method, device, equipment and storage medium
US20210208855A1 (en) Code recommender for resolving a new issue received by an issue tracking system
WO2023151397A1 (en) Application program deployment method and apparatus, device, and medium
CN110502538A (en) Label of drawing a portrait generates method, system, equipment and the storage medium of logical mappings
CN116346660A (en) Data processing method, device, equipment and medium based on dependent replacement service
CN110334014A (en) For user interface automated testing method, system, server and storage medium
CN105912573A (en) Data updating method and data updating device
US10606569B2 (en) Declarative configuration elements
CN115687075A (en) Error correction method and device for page test script
CN116450246A (en) Event stream configurable method based on state machine
CN111639079A (en) Office data checking method and device for content charging service
CN107463690B (en) Method and system for realizing quick link

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