CN108959067A - Test method, device and the computer readable storage medium of search engine - Google Patents
Test method, device and the computer readable storage medium of search engine Download PDFInfo
- Publication number
- CN108959067A CN108959067A CN201810546878.3A CN201810546878A CN108959067A CN 108959067 A CN108959067 A CN 108959067A CN 201810546878 A CN201810546878 A CN 201810546878A CN 108959067 A CN108959067 A CN 108959067A
- Authority
- CN
- China
- Prior art keywords
- test
- data
- search engine
- tested
- test script
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a kind of test methods of search engine, this method comprises: determining the interface to be tested of tested search engine, and the corresponding test case data of interface to be tested and the first test script corresponding with test case data is obtained from default test script library;Based on interface to be tested, test case data corresponding with interface to be tested is executed to obtain search result;Determine anticipatory data corresponding with test case data;The first test script corresponding with test case data is executed, carries out search result and anticipatory data to assert comparison;Above-mentioned steps are repeated, until the test case data and the first test script in test script library are all finished, and test report are generated according to the executive condition of the first test script.The present invention also propose a kind of search engine test device and a kind of computer readable storage medium.The testing efficiency of present invention raising testing engine.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of test methods of search engine, device and computer
Readable storage medium storing program for executing.
Background technique
Search engine refers to according to certain strategy, with specific computer program collects information from internet,
After carrying out tissue and processing to information, retrieval service is provided for user, is by what the relevant information of user search showed user
System, the function of being realized are exactly data prediction, establish index and receive inquiry request and return the result in short.Its
In, data prediction refers to according to search engine requirement, and the data obtained through various channels are converted into structural data;It establishes
Index, which refers to, establishes corresponding index according to the various fields in structural data;Receive inquiry request and return the result to be to instigate
It is retrieved with index of the searching keyword to foundation, and returns to structural data pointed by the index retrieved.
In general, the update of search engine version is very frequent, and will be to update after each update after
Search engine carry out functional test to judge whether it meets the requirements.But existing test method generally uses manual type
Search engine to be tested is tested.I.e. predetermined multiple search pipe detections are input to be tested by tester
In search engine, search result is obtained, search result is assessed by tester, testing efficiency is low.
Summary of the invention
The present invention provides test method, device and the computer readable storage medium of a kind of search engine, main purpose
It is technical problem low to the testing efficiency of search engine in the prior art.
To achieve the above object, the present invention also provides a kind of test methods of search engine, this method comprises:
The interface to be tested for determining tested search engine obtains survey corresponding with interface to be tested from default test script library
Try case data and the first test script corresponding with the test case data;
Based on the interface to be tested, executes test case data corresponding with the interface to be tested and tied with obtaining search
Fruit;
Determine anticipatory data corresponding with the test case data;
The first test script corresponding with the test case data is executed, by described search result and the expected numbers
According to carrying out asserting comparison;
Above-mentioned steps are repeated, until test case data and first test script in the test script library
It is all finished, and test report is generated according to the executive condition of the first test script.
It optionally, include search key, search rule and ordering rule, the determination in the test case data
The step of anticipatory data corresponding with the test case data includes:
It determines search key, search rule and the ordering rule in the test case data, is closed based on described search
Keyword, search rule, ordering rule and described search engine index database determine the anticipatory data.
Optionally, the determination be tested search engine interface to be tested, from default test script library obtain with it is to be measured
It is described before the step of corresponding test case data of mouth of trying and the first test script corresponding with the test case data
Method further comprises the steps of:
Current time is monitored in real time apart from the time interval that last time tests;
When time interval reaches prefixed time interval, start test assignment, executes the determination and be tested search engine
Interface to be tested, from default test script library obtain corresponding with interface to be tested test case data and with the test case
The step of data corresponding first test script.
Optionally, the method also includes steps:
The second test script write in advance is obtained, is held on the database of the index database docking of the tested search engine
Row second test script, to update the database, wherein described search engine has data more in the judgement database
When new operation, according to data pick-up logic from the data that database extraction updates to index database;
After detecting that the tested search engine executes data pick-up operation to the database, determination is drawn into index
More new data in library;
Expected extraction data are determined according to second test script, and determining more new data and the expection are extracted
Data compare, to judge whether the data pick-up logic is wrong;
If the more new data is consistent with the expected data that extract, determine that the data pick-up is logically true;
If the more new data and the expected data that extract are inconsistent, determine that the data pick-up logic is wrong, it is defeated
Make mistake prompt information.
Optionally, described to obtain the second test script write in advance, it is docked in the index database of the tested search engine
Database on after the step of executing second test script, the method also includes steps:
The prompt information that data change is sent to the tested search engine, so that described search engine is according to the prompt
Information judges whether the database has data to update operation, wherein when described search engine is receiving the prompt information
When, determine there are data to update operation in the database.
In addition, to achieve the above object, the present invention also provides a kind of test device of search engine, which includes storage
Device and processor are stored with the test program for the search engine that can be run on the processor in the memory, described to search
It indexes when the test program held up is executed by the processor and realizes following steps:
The interface to be tested for determining tested search engine obtains survey corresponding with interface to be tested from default test script library
Try case data and the first test script corresponding with the test case data;
Based on the interface to be tested, executes test case data corresponding with the interface to be tested and tied with obtaining search
Fruit;
Determine anticipatory data corresponding with the test case data;
The first test script corresponding with the test case data is executed, by described search result and the expected numbers
According to carrying out asserting comparison;
Above-mentioned steps are repeated, until test case data and first test script in the test script library
It is all finished, and test report is generated according to the executive condition of the first test script.
Optionally, the test program of described search engine can also be executed by the processor, be searched with being tested in the determination
Index the interface to be tested held up, from default test script library obtain test case data corresponding with interface to be tested and with it is described
Before the step of test case data corresponding first test script, also realization following steps:
Current time is monitored in real time apart from the time interval that last time tests;
When time interval reaches prefixed time interval, start test assignment, executes the determination and be tested search engine
Interface to be tested, from default test script library obtain corresponding with interface to be tested test case data and with the test case
The step of data corresponding first test script.
Optionally, the test program of described search engine can also be executed by the processor, to realize following steps:
The second test script write in advance is obtained, is held on the database of the index database docking of the tested search engine
Row second test script, to update the database, wherein described search engine has data more in the judgement database
When new operation, according to data pick-up logic from the data that database extraction updates to index database;
After detecting that the tested search engine executes data pick-up operation to the database, determination is drawn into index
More new data in library;
Expected extraction data are determined according to second test script, and determining more new data and the expection are extracted
Data compare, to judge whether the data pick-up logic is wrong;
If the more new data is consistent with the expected data that extract, determine that the data pick-up is logically true;
If the more new data and the expected data that extract are inconsistent, determine that the data pick-up logic is wrong, it is defeated
Make mistake prompt information.
Optionally, the test program of described search engine can also be executed by the processor, to compile in advance in the acquisition
The second test script write executes second test script on the database of the index database docking of the tested search engine
The step of after, also realization following steps:
The prompt information that data change is sent to the tested search engine, so that described search engine is according to the prompt
Information judges whether the database has data to update operation, wherein when described search engine is receiving the prompt information
When, determine there are data to update operation in the database.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium
The test program of search engine is stored on storage medium, the test program of described search engine can be handled by one or more
The step of device executes, test method to realize search engine as described above.
Test method, device and the computer readable storage medium of search engine proposed by the present invention determine tested search
The interface to be tested of engine obtains test case data corresponding with interface to be tested from default test script library and uses with test
Number of cases is according to corresponding first test script;Based on interface to be tested, execute test case data corresponding with interface to be tested with
Obtain search result;Determine anticipatory data corresponding with test case data;Corresponding with test case data first is executed to survey
Training sheet carries out search result and anticipatory data to assert comparison;Above-mentioned steps are repeated, until in test script library
Test case data and the first test script are all finished, and generate test report according to the executive condition of the first test script
It accuses.In the present solution, obtaining search result by test case data, the first test script is based on by actual search results and expection
Data carry out asserting comparison and generate test report, realize full-automatic test process, are manually entered without tester
Keyword, without artificial contrast as a result, improving the testing efficiency of search engine.
Detailed description of the invention
Fig. 1 is the flow diagram of the test method for the search engine that one embodiment of the invention provides;
Fig. 2 is the schematic diagram of internal structure of the test device for the search engine that one embodiment of the invention provides;
Fig. 3 is the module of the test program of search engine in the test device for the search engine that one embodiment of the invention provides
Schematic diagram.
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 present invention provides a kind of test method of search engine.Shown in referring to Fig.1, searched for what one embodiment of the invention provided
Index the flow diagram for the test method held up.This method can be executed by device, which can be by software and/or hard
Part is realized.
In the present embodiment, the test method of search engine includes:
Step S10 determines the interface to be tested of tested search engine, obtains and interface to be tested from default test script library
Corresponding test case data and the first test script corresponding with the test case data.
Step S20 is based on the interface to be tested, executes test case data corresponding with the interface to be tested to obtain
Take search result.
In the method for the present embodiment, there are multiple need API (Application to be tested on the backstage of search engine
Programming Interface, application programming interface), for each API to be tested, tester can be
It writes one or more the first test script, wherein first test script corresponds to one or more test and uses
Number of cases evidence includes search key, search rule and ordering rule in the test case data.It will be for search engine
First test script of all API creations and associated test case data are stored to test script library.
In the method for the present embodiment, the first test script and test case data are decoupled, test case data is first carried out
Search result is obtained from search engine to be tested, reuses the first test script for actual search results and expected search knot
Fruit compares.
Pre-set multiple search keys, multiple search rules, multiple sortords;The therefrom suitable search of selection
Keyword, search rule, sortord write a test case data.Meanwhile tester needs previously according to each survey
Case data is tried, the corresponding expected search result of each test case data is built.Specifically, due to the test case
It include search key, search rule and ordering rule in data, tester can be according to search key, search rule
Anticipatory data is determined from index database with ordering rule, it is contemplated that data are use according to search key, search rule and sequence
Rule scans in index database, it is contemplated that the data that should be got.
The API to be tested for determining tested search engine obtains survey corresponding with interface to be tested from default test script library
Try case data and the first test script corresponding with test case data.API implementation of test cases data to be tested are first based on,
It is based on the API Access search engine, is got and search key, search rule and the ordering rule in test case data
Corresponding search result.
Step S30 determines anticipatory data corresponding with the test case data.
Step S40 executes the first test script corresponding with the test case data, by described search result and institute
Anticipatory data is stated to carry out asserting comparison.
Step S50, repeats above-mentioned steps, until the test case data and described first in the test script library
Test script is all finished, and generates test report according to the executive condition of the first test script.
Tester determines previously according to search key, search rule, the sortord in test case data and corresponds to
Anticipatory data.After the completion of test case executes, the first test script is executed.It is understood that due to test script library
In have multiple first test scripts, each first test script corresponds to multiple test case datas again, therefore, can be multiple
After test case data all executes completion, the first test script is executed.Execute the first test script with by search result with
Corresponding anticipatory data carries out asserting comparison.It repeats the above process, until the test case data and first in test script library
Test script is all finished, and generates test report according to the implementing result of script and test coverage situation.
Optionally, as an implementation, fixed time test task is pre-created, can be and start at interval of preset time
Test assignment, such as: daily 8 points of startings test assignment executes the test case data in test script library and first and surveys
Training sheet.When reaching the time of setting, alternatively, when the time interval tested twice reaches preset time interval, starting
Test assignment is using the first test script and corresponding test case data being pre-created to search engine to be tested
API tested.
In addition, writing about the first test script, tester can based on previously-introduced automated test frame,
And the first test script is write in the universal method library encapsulated in advance.The execution of first test script will also be based on above-mentioned automation
Test frame, and in the implementation procedure of script, need the method in called side Faku County.
The test method for the search engine that the present embodiment proposes determines the interface to be tested of tested search engine, from default
Test script library obtains and the corresponding test case data of interface to be tested and the first test foot corresponding with test case data
This;Based on interface to be tested, test case data corresponding with interface to be tested is executed to obtain search result;It determines and tests
The corresponding anticipatory data of case data;The first test script corresponding with test case data is executed, by search result and in advance
Issue is according to carrying out asserting comparison;Above-mentioned steps are repeated, until test case data and the first test in test script library
Script is all finished, and generates test report according to the executive condition of the first test script.In the present solution, being used by test
Example data acquisition search result, actual search results based on the first test script carried out asserting comparison and be generated with anticipatory data
Test report realizes full-automatic test process, keyword is manually entered without tester, ties without artificial contrast
Fruit improves the testing efficiency of search engine.
Further, in other embodiments, this method further comprises the steps of:
The second test script write in advance is obtained, is held on the database of the index database docking of the tested search engine
Row second test script, to update the database, wherein described search engine has data more in the judgement database
When new operation, according to data pick-up logic from the data that database extraction updates to index database;
After detecting that the tested search engine executes data pick-up operation to the database, determination is drawn into index
More new data in library;
Expected extraction data are determined according to second test script, and determining more new data and the expection are extracted
Data compare, to judge whether the data pick-up logic is wrong;
If the more new data is consistent with the expected data that extract, determine that the data pick-up is logically true;
If the more new data and the expected data that extract are inconsistent, determine that the data pick-up logic is wrong, it is defeated
Make mistake prompt information.
Search engine is according to data pick-up logic by the unstructured data in the database of each operation system of docking
It extracts, is stored after being converted into structural data, and according to the data update status of operation system, it is in real time or fixed
When from operation system according to data pick-up logic extract data, addition or update arrive index database.
In the embodiment, the data in one database are updated by the second test script, in the updated, by searching for
Engine extracts the data of update according to data pick-up logic from the database, due to writing for tester
When two test scripts, which data clearly will be updated, i.e., expected extraction data can be determined according to the second test script.Cause
This search engine according to data pick-up logic after extracting the data of update in the database, by determining more new data and pre-
Phase extracts data and compares, then may determine that whether data pick-up logic is wrong.
Wherein, search engine more new search data by way of message trigger, message trigger can have following implemented side
Update message is actively issued by the operation system that generation data update, search engine is taken out according to update message from operation system likes:
Take the data of update;Alternatively, real-time monitoring of the search engine by the database to operation system, when having listened to data variation
When, the data for updating part are extracted;Alternatively, by search engine periodically from the database of operation system do increment or
The data pick-up of full dose.
Alternatively, as an implementation, the second test script write in advance is obtained, in the tested search engine
On the database of index database docking after the step of executing second test script, the method also includes steps: to described
Tested search engine sends the prompt information of data change, so that described search engine judges the number according to the prompt information
Whether there are data to update operation according to library, wherein when described search engine is when receiving the prompt information, to determine the data
There are data to update operation in library.Search engine starts the data for extracting update from database according to data pick-up logic.
The present invention also provides a kind of test devices of search engine.Referring to shown in Fig. 2, provided for one embodiment of the invention
The schematic diagram of internal structure of the test device of search engine.
In the present embodiment, the test device 1 of search engine can be PC (Personal Computer, PC),
It is also possible to the terminal devices such as smart phone, tablet computer, portable computer.The test device 1 of the search engine includes at least
Memory 11, processor 12, communication bus 13 and network interface 14.
Wherein, memory 11 include at least a type of readable storage medium storing program for executing, the readable storage medium storing program for executing include flash memory,
Hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), magnetic storage, disk, CD etc..Memory 11
It can be the internal storage unit of the test device 1 of search engine, such as the test dress of the search engine in some embodiments
Set 1 hard disk.Memory 11 is also possible to the External memory equipment of the test device 1 of search engine in further embodiments,
Such as the plug-in type hard disk being equipped in the test device 1 of search engine, intelligent memory card (Smart Media Card, SMC), peace
Digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, memory 11 can also be wrapped both
The internal storage unit for including the test device 1 of search engine also includes External memory equipment.Memory 11 can be not only used for depositing
Storage be installed on search engine test device 1 application software and Various types of data, such as search engine test program 01 generation
Code etc., can be also used for temporarily storing the data that has exported or will export.
Processor 12 can be in some embodiments a central processing unit (Central Processing Unit,
CPU), controller, microcontroller, microprocessor or other data processing chips, the program for being stored in run memory 11
Code or processing data, such as execute the test program 01 etc. of search engine.
Communication bus 13 is for realizing the connection communication between these components.
Network interface 14 optionally may include standard wireline interface and wireless interface (such as WI-FI interface), be commonly used in
Communication connection is established between the device 1 and other electronic equipments.
Optionally, which can also include user interface, and user interface may include display (Display), input
Unit such as keyboard (Keyboard), optional user interface can also include standard wireline interface and wireless interface.It is optional
Ground, in some embodiments, display can be light-emitting diode display, liquid crystal display, touch-control liquid crystal display and OLED
(Organic Light-Emitting Diode, Organic Light Emitting Diode) touches device etc..Wherein, display can also be appropriate
Referred to as display screen or display unit, for be shown in the information handled in the test device 1 of search engine and for show can
Depending on the user interface changed.
Fig. 2 illustrates only the test device of the search engine of the test program 01 with component 11-14 and search engine
1, it will be appreciated by persons skilled in the art that structure shown in fig. 1 does not constitute the limit to the test device 1 of search engine
It is fixed, it may include perhaps combining certain components or different component layouts than illustrating less perhaps more components.
In 1 embodiment of device shown in Fig. 2, the test program 01 of search engine is stored in memory 11;Processor
Following steps are realized when the test program 01 of the search engine stored in 12 execution memories 11:
The interface to be tested for determining tested search engine obtains survey corresponding with interface to be tested from default test script library
Try case data and the first test script corresponding with the test case data.
Based on the interface to be tested, executes test case data corresponding with the interface to be tested and tied with obtaining search
Fruit.
Determine anticipatory data corresponding with the test case data.
The first test script corresponding with the test case data is executed, by described search result and the expected numbers
According to carrying out asserting comparison.
Above-mentioned steps are repeated, until test case data and first test script in the test script library
It is all finished, and test report is generated according to the executive condition of the first test script.
In the method for the present embodiment, there are multiple need API (Application to be tested on the backstage of search engine
Programming Interface, application programming interface), for each API to be tested, tester can be
It writes one or more the first test script, wherein first test script corresponds to one or more test and uses
Number of cases evidence includes search key, search rule and ordering rule in the test case data.It will be for search engine
First test script of all API creations and associated test case data are stored to test script library.
In the method for the present embodiment, the first test script and test case data are decoupled, test case data is first carried out
Search result is obtained from search engine to be tested, reuses the first test script for actual search results and expected search knot
Fruit compares.
Pre-set multiple search keys, multiple search rules, multiple sortords;The therefrom suitable search of selection
Keyword, search rule, sortord write a test case data.Meanwhile tester needs previously according to each survey
Case data is tried, the corresponding expected search result of each test case data is built.Specifically, due to the test case
It include search key, search rule and ordering rule in data, tester can be according to search key, search rule
Anticipatory data is determined from index database with ordering rule, it is contemplated that data are use according to search key, search rule and sequence
Rule scans in index database, it is contemplated that the data that should be got.
The API to be tested for determining tested search engine obtains survey corresponding with interface to be tested from default test script library
Try case data and the first test script corresponding with test case data.API implementation of test cases data to be tested are first based on,
It is based on the API Access search engine, is got and search key, search rule and the ordering rule in test case data
Corresponding search result.
Tester determines previously according to search key, search rule, the sortord in test case data and corresponds to
Anticipatory data.After the completion of test case executes, the first test script is executed.It is understood that due to test script library
In have multiple first test scripts, each first test script corresponds to multiple test case datas again, therefore, can be multiple
After test case data all executes completion, the first test script is executed.Execute the first test script with by search result with
Corresponding anticipatory data carries out asserting comparison.It repeats the above process, until the test case data and first in test script library
Test script is all finished, and generates test report according to the implementing result of script and test coverage situation.
Optionally, as an implementation, fixed time test task is pre-created, can be and start at interval of preset time
Test assignment, such as: daily 8 points of startings test assignment executes the test case data in test script library and first and surveys
Training sheet.When reaching the time of setting, alternatively, when the time interval tested twice reaches preset time interval, starting
Test assignment is using the first test script and corresponding test case data being pre-created to search engine to be tested
API tested.
In addition, writing about the first test script, tester can based on previously-introduced automated test frame,
And the first test script is write in the universal method library encapsulated in advance.The execution of first test script will also be based on above-mentioned automation
Test frame, and in the implementation procedure of script, need the method in called side Faku County.
The test device for the search engine that the present embodiment proposes determines the interface to be tested of tested search engine, from default
Test script library obtains and the corresponding test case data of interface to be tested and the first test foot corresponding with test case data
This;Based on interface to be tested, test case data corresponding with interface to be tested is executed to obtain search result;It determines and tests
The corresponding anticipatory data of case data;The first test script corresponding with test case data is executed, by search result and in advance
Issue is according to carrying out asserting comparison;Above-mentioned steps are repeated, until test case data and the first test in test script library
Script is all finished, and generates test report according to the executive condition of the first test script.In the present solution, being used by test
Example data acquisition search result, actual search results based on the first test script carried out asserting comparison and be generated with anticipatory data
Test report realizes full-automatic test process, keyword is manually entered without tester, ties without artificial contrast
Fruit improves the testing efficiency of search engine.
Further, in other embodiments, the test program of described search engine can also be executed by the processor, with
Realize following steps:
The second test script write in advance is obtained, is held on the database of the index database docking of the tested search engine
Row second test script, to update the database, wherein described search engine has data more in the judgement database
When new operation, according to data pick-up logic from the data that database extraction updates to index database;
After detecting that the tested search engine executes data pick-up operation to the database, determination is drawn into index
More new data in library;
Expected extraction data are determined according to second test script, and determining more new data and the expection are extracted
Data compare, to judge whether the data pick-up logic is wrong;
If the more new data is consistent with the expected data that extract, determine that the data pick-up is logically true;
If the more new data and the expected data that extract are inconsistent, determine that the data pick-up logic is wrong, it is defeated
Make mistake prompt information.
Search engine is according to data pick-up logic by the unstructured data in the database of each operation system of docking
It extracts, is stored after being converted into structural data, and according to the data update status of operation system, it is in real time or fixed
When from operation system according to data pick-up logic extract data, addition or update arrive index database.
In the embodiment, the data in one database are updated by the second test script, in the updated, by searching for
Engine extracts the data of update according to data pick-up logic from the database, due to writing for tester
When two test scripts, which data clearly will be updated, i.e., expected extraction data can be determined according to the second test script.Cause
This search engine according to data pick-up logic after extracting the data of update in the database, by determining more new data and pre-
Phase extracts data and compares, then may determine that whether data pick-up logic is wrong.
Wherein, search engine more new search data by way of message trigger, message trigger can have following implemented side
Update message is actively issued by the operation system that generation data update, search engine is taken out according to update message from operation system likes:
Take the data of update;Alternatively, real-time monitoring of the search engine by the database to operation system, when having listened to data variation
When, the data for updating part are extracted;Alternatively, by search engine periodically from the database of operation system do increment or
The data pick-up of full dose.
Alternatively, as an implementation, the second test script write in advance is obtained, in the tested search engine
On the database of index database docking after the step of executing second test script, the method also includes steps: to described
Tested search engine sends the prompt information of data change, so that described search engine judges the number according to the prompt information
Whether there are data to update operation according to library, wherein when described search engine is when receiving the prompt information, to determine the data
There are data to update operation in library.Search engine starts the data for extracting update from database according to data pick-up logic.
Optionally, in other examples, the test program of search engine can also be divided into one or more
Module, one or more module are stored in memory 11, and (the present embodiment is processor by one or more processors
12) performed to complete the present invention, the so-called module of the present invention is the series of computation machine program for referring to complete specific function
Instruction segment, for describing implementation procedure of the test program of search engine in the test device of search engine.
It is the test of the search engine in one embodiment of test device of search engine of the present invention for example, referring to shown in Fig. 3
The program module schematic diagram of program, in the embodiment, the test program of search engine can be divided into script obtain module 10,
First test module 20, data acquisition module 30, the second test module 40 and report generation module 50, illustratively: determining quilt
The interface to be tested for surveying search engine, from default test script library obtain corresponding with interface to be tested test case data and with
Corresponding first test script of the test case data;
Script obtains module 10 and is used for: determining the interface to be tested of tested search engine, obtains from default test script library
And the corresponding test case data of interface to be tested and the first test script corresponding with the test case data;
First test module 20 is used for: being based on the interface to be tested, is executed test corresponding with the interface to be tested
Case data is to obtain search result;
Data acquisition module 30 is used for: determining anticipatory data corresponding with the test case data;
Second test module 40 is used for: the first test script corresponding with the test case data is executed, it will be described
Search result and the anticipatory data carry out asserting comparison;
Script obtains module 10, the first test module 20, data acquisition module 30 and the second test module 40 and repeats
Above-mentioned steps, until the test case data and first test script in the test script library are all finished;
Report generation module 50 generates test report according to the executive condition of the first test script.
Above-mentioned script obtains module 10, the first test module 20, data acquisition module 30, the second test module 40 and report
The program modules such as generation module 50 are performed realized functions or operations step and are substantially the same with above-described embodiment, herein not
It repeats again.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium
On be stored with the test program of search engine, the test program of described search engine can be executed by one or more processors, with
Realize following operation:
The interface to be tested for determining tested search engine obtains survey corresponding with interface to be tested from default test script library
Try case data and the first test script corresponding with the test case data;
Based on the interface to be tested, executes test case data corresponding with the interface to be tested and tied with obtaining search
Fruit;
Determine anticipatory data corresponding with the test case data;
The first test script corresponding with the test case data is executed, by described search result and the expected numbers
According to carrying out asserting comparison;
Above-mentioned steps are repeated, until test case data and first test script in the test script library
It is all finished, and test report is generated according to the executive condition of the first test script.Computer-readable storage medium of the present invention
Matter specific embodiment and each embodiment of test device and method of above-mentioned search engine are essentially identical, do not make tired state herein.
It should be noted that the serial number of the above embodiments of the invention is only for description, do not represent the advantages or disadvantages of the embodiments.And
The terms "include", "comprise" herein or any other variant thereof is intended to cover non-exclusive inclusion, so that packet
Process, device, article or the method for including a series of elements not only include those elements, but also including being not explicitly listed
Other element, or further include for this process, device, article or the intrinsic element of method.Do not limiting more
In the case where, the element that is limited by sentence "including a ...", it is not excluded that including process, device, the article of the element
Or there is also other identical elements in method.
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 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 method of search engine, which is characterized in that the described method includes:
The interface to be tested for determining tested search engine obtains test corresponding with interface to be tested from default test script library and uses
Number of cases evidence and the first test script corresponding with the test case data;
Based on the interface to be tested, test case data corresponding with the interface to be tested is executed to obtain search result;
Determine anticipatory data corresponding with the test case data;
Execute corresponding with the test case data the first test script, by described search result and the anticipatory data into
Row asserts comparison;
Above-mentioned steps are repeated, until the test case data and first test script in the test script library are whole
It is finished, and test report is generated according to the executive condition of the first test script.
2. the test method of search engine as described in claim 1, which is characterized in that include in the test case data
The step of search key, search rule and ordering rule, the determination corresponding with test case data anticipatory data
Include:
Determine search key, search rule and the ordering rule in the test case data, based on described search keyword,
The index database of search rule, ordering rule and described search engine determines the anticipatory data.
3. the test method of search engine as described in claim 1, which is characterized in that be tested search engine in the determination
Interface to be tested, from default test script library obtain corresponding with interface to be tested test case data and with the test case
Before the step of data corresponding first test script, the method also includes steps:
Current time is monitored in real time apart from the time interval that last time tests;
When time interval reaches prefixed time interval, start test assignment, executes the determination and be tested the to be measured of search engine
Try mouth, from default test script library obtain test case data corresponding with interface to be tested and with the test case data
The step of corresponding first test script.
4. the test method of search engine as claimed any one in claims 1 to 3, which is characterized in that the method is also wrapped
Include step:
The second test script write in advance is obtained, executes institute on the database of the index database docking of the tested search engine
The second test script is stated, to update the database, wherein described search engine there are data to update behaviour in the judgement database
When making, according to data pick-up logic from the data that database extraction updates to index database;
After detecting that the tested search engine executes data pick-up operation to the database, determination is drawn into index database
More new data;
Expected extraction data are determined according to second test script, and determining more new data and the expection are extracted into data
It compares, to judge whether the data pick-up logic is wrong;
If the more new data is consistent with the expected data that extract, determine that the data pick-up is logically true;
If the more new data and the expected data that extract are inconsistent, determine that the data pick-up logic is wrong, output is wrong
Accidentally prompt information.
5. the test method of search engine as claimed in claim 4, which is characterized in that described to obtain the second survey write in advance
Training sheet, the tested search engine index database dock database on execute second test script the step of it
Afterwards, following steps are also realized:
The prompt information that data change is sent to the tested search engine, so that described search engine is according to the prompt information
Judge whether the database there are data to update operation, wherein when described search engine is when receiving the prompt information, sentence
There are data to update operation in the fixed database.
6. a kind of test device of search engine, which is characterized in that described device includes memory and processor, the memory
On be stored with the test program of the search engine that can be run on the processor, the test program of described search engine is described
Processor realizes following steps when executing:
The interface to be tested for determining tested search engine obtains test corresponding with interface to be tested from default test script library and uses
Number of cases evidence and the first test script corresponding with the test case data;
Based on the interface to be tested, test case data corresponding with the interface to be tested is executed to obtain search result;
Determine anticipatory data corresponding with the test case data;
Execute corresponding with the test case data the first test script, by described search result and the anticipatory data into
Row asserts comparison;
Above-mentioned steps are repeated, until the test case data and first test script in the test script library are whole
It is finished, and test report is generated according to the executive condition of the first test script.
7. the test device of search engine as claimed in claim 6, which is characterized in that the test program of described search engine is also
It can be executed by the processor, to be tested the interface to be tested of search engine in the determination, be obtained from default test script library
And the step of corresponding test case data of interface to be tested and the first test script corresponding with the test case data it
Before, also realize following steps:
Current time is monitored in real time apart from the time interval that last time tests;
When time interval reaches prefixed time interval, start test assignment, executes the determination and be tested the to be measured of search engine
Try mouth, from default test script library obtain test case data corresponding with interface to be tested and with the test case data
The step of corresponding first test script.
8. the test device of search engine as claimed in claims 6 or 7, which is characterized in that the test journey of described search engine
Sequence can also be executed by the processor, to realize following steps:
The second test script write in advance is obtained, executes institute on the database of the index database docking of the tested search engine
The second test script is stated, to update the database, wherein described search engine there are data to update behaviour in the judgement database
When making, according to data pick-up logic from the data that database extraction updates to index database;
After detecting that the tested search engine executes data pick-up operation to the database, determination is drawn into index database
More new data;
Expected extraction data are determined according to second test script, and determining more new data and the expection are extracted into data
It compares, to judge whether the data pick-up logic is wrong;
If the more new data is consistent with the expected data that extract, determine that the data pick-up is logically true;
If the more new data and the expected data that extract are inconsistent, determine that the data pick-up logic is wrong, output is wrong
Accidentally prompt information.
9. the test device of search engine as claimed in claim 8, which is characterized in that the test program of described search engine is also
It can be executed by the processor, to obtain the second test script write in advance described, in the rope of the tested search engine
After drawing the step of executing second test script on the database of library docking, following steps are also realized:
The prompt information that data change is sent to the tested search engine, so that described search engine is according to the prompt information
Judge whether the database there are data to update operation, wherein when described search engine is when receiving the prompt information, sentence
There are data to update operation in the fixed database.
10. a kind of computer readable storage medium, which is characterized in that be stored with search on the computer readable storage medium and draw
The test program of the test program held up, described search engine can be executed by one or more processor, to realize as right is wanted
The step of test method of search engine described in asking any one of 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810546878.3A CN108959067B (en) | 2018-05-31 | 2018-05-31 | Method and device for testing search engine and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810546878.3A CN108959067B (en) | 2018-05-31 | 2018-05-31 | Method and device for testing search engine and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108959067A true CN108959067A (en) | 2018-12-07 |
CN108959067B CN108959067B (en) | 2023-04-07 |
Family
ID=64492770
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810546878.3A Active CN108959067B (en) | 2018-05-31 | 2018-05-31 | Method and device for testing search engine and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108959067B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109766279A (en) * | 2019-01-14 | 2019-05-17 | 未来电视有限公司 | Test method and device |
CN110221971A (en) * | 2019-05-21 | 2019-09-10 | 口口相传(北京)网络技术有限公司 | The test method and device of search engine, electronic equipment, storage medium |
CN110442512A (en) * | 2019-07-05 | 2019-11-12 | 深圳壹账通智能科技有限公司 | The method for testing reliability and relevant device of information management system by all kinds of means |
CN110609791A (en) * | 2019-09-03 | 2019-12-24 | 深圳证券交易所 | Interface test method, interface test device and storage medium for bidding system |
CN111209185A (en) * | 2019-12-23 | 2020-05-29 | 厦门市美亚柏科信息股份有限公司 | Keyword-based automated testing method and computer-readable storage medium |
CN112612691A (en) * | 2020-11-30 | 2021-04-06 | 北京思特奇信息技术股份有限公司 | Method and system for realizing automatic test data management and control based on SVN, electronic device and storage medium |
CN112731899A (en) * | 2019-10-14 | 2021-04-30 | 上海为彪汽配制造有限公司 | Test method and test system of radar controller |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9047414B1 (en) * | 2011-03-15 | 2015-06-02 | Symantec Corporation | Method and apparatus for generating automated test case scripts from natural language test cases |
CN106776299A (en) * | 2016-11-30 | 2017-05-31 | 努比亚技术有限公司 | Search engine test device and method |
CN106776333A (en) * | 2016-12-27 | 2017-05-31 | 努比亚技术有限公司 | The method of testing and mobile terminal of a kind of search engine |
CN107391379A (en) * | 2017-07-28 | 2017-11-24 | 武汉斗鱼网络科技有限公司 | Interface automatic test approach and device |
WO2018010552A1 (en) * | 2016-07-12 | 2018-01-18 | 博彦科技股份有限公司 | Test method and device |
CN108052442A (en) * | 2017-10-30 | 2018-05-18 | 努比亚技术有限公司 | A kind of engine test method, terminal and computer readable storage medium |
-
2018
- 2018-05-31 CN CN201810546878.3A patent/CN108959067B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9047414B1 (en) * | 2011-03-15 | 2015-06-02 | Symantec Corporation | Method and apparatus for generating automated test case scripts from natural language test cases |
WO2018010552A1 (en) * | 2016-07-12 | 2018-01-18 | 博彦科技股份有限公司 | Test method and device |
CN106776299A (en) * | 2016-11-30 | 2017-05-31 | 努比亚技术有限公司 | Search engine test device and method |
CN106776333A (en) * | 2016-12-27 | 2017-05-31 | 努比亚技术有限公司 | The method of testing and mobile terminal of a kind of search engine |
CN107391379A (en) * | 2017-07-28 | 2017-11-24 | 武汉斗鱼网络科技有限公司 | Interface automatic test approach and device |
CN108052442A (en) * | 2017-10-30 | 2018-05-18 | 努比亚技术有限公司 | A kind of engine test method, terminal and computer readable storage medium |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109766279A (en) * | 2019-01-14 | 2019-05-17 | 未来电视有限公司 | Test method and device |
CN110221971A (en) * | 2019-05-21 | 2019-09-10 | 口口相传(北京)网络技术有限公司 | The test method and device of search engine, electronic equipment, storage medium |
CN110221971B (en) * | 2019-05-21 | 2023-01-24 | 口口相传(北京)网络技术有限公司 | Search engine testing method and device, electronic equipment and storage medium |
CN110442512A (en) * | 2019-07-05 | 2019-11-12 | 深圳壹账通智能科技有限公司 | The method for testing reliability and relevant device of information management system by all kinds of means |
CN110609791A (en) * | 2019-09-03 | 2019-12-24 | 深圳证券交易所 | Interface test method, interface test device and storage medium for bidding system |
CN112731899A (en) * | 2019-10-14 | 2021-04-30 | 上海为彪汽配制造有限公司 | Test method and test system of radar controller |
CN112731899B (en) * | 2019-10-14 | 2024-01-19 | 上海为彪汽配制造有限公司 | Test method and test system of radar controller |
CN111209185A (en) * | 2019-12-23 | 2020-05-29 | 厦门市美亚柏科信息股份有限公司 | Keyword-based automated testing method and computer-readable storage medium |
CN111209185B (en) * | 2019-12-23 | 2022-12-06 | 厦门市美亚柏科信息股份有限公司 | Keyword-based automated testing method and computer-readable storage medium |
CN112612691A (en) * | 2020-11-30 | 2021-04-06 | 北京思特奇信息技术股份有限公司 | Method and system for realizing automatic test data management and control based on SVN, electronic device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN108959067B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108959067A (en) | Test method, device and the computer readable storage medium of search engine | |
CN109783351A (en) | Interface detection method, apparatus and computer readable storage medium | |
CN110389896A (en) | Code automated analysis and test method, device and computer readable storage medium | |
CN109446218A (en) | SQL statement generation method, device and computer readable storage medium | |
CN110147320A (en) | Interface test method, device and electronic equipment | |
CN109783350A (en) | Interface test method, device and computer readable storage medium | |
CN106326120B (en) | Regression testing method and device for application software and electronic equipment | |
CN107967135A (en) | Computing engines implementation method, electronic device and storage medium | |
CN108519943A (en) | Testing and control and test execution device, method and computer storage media | |
CN110275826A (en) | Automated testing method, device and computer readable storage medium | |
CN109783365A (en) | Automated testing method, device, computer equipment and storage medium | |
CN110297760A (en) | Building method, device, equipment and the computer readable storage medium of test data | |
CN109194689B (en) | Abnormal behavior recognition method, device, server and storage medium | |
US11681511B2 (en) | Systems and methods for building and deploying machine learning applications | |
CN108664372A (en) | Monitoring device, method and the computer readable storage medium of test process | |
CN110287094A (en) | UI automated testing method, device and computer readable storage medium | |
CN112506757A (en) | Automatic test method, system, computer device and medium thereof | |
CN112597052A (en) | Interface testing method and device and computer readable storage medium | |
CN110457346A (en) | Data query method, apparatus and computer readable storage medium | |
CN108399125B (en) | Automatic testing method and device, computer equipment and storage medium | |
CN113590454A (en) | Test method, test device, computer equipment and storage medium | |
CN109657125A (en) | Data processing method, device, equipment and storage medium based on web crawlers | |
CN109271316A (en) | Android device and its automated testing method, memory | |
CN112363814A (en) | Task scheduling method and device, computer equipment and storage medium | |
US10719482B2 (en) | Data comparison |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |