Background technology
Because Chinese north and south network discrepancy, each province and city network connectivity difference has determined Website testing system to distribute in the whole nation, otherwise can cause data collection imperfect.
Wherein, described Website testing system is a distributed system, and described distributed system is the software systems that are based upon on the network.
In a distributed system, one group independently computer represent to the user be a unified integral body, just look like to be like the system.System has multiple general physics and logical resource, allocating task dynamically, and the physics and the logical resource of dispersion are realized information exchange by computer network.There is a mode supervisory computer distribution of resource formula operating system in the system with the overall situation.Usually, concerning the user, distributed system has only a model or pattern.
The common ground of described distributed system and computer network system is: most distributed systems are to be based upon on the computer network, so distributed system and computer network are essentially identical on physical structure.
Distinctive points is: the design philosophy of distributed operating system is different with network operating system, and this has determined them also different on structure, working method and function.Network operating system requires the network user's at first necessary awareness network resource when using Internet resources, the network user must know situations such as the function of each computer in the network and configuration, software resource, network file structure, when if the user will read a shared file in network, the user must know this file is placed under which catalogue of which platform computer; Distributed operating system is with the global mode management of system resource, and it can be any dispatch network resource of user, and scheduling process is " transparent ".When the user submitted an operation to, distributed operating system can be as required selected only processor in system, and user's operation is submitted to this handling procedure, after processor fulfils assignment, the result was passed to the user.In this process, the user can't recognize the existence that a plurality of processors are arranged, and this system similarly is a processor.
The method of existing website test is divided three kinds, all is based on the method for distributed system.
(1) Passive Test
Tested website need embed the js code of test website, initiates test when tested website is accessed to, and test target is exactly the accessed page, and test result generally has: visit ip, the visit source page, page load time or the like
(2) manual test
Manual test is meant the test sheets that is had access to the test website by some netizens, input test target URL (Uniform/Universal Resource Locator, URL(uniform resource locator)), test with manual triggers by this, test target is exactly the URL of user's input or the machine room of being selected by the user, test result generally has: the client is to the speed of download of machine room, response time or the like.
(3) initiatively test
Initiatively test being meant by client test test target, and test is to trigger or periodic, and to be exactly client initiatively get or the task center initiatively issues to the task center test target, and test result is to be finished to report by the client test to give data center.
Three kinds of above-mentioned method of testings, initiatively test is common method, and, website based on initiatively test mainly contains gomez, and the principle of its test macro is that client downloads software is provided, promptly pay to the on-hook user by duration, perhaps cloth node on backbone network, node initiatively obtains test target from the task center and tests, and test result is aggregated into data center.
Yet described client is paid to the on-hook user by duration, perhaps arranges all must spend a large amount of money by node on backbone network, like this, has increased layout test client cost.
Summary of the invention
In view of this, the invention provides a kind of Website testing system and method, when carrying out the website test to solve existing Website testing system, need pay to on-hook user by duration described client or on backbone network, arrange node, so the increase that causes arrange the problem of test client cost.
Described Website testing system comprises:
The task center is used for the test target that acceptance test person defines, and generates test assignment and preservation according to described test target;
SmartClient, its code embeds the webpage of host website, is used for: when described host website is accessed, obtain the test assignment that described task center generates, and testing report test result in back according to described test assignment;
Data center is used for receiving and resolving described test result;
Analysis center is used to collect and analyze the test result after the described parsing;
The test report center is used for the test result after the described parsing is generated chart in conjunction with the user report configuration.
Preferably, described task center comprises:
The general assignment center is used for generating described test assignment and it being divided according to described test target;
The task center that can distribute is used to preserve the described test assignment of division, and sends described test assignment according to the request of described SmartClient.
Preferably, described system also comprises:
The intelligence dns server is controlled described SmartClient and is communicated by letter with the task center foundation that can distribute.Preferably, when the quantity of the SmartClient of testing surpasses predetermined value, when the task centric quantity that maybe can distribute surpassed predetermined value, described general assignment center also comprised center, a plurality of subtask.
Described website method of testing comprises:
When the host website is accessed, obtain test assignment, and test the back according to test assignment and report test result, wherein, the test assignment that the test target that described test assignment defines according to the tester for the SmartClient that embeds the webpage of described host website by its code obtains generates;
Receive and resolve described test result;
Collect and analyze the test result after the described parsing;
Test result after the described parsing is generated chart in conjunction with the user report configuration.
Preferably, test target being converted to test assignment comprises:
Generate described test assignment and it is divided according to described test target;
Preserve the described test assignment of dividing.
Preferably, after described tested website is accessed, also comprise:
Judged whether legacy client,, loaded described legacy client, made it to bring into operation,, carried out and obtain described test assignment operation if do not have if having.
Preferably, also comprise before obtaining test assignment:
Send the request of obtaining described test assignment, send described accessed website and webpage uniform resource position mark URL simultaneously;
Judge whether request is successful, if the operation of obtaining described test assignment is then carried out in success, if get nowhere, request once judges whether success again, if still unsuccessful, then withdraws from.
Preferably, test according to described test assignment and comprise:
Resolve described test assignment, test the uniform resource position mark URL in the described test assignment;
Judge whether to test,, carry out and report the test result operation,, continue the uniform resource position mark URL in the described test assignment of test if test is not intact if test finishes.
Preferably, after the test of the uniform resource position mark URL in finishing once described test assignment, also comprise and obtain test index.
Preferably, it is characterized in that, also comprise after the described report test result:
Whether the described test result of judgement report is successful, if success is then withdrawed from, once reports described test result as if getting nowhere, re-executing and operates, and judges whether success, if still unsuccessful, then withdraws from.
Preferably, distribute described test target to comprise:
Obtain described test target information;
Test density in the described test target information be multiply by each weight;
According to weight described test target is distributed by the zone.
Preferably, also comprise after described request is judged successfully sending described test assignment, be specially:
Inquire about the described geography information of sending the request IP that obtains described test assignment;
Filter described test assignment according to described IP geography information;
Test assignment after the described filtration is sorted by default principle;
Send the XML of a preceding pre-set threshold value task composition of described ordering back test assignment;
After transmission finished, updating task sent percentage according to sending as a result.
Preferably, described default principle is:
50% of described test assignment sends the percentage ascending order according to described task and arranges, and arranges according to province, city, the ISP of ISP inverted order then; Residue 50% is arranged according to province, city, the ISP of ISP inverted order, sends the percentage ascending order according to described task then and arranges.
Preferably, resolving described test result comprises:
Search the described geography information of sending the request IP that obtains described test assignment;
According to described test result information, extract the browser operation system information;
Resolve described test result;
Write down the data after described test result is resolved.
Preferably, collecting and analyze the data of described test result after resolving comprises:
Collect the data of described test result after resolving according to Preset Time;
According to the data after the Preset Time parsing collection.
From above-mentioned technical scheme as can be seen, network test system provided by the invention, its code of described SmartClient embeds the webpage of described host website, do not need client is paid to the on-hook user by duration, perhaps on backbone network, arrange node, solved existing Website testing system and carried out website when test, because of needs are paid to on-hook user by duration described client or arrange node on backbone networks, and then the increase that causes arrange the problem of test client cost.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The embodiment of the invention discloses a kind of Website testing system, as shown in Figure 1, comprising:
Task center 1 is used for the test target that acceptance test person defines, and generates test assignment and preservation according to described test target;
SmartClient 2, its code embeds the webpage of host website, is used for: when described host website is accessed, obtain the test assignment that described task center generates, and testing report test result in back according to described test assignment;
Concrete, SmartClient 2 is the Flash client, the flash client breaks through the flash restriction, can test the file of non-picture or non-swf; When one of them SmartClient will carry out updating operation, can use the flash player to load the another one smart client automatically and bring in and carry out test job.
Data center 3 is used for receiving and resolving described test result;
Analysis center 4 is used to collect and analyze the test result after the described parsing;
Test report center 5 is used for the test result after the described parsing is generated chart in conjunction with the user report configuration.
SmartClient 2 its codes embed the webpage of described host website, do not need client is paid to the on-hook user by duration, perhaps on backbone network, arrange node, solve existing Website testing system and carried out website when test, because of needs are paid to on-hook user by duration client or arrange node on backbone networks, so the increase that causes arrange the problem of test client cost.
And, client is arranged node on backbone network, owing to can only cover on the described backbone network, can not guarantee to cover all places, the whole nation, like this, test volume is very little.And the Website testing system that the embodiment of the invention provides, test volume is not subjected to the restriction of the layout node of SmartClient, can realize nationwide test substantially.
Concrete, as shown in Figure 2, task center 1 comprises: general assignment center 11 and the task center 12 that can distribute, wherein, general assignment center 11 is used for generating test assignment according to the test target of tester's definition, and the province and the weight of being administered according to the task center 12 that can distribute carried out task division then, described test assignment is issued to the task center 12 that each can distribute, and the task center 12 that can distribute is used to preserve described test assignment.
And extendable functions can be realized in general assignment center 11.Surpass and to preset numerical value when the quantity of the SmartClient of testing 2 is more, task center 12 quantity that maybe can distribute are more to be surpassed when presetting numerical value, the operating pressure at general assignment center 11 is bigger, shown in Fig. 3 (a), can add center, subtask 111 under described general assignment center, this kind structure is a single layer structure; Also can adopt hybrid architecture, shown in Fig. 3 (b), a general assignment center 11 can be added 11 times in the general assignment center, same, all add center, subtask 111 at these two general assignment centers.Concrete, the effect that center, a plurality of subtask is added at the general assignment center for 11 times is:
(1) a large amount of SmartClients is decomposed in each subtask in the heart, can reduce the pressure at general assignment center 11;
(2) since each subtask central distribution throughout the country, SmartClient in all parts of the country just can be visited nearby, guarantees connectivity like this, for example: the phenomenon of the client-access in Guangzhou to task center, Pekinese can not occur;
(3) because the situation that the network because of the somewhere has gone wrong and caused all task centers to visit throughout the country, can not appear in the subtask central distribution.
For guaranteeing that SmartClient 2 can successfully obtain described test assignment, and successfully send described test result, described system also comprises intelligent dns server, is used to control SmartClient 2 and sets up with the task center that distributes of the network close with self and communicate by letter in succession.Before SmartClient 2 obtains described test assignment, send by intelligent dns server earlier and obtain the test assignment request to the task center 12 that can distribute, after asking successfully, SmartClient 2 receives the task center described test assignment of 12 transmissions that can distribute and tests; Behind EOT, the transmission of messages that SmartClient 2 also will will be reported described test result by intelligent dns server is to data center 3, and this moment, data center 3 received the described test result that SmartClients 2 send.
The embodiment of the invention also discloses a kind of website method of testing, this method as shown in Figure 4, comprising based on above-mentioned Website testing system:
The code of step S1, SmartClient 2 embeds the webpage of host website;
Step S2, definition test target also transmit;
Step S3, receive described test target, generate test assignment and preserve according to described test target;
When described host website is accessed, execution in step S4, obtain described test assignment, and report test result testing the back according to described test assignment;
Step S5, reception are also resolved described test result;
Step S6, collection and analyze described parsing after test result;
Step S7, the test result after the described parsing is generated chart in conjunction with user report configuration.
Wherein, the chart that generates is delivered to described host website, shows by described host website, described host website can also provide work such as downloading report and the report of realization timed sending mail.
Generate described test assignment and preserve according to described test target, as shown in Figure 5, can be divided into:
Step S11, according to described test target, generate described test assignment through logical operation, and with it according to province and weight, carry out task division;
Step S12, preserve described test assignment.
Concrete, in the above-described embodiments, the tester is according to the test request definition test target of self, described test target is sent to general assignment center 11, general assignment center 11 generates test assignment according to described test target, is transferred to the different task centers 12 that distributes, when needs are tested, the task center 12 that can distribute sends the task center to SmartClient 2, and SmartClient 2 is tested according to described test assignment.Concrete, the tester can define the operation state of the own website of SmartClient 12 tests, i.e. the operation state of host website, and like this, the tester can be well understood to the operation state of own website, more can understand the actual experience of netizen to own website.
The tester also can define the operation state of SmartClient 12 other websites of test, for example: the tester defines test target and is: the operation state of the Baidu website in test somewhere, at this moment, general assignment center 11 generates the task center 12 that distributes that is sent to this area after test assignment, the operation state of these regional SmartClient 2 test Baidu websites of task center 12 controls that can distribute with it.Like this, the tester just can obtain the operation state of Baidu website.
As shown in Figure 6, step S11, generate test assignment according to described test target and can be divided into:
Step S111, obtain described test target information;
Concrete, obtain the information of described test target one by one.
Step S112, the test density in the described test target information be multiply by each weight;
Concrete, carry out the following operation of the preceding execution earlier of this step:
Obtain the weight of the not same district of network coverage area;
Again the weight of normalization network's coverage area.
Step S113, described test target is distributed by the zone according to the weight difference.
Through aforesaid operations, can make the test density of test target increase according to the weight of each province ISP (Internet Service Provider, ISP) according to the netizen of this area number.And in order to improve the speed of distributing described test target, general elder generation carries out the ordering of priority with the not same district of network's coverage area according to weight, the described test target of reallocating.
In the above-described embodiments, when the netizen visits described host website, SmartClient 2 can be set up with the task center 12 that can distribute and get in touch, SmartClient 2 sends the request of obtaining described test assignment, this moment, the task center that distributes 12 in each zone sent described test assignment, its step comprises as shown in Figure 7:
Step S13, the described geography information of sending the request IP that obtains described test assignment of inquiry;
Step S14, filter described test assignment according to described IP geography information;
Step S15, with the test assignment after the described filtration by default principle ordering;
Described default principle is: 50% of described test assignment sends the percentage ascending order according to described task and arranges, and arranges according to province, city, ISP inverted order then; Residue 50% is arranged according to province, city, ISP inverted order, sends the percentage ascending order according to described task then and arranges.
The XML (Extensible Markup Language, extend markup language) that a preceding pre-set threshold value task of step S16, the described ordering of transmission back test assignment is formed, concrete described pre-set threshold value is 4;
After step S17, transmission finished, updating task sent percentage according to sending as a result.
Concrete, after SmartClient 2 sent the request success of obtaining described test assignment, the task center 12 that can distribute just sent described task test, and SmartClient 2 receives described test assignment, and as shown in Figure 8, its step comprises:
Step S21, SmartClient send the request of obtaining described test assignment, and send described accessed website and webpage URL (Uniform Resource Locator, URL(uniform resource locator));
Step S22, judge the whether success of request obtain described test assignment, if success, execution in step S23, if unsuccessful, execution in step S24 then;
Step S23, receive described test assignment;
Because the task center 12 that the test assignment of this moment is a SmartClient 2 to be accepted to distribute sends, and is concrete, the task center 12 that can distribute sends corresponding with it test assignment according to the described geography information of obtaining the request IP of described test assignment.
Step S24, judged whether again request once, if not, re-executed step S21, if when judging that request is still unsuccessful, then execution in step S25, client are deactivated.
After receiving described test assignment, client begins to test according to described test assignment, concrete, obtain and resolve described task list XML, test, finish execution in step S27 after the test assignment, judge whether to test, if test finishes, carry out to report the test result operation,, execution in step S28, test URL in the described test assignment one by one if test is intact.
Can not only test according to test target in order to realize described website method of testing, can also obtain test index, promptly test out response time, download time, speed of download and website availability, and, can handle faulty operation work, after the test of URL in finishing once described test assignment, also comprise step S29, obtain test index.
After obtaining described test index, the response time of described tested website can be learnt by the Information Provider of tested website, download time, the content of aspects such as speed of download and website availability, the more important thing is, task center 12 is arranged in the network's coverage area in each zone owing to can distribute, test according to the test target that receives task center 12 transmissions that to distribute by being arranged at each regional SmartClient, the operation state of each regional tested website can be understood by the Information Provider of tested website, by understanding the operation state of each regional tested website, can know can't access websites as the netizen reason.
And, before step S21, also comprise: step S20, judged whether legacy client,, execution in step S26, loaded described legacy client, made it to bring into operation, if there is not execution in step S21 if having.
Behind EOT, execution in step S4, SmartClient to report test result, concrete, as shown in Figure 9, also comprise after the report test result:
Whether successfully step S31, judgement report described test result, if success, then execution in step S33 client is deactivated, if it is unsuccessful, execution in step S32, judged whether to re-execute again and once reported the operation of described test result, if do not re-execute, execution in step S3 then, if re-execute operation, execution in step S33.
As shown in figure 10, step S5, the described test result of parsing specifically comprise:
Step S41, search the described geography information of sending the request IP that obtains described test assignment;
Step S42, according to described IP geography information, extract the browser operation system information;
Step S43, resolve described test result;
Data after step S44, the described test result of record are resolved.
As shown in figure 11, step S6, collection and analyze described test result after resolving and comprise:
Step S51, collect described test result after resolving according to Preset Time;
Concrete, imported to lane database every 5 minutes from data center, obtaining data file by NFS (Network File System, NFS).
Step S52, analyze described test result after resolving according to Preset Time.
Concrete, go out the data of each dimension every 5 minutes statistical analysis initial data, every 1 hour in 5 minutes granularity datas statistical separate out the data of each dimension, every 1 day in 1 hour granularity data statistical separate out the data of each dimension.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment will be conspicuous concerning those skilled in the art, and defined herein General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.