CN1248115C - Method for readlizing universal test report - Google Patents

Method for readlizing universal test report Download PDF

Info

Publication number
CN1248115C
CN1248115C CN 02123769 CN02123769A CN1248115C CN 1248115 C CN1248115 C CN 1248115C CN 02123769 CN02123769 CN 02123769 CN 02123769 A CN02123769 A CN 02123769A CN 1248115 C CN1248115 C CN 1248115C
Authority
CN
China
Prior art keywords
test
file
test report
dom
document
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.)
Expired - Fee Related
Application number
CN 02123769
Other languages
Chinese (zh)
Other versions
CN1466058A (en
Inventor
雷雨后
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN 02123769 priority Critical patent/CN1248115C/en
Publication of CN1466058A publication Critical patent/CN1466058A/en
Application granted granted Critical
Publication of CN1248115C publication Critical patent/CN1248115C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The present invention discloses a method for realizing a universal test report, which comprises a test process and a test report generating process, wherein in a test process, the obtained result data of each test item is stored in a document object model (DOM) object according to a certain mode, and the DOM object is stored in an extensible markup language (XML) file after all the test items are completely tested; in the test report generating process, the obtained DOM object is converted by extensible style language (XSL), formatted output into a document capable of being understood by testers and displayed in a browser. The test report generated by the method has universality and expandability, can be freely transferred and communicated on Internet and can consume few system resources during running.

Description

The implementation method of universal test report
Technical field
The present invention relates to the implementation method of testing software test report after finishing test job, particularly a kind of implementation method of universal test report.
Background technology
The general flow that testing tool software is tested tested system as shown in Figure 1, in a test process, need a plurality of test items of test, all there are a test item result, this result to preserve after each test item end of test (EOT) and sum up and generate test report so that analyze at last.Adopting the test item result of what mode and each test item of technical notes and generate final test report file from these test items result, is the reason place of the performance difference of different test report module.
In the present business software testing tool, exist multiple solution to write down the test item result and generate test report, wherein preferably technical scheme as:
Scheme one: use database technology to write down the test item result, and directly generate form from database, this form is exactly final test report.The schematic diagram of this scheme as shown in Figure 2, in this scheme, database generally adopts small-sized desktop database system, such as FoxPro and Access etc.In test process, all test item result datas are added in the database as a record.After test was finished, the report form generator that uses database to carry just can generate test report from database.If database does not have report form generator, the DLL (dynamic link library) (ODBC etc.) that can take database to provide is inquired about the test item result data from database, then these data organizations are advanced in the test report file.
In this scheme, the generation of test item result's collection and final test report has been divided into tangible two steps: at first in test process, the result writes database with test item; Secondly after end of test (EOT), data query from database generates test report.
Scheme two: in test process, with each test item as a result straightforward format change into the form that can understand for the final user, write the file (text, Html file or Word file etc.) of a specific format then.The principle of this scheme as shown in Figure 3.In this scheme, final test report file is record test item result's a carrier, also be to be presented on tester's final form in front, this point and scheme one are different, and this scheme is integrated two steps of scheme one, that is: after test process finished, test report had just generated.In this scheme, the form of final test report file is not limit, and adopts maximum multiple forms such as text-only file, html file that have now.
All there is corresponding shortcoming in but above-mentioned two kinds of schemes, wherein,
Scheme one shortcoming is that the test item result data is retained in the database with binary mode, so test result data does not possess readability concerning the tester; And the form of test report fixes, and can not change according to the situation of reality.
Scheme two shortcomings are, the test item result data directly is kept in the test report file, though after handling through format, can make things convenient for the tester to read, but can not carry out further statistical study and processing, and the form of final test report fixes, and can not change according to actual conditions and tester's hobby.
In addition, above-mentioned two schemes also have a common shortcoming, that is: could read because of the specific software of need installation to be unfavorable for the interchange of data on Internet.As: when final test report is the document of a Word form, other testers just must install corresponding software (Microsot Word) and can report by reading test, even the most usual text-only file, on Unix, Window and operating systems such as Mac, different definition is arranged all also such as " carriage return " and " line feed character ", and then also may bring the trouble of reading to the test man.
Summary of the invention
The invention reside at above-mentioned shortcoming of the prior art, a kind of universal test report implementation method of employing XML (extending mark language) technology is provided, make the test report that generates by this method have good versatility and extensibility.
Solution of the present invention comprises step:
A) testing tool software is tested system under test (SUT) and each test item result data of obtaining leaves in DOM Document Object Model (DOM) object;
B) test is finished after resulting DOM Document Object Model (DOM) object be saved in an extending mark language (XML) file;
C) file with above-mentioned preservation test result carries out expansion type list language (Extensible StylesheetLanguage:XSL) conversion, and exports the test report document that the tester can read.
Wherein: a) go on foot described result data and leave in DOM Document Object Model (DOM) object according to extending mark language (XML) file layout.
C) go on foot the described browser that is meant and according to fixed expansion type list language (XSL) file of extending mark language (XML) document this extending mark language (XML) file is changed automatically, and the test report document is directly shown; Or
From converter of expansion type list language (XSL) file build, with extending mark language (XML) file conversion of preserving test result is HTML (Hypertext Markup Language, HTML (Hypertext Markup Language)) file utilizes browser directly to browse this html file then.
Beneficial effect of the present invention:
1, the XML file of this method employing is a text, support multiple coding, and support the international standard XML 1.0 of W3C fully, because this standard has obtained supporting widely and using, so this method can be used down in several operation systems (Windows, Unix, Mac etc.) and multiple programming language (C++, Python, TCL etc.), is a complete cross-platform implementation method.
2, owing to adopted XSL and XPATH language as converter, the original test result data that is kept in the XML document is converted to final test report, so can customize this converter very convenient and flexibly, make same test result data be converted to different test report forms according to tester's hobby and real needs.As by change XSL converter, can change the color of test report, layout, composing and content displayed or the like.
3, the XML standard is the standard criterion of the enterprising row data communication of following Internet, and the test result data that this method generates can freely transmit on Internet and exchange with test report, and this is a most outstanding advantage of this method;
4, the test result data of Sheng Chenging can be used for being further analyzed.Adopt the form of XML file to preserve data, can be so that data have unusual good institutional framework, so that the carrying out of follow-up further analyzing and processing.
5, consume less resources, save cost.Adopt this method, XML parsing software only need be installed on machine just can finish whole operations, and XML is as a kind of international standard, (com component, routine library etc.) in multilingual (such as Java, C#, C++, VB, Python and TCL etc.) have obtained realization in a variety of forms, and the operation in consume system resources seldom.
Description of drawings
The general flow figure that Fig. 1 tests tested system for testing tool software;
Fig. 2 is the schematic diagram of scheme one in the prior art;
Fig. 3 is the schematic diagram of scheme two in the prior art;
Fig. 4 is a schematic diagram of the present invention.
Embodiment
Testing software must gather final test result analysis after finishing test job, presents to the tester by the form of test report then.Test report is a part indispensable in the various testing softwares.The present invention realizes general test report module by adopting extending mark language (XML) technology.
With reference to figure 4: as can be seen from the figure, this programme mainly comprises two steps: test process and generate the test report process.
A, test process: each test item result data that test is obtained leaves in the DOM object according to certain form, after the whole tests of all test items are finished, this DOM object is saved in the XML file.Can think that this DOM is to liking the reflection of XML file in internal memory.
B, generation test report process: the DOM object that obtains is changed through XSL, and format is output as the document that the tester can understand, and shows in browser.Simultaneously, also the document can be saved as a html file, watch so that in browser, directly open later on.
Wherein, the main task of test process is to preserve each the test item result who obtains in the test process, and promptly whether this item is tested and passed through.The form of saving result data is DOM and XML file.The main task that generates the test report process is to utilize the XSL converter, XML data and the DOM that obtains in the test process is converted to the form that the tester can understand, and report is shown.
The mode of conversion and demonstration XML data has two kinds:
One, uses browser direct display.Because browser Internet Explorer supports XML 1.0 standards of W3C fully, so when allowing browser open the XML file of appointment, it can format conversion according to the fixed xsl file of XML document to the XML file automatically, then transformation result is shown in its window.
Two, from converter object of xsl file structure, the input of this object is exactly the XML file that we generate, and its conversion output is the file of html format.The content of xsl file has determined conversion regime and net result.After having generated html file, browser can directly be opened and browse this html file.
The principle of these two kinds of methods all is identical with the final being seen test report of tester, and difference is: in the method one, browser is to finish conversion work automatically.
Result data files is an XML document, is used for preserving each test result in the test process.
Its XML grammer is as follows:
1, preface part:
<?xml?version=″1.0″encoding=″UTF-8″?>
<?xml-stylesheet?type=″text/xsl″href=″show_testreport.xsl″?>
Wherein, the content of first row is fixed; Second row, expression adopt the testreport.xsl file to be used for the XML file is formatd, and output in the IE browser.
2, root element:
<result?ts2File=″...″
testDate=″...?
testEndDate=″″
testTime=″″
passed=″″title=″″>
...
</result>
The element of root element is called result, has five attributes:
(1) ts2File: the filename of representing the test script of this test result file representative.
(2) testDate: the date of representing the test of this test data file.
(3) tesEndtDate: the date of representing this test data file end of test (EOT).
(4) testTime; Represent this test time.
(5) passed: represent that whether this test script is by test.
3, the element of expression test item:
<item?line=″...″passed=″″>
<command><![CDATA[......]]></command>
<expect><![CDATA[......]]></expect>
<actual><![CDATA[......]]></actual>
</item>
The daughter element of this element representation result.
Attribute line represents passed represents whether this test item passes through capable number.
<command〉daughter element represents the network element commands of testing.
<expect〉daughter element represents the expected results tested.
<actual〉daughter element represents the actual result of testing.
Above the content of three daughter elements all use CDATA Section to represent.
4, the element of expression note:
<testcomment?line=″″line=″″>
<![CDATA[......]]>
</testcomment>
Its content is also represented with CDATA Section.
Top syntactic structure can be changed according to actual conditions.
The XSL converter in fact also is an XML file, it has adopted the XPATH grammer, method by recursion resolution (belongs to prior art, be not described in detail in this) each element in the top test result data file is formatd processing, and then finally export a test report with good readability.

Claims (4)

1, a kind of implementation method of universal test report is characterized in that this method comprises the steps:
A) testing tool software is tested system under test (SUT) and each test item result data of obtaining leaves in the DOM Document Object Model DOM object;
B) test is finished after resulting DOM Document Object Model DOM object be saved in the extending mark language XML file;
C) file with above-mentioned preservation test result carries out expansion type list language XSL conversion, and is output as the test report document that the tester can read.
2, method according to claim 1, it is characterized in that c) the described browser that is meant of step changes this extending mark language XML file according to the fixed expansion type list language xsl file of extending mark language XML document automatically, and the test report document directly shown.
3, method according to claim 1, it is characterized in that c) described being meant of step from converter of expansion type list language file build, with the extending mark language XML file conversion of preserving test result is html file, utilizes browser directly to browse this html file then.
4, method according to claim 1 is characterized in that a) described result data of step leaves in the DOM Document Object Model DOM object according to extending mark language XML file layout.
CN 02123769 2002-06-24 2002-06-24 Method for readlizing universal test report Expired - Fee Related CN1248115C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 02123769 CN1248115C (en) 2002-06-24 2002-06-24 Method for readlizing universal test report

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 02123769 CN1248115C (en) 2002-06-24 2002-06-24 Method for readlizing universal test report

Publications (2)

Publication Number Publication Date
CN1466058A CN1466058A (en) 2004-01-07
CN1248115C true CN1248115C (en) 2006-03-29

Family

ID=34142469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 02123769 Expired - Fee Related CN1248115C (en) 2002-06-24 2002-06-24 Method for readlizing universal test report

Country Status (1)

Country Link
CN (1) CN1248115C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007041901A1 (en) * 2005-10-14 2007-04-19 Honeywell International, Inc. System and method for formal verification of statecharts

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100412815C (en) * 2005-04-01 2008-08-20 上海宝信软件股份有限公司 Method for integrative debugging of application program under three-tier architecture
CN100401266C (en) * 2005-05-08 2008-07-09 中兴通讯股份有限公司 Data coding and decoding method and its coding and decoding device
CN100392615C (en) * 2005-08-08 2008-06-04 中国电子技术标准化研究所 Generating method of computer information processing product test sample file
CN100504809C (en) * 2005-08-25 2009-06-24 国际商业机器公司 Device and method for implementing test scenarios replay in different voice environment
CN1967580B (en) * 2006-04-04 2010-10-27 华为技术有限公司 Realizing method of electronic bill
CN102081597A (en) * 2009-12-01 2011-06-01 鸿富锦精密工业(深圳)有限公司 Failure analysis report generation system and method
CN103678107A (en) * 2012-09-21 2014-03-26 上海斐讯数据通信技术有限公司 Data processing method and system
CN105446866A (en) * 2014-08-22 2016-03-30 全智科技股份有限公司 Cross-platform testing device
CN104601768A (en) * 2014-12-22 2015-05-06 上海斐讯数据通信技术有限公司 Android mobile phone automatic testing system and testing method thereof
CN107229562A (en) * 2016-03-25 2017-10-03 展讯通信(天津)有限公司 A kind of test report automatic statistical analysis method and device
CN106021049A (en) * 2016-05-18 2016-10-12 中国电子科技集团公司第三十二研究所 Verification platform and establishment method for domestic operating system
CN106446598A (en) * 2016-11-15 2017-02-22 上海派森诺生物科技股份有限公司 Project paper automatic generation method
CN109542768A (en) * 2018-10-25 2019-03-29 惠州市德赛西威汽车电子股份有限公司 A kind of multi-lingual automatic testing method based on Labview
CN111008150B (en) * 2019-12-23 2024-03-22 杭州迪普科技股份有限公司 Test report generation method, device and equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007041901A1 (en) * 2005-10-14 2007-04-19 Honeywell International, Inc. System and method for formal verification of statecharts

Also Published As

Publication number Publication date
CN1466058A (en) 2004-01-07

Similar Documents

Publication Publication Date Title
CN1248115C (en) Method for readlizing universal test report
CN101661460B (en) Method and device for generating management system report
CN1277186C (en) Software interface testing method
US7284194B2 (en) XML based report generator
CN109582647B (en) Unstructured evidence file oriented analysis method and system
CN1851667A (en) Graphic user interface test method and system
US7797325B2 (en) Lightweight generic report generation tool
CN1728166A (en) Integration method for product data management system
CN1101027C (en) External character management apparatus
US20030233343A1 (en) System and method for generating custom business reports for a WEB application
CN1808428A (en) Information searching criteria presentation and editing system and method
CN1768337A (en) Systems and method for optimizing tag based protocol stream parsing
CN112597171A (en) Table relation visualization method and device, electronic equipment and storage medium
CN112596688A (en) Web end custom printing method based on TinyMCE rich text
CN1740969A (en) Data types with incorporated collation information
CN1567287A (en) Centralized broad spectrum report generation method based on expandable sign language
CN116303359A (en) Method for realizing multi-type document export of database structure
CN114546381A (en) Front-end page code file generation method and device, electronic equipment and storage medium
Chang et al. Supporting unified interface to wrapper generator in Integrated Information Retrieval
CN1567201A (en) Restructurable virtual device for software bus and chip structure
US7953714B2 (en) Method for maintaining parallelism in database processing using record identifier substitution assignment
CN111814444A (en) Table data summarizing and analyzing method based on BS (browser/server) architecture
CN111353283A (en) Automatic report generation method and generation system
CN1932760A (en) Development and execution platform
CN1471679A (en) Extensible style sheet designs using metal-tag information

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20060329

Termination date: 20150624

EXPY Termination of patent right or utility model