CN104461901A - Method and system for automatically generating test case - Google Patents

Method and system for automatically generating test case Download PDF

Info

Publication number
CN104461901A
CN104461901A CN201410816229.2A CN201410816229A CN104461901A CN 104461901 A CN104461901 A CN 104461901A CN 201410816229 A CN201410816229 A CN 201410816229A CN 104461901 A CN104461901 A CN 104461901A
Authority
CN
China
Prior art keywords
tested object
test data
tested
test
behavioral test
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
CN201410816229.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.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry 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 Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN201410816229.2A priority Critical patent/CN104461901A/en
Publication of CN104461901A publication Critical patent/CN104461901A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method and system for automatically generating a test case. The method comprises the following steps that a web test object is acquired and placed in a to-be-tested object database; a test object behavior database is searched for, and test behavior data corresponding to the web test object are acquired; the test behavior data are endowed to the web test object, and the test case is formed. According to the method and system, the work of acquiring the test object is automatically completed, the operation of manually adding the test object is omitted, the number of test personnel is reduced, test comprehensiveness is enhanced, test efficiency is improved, and time is saved.

Description

A kind of method and system of automatic generating test use case
Technical field
The invention belongs to testing and control field, particularly relate to a kind of method and system of automatic generating test use case.
Background technology
Becoming stronger day by day of software function, and for the high-quality requirement of software version, automatic test is applied to the various aspects of software test gradually, for huge contribution has been made in efficient software test.
As a part for automatic test, automatic generating test use case is absolutely necessary, the importance of test case to test macro is self-evident, the test case that outstanding tester writes can improve rationality and the work efficiency of test, therefore, how to allow computing machine automatically generate complete, reasonably test case be very crucial.
Summary of the invention
The invention provides a kind of method and system of automatic generating test use case, to solve the problem.
The invention provides a kind of method of automatic generating test use case, comprise the following steps:
Obtain web tested object and described web tested object is put into object database to be tested;
By searching tested object behavior database, obtain the behavioral test data that described web tested object is corresponding;
Give described web tested object by described behavioral test data, form test case.
The present invention also provides a kind of system of automatic generating test use case, comprises tested object acquisition module, behavioral test data acquisition module, test case formation module; Wherein, described tested object acquisition module forms module with described behavioral test data acquisition module, described test case respectively and is connected; Described behavioral test data acquisition module and described test case form module and are connected;
Described tested object acquisition module, after obtaining web tested object, puts into object database to be tested by described web tested object and described web tested object is sent to respectively described behavioral test data acquisition module, described test case formation module;
Described behavioral test data acquisition module, for by searching tested object behavior database, obtaining behavioral test data corresponding to described web tested object and described behavioral test data being sent to described test case formation module;
Described test case forms module, for giving described web tested object by described behavioral test data, forms test case.
Compared to prior art, according to the method and system of a kind of automatic generating test use case provided by the invention, automatically the acquisition work of tested object is completed, eliminate the operation manually adding tested object, decrease the quantity of tester, strengthen comprehensive, the raising testing efficiency of test, save time.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, and form a application's part, schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Figure 1 shows that the method processing flow chart of the automatic generating test use case of the embodiment of the present invention 1;
Figure 2 shows that the system construction drawing of the automatic generating test use case of the embodiment of the present invention 2.
Embodiment
Hereinafter also describe the present invention in detail with reference to accompanying drawing in conjunction with the embodiments.It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.
Figure 1 shows that the method processing flow chart of the automatic generating test use case of the embodiment of the present invention 1, comprise the following steps:
Step 101: obtain web tested object and described web tested object is put into object database to be tested;
Described web tested object refers to page elements.
Obtain web tested object and the process described web tested object being put into object database to be tested is: by traversal page front-end source file acquisition page elements, described page elements is put into object database to be tested.
Obtain page handle html.document, travel through the front-end source file acquisition page elements of each page and described page elements is put into object database to be tested according to certain sequence.
Described page front-end source file comprises: html file, jsp file.
Described page elements comprises: text box, menu, button.
Step 102: by searching tested object behavior database, obtains the behavioral test data that described web tested object is corresponding;
Described tested object behavior database On-board test object type and the behavioral test data table of comparisons.
By searching tested object behavior database, the process obtaining behavioral test data corresponding to described web tested object is;
Obtain the tested object type belonging to described web tested object;
By searching described tested object type in tested object behavior database and the behavioral test data table of comparisons, obtain corresponding behavioral test data.
Step 103: give described web tested object by described behavioral test data, forms test case.
Citing is below described in detail:
1) get out page front-end source file, obtain page handle html.document, travel through the front-end source file of each page, obtain the dom element of respective page and described dom element is put into object database to be tested according to certain sequence;
2) obtaining type belonging to different dom elements, by searching behavioral test database, obtaining the behavioral test data that different dom elements is corresponding,
Such as: when dom is a textbox type, by searching behavioral test database, the behavioral test data obtaining textbox type corresponding are: " empty data check ", " verification of character overlength ", " verification of character legitimacy ".
3) each dom element and corresponding behavioral test data are combined, form different test cases and described different test case is stored in test case data storehouse.
Figure 2 shows that the system construction drawing of the automatic generating test use case of the embodiment of the present invention 2, comprise tested object acquisition module, behavioral test data acquisition module, test case formation module; Wherein, described tested object acquisition module forms module with described behavioral test data acquisition module, described test case respectively and is connected; Described behavioral test data acquisition module and described test case form module and are connected;
Described tested object acquisition module, after obtaining web tested object, puts into object database to be tested by described web tested object and described web tested object is sent to respectively described behavioral test data acquisition module, described test case formation module;
Described behavioral test data acquisition module, for by searching tested object behavior database, obtaining behavioral test data corresponding to described web tested object and described behavioral test data being sent to described test case formation module;
Described test case forms module, for giving described web tested object by described behavioral test data, forms test case.
Compared to prior art, according to the method and system of a kind of automatic generating test use case provided by the invention, automatically the acquisition work of tested object is completed, eliminate the operation manually adding tested object, decrease the quantity of tester, strengthen comprehensive, the raising testing efficiency of test, save time.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (9)

1. a method for automatic generating test use case, is characterized in that, comprises the following steps:
Obtain web tested object and described web tested object is put into object database to be tested;
By searching tested object behavior database, obtain the behavioral test data that described web tested object is corresponding;
Give described web tested object by described behavioral test data, form test case.
2. method according to claim 1, is characterized in that, described web tested object refers to page elements.
3. method according to claim 2, is characterized in that, by traveling through page front-end source file acquisition page elements and described page elements being put into object database to be tested.
4. method according to claim 3, is characterized in that, obtains page handle html.document, travels through the front-end source file acquisition page elements of each page and described page elements is put into object database to be tested according to certain sequence.
5. the method according to claim 3 or 4, is characterized in that, described page front-end source file comprises: html file, jsp file.
6. the method according to Claims 2 or 3 or 4, is characterized in that, described page elements comprises: text box, menu, button.
7. method according to claim 1, is characterized in that, described tested object behavior database On-board test object type and the behavioral test data table of comparisons.
8. method according to claim 7, is characterized in that, by searching tested object behavior database, the process obtaining behavioral test data corresponding to described web tested object is;
Obtain the tested object type belonging to described web tested object;
By searching described tested object type in tested object behavior database and the behavioral test data table of comparisons, obtain corresponding behavioral test data.
9. a system for automatic generating test use case, is characterized in that, comprises tested object acquisition module, behavioral test data acquisition module, test case formation module; Wherein, described tested object acquisition module forms module with described behavioral test data acquisition module, described test case respectively and is connected; Described behavioral test data acquisition module and described test case form module and are connected;
Described tested object acquisition module, after obtaining web tested object, puts into object database to be tested by described web tested object and described web tested object is sent to respectively described behavioral test data acquisition module, described test case formation module;
Described behavioral test data acquisition module, for by searching tested object behavior database, obtaining behavioral test data corresponding to described web tested object and described behavioral test data being sent to described test case formation module;
Described test case forms module, for giving described web tested object by described behavioral test data, forms test case.
CN201410816229.2A 2014-12-23 2014-12-23 Method and system for automatically generating test case Pending CN104461901A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410816229.2A CN104461901A (en) 2014-12-23 2014-12-23 Method and system for automatically generating test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410816229.2A CN104461901A (en) 2014-12-23 2014-12-23 Method and system for automatically generating test case

Publications (1)

Publication Number Publication Date
CN104461901A true CN104461901A (en) 2015-03-25

Family

ID=52907990

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410816229.2A Pending CN104461901A (en) 2014-12-23 2014-12-23 Method and system for automatically generating test case

Country Status (1)

Country Link
CN (1) CN104461901A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104820640A (en) * 2015-05-19 2015-08-05 广州华多网络科技有限公司 Webpage testing method and device
CN105159825A (en) * 2015-08-20 2015-12-16 上海斐讯数据通信技术有限公司 Web testing method and system
CN105279092A (en) * 2015-11-20 2016-01-27 浪潮电子信息产业股份有限公司 Software testing method and apparatus
CN108490922A (en) * 2018-04-27 2018-09-04 北京新能源汽车股份有限公司 Generation method and device of unified diagnostic service test case
CN109086196A (en) * 2018-08-16 2018-12-25 郑州云海信息技术有限公司 A kind of calculator room equipment test case management system
CN109582582A (en) * 2018-12-06 2019-04-05 亚信科技(中国)有限公司 A kind of automated testing method and system of web interface
CN111930630A (en) * 2020-08-17 2020-11-13 电信科学技术第十研究所有限公司 Big data test case generation method and device based on data flow
CN112131136A (en) * 2020-11-24 2020-12-25 智道网联科技(北京)有限公司 Automatic interactive testing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1622022A1 (en) * 2004-07-22 2006-02-01 Siemens Aktiengesellschaft Automatic generation of test cases
CN101526919A (en) * 2009-04-29 2009-09-09 福建星网锐捷网络有限公司 Method for generating script files to test Web application software and device thereof
US8180679B2 (en) * 2004-11-23 2012-05-15 International Business Machines Corporation Computer-implemented method of performance testing software applications
CN104090844A (en) * 2014-07-18 2014-10-08 百度在线网络技术(北京)有限公司 Webpage automated testing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1622022A1 (en) * 2004-07-22 2006-02-01 Siemens Aktiengesellschaft Automatic generation of test cases
US8180679B2 (en) * 2004-11-23 2012-05-15 International Business Machines Corporation Computer-implemented method of performance testing software applications
CN101526919A (en) * 2009-04-29 2009-09-09 福建星网锐捷网络有限公司 Method for generating script files to test Web application software and device thereof
CN104090844A (en) * 2014-07-18 2014-10-08 百度在线网络技术(北京)有限公司 Webpage automated testing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
储久良: "《web前端开发技术实验与实践——HTML、CSS、JavaScript》", 30 June 2013, 清华大学出版社 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104820640A (en) * 2015-05-19 2015-08-05 广州华多网络科技有限公司 Webpage testing method and device
CN105159825A (en) * 2015-08-20 2015-12-16 上海斐讯数据通信技术有限公司 Web testing method and system
CN105279092A (en) * 2015-11-20 2016-01-27 浪潮电子信息产业股份有限公司 Software testing method and apparatus
CN108490922A (en) * 2018-04-27 2018-09-04 北京新能源汽车股份有限公司 Generation method and device of unified diagnostic service test case
CN108490922B (en) * 2018-04-27 2020-03-24 北京新能源汽车股份有限公司 Generation method and device of unified diagnostic service test case
CN109086196A (en) * 2018-08-16 2018-12-25 郑州云海信息技术有限公司 A kind of calculator room equipment test case management system
CN109086196B (en) * 2018-08-16 2021-10-22 郑州云海信息技术有限公司 Computer lab equipment test case management system
CN109582582A (en) * 2018-12-06 2019-04-05 亚信科技(中国)有限公司 A kind of automated testing method and system of web interface
CN111930630A (en) * 2020-08-17 2020-11-13 电信科学技术第十研究所有限公司 Big data test case generation method and device based on data flow
CN111930630B (en) * 2020-08-17 2024-01-05 电信科学技术第十研究所有限公司 Method and device for generating big data test case based on data stream
CN112131136A (en) * 2020-11-24 2020-12-25 智道网联科技(北京)有限公司 Automatic interactive testing method and device

Similar Documents

Publication Publication Date Title
CN104461901A (en) Method and system for automatically generating test case
CN104077401B (en) Data migration device and data migration method for database
CN103309801B (en) A kind of method and apparatus determining regression test scope
JP2014519080A5 (en)
EA201591779A1 (en) SYSTEM AND METHOD OF PERSONALIZATION OF DIALOGUES
CN101859303A (en) Metadata management method and management system
CN103823796A (en) System and method for translation
WO2014052661A3 (en) Security remediation
CN103678651A (en) Sensitive word searching method and device
CN102968349B (en) Remote sensing image data file completeness method of calibration and system
CN106919612A (en) A kind of processing method and processing device of SQL script of reaching the standard grade
CN104216987A (en) Timestamp-based method for capturing incremental data and supporting delete operation
CN105468352A (en) Query interface generation method and apparatus
CN103605514A (en) Front-end template processing method and device
CN106919501A (en) Static Analysis Method and instrument based on defect mode
CN105718468A (en) Method and device for building ODS layer of data warehouse
CN105046419A (en) Emolument data processing method and device
IN2015DE00970A (en)
CN103019944A (en) Device and method for testing based on code injection mode
CN104408167A (en) Method for expanding sqoop function in Hue based on django
CN105573972A (en) Report check formula generation method and apparatus
CN105243020B (en) A kind of automated testing method suitable for wide-area distribution type real-time data base
CN106484912A (en) A kind for the treatment of method and apparatus of cloud disk resource
CN105320603A (en) Locating system and method for browser page elements and automatic testing method thereof
CN104239070A (en) Software development method based on live documents

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20150325

RJ01 Rejection of invention patent application after publication