[go: up one dir, main page]

CN109726089A - Test report generation method, unit and computer readable storage medium - Google Patents

Test report generation method, unit and computer readable storage medium Download PDF

Info

Publication number
CN109726089A
CN109726089A CN201810947060.2A CN201810947060A CN109726089A CN 109726089 A CN109726089 A CN 109726089A CN 201810947060 A CN201810947060 A CN 201810947060A CN 109726089 A CN109726089 A CN 109726089A
Authority
CN
China
Prior art keywords
test
measured
report
chained list
data
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
CN201810947060.2A
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 Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201810947060.2A priority Critical patent/CN109726089A/en
Publication of CN109726089A publication Critical patent/CN109726089A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of test report generation method, test report generation method defines simultaneously initialization test report generation class the following steps are included: according to testing requirement;Current object to be measured is obtained according to test chained list, wherein the test chained list is generated according to default test scope;The current object to be measured is tested according to test order, and generates test data;The test data is written in test file;The step of current object to be measured is obtained according to test chained list is returned to, until traversing whole object to be measured in the test chained list;Class, which is generated, based on the test file and the test report generates test report.The invention also discloses a kind of test report generating device, device and computer readable storage mediums.The customized of test report can be achieved in the present invention, so as to improve test effect.

Description

Test report generation method, unit and computer readable storage medium
Technical field
The present invention relates to the field of test technology more particularly to a kind of test report generation methods, unit and computer Readable storage medium storing program for executing.
Background technique
Test report is the record to test process and result, finds the problems in system or website convenient for tester, To further correct and safeguard.In the prior art, the content of test report is determined by specific test process, is surveyed Whole test data caused by test process is normally comprised in examination report, so that tester carries out full system or website Face checks.However, in fact tester, which is typically not required, knows whole test datas according to the difference of testing requirement, It is this can not customized test report be unfavorable for checking for tester, and a large amount of storage resource is typically taken up, to survey Examination effect causes adverse effect.
Above content is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that above content is existing skill Art.
Summary of the invention
The main purpose of the present invention is to provide a kind of test report generation methods, it is intended to which solving above-mentioned test report can not Customized technical problem, to improve test effect.
To achieve the above object, the present invention provides a kind of test report generation method, comprising the following steps:
According to testing requirement, simultaneously initialization test report generation class is defined;
Current object to be measured is obtained according to test chained list, wherein the test chained list is generated according to default test scope 's;
The current object to be measured is tested according to test order, and generates test data;
The test data is written in test file;
Return according to test chained list obtain current object to be measured the step of, until traverse it is described test chained list in all to Survey target;
Class, which is generated, based on the test file and the test report generates test report.
Preferably, it according to testing requirement, defines and the step of initialization test report generation class includes:
Obtain the test report name of test report to be generated;
According to the test report name, report content information corresponding with the test report and reporting format letter are obtained Breath;
According to the report content information and the report format information, test report catalogue is created;
The corresponding test internal data of the test report catalogue is initialized, the test internal data includes the test Report the data structure and call method in catalogue.
Preferably, include: according to the step of test chained list acquisition current object to be measured
According to test chained list, the current object to be measured of request, and detect the company of current object to be measured described in request Connect parameter;
When the Connecting quantity exceeds default Connecting quantity range, suspend current object to be measured described in request, and The accumulative suspending count of current object to be measured described in the object to be measured and request is recorded in the of the test file One skips in data;
Acquisition request obtains the preset times of the current object to be measured;
Compare the accumulative suspending count and the preset times;
When the accumulative suspending count is less than the preset times, object to be measured described in request;
When the accumulative suspending count is greater than or equal to the preset times, stop object to be measured described in request, And the object to be measured is recorded in the second of the test file and is skipped in data.
Preferably, after the step of obtaining current object to be measured according to test chained list, the test report generation method It is further comprising the steps of:
Extract the link in the object to be measured;
Judge the link whether within default test scope;
When the link is within the default test scope, the link is added in the test chained list;
When the link is except the default test scope, by the chained record the of the test file Three skip in data.
Preferably, when the link is within the default test scope, the link is added to the test Step in chained list includes:
When the link is within the default test scope, judge to whether there is in the test chained list with it is described Link corresponding object to be measured;
When in the test chained list exist with it is described link corresponding object to be measured when, by the chained record described The forth jump of test file is crossed in data;
When in the test chained list there is no with it is described link corresponding object to be measured when, by it is described link be added to institute It states in test chained list.
Preferably, the test order includes connecting test rule, content test rule and customized test order;
The current object to be measured is tested according to test order, and the step of generating test data includes:
Detection obtains the Connecting quantity of current object to be measured according to the test chained list;
The Connecting quantity is verified according to the connecting test rule, and generates connecting test data;
Parse the content information of the object to be measured;
The content information is verified according to the content test rule, and generates content test data;
The current object to be measured is verified according to the customized test order, and generates customized test data.
It is preferably based on the test file and the test report and generates the step of class generates test report and include:
Class is generated based on the test report, parses the test file;
According to the parsing result of the test file, hypertext markup language data is synthesized;
According to the hypertext markup language data, HTML document is generated, to obtain test report.
To achieve the above object, the present invention also proposes a kind of test report generating device, the test report generating device Include: memory, processor and is stored in the computer program that can be run on the memory and on the processor, it is described The step of test report generation method is realized when computer program is executed by the processor, the test report generation method packet It includes following steps: according to testing requirement, defining simultaneously initialization test report generation class;Current mesh to be measured is obtained according to test chained list Mark, wherein the test chained list is generated according to default test scope;According to the test order test current mesh to be measured Mark, and generate test data;The test data is written in test file;It returns and current mesh to be measured is obtained according to test chained list Target step, until traversing whole object to be measured in the test chained list;Based on the test file and the test report It generates class and generates test report.
To achieve the above object, the present invention also proposes a kind of test report generating means, the test report generating means Including initialization module, obtain module, test module, writing module and generation module, wherein the initialization module is to root According to testing requirement, simultaneously initialization test report generation class is defined;The acquisition module to according to test chained list obtain currently to Survey target, wherein the test chained list is generated according to default test scope;The test module is to according to test order The current object to be measured is tested, and generates test data;The write module is to be written test text for the test data In part;The generation module generates test report to generate class based on the test file and the test report.
To achieve the above object, the present invention also proposes a kind of computer readable storage medium, the computer-readable storage It is stored with test report on medium and generates program, the test report generates and realizes that test report is raw when program is executed by processor The step of at method, the test report generation method define simultaneously initialization test report the following steps are included: according to testing requirement It accuses and generates class;Current object to be measured is obtained according to test chained list, wherein the test chained list is generated according to default test scope 's;The current object to be measured is tested according to test order, and generates test data;Test file is written into the test data In;The step of current object to be measured is obtained according to test chained list is returned to, until traversing the whole mesh to be measured in the test chained list Mark;Class, which is generated, based on the test file and the test report generates test report.
In the technical solution of the present invention, test report generation method defines and first the following steps are included: according to testing requirement Beginningization test report generates class;Current object to be measured is obtained according to test chained list, wherein the test chained list is surveyed according to default Try what range generated;The current object to be measured is tested according to test order, and generates test data;The test data is write Enter in test file;The step of current object to be measured is obtained according to test chained list is returned to, until traversing in the test chained list Whole object to be measured;Class, which is generated, based on the test file and the test report generates test report.By according to test need Definition and initialization test report generation class are asked, the frame of required test report is constructed.During the test, using based on chain The mode of table is tested, and in test loop each time, and resulting test data is written in test file, complete in traversal After portion's object to be measured, the test file comprising whole test datas can be obtained.It is based further on test file and test report It generates class and generates the test report for meeting testing requirement, so that the customized of test report is realized, so that tester checks test Report improves test effect.Meanwhile the test report of this generation customized according to testing requirement does not usually include all surveying Data are tried, therefore are conducive to storage resource needed for reducing test report, by the way that the storage resource of saving is put into test In other links, also helping further improves test effect.
Detailed description of the invention
Fig. 1 is the flow diagram of test report generation method first embodiment of the present invention;
Fig. 2 is the refinement flow diagram of step S100 in test report generation method second embodiment of the present invention;
Fig. 3 is the refinement flow diagram of step S200 in test report generation method 3rd embodiment of the present invention;
Fig. 4 is the flow diagram of test report generation method fourth embodiment of the present invention;
Fig. 5 is the refinement flow diagram of step S631 in the 5th embodiment of test report generation method of the present invention;
Fig. 6 is the refinement flow diagram of step S300 in test report generation method sixth embodiment of the present invention;
Fig. 7 is the refinement flow diagram of step S500 in the 7th embodiment of test report generation method of the present invention;
Fig. 8 is the structural representation of the test report generating device for the hardware running environment that the embodiment of the present invention is related to Figure.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are: by according to testing requirement definition and initialization test report generation Class, and tested based on chained list, by the test data write-in test file of generation, by parsing test file, it is based on surveying Examination report generation meets the test report of testing requirement, to realize the customized of test report.
As the prior art test report in include whole test datas involved in test process, inconvenient tester Member's checks, and generally takes up a large amount of storage resource, and test effect is caused to be deteriorated.
The present invention provides a solution, by defining simultaneously initialization test report generation class according to testing requirement, and It is tested based on chained list, by the test data write-in test file of generation, by parsing test file, is based on test report The test report that generation class generation meets testing requirement reduces the occupancy of storage resource to facilitate checking for tester, improves Test effect.
First embodiment of the invention provides a kind of test report generation method, as shown in Figure 1, test report generation method packet Include following steps:
Step S100, according to testing requirement, simultaneously initialization test report generation class is defined;
In order to make the test report ultimately generated meet the testing requirement of tester, including all required test number According to, and unwanted test data is excluded, by definition and initialization test report generation class, construct the frame of test report. The frame of test report may include the content frame and lattice frame of test report, in order to which tester checks test report It accuses.In definition and when initialization test report generation class, mainly to may be related in test process and test report generating process And to parameter, method etc. be defined and initialize, hereinafter also will be apparent from.
Step S200, current object to be measured is obtained according to test chained list;
Chained list is a kind of discontinuous, non-sequential storage organization.Test chained list is generated according to default test scope, is wrapped Object to be measured is included.Test chained list can once be generated according to driven file, can also be in traversal test process constantly It is filled with and is continuously generated, hereinafter also will be apparent from.The element for testing chained list includes data field and pointer field, in data field In, it include specific object to be measured, and in pointer field, include the directional information of next object to be measured, completes this After the test of object to be measured, according to the next object to be measured of the directional information of object to be measured next in pointer field acquisition, and after Continue the test of next object to be measured, to drive the circulation entirely tested.Particularly, in website test, object to be measured can be with It is link to be measured, when measuring this link to be measured, by requesting link to be measured to access the corresponding content of pages of link to be measured.
Step S300, current object to be measured is tested according to test order, and generates test data;
Test order is usually relevant to factors such as object to be measured and testing requirements.During the test, according to test Rule tests object to be measured, and generates test data.Test data include involved in test process all or Partial data, and cover total data needed for final test report.Specifically, test data may include to be measured Whether the directional information of target, object to be measured the information such as are successfully tested, and hereinafter also will be apparent from.
Step S400, test data is written in test file;
In each test loop, after testing current object to be measured according to test order, test text is written into test data In part, the related content in test file is called to store test data, when convenient for being subsequently generated test report.Test file is logical It is often one kind of configuration file, test data can be written in test file by forms such as key-value pairs, to avoid testing Complicated processing is carried out to test data in the process, to improve testing efficiency.
Return step S200, until whole object to be measured in traversal test chained list;
In each test loop, above-mentioned steps S200 to step S400 is executed, until the whole in traversal test chained list Object to be measured, to complete the test of whole object to be measured in default test scope, obtain include complete test data test it is literary Part.Specifically, can be by judging the last one object to be measured in the case where test loop is carried out according to linked list order No last bit element corresponding to chained list determines, if so, showing to have had stepped through whole object to be measured, then completes this survey Examination;If it is not, then next object to be measured according to pointed by pointer field, continues to test.It is according to other suitable in test loop When sequence carries out, it can judge whether to have traversed whole object to be measured according to corresponding circular order.
Step S500, class is generated based on test file and test report and generates test report.
Since what is be written in test file is usually the test data of the forms such as key-value pair, and it is not easy to tester's It checks, therefore, by parsing test file, class is generated to generate test report based on test report.Since test report generates The frame of test report, including content information and format information etc. are constructed in class in advance, therefore, based on test file and Test report generates class, extracts corresponding content information, and according to the preset extracted content information of format information tissue, Test report is generated, is checked with personnel to be tested.
In the present embodiment, test report generation method defines the following steps are included: according to testing requirement and initializes survey Try report generation class;Current object to be measured is obtained according to test chained list, wherein the test chained list is according to default test scope It generates;The current object to be measured is tested according to test order, and generates test data;The test data is written and is tested In file;Return according to test chained list obtain current object to be measured the step of, until traverse it is described test chained list in all to Survey target;Class, which is generated, based on the test file and the test report generates test report.By being defined according to testing requirement And initialization test report generation class, construct the frame of required test report.During the test, using the side based on chained list Formula is tested, and in test loop each time, and resulting test data is written in test file, all to be measured in traversal After target, the test file comprising whole test datas can be obtained.It is based further on test file and test report generates class The test report that generation meets testing requirement, so that tester checks test report, changes to realize the customized of test report Kind test effect.Meanwhile the test report of this generation customized according to testing requirement does not usually include whole test datas, Therefore be conducive to storage resource needed for reducing test report, by other links that the storage resource of saving is put into test In, also helping further improves test effect.
Based on above-mentioned first embodiment, as shown in Fig. 2, in the second embodiment of the present invention, step S100 includes:
Step S110, the test report name of test report to be generated is obtained;
Step S120, according to test report name, report content information corresponding with test report and reporting format letter are obtained Breath;
Step S130, according to report content information and report format information, test report catalogue is created;
Step S140, the corresponding test internal data of initialization test report catalogue, test internal data include test report Accuse the data structure and call method in catalogue.
For the ease of tester's initialization test report generation class, can be arranged in advance for specific test report frame Corresponding test report name, establishes the mapping relations between test report name and report content information and report format information.That , in initialization test report generation class, by the test report for obtaining test report to be generated provided by tester Name is accused, report content information corresponding with the test report and report format information can be obtained.According to report content information and Report format information, creates test report catalogue, and initialization test reports catalogue corresponding test internal data, wherein test Internal data includes data structure and call method in test report catalogue, to store test data according to preset structure, When being subsequently generated test report, test report catalogue is filled according to test file, to generate test report.
Based on the various embodiments described above, as shown in figure 3, in the third embodiment of the present invention, step S200 includes:
Step S210, according to test chained list, the current object to be measured of request, and the current object to be measured of request is detected Connecting quantity;
Step S220, when Connecting quantity exceeds default Connecting quantity range, suspend the current object to be measured of request, and First that the accumulative suspending count of object to be measured and the current object to be measured of request is recorded in test file skips in data;
Step S230, acquisition request obtains the preset times of current object to be measured;
Step S240, accumulative suspending count and preset times are compared;
Step S251, when accumulative suspending count is less than preset times, request object to be measured;
Step S252, when accumulative suspending count is greater than or equal to preset times, stop request object to be measured, and will What object to be measured was recorded in test file second skips in data.
In the present embodiment, in order to avoid there are problems for the connection of some object to be measured, lead to the stagnation of testing process, drop Low testing efficiency regulates and controls the connection procedure of each object to be measured by default Connecting quantity range.Wherein, connection ginseng is preset Number range can specifically include between connection time-out time range, request returned data magnitude range, request return code range, request Waiting time range, number of threads range etc., when the connection time-out time of the object to be measured has been more than connection time-out time range, Or request returned data size be more than request returned data magnitude range, or request return code not request return code range it It is interior, or between request the waiting time be more than waiting time range between request, or the number of threads of object to be measured connected simultaneously is super Whens having crossed number of threads range etc., then suspend and request the object to be measured, and by the accumulative of object to be measured itself and the object to be measured What suspending count was recorded in test file first skips in data, to record problem specific in connection procedure, and continues next The test of object to be measured.Data are skipped corresponding to the object to be measured that there is a problem in test process, are carried out automatically so as to subsequent Or it checks manually, in view of the pause of certain object to be measured may be as caused by accidentalia, in order to mitigate tester Burden skip data after traversal completes the object to be measured that do not suspend all in test chained list according to first, return to test The object to be measured suspended before.The accumulative suspending count and preset times for comparing the object to be measured of same pause, when accumulative pause When number is less than preset times, the pause before showing may be to request the object to be measured as caused by accidentalia;And work as When accumulative suspending count is greater than or equal to preset times, show that the object to be measured is abnormal always, then consider there are other failures, Stop request object to be measured, and the object to be measured be recorded in the second of test file and is skipped in data, so as to tester into Row checks.In general, preset times can be set as 1~5 time, to take into account the raising of testing efficiency and subtracting for tester's burden Gently.
Based on the various embodiments described above, as shown in figure 4, in the fourth embodiment of the present invention, after step S200, test Report-generating method is further comprising the steps of:
Step S610, the link in object to be measured is extracted;
Step S620, judge link whether within default test scope;
Step S631, when linking within default test scope, link is added in test chained list;
Step S632, when linking except default test scope, the third by chained record in test file is skipped In data.
In the present embodiment, test chained list is constantly filled during the test and is continuously generated, according to mesh to be measured Target content constantly obtains other object to be measured, and is filled into test chained list, to drive the circulation of test.Specifically, to It surveys in target and is likely present other links, these link some and are directed toward within default test scope, and also some may be directed toward Except default test scope, therefore, it is necessary to be screened according to default test scope to link, and will be in default test scope Within link be added to test chained list in.In a specific example, by taking the test to website as an example, object to be measured be specially to Surveyor's chain connects, when needing to test whole pages that domain suffix is .abc, it is assumed that the domain name of a certain link to be measured is Def.abc further includes the page that domain name is ghi.def.abc and domain name is mno.jkl on the corresponding page of link to be measured Link, then, according to default test scope it is found that the page link that domain name is ghi.def.abc is being preset within test scope, Ghi.def.abc is added in test chained list, and the page link that domain name is mno.jkl is not being preset within test scope, Therefore the page link is not added into test chained list.It is to be noted, however, that being directed to this page link sheet of mno.jkl The test of body, which is normally included in, to be treated surveyor's chain and connects in the test of def.abc, that is, in step S300, works as test order When including hyperlink test order, need to test mno.jkl this page link itself according to hyperlink test order, And generate corresponding test data.And due to mno.jkl, this page link is not being preset within test scope, is no longer needed The page of its direction is obtained by mno.jkl, and other contents on the page are tested.In order to ensure the complete of test Face should select can to jump to that default test scope included is needed in the linking inlet ports of selection test chained list as far as possible The homepage of target is surveyed, in order to avoid there is test leakage.Certainly, in testing, object to be measured is also possible to other other than link, the page Element.
Based on above-mentioned fourth embodiment, as shown in figure 5, in the fifth embodiment of the present invention, step S631 includes:
Step S631a, when linking within default test scope, judging to test in chained list whether there is and link phase Corresponding object to be measured;
Step S631b, when testing in chained list in the presence of with corresponding object to be measured is linked, by chained record in test text The forth jump of part is crossed in data;
Step S631c, when testing in chained list there is no with corresponding object to be measured is linked, link is added to test In chained list.
In the present embodiment, it is contemplated that in the object to be measured pointed by different links, it is understood that there may be identical to be measured Target, in order to avoid retest also executes deduplication operation after getting the link within default test scope, Judge test in chained list whether have existed object to be measured corresponding with linking, and if it exists, then no longer add the mesh to be measured Mark is into test chained list, to improve testing efficiency, if it does not exist, then the object to be measured is added in test chained list, with to be measured Examination.Specifically, duplicate removal can be using modes such as the grand filterings of cloth.In the grand filtering of cloth, the data structure based on Hash table passes through one One element is mapped to a point in a bit array by a hash function, to judge whether the element has specifically collected In conjunction.Bu Long filtering has good space efficiency and query time, but there are certain false recognition rates.When misidentifying When, being equivalent to the object to be measured will be repeatedly tested, but generally, and the false recognition rate of the grand filtering of cloth is smaller, decline to efficiency Influence and not very big can significantly improve testing efficiency and by duplicate removal.
Based on the various embodiments described above, as shown in fig. 6, test order includes that connection is surveyed in the sixth embodiment of the present invention Examination rule, content test rule and customized test order;
Step S300 includes:
Step S310, the Connecting quantity that current object to be measured is obtained according to test chained list is detected;
Step S320, Connecting quantity is verified according to connecting test rule, and generates connecting test data;
Step S330, the content information of object to be measured is parsed;
Step S340, content information is verified according to content test rule, and generates content test data;
Step S350, current object to be measured is verified according to customized test order, and generates customized test data.
Connecting test, content test and customized test etc. are specifically included to the test of object to be measured.Above-mentioned steps S310 and Step S320, step S330 and step S340, the sequence of step S350 is unrestricted, that is, connecting test, content test and The sequence of customized test is unrestricted.Wherein, when connecting test can specifically include the verification to request return code, request response Between verification, request returned data size verification etc., so that tester is according to the connection of the data-optimized object to be measured of connecting test Process improves user experience.It, will be in each type by parsing the content information of object to be measured when carrying out content test Hold information extraction and classify, to verify content information according to corresponding test order, generates content test data.Wherein, content Information can specifically include content of text, image content, hyperlink content, scripting language (such as JavaScript, js) content, Cascading style sheets (Cascading Style Sheets, css) content and source code normative content etc..Correspondingly, content test is advised It then include text test order, picture test order, hyperlink test order, js test order, css test order and source code rule Model test order etc., and text verification, picture verification, hyperlink verification, js verification, css verification and source code specification are carried out respectively Verification etc., while generating content test data.And customized test order is usually customized according to testing requirement institute by tester , such as to hypertext transfer protocol (HyperText Transfer Protocol, HTTP) and safely for the HTTP of target The verification etc. in channel (Hyper Text Transfer Protocol over Secure Socket Layer, HTTPS).
Based on the various embodiments described above, as shown in fig. 7, in the seventh embodiment of the present invention, step S500 includes:
Step S510, class is generated based on test report, parses test file;
Step S520, according to the parsing result of test file, hypertext markup language (Hyper Text Markup is synthesized Language, HTML) data;
Step S530, according to html data, html file is generated, to obtain test report.
HTML is one under standard generalized markup language application and a kind of specification and a kind of standard, passes through marker character Number the various pieces of content to be shown are marked, utilization is simple and highly functional, have good scalability and versatility. After completing traversal test, it will obtain including test summary data, object to be measured, the successful data of object to be measured, object to be measured Miss data and the test file of skipping data etc., however, test file is usually configuration file, content therein is key Value pair, inconvenience is checked.Class is generated based on test report, test file is parsed, it is corresponding with testing requirement to extract Test data meets the report content information of testing requirement, and combines report format information, synthesize html data, further Html file is generated more intuitively to show test result to obtain the test report for meeting testing requirement, facilitate tester It checks.
As shown in figure 8, Fig. 8 is the terminal for the hardware running environment that the embodiment of the present invention is related to, i.e., test report is raw The structural schematic diagram of forming apparatus.
The terminal of that embodiment of the invention can be server, PC, be also possible to smart phone, tablet computer, e-book reading Device, MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio Level 3) player, MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert compression Standard audio level 3) the packaged type terminal device having a display function such as player, portable computer.
As shown in figure 8, the terminal may include: processor 1001, such as CPU, network interface 1004, user interface 1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is for realizing the connection communication between these components. User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 optionally may include that the wired of standard connects Mouth, wireless interface (such as WI-FI interface).Memory 1005 can be high speed RAM memory, be also possible to stable memory (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor 1001 storage device.
Optionally, terminal can also include camera, RF (Radio Frequency, radio frequency) circuit, sensor, audio Circuit, WiFi module etc..Wherein, sensor such as optical sensor, motion sensor and other sensors.Specifically, light Sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can according to the light and shade of ambient light come The brightness of display screen is adjusted, proximity sensor can close display screen and/or backlight when mobile terminal is moved in one's ear.As One kind of motion sensor, gravity accelerometer can detect the size of (generally three axis) acceleration in all directions, quiet Size and the direction that can detect that gravity when only, the application that can be used to identify mobile terminal posture are (such as horizontal/vertical screen switching, related Game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;Certainly, mobile terminal can also match The other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor are set, details are not described herein.
It will be understood by those skilled in the art that the restriction of the not structure paired terminal of terminal structure shown in Fig. 8, can wrap It includes than illustrating more or fewer components, perhaps combines certain components or different component layouts.
As shown in figure 8, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium Believe that module, Subscriber Interface Module SIM and test report generate program.
In terminal shown in Fig. 8, network interface 1004 is mainly used for connecting background server, carries out with background server Data communication;User interface 1003 is mainly used for connecting client (user terminal), carries out data communication with client;And processor 1001 can be used for that the test report stored in memory 1005 is called to generate program, and execute following operation:
According to testing requirement, simultaneously initialization test report generation class is defined;
Current object to be measured is obtained according to test chained list;
Current object to be measured is tested according to test order, and generates test data, wherein test chained list is surveyed according to default Try what range generated;
Test data is written in test file;
The step of current object to be measured is obtained according to test chained list is returned to, until the whole mesh to be measured in traversal test chained list Mark;
Class, which is generated, based on test file and test report generates test report.
Further, processor 1001 can be used for that the test report stored in memory 1005 is called to generate program, root According to testing requirement, defines and the operation of initialization test report generation class includes:
Obtain the test report name of test report to be generated;
According to test report name, report content information corresponding with test report and report format information are obtained;
According to report content information and report format information, test report catalogue is created;
Initialization test reports catalogue corresponding test internal data, and test internal data includes in test report catalogue Data structure and call method.
Further, processor 1001 can be used for that the test report stored in memory 1005 is called to generate program, root Include: according to the operation that test chained list obtains current object to be measured
According to test chained list, the current object to be measured of request, and detect the connection ginseng of the current object to be measured of request Number;
When Connecting quantity exceeds default Connecting quantity range, suspend the current object to be measured of request, and by mesh to be measured Mark and the accumulative suspending count of the current object to be measured of request are recorded in the first of test file and skip in data;
Acquisition request obtains the preset times of current object to be measured;
Compare accumulative suspending count and preset times;
When accumulative suspending count is less than preset times, request object to be measured;
When accumulative suspending count is greater than or equal to preset times, stop request object to be measured, and by object to be measured Be recorded in test file second skips in data.
Further, processor 1001 can be used for that the test report stored in memory 1005 is called to generate program, After the operation for obtaining current object to be measured according to test chained list, following operation is also executed:
Extract the link in object to be measured;
Judge link whether within default test scope;
When linking within default test scope, link is added in test chained list;
When linking except default test scope, the third by chained record in test file is skipped in data.
Further, processor 1001 can be used for that the test report stored in memory 1005 is called to generate program, when When link is within default test scope, include: by the operation that link is added in test chained list
When linking within default test scope, judge to test in chained list with the presence or absence of corresponding with linking to be measured Target;
When test chained list in exist with corresponding object to be measured is linked when, by chained record test file the forth jump It crosses in data;
When testing in chained list there is no with corresponding object to be measured is linked, link is added in test chained list.
Further, processor 1001 can be used for that the test report stored in memory 1005 is called to generate program, survey Examination rule includes connecting test rule, content test rule and customized test order;
Current object to be measured is tested according to test order, and the operation for generating test data includes:
Detection obtains the Connecting quantity of current object to be measured according to test chained list;
Connecting quantity is verified according to connecting test rule, and generates connecting test data;
Parse the content information of object to be measured;
Content information is verified according to content test rule, and generates content test data;
Current object to be measured is verified according to customized test order, and generates customized test data.
Further, processor 1001 can be used for that the test report stored in memory 1005 is called to generate program, base Include: in the operation that test file and test report generate class generation test report
Class is generated based on test report, parses test file;
According to the parsing result of test file, hypertext markup language data is synthesized;
According to hypertext markup language data, HTML document is generated, to obtain test report.
In addition, the embodiment of the present invention also proposes that a kind of test report generating means, test report generating means include:
Initialization module, to define simultaneously initialization test report generation class according to testing requirement;
Module is obtained, to obtain current object to be measured according to test chained list, wherein the test chained list is according to default What test scope generated;
Test module to test current object to be measured according to test order, and generates test data;
Writing module, test data to be written in test file;
Generation module generates test report to generate class based on test file and test report.
Further, initialization module includes:
Name acquiring unit, to obtain the test report name of test report to be generated;
Information acquisition unit, to obtain report content information corresponding with test report and report according to test report name Accuse format information;
Directory creating unit, to create test report catalogue according to report content information and report format information;
Internal initialization unit tests internal data to the corresponding test internal data of initialization test report catalogue Including the data structure and call method in test report catalogue.
Further, obtaining module includes:
First connecting detection unit, to according to test chained list, the current object to be measured of request, and detect request The Connecting quantity of current object to be measured;
Request unit, to suspend request currently mesh to be measured when Connecting quantity exceeds default Connecting quantity range Mark;
Writing module is also to be recorded in survey for the accumulative suspending count of object to be measured and the current object to be measured of request The first of examination file skips in data;
Number acquiring unit obtains the preset times of current object to be measured to acquisition request;
Comparing unit, to compare accumulative suspending count and preset times;
Request unit also to when accumulative suspending count be less than preset times when, the current object to be measured of request;
Request unit is also to stop request mesh to be measured when accumulative suspending count is greater than or equal to preset times Mark;
Writing module is also skipped in data object to be measured is recorded in the second of test file.
Further, test report generating means further include;
Extraction module is linked, to extract the link in object to be measured;
Range judgment module, to judge link whether within default test scope;
Chained list adding module, when linking within default test scope, link to be added in test chained list;
Writing module also to when linking except default test scope, by chained record test file third It skips in data.
Further, chained list adding module includes:
Judging unit is repeated, to when linking within default test scope, judging to test in chained list whether there is Object to be measured corresponding with linking;
Adding unit is linked, when testing in chained list there is no with corresponding object to be measured is linked, link to be added It adds in test chained list;
Writing module is also when testing in chained list in the presence of with corresponding object to be measured is linked, chained record to be surveyed The forth jump of examination file is crossed in data.
Further, test order includes connecting test rule, content test rule and customized test order;
Test module includes:
Second connecting detection unit, to detect the Connecting quantity for obtaining current object to be measured according to test chained list;
Connecting test unit to verify Connecting quantity according to connecting test rule, and generates connecting test data;
Context resolution unit, to parse the content information of object to be measured;
Content test unit to verify content information according to content test rule, and generates content test data;
Customized test cell to verify current object to be measured according to customized test order, and generates customized test data.
Further, generation module includes:
Document analysis unit parses test file to generate class based on test report;
Synthesis unit synthesizes hypertext markup language data to the parsing result according to test file;
Generation unit, HTML document is generated, to be tested according to hypertext markup language data Report.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, deposited on computer readable storage medium It contains test report and generates program, test report, which generates, realizes following operation when program is executed by processor:
According to testing requirement, simultaneously initialization test report generation class is defined;
Current object to be measured is obtained according to test chained list;
Current object to be measured is tested according to test order, and generates test data, wherein test chained list is surveyed according to default Try what range generated;
Test data is written in test file;
The step of current object to be measured is obtained according to test chained list is returned to, until the whole mesh to be measured in traversal test chained list Mark;
Class, which is generated, based on test file and test report generates test report.
Further, when test report generation program is executed by processor, according to testing requirement, simultaneously initialization test is defined The operation of report generation class includes:
Obtain the test report name of test report to be generated;
According to test report name, report content information corresponding with test report and report format information are obtained;
According to report content information and report format information, test report catalogue is created;
Initialization test reports catalogue corresponding test internal data, and test internal data includes in test report catalogue Data structure and call method.
Further, when test report generation program is executed by processor, current object to be measured is obtained according to test chained list Operation include:
According to test chained list, the current object to be measured of request, and detect the connection ginseng of the current object to be measured of request Number;
When Connecting quantity exceeds default Connecting quantity range, suspend the current object to be measured of request, and by mesh to be measured Mark and the accumulative suspending count of the current object to be measured of request are recorded in the first of test file and skip in data;
Acquisition request obtains the preset times of current object to be measured;
Compare accumulative suspending count and preset times;
When accumulative suspending count is less than preset times, request object to be measured;
When accumulative suspending count is greater than or equal to preset times, stop request object to be measured, and by object to be measured Be recorded in test file second skips in data.
Further, when test report generation program is executed by processor, current mesh to be measured is being obtained according to test chained list After target operation, following operation is also executed:
Extract the link in current object to be measured;
Judge link whether within default test scope;
When linking within default test scope, link is added in test chained list;
When linking except default test scope, the third by chained record in test file is skipped in data.
Further, when linking within default test scope, link is added to the operation packet in test chained list It includes:
When linking within default test scope, judge to test in chained list with the presence or absence of corresponding with linking to be measured Target;
When test chained list in exist with corresponding object to be measured is linked when, by chained record test file the forth jump It crosses in data;
When testing in chained list there is no with corresponding object to be measured is linked, link is added in test chained list.
Further, test order includes connecting test rule, content test rule and customized test order;
Current object to be measured is tested according to test order, and the operation for generating test data includes:
Detection obtains the Connecting quantity of current object to be measured according to test chained list;
Connecting quantity is verified according to connecting test rule, and generates connecting test data;
Parse the content information of object to be measured;
Content information is verified according to content test rule, and generates content test data;
Current object to be measured is verified according to customized test order, and generates customized test data.
Further, when test report generation program is executed by processor, class is generated based on test file and test report Generate test report operation include:
Class is generated based on test report, parses test file;
According to the parsing result of test file, hypertext markup language data is synthesized;
According to hypertext markup language data, HTML document is generated, to obtain test report.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
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, technical solution of the present invention 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 one as described above In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that terminal device (it can be mobile phone, Computer, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of test report generation method, which is characterized in that the test report generation method the following steps are included:
According to testing requirement, simultaneously initialization test report generation class is defined;
Current object to be measured is obtained according to test chained list, wherein the test chained list is generated according to default test scope;
The current object to be measured is tested according to test order, and generates test data;
The test data is written in test file;
The step of current object to be measured is obtained according to test chained list is returned to, until traversing the whole mesh to be measured in the test chained list Mark;
Class, which is generated, based on the test file and the test report generates test report.
2. test report generation method as described in claim 1, which is characterized in that according to testing requirement, define and initialize Test report generate class the step of include:
Obtain the test report name of test report to be generated;
According to the test report name, report content information corresponding with the test report and report format information are obtained;
According to the report content information and the report format information, test report catalogue is created;
The corresponding test internal data of the test report catalogue is initialized, the test internal data includes the test report Data structure and call method in catalogue.
3. test report generation method as described in claim 1, which is characterized in that obtain current mesh to be measured according to test chained list Target step includes:
According to test chained list, the current object to be measured of request, and detect the connection ginseng of current object to be measured described in request Number;
When the Connecting quantity exceeds default Connecting quantity range, suspend current object to be measured described in request, and by institute The accumulative suspending count for stating current object to be measured described in object to be measured and request is recorded in the first of the test file and jumps It crosses in data;
Acquisition request obtains the preset times of the current object to be measured;
Compare the accumulative suspending count and the preset times;
When the accumulative suspending count is less than the preset times, object to be measured described in request;
When the accumulative suspending count is greater than or equal to the preset times, stop object to be measured described in request, and will What the object to be measured was recorded in the test file second skips in data.
4. test report generation method as described in claim 1, which is characterized in that current to be measured being obtained according to test chained list After the step of target, the test report generation method is further comprising the steps of:
Extract the link in the object to be measured;
Judge the link whether within default test scope;
When the link is within the default test scope, the link is added in the test chained list;
When the link is except the default test scope, the third by the chained record in the test file is jumped It crosses in data.
5. test report generation method as claimed in claim 4, which is characterized in that when the link is in the default test When within range, include: by the step that the link is added in the test chained list
When the link is within the default test scope, judging whether there is in the test chained list links with described Corresponding object to be measured;
When in the test chained list exist with it is described link corresponding object to be measured when, by the chained record in the test The forth jump of file is crossed in data;
When in the test chained list there is no with it is described link corresponding object to be measured when, by it is described link be added to the survey It tries in chained list.
6. test report generation method as described in claim 1, which is characterized in that the test order includes connecting test rule Then, content test rule and customized test order;
The current object to be measured is tested according to test order, and the step of generating test data includes:
Detection obtains the Connecting quantity of current object to be measured according to the test chained list;
The Connecting quantity is verified according to the connecting test rule, and generates connecting test data;
Parse the content information of the object to be measured;
The content information is verified according to the content test rule, and generates content test data;
The current object to be measured is verified according to the customized test order, and generates customized test data.
7. test report generation method as described in claim 1, which is characterized in that be based on the test file and the test Report generation class generate test report the step of include:
Class is generated based on the test report, parses the test file;
According to the parsing result of the test file, hypertext markup language data is synthesized;
According to the hypertext markup language data, HTML document is generated, to obtain test report.
8. a kind of test report generating device, which is characterized in that the test report generating device includes: memory, processor And it is stored in the computer program that can be run on the memory and on the processor, the computer program is by the place Manage the step of realizing the test report generation method as described in any one of claims 1 to 7 when device executes.
9. a kind of test report generating means, which is characterized in that the test report generating means include:
Initialization module, to define simultaneously initialization test report generation class according to testing requirement;
Module is obtained, to obtain current object to be measured according to test chained list, wherein the test chained list is according to default test What range generated;
Test module to test the current object to be measured according to test order, and generates test data;
Writing module, the test data to be written in test file;
Generation module generates test report to generate class based on the test file and the test report.
10. a kind of computer readable storage medium, which is characterized in that be stored with test report on the computer readable storage medium It accuses and generates program, the test report is generated when program is executed by processor and realized as described in any one of claims 1 to 7 The step of test report generation method.
CN201810947060.2A 2018-08-17 2018-08-17 Test report generation method, unit and computer readable storage medium Pending CN109726089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810947060.2A CN109726089A (en) 2018-08-17 2018-08-17 Test report generation method, unit and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810947060.2A CN109726089A (en) 2018-08-17 2018-08-17 Test report generation method, unit and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN109726089A true CN109726089A (en) 2019-05-07

Family

ID=66294640

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810947060.2A Pending CN109726089A (en) 2018-08-17 2018-08-17 Test report generation method, unit and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109726089A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127340A (en) * 2021-03-26 2021-07-16 山东英信计算机技术有限公司 Multi-test information linking method, system and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7194679B1 (en) * 1998-10-20 2007-03-20 International Business Machines Corporation Web-based file review system utilizing source and comment files
CN104111890A (en) * 2014-07-29 2014-10-22 北京航空航天大学 Real-time performance test method and system
CN107168879A (en) * 2017-05-23 2017-09-15 网易(杭州)网络有限公司 The generation method and device of centralized configuration management System Test Report

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7194679B1 (en) * 1998-10-20 2007-03-20 International Business Machines Corporation Web-based file review system utilizing source and comment files
CN104111890A (en) * 2014-07-29 2014-10-22 北京航空航天大学 Real-time performance test method and system
CN107168879A (en) * 2017-05-23 2017-09-15 网易(杭州)网络有限公司 The generation method and device of centralized configuration management System Test Report

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127340A (en) * 2021-03-26 2021-07-16 山东英信计算机技术有限公司 Multi-test information linking method, system and medium
CN113127340B (en) * 2021-03-26 2024-01-12 山东英信计算机技术有限公司 A linking method, system and medium for multiple test information

Similar Documents

Publication Publication Date Title
CN109582579B (en) Application program testing method and device, electronic equipment and storage medium
CN107704356B (en) Exception stack information acquisition method, device and computer readable storage medium
US9922260B2 (en) Scrapped information providing method and apparatus
US9268670B1 (en) System for module selection in software application testing including generating a test executable based on an availability of root access
CN105677571B (en) Mobile terminal software device for testing compatibility and method
CN107133174A (en) Test case code automatically generating device and method
US20170161240A1 (en) Web page operation method and electronic device for supporting the same
CN108427546A (en) Full screen adaptation method, display device and the storage medium of display device
CN110413501A (en) Browser compatibility test method, device, system and readable storage medium storing program for executing
CN104915297B (en) A kind of automated testing method of the APP power consumption of android equipment
US20150234799A1 (en) Method of performing text related operation and electronic device supporting same
CN113835948B (en) Temperature detection method, temperature detection device and electronic equipment
CN105187608B (en) The method and apparatus of application program power consumption on a kind of acquisition mobile terminal
KR102471739B1 (en) Apparatus and method for managing of history information in a electronic device
CN107016282A (en) A kind of information processing method and device
CN110362488A (en) A kind of page test method, device, electronic equipment and storage medium
CN109726110B (en) Document testing method, device, apparatus and computer readable storage medium
CN110377514A (en) Management method, device, electronic equipment and the storage medium of software component
KR102316846B1 (en) Method for sorting a media content and electronic device implementing the same
US20230351095A1 (en) Reducing data usage for rendering state changes
EP2960816A1 (en) Method and apparatus for managing data
CN112860261A (en) Static code checking method and device, computer equipment and readable storage medium
CN109726089A (en) Test report generation method, unit and computer readable storage medium
CN109857646A (en) An automated testing method and device
CN110502263A (en) Upgrade package production method, system and computer readable storage medium

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190507