CN104750604A - Generating method and device for browser compatibility test case - Google Patents

Generating method and device for browser compatibility test case Download PDF

Info

Publication number
CN104750604A
CN104750604A CN201310747049.9A CN201310747049A CN104750604A CN 104750604 A CN104750604 A CN 104750604A CN 201310747049 A CN201310747049 A CN 201310747049A CN 104750604 A CN104750604 A CN 104750604A
Authority
CN
China
Prior art keywords
function point
tested
knowledge base
test cases
sample book
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.)
Granted
Application number
CN201310747049.9A
Other languages
Chinese (zh)
Other versions
CN104750604B (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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201310747049.9A priority Critical patent/CN104750604B/en
Publication of CN104750604A publication Critical patent/CN104750604A/en
Application granted granted Critical
Publication of CN104750604B publication Critical patent/CN104750604B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the developing technology of computer software, and specifically to a generating method and device for browser compatibility test case. The device for generating the browser compatibility test case comprises a static scanner, configured to generate a module of a to-be-tested function point list through scanning the page source program, wherein the to-be-tested function point list comprises function points detected in the page source program; a knowledge base, configured to store test samples matched with the function points; a knowledge base matcher, configured to find the test samples matched with the function points in the to-be-tested function point list in the knowledge base; and a test case document generator, configured to generate a test case document containing the test samples.

Description

The generation method and apparatus of browser compatibility test cases
Invention field
The present invention relates to develop computer software technology, particularly a kind of generation method and apparatus of browser compatibility test cases.
Background technology
Browser-safe sex chromosome mosaicism is otherwise known as the compatible or website compatibility issue of webpage, refers to that the display effect of webpage on various browser may the inconsistent and compatibling problem that produces between browser and webpage.Due to different browsers kernel, present engine, JavaScript interpreter and data store between there is difference, make the display effect of same webpage in some clients not reach desirable effect, thus have influence on the experience of user.
The current test for browser compatibility is generally by manually completing.Tester needs to make artificial compare of analysis to the effect that presents of the same page on different browsers.There is shortcomings in this mode.
Such as, numerous and the navigator product of same manufacturer also exists many versions due to Development of Web Browser manufacturer, therefore test environment is very huge, if will accomplish comprehensive covering, need drop into a large amount of testers and test the resources such as man-hour, cause cost very high.Secondly, test is general adopts general test cases, and reckon without the feature between each browser and difference, lack dirigibility, therefore useless in test process repetitive operation occupies sizable ratio.Moreover because test result depends on artificial judgment, with subjective colo(u)r, therefore accuracy rate cannot be guaranteed.
As can be seen here, in the urgent need to providing a kind of browser compatibility method of testing and the device that can overcome above-mentioned shortcoming.
Summary of the invention
An object of the present invention is to provide a kind of generation method of browser compatibility test cases, it can improve efficiency and the accuracy of compatibility test.
According to the generation method of the browser compatibility test cases of one embodiment of the invention, comprise the following steps:
Generate function point list to be tested, described function point list to be tested is included in the function point detected in page source program;
The test sample book matched with the function point in described function point list to be tested is searched in knowledge base; And
Generate the test cases file comprising described test sample book.
Preferably, in the generation method of above-mentioned browser compatibility test cases, the step generating function point list to be tested comprises:
If detect that described page source program exists grammar mistake, then stop the generation of described function point list to be tested, otherwise proceed to the following step;
According to the type of function point, search by the code scanning described page source program the function point wherein existed; And
The function point found is added into described function point list to be tested.
Preferably, in the generation method of above-mentioned browser compatibility test cases, the type of described function point comprises Javascript class, CSS class and HTML5 class.
Preferably, in the generation method of above-mentioned browser compatibility test cases, in knowledge base, search the test sample book matched with each function point in described function point list to be tested.
Preferably, in the generation method of above-mentioned browser compatibility test cases, in knowledge base, search the test sample book with the type matching of often kind of function point in described function point list to be tested.
Preferably, in the generation method of above-mentioned browser compatibility test cases, in knowledge base, search the test sample book matched with multiple function point or several functions vertex type in a parallel fashion.
Preferably, in the generation method of above-mentioned browser compatibility test cases, the type of described function point is renewable.
Of the present invention also have an object to be to provide a kind of device for generating browser compatibility test cases, and it can improve efficiency and the accuracy of compatibility test.
Comprising for the device generating browser compatibility test cases according to one embodiment of the invention:
Static scanning device, it is configured to pass scanning page source program to generate the module of function point list to be tested, and described function point list to be tested is included in the function point detected in page source program;
Knowledge base, it is configured to store the test sample book of mating with function point;
Knowledge base adaptation, it is configured in described knowledge base, search the test sample book matched with the function point in described function point list to be tested; And
Test cases file generator, it is configured to generate the test cases file comprising described test sample book.
Preferably, in the above-mentioned device for generating browser compatibility test cases, the test sample book of described knowledge base is renewable.
Preferably, in the above-mentioned device for generating browser compatibility test cases, the test sample book matched with multiple function point searched in a parallel fashion by described knowledge base adaptation in knowledge base.
Accompanying drawing explanation
From following detailed description by reference to the accompanying drawings, above and other objects of the present invention and advantage will be made more completely clear.
Fig. 1 is the block diagram of the device for generating browser compatibility test cases according to one embodiment of the invention.
Fig. 2 is the process flow diagram of the generation method of browser compatibility test cases according to one embodiment of the invention.
Fig. 3 is the process flow diagram of the function point list generation step S220 to be tested in process flow diagram shown in Fig. 2.
Fig. 4 is the process flow diagram searching test sample book step S230 in process flow diagram shown in Fig. 2.
Embodiment
More all sidedly the present invention is described referring to the accompanying drawing which illustrates illustrative examples of the present invention.But the present invention can realize by multi-form, and should not be read as each embodiment being only limitted to provide herein.The various embodiments described above provided are intended to make disclosure herein comprehensively complete, thus make the understanding of scope more comprehensive and accurate.
Such as " comprise " and the term of " comprising " and so on represents except having the unit and step that have in the specification and in the claims directly and clearly state, technical scheme of the present invention does not get rid of the situation had not by other unit of directly or clearly stating and step yet.
Embodiments of the invention are specifically described below by accompanying drawing.
Fig. 1 is the block diagram of the device for generating browser compatibility test cases according to one embodiment of the invention.
As shown in Figure 1, the device 10 for generating browser compatibility test cases comprises static scanning device 110, knowledge base adaptation 120, knowledge base 130 and test cases file generator 140.
In the present embodiment, after page source program to be tested is loaded into internal memory, static scanning device 110 scans to search the function point wherein comprised to it.In this manual, refer to can certain concrete operation flow of complete independently for function point.Preferably, function point is categorized as Javascript class (it meets Javascript script specification), CSS class (it meets Cascading Style Sheet specification) and HTML5 class (it meets HTML5 programming language specification) etc. by embodiments of the invention.The function point found also is put into function point list to be tested and is exported knowledge base adaptation 120 to by static scanning device 110.
Subsequently, the test sample book matched with each function point in function point list to be tested inquired about by knowledge base adaptation 120 in knowledge base 130.If there is the test sample book of coupling, be then added into test sample book list, otherwise, then generate the message lacking the test sample book of coupling and be stored in knowledge base 130, so that knowledge base maintenance personnel increase suitable test sample book for these function points.The content of knowledge base 130 is renewable, that is, can increase, delete and revise test sample book wherein.Preferably, knowledge base adaptation 120 can perform query manipulation to improve processing speed to knowledge base 130 in a parallel fashion.
After the matching inquiry completing all functions point treated in test function point list, knowledge base adaptation 120 exports test sample book list to test cases file generator 140, by the latter's creating test case file.The test sample book matched with each function point in function point list to be tested that can comprise in test cases file that knowledge base adaptation 120 finds.Or in order to reduce test job amount, can only comprise that knowledge base adaptation 120 finds with test sample book that is often kind of function point type matching in function point list to be tested in test cases file.
Fig. 2 is the process flow diagram of the generation method of browser compatibility test cases according to one embodiment of the invention.Exemplarily, here hypothesis adopt shown in Fig. 1 for generating the device of browser compatibility test cases to realize the present embodiment, but will recognize that from the following description, the method for the present embodiment does not also rely on specific structure.
As shown in Figure 2, in step S210, page source program to be tested is loaded in internal memory.Enter step S220 subsequently, static scanning device 110 scans to search the function point wherein comprised to this page source program, and generates the function point list to be tested comprising the function point found.
Enter step S230 subsequently, knowledge base adaptation 120 is inquired about with the test sample book that matches of each function point in function point list to be tested and is generated test sample book list in knowledge base 130.
Then step S240 is entered, test cases file generator 140 generates the test cases file of corresponding format according to the selection of user or default option, and form described here such as includes but not limited to the file layout such as Microsoft word, Microsoft excel.
Fig. 3 is the process flow diagram of the function point list generation step S220 to be tested in process flow diagram shown in Fig. 2.
As shown in Figure 3, in step S221, static scanning device 110 carries out scanning to determine wherein whether there is grammar mistake for page source program to be tested, if existed, then exits the flow process shown in whole Fig. 2, otherwise, then perform step S222.
Step S222 continues the step S210 in Fig. 2.In this step, the Javascript class function point that wherein may exist searched by the code that static scanning device 110 scans page source program, and the Javascript class function point found is added function point list to be tested.
Enter step S223 subsequently, the CSS class function point that wherein may exist searched by the code that static scanning device 110 scans page source program, and the CSS class function point found is added function point list to be tested.
Enter step S224 subsequently, the HTML5 class function point that wherein may exist searched by the code that static scanning device 110 scans page source program, and the HTML5 class function point found is added function point list to be tested.
Enter step S225 subsequently, other control class function point that wherein may exist searched by the code that static scanning device 110 scans page source program, and other control class function point found is added function point list to be tested.
Finally enter step S226, static scanning device exports function point list to be tested to knowledge base adaptation 120.Step S230 in process flow diagram shown in Fig. 2 will be entered after completing steps S226.
Fig. 4 is the process flow diagram searching test sample book step in process flow diagram shown in Fig. 2.
As shown in Figure 4, step S231 continues the step S210 in Fig. 2 or the step S226 in Fig. 3.In step S231, first knowledge base adaptation 120 determines whether each function point in function point list to be tested is traversed, whether there is the function point not performing matching inquiry operation in other words, if there is the function point not performing matching inquiry operation, then enter step step S232, otherwise, then step S233 is entered.
In step S232, knowledge base adaptation 120 such as extracts in function point list to be tested the function point being not yet performed matching inquiry operation according to storage order.
Enter step S234 subsequently, knowledge base adaptation 120 is accessed knowledge base 130 and is determined whether there is the test sample book of mating with the function point extracted in step S232 in knowledge base 130.If there is the test sample book of coupling, then enter step S235, the test sample book found is added test sample book list; Otherwise then enter step S236, generation lacks the message of the test sample book of coupling and is stored in knowledge base 130.
After execution step S235 and S236, the flow process shown in Fig. 4 returns step S231.
Another branching step S233 after getting back to step S231, in this step, knowledge base adaptation 120 exports test sample book list to test cases file generator 140.Alternatively, in this step, knowledge base adaptation 120 can be edited test sample book list, and the function point for same-type only retains one or several test sample books.
After step S233, the flow process shown in Fig. 4 will enter the step S240 in Fig. 2.
It is worthy of note, although in the present embodiment, knowledge base adaptation 120 performs matching inquiry operation one by one according to the order function point treated in test function point list, but in order to improve processing speed, knowledge base adaptation also in a parallel fashion, can perform matching inquiry operation to multiple function point simultaneously.
Compared with prior art, embodiments of the invention have following advantages.
First, by static scanning page source program and read instruction in page source program, code carrys out analytic function point, greatly can reduce the workload of tester.
Secondly, according to the content in browser compatibility knowledge base, for function point generates the compatibility test case file of coupling automatically, this significantly reduces the working load of Test Case Design personnel, and test cases is more simplified, eliminate unnecessary content measurement, thus significantly improve testing efficiency.
Owing to when not deviating from essence spirit of the present invention, can implement the present invention in a variety of manners, therefore above-described embodiment is only illustrative and not restrictive.Scope of the present invention is defined by claims, and the various change do describing mode above or variation all belong to the protection domain of claims.

Claims (10)

1. a generation method for browser compatibility test cases, is characterized in that, comprise the following steps:
Generate function point list to be tested, described function point list to be tested is included in the function point detected in page source program;
The test sample book matched with the function point in described function point list to be tested is searched in knowledge base; And
Generate the test cases file comprising described test sample book.
2. the generation method of browser compatibility test cases according to claim 1, wherein, the step generating function point list to be tested comprises:
If detect that described page source program exists grammar mistake, then stop the generation of described function point list to be tested, otherwise proceed to the following step;
According to the type of function point, search by the code scanning described page source program the function point wherein existed; And
The function point found is added into described function point list to be tested.
3. the generation method of browser compatibility test cases according to claim 2, wherein, the type of described function point comprises Javascript class, CSS class and HTML5 class.
4. the generation method of browser compatibility test cases according to claim 2, wherein, searches the test sample book matched with each function point in described function point list to be tested in knowledge base.
5. the generation method of browser compatibility test cases according to claim 2, wherein, searches the test sample book with the type matching of often kind of function point in described function point list to be tested in knowledge base.
6. the generation method of the browser compatibility test cases according to claim 4 or 5, wherein, searches the test sample book matched with multiple function point or several functions vertex type in a parallel fashion in knowledge base.
7. the generation method of browser compatibility test cases according to claim 2, wherein, the type of described function point is renewable.
8. for generating a device for browser compatibility test cases, it is characterized in that, comprising:
Static scanning device, it is configured to pass scanning page source program to generate the module of function point list to be tested, and described function point list to be tested is included in the function point detected in page source program;
Knowledge base, it is configured to store the test sample book of mating with function point;
Knowledge base adaptation, it is configured in described knowledge base, search the test sample book matched with the function point in described function point list to be tested; And
Test cases file generator, it is configured to generate the test cases file comprising described test sample book.
9. the device for generating browser compatibility test cases according to claim 8, wherein, the test sample book of described knowledge base is renewable.
10. the device for generating browser compatibility test cases according to claim 8, wherein, the test sample book matched with multiple function point searched in a parallel fashion by described knowledge base adaptation in knowledge base.
CN201310747049.9A 2013-12-30 2013-12-30 The generation method and device of browser compatibility test cases Active CN104750604B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310747049.9A CN104750604B (en) 2013-12-30 2013-12-30 The generation method and device of browser compatibility test cases

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310747049.9A CN104750604B (en) 2013-12-30 2013-12-30 The generation method and device of browser compatibility test cases

Publications (2)

Publication Number Publication Date
CN104750604A true CN104750604A (en) 2015-07-01
CN104750604B CN104750604B (en) 2017-08-25

Family

ID=53590338

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310747049.9A Active CN104750604B (en) 2013-12-30 2013-12-30 The generation method and device of browser compatibility test cases

Country Status (1)

Country Link
CN (1) CN104750604B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708726A (en) * 2015-11-17 2017-05-24 北京京东尚科信息技术有限公司 Page compatibility testing system and method
CN107291614A (en) * 2017-05-04 2017-10-24 平安科技(深圳)有限公司 File method for detecting abnormality and electronic equipment
CN108549603A (en) * 2018-04-11 2018-09-18 平安普惠企业管理有限公司 Generating method of test project, device, computer equipment and storage medium
CN111767217A (en) * 2020-06-24 2020-10-13 中国工商银行股份有限公司 JS unit test case generation method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192194A (en) * 2007-01-19 2008-06-04 中兴通讯股份有限公司 Test case design method based on test case database
CN101251798A (en) * 2008-04-01 2008-08-27 中兴通讯股份有限公司 Test case generating method based on relationship
WO2011079685A1 (en) * 2009-12-30 2011-07-07 北京世纪高通科技有限公司 Method and device for magaging regression test
CN103186463A (en) * 2011-12-30 2013-07-03 阿里巴巴集团控股有限公司 Method and system for determining testing range of software
CN103309807A (en) * 2013-05-31 2013-09-18 中国联合网络通信集团有限公司 Program test method and platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101192194A (en) * 2007-01-19 2008-06-04 中兴通讯股份有限公司 Test case design method based on test case database
CN101251798A (en) * 2008-04-01 2008-08-27 中兴通讯股份有限公司 Test case generating method based on relationship
WO2011079685A1 (en) * 2009-12-30 2011-07-07 北京世纪高通科技有限公司 Method and device for magaging regression test
CN103186463A (en) * 2011-12-30 2013-07-03 阿里巴巴集团控股有限公司 Method and system for determining testing range of software
CN103309807A (en) * 2013-05-31 2013-09-18 中国联合网络通信集团有限公司 Program test method and platform

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张盈谦: "本体知识库在软件测试脚本自动生成中的应用", 《中国优秀硕士学位论文全文数据库信息科技辑》 *
陈江勇: "Web自动化测试框架的设计与实现", 《福建师范大学学报》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106708726A (en) * 2015-11-17 2017-05-24 北京京东尚科信息技术有限公司 Page compatibility testing system and method
CN107291614A (en) * 2017-05-04 2017-10-24 平安科技(深圳)有限公司 File method for detecting abnormality and electronic equipment
CN107291614B (en) * 2017-05-04 2020-10-30 平安科技(深圳)有限公司 File abnormity detection method and electronic equipment
CN108549603A (en) * 2018-04-11 2018-09-18 平安普惠企业管理有限公司 Generating method of test project, device, computer equipment and storage medium
CN111767217A (en) * 2020-06-24 2020-10-13 中国工商银行股份有限公司 JS unit test case generation method and device
CN111767217B (en) * 2020-06-24 2024-02-02 中国工商银行股份有限公司 JS unit test case generation method and device

Also Published As

Publication number Publication date
CN104750604B (en) 2017-08-25

Similar Documents

Publication Publication Date Title
CN110674429B (en) Method, apparatus, device and computer readable storage medium for information retrieval
US9588941B2 (en) Context-based visualization generation
US11651014B2 (en) Source code retrieval
CN109308254B (en) Test method, test device and test equipment
CN113282955B (en) Method, system, terminal and medium for extracting privacy information in privacy policy
US20210240758A1 (en) Method of image searching based on artificial intelligence and apparatus for performing the same
CN111367595B (en) Data processing method, program running method, device and processing equipment
US11340871B1 (en) Software-development tool with feedback notifications for improving software specifications
CN104750604A (en) Generating method and device for browser compatibility test case
CN107015986B (en) Method and device for crawling webpage by crawler
CN115562656A (en) Page generation method and device, storage medium and computer equipment
CN112487212A (en) Method and device for constructing domain knowledge graph
CN107066302B (en) Defect inspection method, device and service terminal
CN111813443A (en) Method and tool for automatically filling code sample by JavaFX
CN112989256B (en) Method and device for identifying web fingerprint in response information
CN113901169A (en) Information processing method, information processing device, electronic equipment and storage medium
CN110750297A (en) Python code reference information generation method based on program analysis and text analysis
CN108255891B (en) Method and device for judging webpage type
KR102682244B1 (en) Method for learning machine-learning model with structured ESG data using ESG auxiliary tool and service server for generating automatically completed ESG documents with the machine-learning model
CN116560631A (en) Method and device for generating machine learning model code
CN104834643A (en) Fast common gateway interface file analysis method and apparatus
CN107168627B (en) Text editing method and device for touch screen
CN115186240A (en) Social network user alignment method, device and medium based on relevance information
CN111198934A (en) Information processing method and related equipment
CN115454382A (en) Demand processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant