A kind of automated testing method deriving report data and device
Technical field
The present invention relates to computer testing technology field, particularly relate to a kind of automated testing method deriving report data
And device.
Background technology
Such as in the data base of the operation systems such as financial system, storage has the table of record traffic statistics initial data, passes through industry
Field (arranging) required in table is derived by the form guiding system (application software such as derived for form) in business system,
Obtain the form of such as excel form, the content in the form wherein derived be in table corresponding initial data through translation after
The readable text obtained, in order to user is read.
Operation system storage data are constantly accumulated and are increased, and the form of derivation may comprise the most up to 70 fields, and 30,000
Data volume about row, each field passes through appointment logic rule translation, will be stored as different numerical value in data base
Initial data translates to different readable texts.
User (such as financial staff) is the highest to correctness and the integrity demands of this derivation report data,
But due to the mistake being likely to occur during translation, derive report data and there may be situation about not being inconsistent with initial data, this
It is accomplished by correctness and integrity to deriving report data to test.
But for the biggest form of data volume, the workload of manual testing is the biggest, for example, in view of field it
Between translation during logical associations, in order to ensure finally to derive correctness and the integrity of report data, at additional word
Again, in the case of deriving form after Duan, not only need the data of additional field are tested, in addition it is also necessary to chase after for substantial amounts of
The data adding front field are tested, and by manually carrying out the biggest test not only inefficiency of workload, cost height
High, and owing to manually-operated error rate is higher, it is impossible to ensure the correctness of test result, and probably because workload
Form comprehensively cannot be tested beyond the ability manually born.
Summary of the invention
Technical problem
In view of this, the technical problem to be solved in the present invention is, manual testing derives the inefficiency of report data, cost
High, the correctness of test result cannot be ensured, comprehensive test problem cannot be ensured.
Solution
In order to solve the problems referred to above, on the one hand, propose a kind of automated testing method deriving report data, described side
Method includes: according to predetermined translation rule, translates respectively for each field needing translation in table, generates for respectively
The translation field data of individual field;Utilize function of unity test UFT software analog subscriber for needing each of translation described in table
Individual field carries out deriving Report Operations, obtains deriving report data;Contrast described translation field data and described derivation form number
According to the data of middle respective field, generate test result.
In order to solve the problems referred to above, on the other hand, it is proposed that a kind of automatic test device deriving report data, described
Device includes: translation parts, for according to predetermined translation rule, carrying out respectively for each field needing translation in table
Translation, generates the translation field data for each field;Derive parts, be used for utilizing function of unity test UFT software simulation
User carries out deriving Report Operations for each field needing translation described in table, obtains deriving report data;Contrast parts,
For contrasting the data of respective field in described translation field data and described derivation report data, generate test result.
Beneficial effect
By according to predetermined translation rule, translating respectively for each field needing translation in table, generate
Translation field data for each field;Utilize function of unity test UFT software analog subscriber for needing described in table to turn
Each field translated carries out deriving Report Operations, obtains deriving report data;Contrast described translation field data and described derivation
The data of respective field in report data, generate test result, the automatization deriving report data according to embodiments of the present invention
Method of testing and device can test deriving report data in an automatic fashion, it is to avoid artificial test operation, improves
Test is derived the efficiency of report data, is reduced testing cost and ensure that the correctness of test result.
According to below with reference to the accompanying drawings detailed description of illustrative embodiments, the further feature of the present invention and aspect being become
Clear.
Accompanying drawing explanation
The accompanying drawing of the part comprising in the description and constituting description together illustrates the present invention's with description
Exemplary embodiment, feature and aspect, and for explaining the principle of the present invention.
Fig. 1 illustrates the flow chart of the automated testing method deriving report data according to an embodiment of the invention.
Fig. 2 illustrates the structure chart of the automatic test device deriving report data according to an embodiment of the invention.
Fig. 3 illustrates the knot of the automatic test device deriving report data of an example according to an embodiment of the invention
Composition.
Fig. 4 illustrates the automatic test device deriving report data of another example according to an embodiment of the invention
Structure chart.
Fig. 5 shows the structure of a kind of automated test device deriving report data of an alternative embodiment of the invention
Block diagram.
Detailed description of the invention
Various exemplary embodiments, feature and the aspect of the present invention is described in detail below with reference to accompanying drawing.In accompanying drawing identical
Reference represent the same or analogous element of function.Although the various aspects of embodiment shown in the drawings, but remove
Non-specifically is pointed out, it is not necessary to accompanying drawing drawn to scale.
The most special word " exemplary " means " as example, embodiment or illustrative ".Here as " exemplary "
Illustrated any embodiment should not necessarily be construed as preferred or advantageous over other embodiments.
It addition, in order to better illustrate the present invention, detailed description of the invention below gives numerous details.
It will be appreciated by those skilled in the art that do not have some detail, the present invention equally implements.In some instances, for
Method well known to those skilled in the art, means, element and circuit are not described in detail, in order to highlight the purport of the present invention.
Embodiment 1
Fig. 1 illustrates the flow chart of the automated testing method deriving report data according to an embodiment of the invention.Such as Fig. 1
Shown in, this automated testing method specifically includes that
Step 101, according to predetermined translation rule, translates respectively for each field needing translation in table,
Generate the translation field data for each field;
Step 102, utilizes function of unity test UFT software analog subscriber for each field needing translation described in table
Carry out deriving Report Operations, obtain deriving report data;
Step 103, contrasts described translation field data and the data of respective field in described derivation report data, generates and survey
Test result.
It was recognized by the inventor that the derivation Report Operations error rate for batch field is higher, and the translation of field is grasped one by one
Make then correctness the highest.The automated testing method deriving report data according to embodiments of the present invention is translated by field one by one
Translated field data accurately, then obtained user by deriving the reality that Report Operations obtains by the operation of software analog subscriber
The derivation report data on border, utilizes computer the two to be compared, and tests derivation report based on translating field data accurately
The correctness of table data and integrity such that it is able to test deriving report data in an automatic fashion, it is to avoid artificial
Test operation, improve test derives the efficiency of report data, reduces testing cost and ensure that the correct of test result
Property.
In one example, before derivation report data is carried out automatic test, some test beam workers can be carried out
Make, it may include build hardware environment, software environment and determine predetermined translation rule.Such as, can test system building or platform,
Database server and the corresponding network equipment, installation operating system, installation UFT automatic test software etc..Can be according to derivation
Form demand (i.e. data translation logic demand) determines predetermined translation rule, after referring to the explanation that concrete translation is regular
The example in face.
The acquisition of translation field data
In one example, according to predetermined translation rule described in above-mentioned steps 101, translate for needing in table
Each field carries out translation respectively and comprises the steps that connection data base, and in described data base, storage has described table;Inquire about from described table
Obtain described each field needing translation;Described each field needing translation is carried out respectively according to predetermined translation rule
Translation.
In this example, data base can be all kinds data bases such as Oracle, DB2, MySQL, and the present invention is to data
The type in storehouse is not restricted.Data base has various table, can be inquired about from table by SQL statement and obtain each needing translation
Field, SELECT statement such as can be used to obtain as shown in table 12 field from table, and (such as " userbase " field is with " flat
All the moon sales volume " field).Above-mentioned 2 fields can be translated according to predetermined translation rule.Such as, predetermined translation rule
Could dictate that in then when numerical value is 1 in " userbase " field, " 1 to 1 ten thousand userbase " can be translated to;When being 2, " 1 can be translated to
Ten thousand to 10 ten thousand userbases ";" not carrying out this business temporarily " during for sky, can be translated to." average the moon sales volume " field is and " uses
Family scale " field that is associated of field, when the value of corresponding " userbase " field is non-NULL, " actual average can be translated to
Month sales volume XXXX platform (XXXX be the numerical value in " average the moon sales volume " field) ", when the value of " userbase " field of correspondence
During for sky, can translate to that " (XXXX is in " average the moon sales volume " field to estimate after expansion business average moon sales volume XXXX platform
Numerical value) ".The translation field data generated for each field in table 1 can be found in table 2.Predetermined translation rule can be with business system
System to derive the translation rule that reporting system is based on consistent so that the translation field data obtained for identical field and leading
Go out report data identical in the case of derivation Report Operations is errorless, in order to comparison.
Userbase |
The average moon sales volume |
1 |
3896 |
2 |
49800 |
|
9000 |
Table 1
Userbase |
The average moon sales volume |
1 to 1 ten thousand userbase |
The actual average moon sales volume 3896 |
1 ten thousand to 10 ten thousand userbase |
The actual average moon sales volume 49800 |
Do not carry out this business temporarily |
Estimate after expansion business average moon sales volume 9000 |
Table 2
In one example, translation field data can obtain based on UFT software.For example, it is possible to write UFT software energy
Enough scripts run, by Run Script from being dynamically connected data base inquire about to obtain and need each field of translation.And can
With based on predetermined translation rule, write translation rule language that UFT software can run, for each field needing translation
Sentence, obtains translating field data by running these statements.
In one example, described method may also include that and gives each row of data in described translation field data uniquely
Line identifier.Such as, as shown in table 3, unique line identifier as shown in table 3 can be given to each row of data in above-mentioned table 2
(also known as record identification, such as area ID or other traffic ID).This line identifier can obtain by deriving Report Operations with user
Derive report data line identifier consistent, in order to follow-up comparison and location of mistake.
|
Userbase |
The average moon sales volume |
Area A |
1 to 1 ten thousand userbase |
The actual average moon sales volume 3896 |
Area B |
1 ten thousand to 10 ten thousand userbase |
The actual average moon sales volume 49800 |
Area C |
Do not carry out this business temporarily |
Estimate after expansion business average moon sales volume 9000 |
Table 3
Derive the acquisition of report data
In one example, the Identifying Technique of Object of available UFT software, analog subscriber automatically opens up browser login and leads
Going out reporting system, this derivation reporting system is connected with above-mentioned data base, and can be set to the browser opened maximize
State, can simulate for automatically opening up the derivation page of data derived in reporting system, and analog subscriber is clicked on and derived data page
Derivation button on face, to be derived automatically from described derivation form for each field needing translation from the table of described data base
Data (such as derive form excel file).Wherein it is possible to deriving page of data by the operation of UFT software analog subscriber
Upper each field selecting to need translation, it is also possible to directly in the phase deriving Report Operations for analog subscriber of UFT software
Closing to specify in Run Script and need each field of translation, the present invention is without limitation.Also can will derive form excel file
It is automatically saved to assigned catalogue position.Such as, UFT software can be derived automatically from for the derivation of each field in table 1 by analog subscriber
The derivation report data of excel file format, the derivation report data of this excel file is as shown in table 4.
|
Userbase |
The average moon sales volume |
Area A |
1 to 1 ten thousand userbase |
The actual average moon sales volume 3896 |
Area B |
1 ten thousand to 10 ten thousand userbase |
The actual average moon sales volume 37658 |
Area C |
Do not carry out this business temporarily |
Estimate after expansion business average moon sales volume 9000 |
Table 4
The derivation report data automatically derived in this way, obtains by manually carrying out derivation Report Operations with user
Derivation report data identical, therefore this derivation report data is tested, i.e. available required test result.
In one example, described method may also include that described derivation report data (the excel form such as derived
Derivation report data) be stored in described UFT software carries for the interim grid virtual table Data Table preserving data
In.
In one example, above-mentioned steps 103 contrasts described translation field data and phase in described derivation report data
The data answering field comprise the steps that and contrast the derivation report data being stored in described translation field data and described grid virtual table
The data of middle respective field.Such as, can contrast successively data in field in table 3 " average the moon sales volume " with in grid virtual table
Data in respective field in the derivation report data table 4 being stored in " average the moon sales volume ", to derive report data carry out from
Dynamic test.The contrast of step 103 can be realized by UFT software.
In one example, contrast described translation field data and the data of respective field in described derivation report data,
Generate test result, it may include: in described translation field data with described derivation report data, the data of respective field differ
In the case of cause, showing inconsistent data and the information relevant to described inconsistent data, wherein said information includes institute
State field identification corresponding to inconsistent data and line identifier.Such as, can contrast successively in field in table 3 " average the moon sales volume "
Data and grid virtual table in data in respective field in the derivation report data table 4 that is stored in " average the moon sales volume ",
When data in field " average the moon sales volume " of contrast to row " area B " correspondence, it is possible to find " the actual average moon in table 3
Sales volume 49800 " inconsistent with " the actual average moon sales volume 37658 " in table 4, then can after contrast pop-up window,
Above-mentioned inconsistent data and field identification corresponding to inconsistent data " average the moon sales volume " and row is shown in pop-up window
Mark " area B " (i.e. position in table residing for inconsistent data).
In one example, contrast described translation field data and the data of respective field in described derivation report data,
Generate test result, it may include: the number of respective field in whole described translation field datas with described derivation report data
According in the case of consistent (in the derivation report data table 4 being stored in the translation field data in such as table 3 and grid virtual table
In the case of the data of respective field are completely the same), then can be after contrast, pop-up window prompting is completely the same, represents and derives report
Table data are the most correct.
In one example, generate test result and comprise the steps that the test report generating expandable mark language XML form.
Owing to the readable of test report of XML format can the most intuitively be checked by force, tester can view each step pair
Than whether running through or failure and automatic test contrast time-consuming, it is simple to user understands process and the survey of automatic test
Examination efficiency.
In one example, described method may also include that and automatically saves the derivation report being stored in described grid virtual table
Table data.Such as, the derivation report data table 4 that UFT software is stored in can automatically saving grid virtual table, in order to user is carried out
Again checking, regression analysis is derived report data and the reason of mistake is occurred, adds up probability of makeing mistakes.
Embodiment 2
Fig. 2 illustrates the structure chart of the automatic test device deriving report data according to an embodiment of the invention.This is real
Execute the automatic test device 20 of example and can be used for realizing the operation of each step of method in embodiment 1, the most various concrete examples and
Beneficial effect can be found in embodiment 1, and description is not repeated herein for simplicity's sake.
As in figure 2 it is shown, the automatic test device 20 of this embodiment includes: translation parts 21, for turning according to predetermined
Translate rule, translate respectively for each field needing translation in table, generate the translation Field Count for each field
According to;Derive parts 22, for utilizing function of unity test UFT software analog subscriber for each word needing translation described in table
Duan Jinhang derives Report Operations, obtains deriving report data;Contrast parts 23, are used for contrasting described translation field data with described
Derive the data of respective field in report data, generate test result.
Fig. 3 illustrates the knot of the automatic test device deriving report data of an example according to an embodiment of the invention
Composition.In this example, described translation parts 21 include: connect unit 211, be used for connecting data base, deposit in described data base
Contain described table;Inquiry acquiring unit 212, obtains described each field needing translation for inquiry from described table;Translation
Unit 213, for translating respectively according to predetermined translation rule described each field needing translation.
In one example, derive Report Operations and comprise the steps that login form guiding system, wherein said form guiding system
It is connected with described data base;Open the derivation page of data in described form guiding system;Click on and derive in page of data
Derive button, to be derived automatically from described derivation form number from the table of described data base for described each field needing translation
According to.
In one example, described device also includes: the first storage unit, for being deposited by described derivation report data
Enter in described UFT software in the interim grid virtual table preserving data.
In one example, described contrast parts 23 specifically for: contrast described translation field data and described grid empty
Be stored in plan table derives the data of respective field in report data.
Fig. 4 illustrates the automatic test device deriving report data of another example according to an embodiment of the invention
Structure chart.In this example, described device 20 also includes: mark component 24, for often going in described translation field data
Data give unique line identifier.
In one example, described contrast parts 23 specifically for: at described translation field data and described derivation form
In the case of the data of respective field are inconsistent in data, show inconsistent data and relevant to described inconsistent data
Information, wherein said information includes field identification corresponding to described inconsistent data and line identifier.
In one example, described contrast parts 23 specifically for: lead with described in whole described translation field datas
Go out in report data in the case of the data consistent of respective field, point out completely the same.
In one example, described contrast parts 23 are additionally operable to: generate the test report of expandable mark language XML form
Accuse.
In one example, described device 20 also includes: the second storage unit, is used for automatically saving described grid virtual table
Middle be stored in derivation report data.
Embodiment 3
Fig. 5 shows the structure of a kind of automated test device deriving report data of an alternative embodiment of the invention
Block diagram.Described automated test device 1100 can be to possess the host server of computing capability, personal computer PC or can
The portable computer carried or terminal etc..Calculating node is not implemented and limits by the specific embodiment of the invention.
Described automated test device 1100 includes processor (processor) 1110, communication interface
(Communications Interface) 1120, memorizer (memory) 1130 and bus 1140.Wherein, processor 1110,
Communication interface 1120 and memorizer 1130 complete mutual communication by bus 1140.
Communication interface 1120 is used for and network device communications, and wherein the network equipment includes such as Virtual Machine Manager center, is total to
Enjoy storage etc..
Processor 1110 is used for performing program.Processor 1110 is probably a central processor CPU, or special collection
Become circuit ASIC (Application Specific Integrated Circuit), or be configured to implement the present invention
One or more integrated circuits of embodiment.
Memorizer 1130 is used for depositing file.Memorizer 1130 may comprise high-speed RAM memorizer, it is also possible to also includes non-
Volatile memory (non-volatile memory), for example, at least one disk memory.Memorizer 1130 can also be to deposit
Memory array.Memorizer 1130 is also possible to by piecemeal, and described piece can be by certain rule sets synthesis virtual volume.
In a kind of possible embodiment, said procedure can be the program code including computer-managed instruction.This journey
Sequence is particularly used in and realizes each step operation of method in embodiment 1.
Those of ordinary skill in the art are it is to be appreciated that each exemplary cell in embodiment described herein and algorithm
Step, it is possible to being implemented in combination in of electronic hardware or computer software and electronic hardware.These functions are actually with hardware also
It is that software form realizes, depends on application-specific and the design constraint of technical scheme.Professional and technical personnel can be for
Specific application selects different methods to realize described function, but this realization is it is not considered that exceed the model of the present invention
Enclose.
If using the form of computer software realize described function and as independent production marketing or use time, then exist
To a certain extent it is believed that all or part of (part such as contributed prior art) of technical scheme is
Embody in form of a computer software product.This computer software product is generally stored inside the non-volatile of embodied on computer readable
In storage medium, including some instructions with so that computer equipment (can be that personal computer, server or network set
Standby etc.) perform all or part of step of various embodiments of the present invention method.And aforesaid storage medium include USB flash disk, portable hard drive,
Read only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic
The various medium that can store program code such as dish or CD.
The above, the only detailed description of the invention of the present invention, but protection scope of the present invention is not limited thereto, and any
Those familiar with the art, in the technical scope that the invention discloses, can readily occur in change or replace, should contain
Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with described scope of the claims.