CN102902619B - The regression testing method of web application and device - Google Patents

The regression testing method of web application and device Download PDF

Info

Publication number
CN102902619B
CN102902619B CN201110217258.3A CN201110217258A CN102902619B CN 102902619 B CN102902619 B CN 102902619B CN 201110217258 A CN201110217258 A CN 201110217258A CN 102902619 B CN102902619 B CN 102902619B
Authority
CN
China
Prior art keywords
attribute
web application
result object
result
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201110217258.3A
Other languages
Chinese (zh)
Other versions
CN102902619A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201110217258.3A priority Critical patent/CN102902619B/en
Publication of CN102902619A publication Critical patent/CN102902619A/en
Priority to HK13103664.4A priority patent/HK1176147A1/en
Application granted granted Critical
Publication of CN102902619B publication Critical patent/CN102902619B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

This application discloses a kind of regression testing method and device of web application, wherein, the method comprises: obtain the web page address that in the first web application and the second web application, each function is corresponding, wherein, described first web application and the second web application are the different editions of same web application; Under identical test environment, use the web page address of described acquisition to ask described first web application and the second web application simultaneously; The second result object that the first result object returned in response to described request described first web application and described second web application return in response to described request compares, and obtains comparative result.The application solves the problem that in prior art, test burden is larger, is obviously being better than prior art to the discovery quantitative aspects of program latent fault, thus decreases test burden, improves test speed.

Description

The regression testing method of web application and device
Technical field
The application relates to internet arena, in particular to a kind of regression testing method and device of web application.
Background technology
Agile development is one of development scheme that the Software Industry in the current whole world is the most popular, more and more carries out in software enterprise of various countries.The important feature of of agile development is: frequently pay new software version.But this feature brings tests frequently, and, can not ensure that the function newly increased can not have influence on former function, so regression test can be carried out continually under agile development pattern, namely, former function be retested one time.Like this, result in a large amount of test job repeated, also become the maximum problem that agile development runs in practice.
After above-mentioned regression test refers to and have modified old code, re-start test and do not introduce new mistake to confirm amendment or cause other codes to produce mistake.Automatic regression test will significantly reduce the cost in the stage such as system testing, maintenance upgrade.Regression test, as an ingredient of software life-cycle, occupies very large workload proportion in whole software test procedure, and each stage of software development all can carry out multiple regression test.In the exploitation of progressive and iteratively faster, it is more frequent that the continuous issue of redaction makes regression test carry out, and in Extreme Programming method, require that every day all carries out several times regression test especially.
The pressure of agile development theory to test job is to produce frequently, the test job of high duplication.At present, also there is no good solution in the world, common regression tested method is unit testing+automatic test+manual testing+other aid (as picture contrastive test), above-mentioned automatic test comprises: use business software (such as, QuickTestProfessional (fast the professional QTP of test) etc.)) test.
The mechanism of said units test is: for one section of test code write by software (each) " most elementary cell ".Then run these test codes, check that whether the actual value of " check point " is consistent with expectation value.Unit testing theory is thought: each " unit " is correct, and entirety is exactly correct.Unit testing is other test activity of lowermost level that will carry out in software development process, and in unit testing activity, the separate unit of software is tested when isolated with other parts of program.
The mechanism of the business softwares such as above-mentioned QTP is: moved by mouse, the tested application of keyboard clicking operation, namely obtains corresponding test script, can edit and debug this script.Expectation value can be set up while insertion " check point " in the process of record script.This test script of playback when execution, then checks that whether " check point " actual result is identical with expected result.
But even if use above-mentioned solution, still need tester to carry out extensive work, effect or not fully up to expectations, particularly as on this application on site of internet product, tester must survey again, this is because:
1) for unit testing: need to write test code, the coverage rate of test code can not reach 100%.Usual coverage rate is higher, that writes is more deep, the possibility facing amendment during reconstruct is also larger, here, reconstruct refers on the basis not changing software existing capability, improved quality, the performance of software by adjustment programme code, make the Design Mode of its program and framework more rational, improve the extendability of software and maintainability.Because the unit before the unit after reconstruct not necessarily reconstructs.Unit testing also needs and then " being reconstructed ".In addition, unit testing is limited by the ability of external data source and developer, and the checking ability that therefore whether unit testing exists mistake to reconstruct post code is very limited.
2) for the business automation testing softwares such as QTP: the business automation testing software features such as QTP are to check page function.But be exactly this feature, make, when some change of page function, just to need again to record script.Function has become also will record script again.And it is stronger for the dependence of external data source, because it can Mock (manufacturing false) data unlike unit testing, lift simple case: when playback test script, the test data of the data in database and originally difference completely, even field all differences.Probably just abandon during actual use and some results are detected.Second Problem, present page effect, more and more gorgeous.Business software many times can not correctly catch and playback page events.Cause whole test all can not run.
So be directed to this scene of regression test, the effect of business software is also unable to catch up with unit testing.The advantage of these products is that use face is wider, more common, but effectiveness comparison is poor.
3) for picture contrastive test: picture contrastive test and the application's principle have many similarities, but the practice is completely different, briefly: by the program of identical input request two versions, whether results page that two programs return is identical to allow computing machine automatically compare, and whether basic method then uses these two pictures of algorithm comparison identical by results page directly being become picture.
The usual effect of picture contrastive test is bad, and reason is: a lot of function can not from embodying in appearance, and on the such as page, a hyperlink is problematic, is not from detectable in appearance, only enters a little just to know, so this problem is just tested not out.Another problem, even if Page Views are different, can not think mistake.Such as: number of site has a lot of advertisement be all random appearance.So all can be treated as " mistake " to measure, this must be not right.
As from the foregoing, existing regression testing method still needs a large amount of manual testings, thus adds test burden, reduces test speed.
Summary of the invention
The fundamental purpose of the application is the regression testing method and the device that provide a kind of web application, at least to solve the problem that in prior art, test burden is larger.
According to an aspect of the application, provide a kind of regression testing method of web application, it comprises: obtain the web page address that in the first web application and the second web application, each function is corresponding, wherein, described first web application and the second web application are the different editions of same web application; Under identical test environment, use the web page address of described acquisition to ask described first web application and the second web application simultaneously; The second result object that the first result object returned in response to described request described first web application and described second web application return in response to described request compares, and obtains comparative result.
According to the another aspect of the application, provide a kind of regression test device of web application, it comprises: acquiring unit, for obtaining the web page address that in the first web application and the second web application, each function is corresponding, wherein, described first web application and the second web application are the different editions of same web application; Request unit, asks described first web application and the second web application for using the web page address of described acquisition under identical test environment simultaneously; Comparing unit, the second result object returned in response to described request for the first result object of returning in response to described request described first web application and described second web application compares, and obtains comparative result.
By the technical scheme of the application, following beneficial effect can be reached:
1) by using web page address to ask the web application of two versions under identical test environment simultaneously, comparison can go out difference between former and later two versions, and whether this species diversity can embody amended code have an impact to each function of web application, that is, can judge that according to the result compared which function in the web application of two versions does not change, which function there occurs change, thus can only test for the function that there occurs change in follow-up test, and do not need the function to not changing to test, which reduce testing time and test burden, improve test speed,
2) by using web page address to ask the web application of two versions under identical test environment simultaneously, make test substantially not rely on concrete test data, the maintenance cost of test data can be reduced like this;
3) serializing is on disk again by web application is converted to basic data type in response to all properties (comprising all sub-attributes) of asking in the result object that returns for the application, and solving between different application object cannot the problem of comparison;
4) the application carrys out controlled attribute traversal scope by modes such as the restriction traversal degree of depth and inspection class names, thus solves when traversal compares easily out of hand, the problem that cannot successfully travel through;
5) the application provides self-defining comparer when comparative result object to the attribute with random nature, ensures the high coverage rate to tested program;
6) comparative result is first generated data file by the application, and then the comparative result read in described data file, described comparative result is used to carry out generating report forms according to the statement form of different-format, like this, the process of the test process and generating report forms that obtain comparative result is separated, make when needing to generate different forms, can not need to re-start test process, and directly expand according to data file, thus decrease testing time, reduce the test duration, improve the extendability of test;
7) the application performs at described web application and carries out interception to web application in the process of the function of asking and obtain result object, thus solves the problem that cannot obtain the operating detecting information of program in prior art due to test procedure closed operation; In addition, this interception mode can in conjunction with above-mentioned manner of comparison, to complete Automation regression testing expeditiously.
Certainly, arbitrary product or the method for implementing the application might not need to reach above-described all advantages simultaneously.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide further understanding of the present application, and form a application's part, the schematic description and description of the application, for explaining the application, does not form the improper restriction to the application.In the accompanying drawings:
Fig. 1 is the preferred structural representation of one of the regression test device of web application according to the embodiment of the present application;
Fig. 2 is the preferred structural representation of another kind of the regression test device of web application according to the embodiment of the present application;
Fig. 3 is the preferred process flow diagram of one of the regression testing method of web application according to the embodiment of the present application;
Fig. 4 is according to the preferred schematic diagram of the one of the URL of the embodiment of the present application;
Fig. 5 is according to the preferred schematic diagram of the another kind of the URL of the embodiment of the present application;
Fig. 6 is the preferred process flow diagram of another kind of the regression testing method of web application according to the embodiment of the present application;
Fig. 7 is another the preferred schematic diagram according to the URL of the embodiment of the present application;
Fig. 8 is the preferred schematic diagram of one of the serializing result object according to the embodiment of the present application;
Fig. 9 is the preferred schematic diagram of one of the traversal comparison according to the embodiment of the present application;
Figure 10 is according to the preferred schematic diagram of the one of the comparison process of the embodiment of the present application;
Figure 11 is according to the preferred schematic diagram of the one of the Output rusults of the embodiment of the present application;
Figure 12 is according to the preferred schematic diagram of the another kind of the Output rusults of the embodiment of the present application.
Embodiment
Hereinafter also describe the application in detail with reference to accompanying drawing in conjunction with the embodiments.It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.
Before the further details of each embodiment describing the application, the counting system structure that of the principle that can be used for realizing the application is suitable is described with reference to Fig. 1.In the following description, except as otherwise noted, the symbol otherwise with reference to the action performed by one or more computing machine and operation represents each embodiment describing the application.Thus, be appreciated that processing unit that this kind of action performed sometimes referred to as computing machine and operation comprise computing machine is to the manipulation of electric signal representing data with structured form.It is safeguarded in this manipulation transforms data or the position in the accumulator system of computing machine, and this reshuffles or changes the operation of computing machine in the mode that those skilled in the art understands.The data structure of service data is the physical location of the storer of the particular community that the form with data defines.But although describe the application in above-mentioned context, it does not also mean that restrictive, as understood by those skilled in the art, hereinafter described action and each side of operation also can realize with hardware.
Turn to accompanying drawing, wherein identical reference number refers to identical element, and the principle of the application is shown in a suitable computing environment and realizes.Below describe the embodiment based on described the application, and should not think about the alternative embodiment clearly do not described herein and limit the application.
Fig. 1 shows the schematic diagram of the example computer architecture that can be used for these equipment.For purposes of illustration, the architecture of painting is only an example of proper environment, not proposes any limitation to the usable range of the application or function.This computing system should be interpreted as, to the arbitrary assembly shown in Fig. 1 or its combination, there is any dependence or demand yet.
The principle of the application can use other universal or special calculating or communication environment or configuration to operate.Be applicable to the well-known computing system of the application, the example of environment and configuration includes but not limited to, personal computer, server, multicomputer system, system based on micro-process, minicomputer, mainframe computer and comprise the distributed computing environment of arbitrary said system or equipment.
In the configuration that it is the most basic, the regression test device 100 of the web application in Fig. 1 can be positioned at server.Server can include but not limited to Micro-processor MCV or programmable logic device (PLD) FPGA etc. treating apparatus, for storing the memory storage of data and the transmitting device with client communication.In the present specification and claims, " the regression test device of web application " also can be defined as executive software, firmware or microcode can coming any nextport hardware component NextPort of practical function or the combination of nextport hardware component NextPort.The regression test device 100 of web application can be even distributed, to realize distributed function.
As used in this application, term " submodule ", " module ", " assembly " or " unit " can refer to the software object that performs on the regression test device 100 of web application or routine.Different assembly described herein, submodule, module, unit, engine and service can be implemented as on the regression test device 100 of web application, perform (such as, as independent thread) object or process.Although system and method described herein preferably realizes with software, the realization of the combination of hardware or software and hardware also may and conceived.
Embodiment 1
As shown in Figure 1, the regression test device 100 (or being called Context Tester) of web application comprises: acquiring unit 102, for obtaining the web page address (URL that in the first web application and the second web application, each function is corresponding, URL(uniform resource locator), the network address inputted in browser address bar exactly), wherein, the first web application and the second web application are the different editions of same web application; Request unit 104, is connected to acquiring unit 102, asks the first web application and the second web application for using the web page address of acquisition under identical test environment simultaneously; Comparing unit 106, is connected to request unit 104, for comparing in response to asking the second result object returned in response to first result object of asking to return and the second web application the first web application, obtains comparative result.
In this application, ask the web application of two versions by using web page address under identical test environment simultaneously, comparison can go out difference between former and later two versions, and whether this species diversity can embody amended code have an impact to each function of web application, that is, can judge that according to the result compared which function in the web application of two versions does not change, which function there occurs change, thus can only test for the function that there occurs change in follow-up test, and do not need the function to not changing to test, which reduce testing time and test burden, improve test speed.
Above-mentioned result object refers to: web application is after acceptance http request also process, execution corresponding function is produced a series of execution result, execution result is incorporated in a unified object, this unified object is referred to as " result object " in this application, wherein, object refers to has unique identifier, object comprises attribute (Properties) and method (Methods), attribute is exactly the information needing memory, and method is exactly the service that object can provide.
Above-mentioned identical test environment comprises: the same time uses same test procedure on same machine.Like this, the difference of machine environment can be avoided to bring unnecessary difference to the result object of two web applications, thus cause interference to contrast below.
Starting to perform test, acquiring unit 102 takes out a url data from URL storehouse, as shown in Figure 4.Then, this URL of request unit 104 simulation browser asks the first web application and the second web application.Object is exactly by simulation browser request, to allow the first web application and the second web application perform by brake.Preferably, can realize by the web application successively storing two versions in the same memory space of server the scheme that use url data asks two web applications.Certainly, this is an example, the application is not limited only to this, also the web application of two versions can be stored in two different storage spaces of server, the web application of such two versions corresponds to two different URL, request unit 104, when simulation browser request, obtains above-mentioned two different URL, then uses these two URL to ask two web applications simultaneously from URL storehouse.
The technology of above-mentioned simulation can be realized by HttpUnit open source technology, HttpUnit is the open source technology using web test specially, it can function such as: post and the get user of simulation browser be asked, and simulation browser login system, performs javascript etc.
After two web application process requests, respectively will produce a result object exported, then comparing unit 106 collects this two result objects, and their difference of comparison, be then output into report.
After the Comparative result of a URL terminates, then take out second URL again from URL storehouse, as shown in Figure 5.At this moment second test case is started by second URL.Such use one by one URL is tested, and to the last a URL executes.Here, test case is test the one group of data worked out, and comprising: initial conditions, expected results.
The all functions of web application, pass through the composition of URL one by one.A user has carried out one click to a Website page, is exactly the request of the URL being once sent to website in fact, and after request is received in website, executive routine, sends back to result the browser of user, and user just sees the content wanting to see.Click so one by one and " opened " website all functions, the application simulates such click behavior, and Output rusults of checking, and whether that program than before changes, and just draws whether wrong generation.
For example, have collected a period of time user in the URL storehouse of the application and really access formed request msg, after removing repetition URL, about more than 4000, substantially all functions of this web application are covered, each URL is exactly a test case, and it is almost impossible for measuring 4000 test cases during manual testing.In addition, as this business test of QTP because will record and maintenance test script, it is also impossible for measuring so many test cases.Visible, had very high " tested code coverage " compared with other schemes by the regression test performed by the device shown in Fig. 1.
In addition, in the time, more than 4000 more than one hour URL (use-case) used time, and manually to reach same workload by calculating in 5 minutes, and need 41 working days, visible, according to the regression test of the application, the test duration can be saved widely.Further, these real URL, from line and test log, are need hardly to safeguard separately, this also reduces the maintenance cost of test case.
Contrast the application Context Tester and unit below by form to try to survey and the business automation testing software such as QTP is directed to regression tested ability.
Table 1
More than can see: the performance of the application (ContextTester) is considerably beyond unit testing and business software.
The result object of the web application of different editions belongs to different memory headrooms, can not directly comparison.To this, this application provides one preferably comparing unit, it is by the result object serializing of the web application of different editions to local hard drive (or serializing is on other memory devices), then unification is loaded in same memory headroom.Preferably, the serializing technology used in the application can comprise Java Serializable, xml, json etc.In addition, this preferably comparing unit additionally use Interception Technology to obtain result object.
Specifically, this preferably comparing unit 106 comprise: the blocking module (or being called blocker) 1061, serializing module 1062 and the load-on module 1063 that connect successively.
In the process compared in response to the second result object that request returns in response to first result object of asking to return and the second web application the first web application, blocking module 1061 performs at the first web application and carries out interception to the first web application in the process of the function of asking and obtain the first result object, performs to carry out interception to the second web application in the process of the function of asking and obtain the second result object at the second web application; The attribute of the attribute of the first result object and the second result object is carried out serializing by serializing module 1062, and wherein, serializing refers to process Obj State being converted to the form that can keep or transmit; The attribute of the first result object after serializing and the attribute of the second result object are loaded in same memory headroom and compare by load-on module 1063.
All properties in the result object of the web application of different editions, sub-attribute are all write on memory device by above-mentioned serialization process, can compare follow-up to be loaded in same memory headroom by result object, thus solve in prior art cannot the problem of the direct result object of the web application of comparison different editions.
Response in the present invention in each embodiment refers to: the request that is directed to performs corresponding program and returns results, and is exactly briefly return results.
In addition, the effect of the blocking module 1061 (blocker) in above-mentioned comparing unit 106 is the result object obtaining tested program and former version program.In this application, blocker can use AOP (Aspect Oriented Programming, towards tangent plane (direction) programming) technology, the exit code place finding application program last, tackle in the same code position of two methods program, to obtain the result object of the web application of two versions, wherein, AOP technology is a kind of technology realizing adding to program dynamic unity when not revising source code function by precompile mode and runtime dynamic proxy.By above-mentioned interception mode, the problem that cannot obtain the operating detecting information of program in prior art due to test procedure closed operation can be solved.
In this application, the result object difference of the web application of two versions belongs to normal condition sometimes, this is because the function of the web application of two versions is the functions with random nature, normal conditions, the function of this web application accounts for 5% of the function of web application, the same page on such as website, what all show when entering is different advertisements at every turn, this is program normal function, so when comparison is to when relating to the attribute of such as ad data, if the association attributes of the result object of two web applications will be pointed out different according to normal alignments, thus cause wrong report.
In order to address this is that, present invention also provides one preferably load-on module, this load-on module can select different manner of comparison (or also can be considered as selecting different comparers) according to the attribute of different result objects.
Specifically, load-on module 1063 comprises: interconnective first judges submodule and comparison sub-module.
The attribute of the first result object after serializing and the attribute of the second result object are being loaded in the process compared in same memory headroom, first judge submodule judge serializing after the attribute of the first result object and the attribute of the second result object whether be the attribute with random nature, if the attribute of the first result object after serializing and the attribute of the second result object are the attribute with random nature, then judge that the attribute of the first result object and the attribute of the second result object do not have difference; When the attribute of first result object of comparison sub-module after serializing and the attribute of the second result object be not for having the attribute of random nature, whether the attribute of the attribute and the second result object that compare the first result object there are differences.
That is, in the application, load-on module 1063 can comprise acquiescence comparer and expansion comparer.Wherein, when judging it is the attribute without random nature, then whether the attribute of the attribute and the second result object of selecting acquiescence comparer to compare the first result object there are differences; It is the attribute with random nature if judge, then select expansion comparer, when selecting expansion comparer, generally judge that the attribute of the first result object and the attribute of the second result object do not have difference, and only carry out conventional essential information judgement.
Preferably, above-mentioned acquiescence comparer can comprise: Collection comparer, Map comparer, Bean comparer, URL comparer.Expansion comparer is mainly in the comparer having the attribute of random nature, user oneself writes.
First judges that submodule can be considered as comparer Control Component, act on a total controller, controlled by which comparer to be traveled through by it, here before traversing an attribute, traversal refers to along certain search pattern, all does once and only does successively once access each node in tree.The selective rule that can set is: the preferential expansion comparer that uses carrys out comparison, does not expand the attribute of comparer, finds corresponding acquiescence comparer to compare by attribute type.By the difference that comparer compares, then export.
By above-mentioned manner of comparison, the incorrect problem of the Output rusults caused because mistake compares can be reduced.
Further, in this application, the structure of the attribute of result object is relatively generally reticulate texture, and wherein, some attribute belongs to useless attribute, if the attribute useless to these is compared, then add comparison time, even when the attribute of comparison is the attribute of third party's class (class of Bu Shi our company exploitation), even may occur that ring-type association causes endless loop, even without there is endless loop, also can be very consuming time.
In order to solve the problem, present invention also provides one preferably comparing unit, its before result object is carried out serializing to result object in useless attribute filter, solve the comparison time existed in prior art longer, also may occur the problem of endless loop.
Concrete, comparing unit 106 comprises: filtering module 1064, this filtering module 1064, before the attribute of the attribute of the first result object and the second result object is carried out serializing, filters the attribute of the first result object and the attribute of the second result object, filters out useless attribute.After filtering out useless attribute, the attribute of the first result object except useless attribute and the attribute of the second result object are carried out serializing by serializing module 1062.Like this, basic guarantee result object wants serializing to be all saving result data, useful attribute to the attribute on hard disk.
In order to select useless attribute, the application also provides a kind of preferred filtering module 1064, and it comprises: judge submodule, for judging useless attribute by following steps: if the degree of depth of attribute exceedes predetermined threshold, then judge that this attribute is useless attribute; If or attribute is the attribute in predetermined aggregate type, then judge that this attribute is useless attribute; If or the class name of attribute is not the class name in predetermined set, then judge that this attribute is useless attribute.
Object due to all functions of web application has all been kept in " result object ", and in order to ensure to omit, the application also provides a kind of preferred load-on module, and it compares for carrying out traversal to the attribute of result object.
Specifically, load-on module 1063 comprises: second judges submodule and output sub-module.
The attribute of the first result object after serializing and the attribute of the second result object are being loaded in the process compared in same memory headroom, second judges submodule, for described first result object and described second result object are loaded in the internal memory of test procedure, whether there are differences between the attribute of the first result object after Ergodic judgement serializing and the attribute of the second result object; Output sub-module, during for there are differences between the attribute of the first result object after serializing and the attribute of the second result object, exports the information that there are differences between the attribute of instruction first result object and the attribute of the second result object.
By above-mentioned ergodic process, ensure that all properties of result object all obtains comparison, make to test there is very high coverage rate, avoid and manually carry out repeated test.
The regression test device 100 of web application also comprises: the first generation unit 108, for after the second result object returned compares, comparative result being generated data file in response to asking in response to asking the first result object of returning and the second web application to the first web application; Second generation unit 110, for the comparative result in read data files, uses comparative result to carry out generating report forms according to the statement form of different-format.
Comparative result is first generated data file by the application, and then the comparative result read in described data file, described comparative result is used to carry out generating report forms according to the statement form of different-format, like this, the process of the test process and generating report forms that obtain comparative result is separated, make when needing to generate different forms, can not need to re-start test process, and directly expand according to the data file generated, thus decrease testing time, reduce the test duration, improve the extendability of test.
Embodiment 2
As shown in Figure 2, the application provides a kind of regression test device 20 of web application, and it is arranged in server 10.
The regression test device 20 of web application comprises with lower component: URL gatherer 201, result object gatherer 202, form plug-in unit 203, test cell 204 and URL resources bank 207, the annexation of above-mentioned all parts as shown in Figure 2.
URL gatherer 201 is for collecting daily record 101 on the line of web application and test log 102; The URL resource that URL resources bank 207 is collected for storing URL gatherer 201; Result object gatherer 202 is for collecting the result object of the web application of two different editions simultaneously; Test cell 204 for carrying out traversal comparison to result object, and exports variance data; Form plug-in unit 203 is converted to final report for the variance data produced by test cell 204.
The concrete structure of above-mentioned all parts is further described below in conjunction with accompanying drawing.
URL gatherer 201 comprises: GET data collecting assembly 2011, POST data collecting assembly 2012.In this application, " GET " or " POST " is by relevant with the agreement that tested application program uses.
Result object gatherer 202 comprises: application blocker 2020, Http asks simulated assembly 2021, filtrator 2022, attribute converter 2023 and serializing device 2024.
In the process of collecting result object, Http asks simulated assembly 2021 to be responsible for asking the web application of two different editions simultaneously, allows them run identical function simultaneously.Such as, starting to perform test, Http asks simulated assembly 2021 to take out a url data from URL storehouse, as shown in Figure 4.Then, this URL of request unit 104 simulation browser asks the web application of two different editions, and object is exactly will by simulation browser request, and allow the web application of two different editions perform by brake, bear results object.Here it should be noted that, above-mentioned request is simultaneously what to carry out under identical test environment, and preferably, above-mentioned identical test environment comprises: the same time uses same test procedure on same machine.Like this, the difference of machine environment can be avoided to bring unnecessary difference to the result object of two web applications, thus cause interference to contrast below.
Then, the result object producing is responsible for by application blocker 2020, and interception is got off, namely, the web application of two different editions is performed the Data Collection of the corresponding result object obtained by brake in test procedure in response to above-mentioned request, is convenient to the follow-up comparison carrying out result object.In this application, application blocker 2020 can use AOP (Aspect OrientedProgramming, towards tangent plane (direction) programming) technology, the exit code place finding application program last, tackle in the same code position of two methods program, to obtain the result object of the web application of two versions, wherein, AOP technology is a kind of technology realizing adding to program dynamic unity when not revising source code function by precompile mode and runtime dynamic proxy.By above-mentioned interception mode, the problem that cannot obtain the operating detecting information of program in prior art due to test procedure closed operation can be solved.
Then, filtrator 2022 filters the attribute in the result object tackled of application blocker 2020, namely removes attribute useless in result object.Like this, basic guarantee result object wants serializing to be all saving result data, useful attribute to the attribute on hard disk.In order to select useless attribute, filtrator 2022 can comprise: judge submodule, for judging useless attribute by following steps: if the degree of depth of attribute exceedes predetermined threshold, then judge that this attribute is useless attribute; If or attribute is not the attribute in predetermined aggregate type, then judge that this attribute is useless attribute; If or the class of attribute is called the class name in predetermined set, then judge that this attribute is useless attribute.
After attribute useless in filtrator 2022 filter result object, the result object after filtrator 2022 filters by attribute converter 2023 converts the object can write on hard disk to, for serializing is prepared.
Then, serializing device 2024 attribute converter 2023 is formed can the result object serializing of serializing on hard disk.Because there is the web application of two different editions, so serializing device 2024 can produce the product of two serializings, that is, " result object 205 of program output in the past " and " result object 206 that program to be tested exports " shown in Fig. 2.
All properties in the result object of the web application of different editions, sub-attribute are all write on memory device by above-mentioned serialization process, can compare follow-up to be loaded in same memory headroom by result object, thus solve in prior art cannot the problem of the direct result object of the web application of comparison different editions.
Further, in order to carry out the comparison of result object, test cell 204 comprises: comparer Control Component 2041, acquiescence comparer 2042, self-defined comparer (or claiming expansion comparer) 2043 and filtrator 2044.They join together to carry out traversal comparison to result object, and export variance data.
Acquiescence comparer 2042 and self-defined comparer 2043 are all be responsible for doing concrete attribute contrast work.Because the attribute comparison rule in object is different, so comparer is not one, which comparer is selected to be in charge of by comparer Control Component 2041.
Such as, when comparer Control Component 2041 is judged to be the attribute without random nature, whether there are differences between the attribute selecting acquiescence comparer 2042 to carry out comparative result object; If comparer Control Component 2041 judges it is the attribute with random nature, then select self-defined comparer 2043, when selecting self-defined comparer 2043, between the attribute generally judging two result objects, not there is difference, and only carry out conventional essential information and judge.
Filtrator 2044 is responsible for filtering the Output rusults of acquiescence comparer 2042 and self-defined comparer 2043.
Form plug-in unit 203 comprises self-defined sequencing assembly 2032, filtrator 2031 and self-definedly gathers assembly 2033.They join together the variance data that test cell 204 produces to be converted to last report.Wherein, self-defined sequencing assembly 2032 is responsible for the sequence work of report data; Filtrator 2031 is responsible for filtering out the data not being real mistake or repeating; The self-defined assembly 2033 that gathers is responsible for data to carry out classifying by type by mistake, gathering.Increase form can be readability.
In order to output report, form plug-in unit 203 also takes a kind of mode of variance data file and report file being carried out separately generate, specifically, the comparative result that test cell 204 first produces by form plug-in unit 203 (such as, variance data) generate data file, and then the comparative result read in described data file, described comparative result is used to carry out generating report forms according to the statement form of different-format, like this, the process of the test process and generating report forms that obtain comparative result is separated, make when needing to generate different forms, can not need to re-start test process, and directly expand according to the data file generated, thus decrease testing time, reduce the test duration, improve the extendability of test.
Embodiment 3
On the basis of the computing system shown in Fig. 1-Fig. 2, present invention also provides a kind of regression testing method of web application.As shown in Figure 3, the regression testing method of web application comprises the following steps:
S302, obtains the web page address that in the first web application and the second web application, each function is corresponding, and wherein, the first web application and the second web application are the different editions of same web application; Can by but be not limited to the acquiring unit 102 shown in Fig. 1 to perform S302;
S304, under identical test environment, use the web page address of acquisition to ask the first web application and the second web application simultaneously, such as, web page address A is used to ask the first web application, and use web page address B to ask the second web application, or, use web page address C to ask the first web application and the second web application simultaneously; Can by but be not limited to the request unit 104 shown in Fig. 1 to perform S304;
S306, comparing in response to asking the second result object returned in response to first result object of asking to return and the second web application the first web application, obtaining comparative result; Can by but be not limited to the comparing unit 106 shown in Fig. 1 to perform S306.
In this application, ask the web application of two versions by using web page address under identical test environment simultaneously, comparison can go out difference between former and later two versions, and whether this species diversity can embody amended code have an impact to each function of web application, that is, can judge that according to the result compared which function in the web application of two versions does not change, which function there occurs change, thus can only test for the function that there occurs change in follow-up test, and do not need the function to not changing to test, which reduce testing time and test burden, improve test speed.
Above-mentioned identical test environment comprises: the same time uses same test procedure on same machine.Like this, the difference of machine environment can be avoided to bring unnecessary difference to the result object of two web applications, thus cause interference to contrast below.
When starting to perform test, acquiring unit 102 takes out a url data from URL storehouse, as shown in Figure 4.Then, this URL of request unit 104 simulation browser asks the first web application and the second web application.Object is exactly by simulation browser request, to allow the first web application and the second web application perform by brake.
After two web application process requests, respectively will produce a result object exported, then comparing unit 106 collects this two result objects, and their difference of comparison, be then output into report.
After the Comparative result of a URL terminates, then take out second URL again from URL storehouse, as shown in Figure 5.At this moment second test case is started by second URL.Such use one by one URL is tested, and to the last a URL executes.
The all functions of web application, pass through the composition of URL one by one.A user has carried out one click to a Website page, is exactly the request of the URL being once sent to website in fact, and after request is received in website, executive routine, sends back to result the browser of user, and user just sees the content wanting to see.Click so one by one and " opened " website all functions, the application simulates such click behavior, and Output rusults of checking, and whether that program than before changes, and just draws whether wrong generation.
The result object of the web application of different editions belongs to different memory headrooms, can not directly comparison.To this, this application provides one preferably comparison step, it is by the result object serializing of the web application of different editions to local hard drive (or serializing is on other memory devices), then unification is loaded in same memory headroom.Preferably, the serializing technology used in the application can comprise Java Serializable, xml, json etc.In addition, above-mentioned preferably comparison step additionally uses Interception Technology to obtain result object.
Specifically, first web application being comprised in response to the step of asking the second result object returned to compare in response to asking the first result object of returning and the second web application: perform at the first web application and in the process of the function of asking, interception is carried out to the first web application and obtain the first result object, performing at the second web application and in the process of the function of asking, interception being carried out to the second web application and obtain the second result object; The attribute of the attribute of the first result object and the second result object is carried out serializing; The attribute of the first result object after serializing and the attribute of the second result object are loaded in same memory headroom and compare.
All properties in the result object of the web application of different editions, sub-attribute are all write on memory device by above-mentioned serialization process, can compare follow-up to be loaded in same memory headroom by result object, thus solve in prior art cannot the problem of the direct result object of the web application of comparison different editions.
In addition, the effect of above-mentioned interception step is the result object obtaining tested program and former version program.In this application, blocker can use AOP (Aspect Oriented Programming, towards tangent plane (direction) programming) technology, the exit code place finding application program last, tackle in the same code position of two methods program, to obtain the result object of the web application of two versions, wherein, AOP technology is a kind of technology realizing adding to program dynamic unity when not revising source code function by precompile mode and runtime dynamic proxy.By above-mentioned interception mode, the problem that cannot obtain the operating detecting information of program in prior art due to test procedure closed operation can be solved.
In this application, the result object difference of the web application of two versions belongs to normal condition sometimes, this is because the function of the web application of two versions is the functions with random nature, normal conditions, the function of this web application accounts for 5% of the function of web application, the same page on such as website, what all show when entering is different advertisements at every turn, this is program normal function, so when comparison is to when relating to the attribute of such as ad data, if the association attributes of the result object of two web applications will be pointed out different according to normal alignments, thus cause wrong report.
In order to address this is that, present invention also provides one preferably load step, this load step can select different manner of comparison (or also can be considered as selecting different comparers) according to the attribute of different result objects.
Specifically, the attribute of the first result object after serializing and the attribute of the second result object are loaded into the process compared in same memory headroom to comprise: judge whether the attribute of the first result object after serializing and the attribute of the second result object are the attribute with random nature; If do not have, then whether the attribute of the attribute and the second result object that compare the first result object there are differences; If have, then judge that the attribute of the first result object and the attribute of the second result object do not have difference.By above-mentioned load mode, the incorrect problem of the Output rusults caused because mistake compares can be reduced.
Further, in this application, the structure of the attribute of result object is relatively generally reticulate texture, and wherein, some attribute belongs to useless attribute, if the attribute useless to these is compared, then add comparison time, even when the attribute of comparison is the attribute of third party's class (class of Bu Shi our company exploitation), even may occur that ring-type association causes endless loop, even without there is endless loop, also can be very consuming time.
In order to solve the problem, present invention also provides one preferably filtration step, its before result object is carried out serializing to result object in useless attribute filter, solve the comparison time existed in prior art longer, also may occur the problem of endless loop.
Specifically, before the attribute of the attribute of the first result object and the second result object is carried out serializing, the regression testing method of web application also comprises: filter the attribute of the first result object and the attribute of the second result object, filter out useless attribute; The attribute of the first result object except useless attribute and the attribute of the second result object are carried out serializing.
Preferably, useless attribute can be judged by following steps: if the degree of depth of attribute exceedes predetermined threshold, then judge that this attribute is useless attribute; If or attribute is the attribute in predetermined aggregate type, then judge that this attribute is useless attribute; If or the class name of attribute is not the class name in predetermined set, then judge that this attribute is useless attribute.
The attribute of the first result object after serializing and the attribute of the second result object are loaded into the process compared in same memory headroom comprise: described first result object and described second result object are loaded in the internal memory of test procedure; Whether there are differences between the attribute of the first result object after Ergodic judgement serializing and the attribute of the second result object; If there are differences, then export the information that there are differences between the attribute of instruction first result object and the attribute of the second result object.By above-mentioned ergodic process, ensure that all properties of result object all obtains comparison, make to test there is very high coverage rate, avoid and manually carry out repeated test.
, also comprising: comparative result is generated data file after the second result object returned compares in response to asking in response to asking the first result object of returning and the second web application the first web application; Comparative result in read data files, uses comparative result to carry out generating report forms according to the statement form of different-format.Comparative result is first generated data file by the application, and then the comparative result read in described data file, described comparative result is used to carry out generating report forms according to the statement form of different-format, like this, the process of the test process and generating report forms that obtain comparative result is separated, make when needing to generate different forms, can not need to re-start test process, and directly expand according to the data file generated, thus decrease testing time, reduce the test duration, improve the extendability of test.
Embodiment 4
The present embodiment will describe concrete regression testing method in detail by reference to the accompanying drawings.
Example 1
A such as people is come airport and is prepared by air, by plane by safety check, but due to cause specific, he must leave airport a period of time and go work something, when he returns to airport, must remake safety check.In order to save the cost of labor remaking safety check, we can design such a flow process: when first time carries out safety check, oneself is with all article to put in a case by passenger, and all article in this case are all taken out and checked and see if there is prohibited items by security staff.Then these article are put into again a special equipment, the information of these article all scans and records (supposing there is such equipment) by equipment.Then passenger returns to airport when remaking safety check once again, and safe examination system repeats once scanning just now again and then compares with previous, as long as do not have new article to occur just thinking and can passing through safety check.
Example is summed up:
1) because the last time is that hand inspection have passed.As long as be this time same as last, we just can think, this time also have passed.
2) like this " special equipment " be non-existent in actual life, but in the data for computer-internal, doing this inspection can be accomplished.
3) oneself is with all article to put in a case by passenger: mean that all article all can be checked through, and shows that this inspection has high coverage rate.
4) as long as second time article are had any different in upper example, article as increased, just can be found.This shows that this inspection has high sensitive.Although the article increased are not necessarily problematic, high sensitive can bring the characteristic of not omitting after all, could form the robotization checked
5) certain scheme just imagines if can not ensure all article to be checked through, maybe can not ensure problem one to find surely, that just needs artificial rechecking more once, because we do not know which may be missed, so the workload of people does not reduce along with this instrument of use, instrument can only be artificial assisting.On the contrary, the scheme in example has high coverage rate and high sensitive, so just can self-verifying be adopted when second time checks article, and assisting manually as instrument.Such instrument just can significantly substitute manually.
6) just in certain occasion competence exertion effect.As above example just can be able to can only play a role when second time checks, but for computer system, this quadratic search occasion accounting is very high, especially high in agile development process popular now, so the regression test scheme in the application meets the trend of development.
The Basic way of the regression testing method in the present embodiment is: by the application configuration that same program environment is same, same machine runs the weblication of two different editions of " before " and " to be measured ", then on machine on the same stage with a test procedure, access these two different application programs at one time.The result that they return under the function of 95% is identical.We are just to the comparison inspection of two results.In addition, having sub-fraction has the function of " random nature " to be different, and the present embodiment develops expansion plugin and carries out necessary inspection to the function of " random nature ".Whole process is more similar to the article of twice sweep comparison passenger in example 1.
By above-mentioned regression testing method, can close to 99% the high sensitive to program error and high coverage rate.The business softwares such as regression testing method and unit testing that the application is used for web application and QTP are compared, and have following four obvious advantages: 1. hardly with safeguarding; 2. pair wrong high sensitive; 3. the high coverage rate of test; 4. high artificial substituting rate.
The application of the application just as a large method (function), have will be unified input and output pattern, internet, applications is all accept user's request by http agreement usually, and this is natural " same " entrance.Web framework all plays up the page by O bject-Graph Navigation Language (OGNL) value mostly now, and this is again natural " same " outlet.Be left, as the function of adding in database data, them allowed to be incorporated to a unified outlet not difficult.Just as use unit testing, we also want our program of appropriate reconstruction, increase " testability ", and allowing test procedure is better our work.Unified Web " outlet " design provided, be in fact present in already, the pageContext built-in objects etc. in such as JSP technology, what only some was applied does not also make full use of them.
Example 2:
Suppose the reconstruct at once large-scale architecture level, mainly made two aspects and rebuild: one is the inheritance of application program made an adjustment, another: the parameter (because these parameters original were unreasonable) that have modified a lot of method.Whole application program has no small change in structure and details.Must carry out the regression test of whole application like this, workload is probably 12 day for human beings (people workloads of 12 days).
Based on above-mentioned hypothesis, as shown in Figure 6, the regression testing method in the present embodiment comprises the following steps:
Step S602: collect URL
Obtain on line and access daily record data, use " the Get data collecting assembly " in Fig. 1, remove otiose data, only leave the URL information that we need, the every a line of these information is exactly the URL string that we write in browser address bar, and on line, daily record data as shown in Figure 7.
If the http request of post method, under needing " the post data collecting assembly " of the application when manual testing to collect, get visit data.
Step S604: build test environment
In this application, need a machine, all relative programs are all disposed on this machine, comprising: Context tester (the regression test program of the application), program to be tested, former version program.
The object be deployed on same machine is: avoid the difference of machine environment to two procedure results bring unnecessary difference.And cause interference to contrast below.
Application deployment interception assembly: the effect of application blocker is the result object obtaining tested program and former version program.Blocker uses AOP technology, and the exit code place finding application program last, tackles in the same code position of two methods program.Obtain their result result object.
Step S606: two web applications are asked simultaneously with process simulation browser
Start to perform test, the application, from URL storehouse, takes out a url data.As shown in Figure 4.This URL takes out from URL storehouse, the request that in Fig. 2, " Http asks simulated assembly " simulation browser is applied web with this URL.Object is exactly by simulation browser request, to allow program perform by brake.
After two web application process requests, respectively will produce a result object exported, the core missions of the application's preferred embodiment will collect this two result objects exactly, and their difference of comparison, be then output into report.Detailed comparisons and output procedure are introduced at next step.
After the Comparative result of a URL terminates, then take out second URL again from URL storehouse, as shown in Figure 5.At this moment by second URL, we start second test case.Such use one by one URL is tested, and to the last a URL executes.
The all functions of our weblication, pass through the composition of URL one by one.A user has carried out one click to a Website page, is exactly the request of the URL being once sent to website in fact, and after request is received in website, executive routine, sends back to result the browser of user, and user just sees the content wanting to see.Click so one by one and " opened " website all functions, we simulate such click behavior, and Output rusults of checking, and whether that program than before changes, and just draw whether wrong generation.
One of emphasis of regression testing method in the present embodiment is exactly: ask two web applications simultaneously.
Web application wants connection data storehouse usually, looks into data." same time request " have an enormous advantage, because it makes test substantially not rely on, the test data that also Maintenance free is concrete, thus reduce testing cost.This is that other testing tool is incomparable.Give an example: people's same time opens the same page of same website with two browser points, the content seen should be the same except advertisement, and reason does not have " mistiming ", website data has little time change.We utilize this " data have little time change " feature to reach and do not rely on exactly, do not safeguard the object surveying data.What resemble the business softwares such as QTP is first record test script then to go test, necessarily have " mistiming ", usually a test data to be prepared, when ensureing to record script and when execution tests is identical data, does not so just know what whether the problem tested out was caused by data difference.
Step S608: the result object obtaining two web applications
From the request of upper step by simulation browser, two methods can perform identical function, and then result be kept in an object, instrument can use AOP technology to tackle, and catch result object, then next step is compared to them.
At this moment, following problem may be there is: the object of different web application belongs to different memory headrooms, thus cause can not directly comparison; On the other hand, object inner structure may as reticulate texture, and the object of such web application may be associated with the attribute of third party's class by reticulate texture.Even occur that ring-type association causes endless loop.Even without there is endless loop, also can be very consuming time.Just to take in the test of example 2 us just to travel through several thousand such objects, if each travel time is a little long, it is also not short time that accumulation is got up.
For the 1st problem, the embodiment of the application adopts following solution: by the result object of two converted web applications, serializing is to local hard drive.Specifically, first the attribute of object, sub-attribute are all converted to the Map of serializability, these simple types of Collection, String int are preserved.The object of such work ensures the attribute of object, sub-attribute is all serializability.Then, loading can be unified again by " the result object gatherer 202 " in Fig. 2 and come in, thus achieve by different memory headrooms to same memory headroom, so just can realize the comparison of result object.
For the 2nd problem, the embodiment of the application adopts " extendible filtrator " scheme: extendible filtrator briefly, is exactly according to different tested web applications, can write an assembly and filtered out by unwanted attribute.Concrete principle is, first calls filter assemblies before traveling through an attribute, allows this this attribute of filter assemblies identification the need of, unwanted words, and this attribute and the attribute associated by it have all no longer traveled through.Our object of such basic guarantee wants serializing to be all saving result data, useful attribute to the attribute on hard disk.
Concrete, can judge by following steps the attribute which attribute belongs to useless:
1) the attribute degree of depth is considered as useless excessively deeply.
The degree of depth of Attribute Association is darker, the more impossible place being tested application and preserving data.So in example 2, in test, our filtrator limits the attribute degree of depth is 10.Traversal can not be gone again in association backward.
2) not that user develops, do not belong to again the attribute of aggregate type, be deeply considered as useless (class in oneself class libraries of certain Java be except).
Because preserve the class of data, be all self-defining java class usually, write by developer, can be known by the bag name of class, some situation has used the class of third party's class libraries, should be the data structure class of aggregate type, Map and List as special in some.
3) class name of attribute belongs to the class name in predetermined set, then this attribute is useless attribute
Because the class name definition of attribute has Naming conventions, just know that these attributes can not to be used to preserve data by class name.As: XXService, XXUtils, XXHelper, XXBroker etc.These one are established a capital and are not used to preserve the class of data.
Because filter assemblies is write according to different web application, so use the web application of the application oneself can design the filtrator of oneself.
Said process as shown in Figure 8.
Step S610: the result object of traversal comparison two web applications
Step S608 by the serializing of the result object of two web applications on the hard disk of testing server (server 10 as Fig. 2).In step S610, they are compared in the middle of the internal memory that hard disk is loaded into proving installation (proving installation 20 as Fig. 2).
As shown in Figure 10, this traversal comparison process is exactly briefly whether the attribute of comparison two objects and sub-attribute be identical.Be equivalent to passenger's twice safety check in example 1, the contrast of machine autoscan with chest in the behavior of article similar.The thing that program also finds out the inside one by one contrasts.
But, the result difference of two programs is normal sometimes, because some is the function of random character, account for our weblication function 5%, the same page on such as our website, what all show when entering is different advertisements at every turn, and this is program normal function, so when comparison is to two weblication association attributeses will be pointed out when relating to the attribute of ad data different.Cause wrong report.
In order to address this is that, this application provides " easily extensible comparer " as shown in Figure 9, make when using the technical scheme of the application, if when running into this attribute with " random nature ", according to possible " random nature " and Design with Rule be directed to the comparer of this attribute specially, carry out necessary inspection.
As shown in Figure 9, comparer Control Component, acts on a total controller, is controlled by which comparer to be traveled through before traversing an attribute by it.Rule is: the preferential expansion comparer that uses carrys out comparison, does not expand the attribute of comparer, finds corresponding acquiescence comparer to compare by attribute type.By the difference that comparer compares, then export.
Above-mentioned test process can bring following technique effect:
1) high coverage rate
Owing to all functions result being all kept in " result object ", guarantee can not have been omitted.Function that these results are all corresponding, checked all results, checked all functions exactly.
2) high sensitive
If the wrong mistake of program to be measured exists, so be bound to preserve the result object of this function in " result object ", this result object is bound to distinguish the result object with former program, be so just bound to examined out, thus make the application have high sensitive.
Although procedure result in the past may also can be wrong, program was a program issued in the past.Enterprise's existing force, the highest quality level that can reach.The test so make comparisons with it, what bring us is exactly the highest susceptibility.
3) high artificial substituting rate
Because test errors discovery rate does not reach requirement in instrument in the past, a lot of problem is had all not measure, so will manual testing be carried out, because and it is local not know which instrument test can omit actually, so artificial test specification and the scope that instrument is tested are the same substantially, the work of people does not reduce thereupon, only people and instrument co-operation, serves the effect more easily finding mistake.
But the application has high coverage rate and high sensitive feature, make false discovery rate higher than manual testing, carry out manual testing more nonsensical, the workload of people is only that reading test is reported, remove the mistake of wrong report, find real mistake, natural workload has just gone test few much than people in person.
Step S612: export comparing result
Comparing result is outputted in a file or database, when performing example 2 and testing, result has been outputted to a file.
Now, another one problem is encountered: output content is a lot.This is that the hypersensitivity of the application, brings in addition because the amplitude of our reconstruct is very large.Such as: some attribute be in original program with less than rubbish attribute, in reconstruct, it please be removed, the difference of formation.The Query Result produced due to a mistake is different, produces a lot of indirectly difference results.
In order to address this problem, we realize the filtration to Output rusults, to reduce unnecessary output by realization " extendible output filter ".Such as: in the test middle filtrator in example 2, done following operation: ignore with less than the output of rubbish attribute; Query Result is diverse, only exports the id of Query Result record, no longer exports detail.Query Result is substantially identical, then exports details difference.
Step S614: generate test report
The thing that this step will be done is the result data files upper step generated, but these data are not the data that we will see.We allow user according to the different form rule that should be used for reality oneself by the design of extendible " form plug-in unit ", can realize filtering, sequence, Classifying Sum, and other process.Allowing user oneself define which type of data is that they want to see.Thus solve this bring because test susceptibility is high the large problem of generation data volume.
The benefit of such work is given an example: in our test process in example 2,1 hour 40 minutes used time, generates the report plug-in component operation time less than 1 second.If will be unsatisfied with the data structure of report, can adjust the setting of test report plug-in unit, regenerate report, what this adjusted only needs just generate a new report in.If but test process be not separated with generation reporting process, heavily come once must 1 hour 40 minutes.
Here is the test report generated after the test process of example 2: this report that we generate is through the report of the XML format gathered by property location, opens as shown in figure 11 with IE.
As shown in figure 11, what <Path> described is the position of attribute in result object.Deploying portion represents: this difference all occurred in which URL.Except value: before referring to, what value of the operation result of program is.Current value: what value referring to program operation result to be measured is.
As above Figure 11 shows, and this property value of context.ctr product ids of two web applications is different.
This attribute saves the Query Result id of " function of search ", and this property value is different, and illustrate that two methods program is under same search condition, Search Results is different, and we have just found an important mistake like this.
As above Figure 12 shows this property value difference of context.listView.leftSortBy of two weblications.Difference is very little, is only that program to be measured has had more one "-".This attribute is the URL's of " rank button " of preserving on the page.This is obviously application program to be measured " generate URL " there is problem in function.
The regression testing method of the application and the preferred scope of application of device are: the regression test of web application, non-page function.
Obviously, those skilled in the art should be understood that, each module of above-mentioned the application or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, and in some cases, step shown or described by can performing with the order be different from herein, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the application is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiment of the application, be not limited to the application, for a person skilled in the art, the application can have various modifications and variations.Within all spirit in the application and principle, any amendment done, equivalent replacement, improvement etc., within the protection domain that all should be included in the application.

Claims (11)

1. a regression testing method for web application, is characterized in that, comprising:
Obtain the web page address that in the first web application and the second web application, each function is corresponding, wherein, described first web application and the second web application are the different editions of same web application;
Under identical test environment, use the web page address of described acquisition to ask described first web application and the second web application simultaneously;
The second result object that the first result object returned in response to described request described first web application and described second web application return in response to described request compares, and obtains comparative result;
Wherein, the step that the first result object returned in response to described request described first web application and described second web application compare in response to the second result object that described request returns comprises: perform at described first web application and carry out interception to described first web application in the process of the function of asking and obtain described first result object, performs carry out interception to described second web application in the process of the function of asking and obtain described second result object at described second web application; The attribute of the attribute of described first result object and described second result object is carried out serializing; The attribute of described first result object after serializing and the attribute of described second result object are loaded in same memory headroom and compare.
2. method according to claim 1, is characterized in that, before the attribute of the attribute of described first result object and described second result object is carried out serializing, also comprises:
The attribute of described first result object and the attribute of described second result object are filtered, filters out useless attribute;
The attribute of described first result object except described useless attribute and the attribute of described second result object are carried out serializing.
3. method according to claim 2, is characterized in that, judges described useless attribute by following steps:
If the degree of depth of described attribute exceedes predetermined threshold, then judge that this attribute is useless attribute; Or
If described attribute is the attribute in predetermined aggregate type, then judge that this attribute is useless attribute; Or
If the class name of described attribute is not the class name in predetermined set, then judge that this attribute is useless attribute.
4. method according to claim 1, is characterized in that, the attribute of described first result object after serializing and the attribute of described second result object is loaded into the process compared in same memory headroom and comprises:
Described first result object and described second result object are loaded in the internal memory of test procedure;
Whether there are differences between the attribute of described first result object after Ergodic judgement serializing and the attribute of described second result object;
If there are differences, then export the information that there are differences between the attribute of described first result object of instruction and the attribute of described second result object.
5. method according to claim 1, it is characterized in that, after the second result object returned in response to described request at the first result object returned in response to described request described first web application and described second web application compares, also comprise:
Comparative result is generated data file;
Read the comparative result in described data file, use described comparative result to carry out generating report forms according to the statement form of different-format.
6. method according to claim 1, is characterized in that, described identical test environment comprises: the same time uses same test procedure on same machine.
7. a regression test device for web application, is characterized in that, comprising:
Acquiring unit, for obtaining the web page address that in the first web application and the second web application, each function is corresponding, wherein, described first web application and the second web application are the different editions of same web application;
Request unit, asks described first web application and the second web application for using the web page address of described acquisition under identical test environment simultaneously;
Comparing unit, the second result object returned in response to described request for the first result object of returning in response to described request described first web application and described second web application compares, and obtains comparative result;
Wherein, described comparing unit comprises: blocking module, in the process of the function of asking, interception is carried out to described first web application obtain described first result object for performing at described first web application, perform at described second web application and in the process of the function of asking, interception is carried out to described second web application and obtain described second result object; Serializing module, for carrying out serializing by the attribute of the attribute of described first result object and described second result object; Load-on module, compares for the attribute of described first result object after serializing and the attribute of described second result object being loaded in same memory headroom.
8. device according to claim 7, is characterized in that, described comparing unit comprises:
Filtering module, for before the attribute of the attribute of described first result object and described second result object is carried out serializing, filters the attribute of described first result object and the attribute of described second result object, filters out useless attribute;
Wherein, described serializing module is used for the attribute of described first result object except described useless attribute and the attribute of described second result object to carry out serializing.
9. device according to claim 8, is characterized in that, described filtering module comprises: judge submodule, for being judged described useless attribute by following steps:
If the degree of depth of described attribute exceedes predetermined threshold, then judge that this attribute is useless attribute; Or
If described attribute is the attribute in predetermined aggregate type, then judge that this attribute is useless attribute; Or
If the class name of described attribute is not the class name in predetermined set, then judge that this attribute is useless attribute.
10. device according to claim 7, is characterized in that, described load-on module comprises:
Second judges submodule, for described first result object and described second result object are loaded in the internal memory of test procedure, and whether there are differences between the attribute of described first result object after Ergodic judgement serializing and the attribute of described second result object;
Output sub-module, during for there are differences between the attribute of described first result object after serializing and the attribute of described second result object, export the information that there are differences between the attribute of described first result object of instruction and the attribute of described second result object.
11. devices according to claim 7, is characterized in that, also comprise:
First generation unit, after the second result object for returning in response to described request at the first result object returned in response to described request described first web application and described second web application compares, comparative result is generated data file;
Second generation unit, for reading the comparative result in described data file, uses described comparative result to carry out generating report forms according to the statement form of different-format.
CN201110217258.3A 2011-07-29 2011-07-29 The regression testing method of web application and device Active CN102902619B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201110217258.3A CN102902619B (en) 2011-07-29 2011-07-29 The regression testing method of web application and device
HK13103664.4A HK1176147A1 (en) 2011-07-29 2013-03-25 Method and device for regression testing of a web application program web

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110217258.3A CN102902619B (en) 2011-07-29 2011-07-29 The regression testing method of web application and device

Publications (2)

Publication Number Publication Date
CN102902619A CN102902619A (en) 2013-01-30
CN102902619B true CN102902619B (en) 2015-09-09

Family

ID=47574865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110217258.3A Active CN102902619B (en) 2011-07-29 2011-07-29 The regression testing method of web application and device

Country Status (2)

Country Link
CN (1) CN102902619B (en)
HK (1) HK1176147A1 (en)

Families Citing this family (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335278A (en) * 2014-06-16 2016-02-17 阿里巴巴集团控股有限公司 Testing method and device
US9811248B1 (en) 2014-07-22 2017-11-07 Allstate Institute Company Webpage testing tool
CN104239209B (en) * 2014-09-19 2017-09-26 广州华多网络科技有限公司 A kind of perspective and method of testing for web system, relevant apparatus and system
CN105760291B (en) * 2014-12-17 2019-08-09 阿里巴巴集团控股有限公司 A kind of regression testing method and system
CN106155890A (en) * 2015-04-02 2016-11-23 深圳市腾讯计算机系统有限公司 platform test method and system
CN104809061B (en) * 2015-04-09 2018-08-10 百度在线网络技术(北京)有限公司 regression testing method and device
CN104965784B (en) * 2015-06-16 2017-12-26 广州华多网络科技有限公司 Automatic test approach and device
CN106484601B (en) * 2015-08-24 2020-08-25 腾讯科技(深圳)有限公司 User data analysis method and system for client
CN106557414A (en) * 2015-09-28 2017-04-05 富士通株式会社 Application testing system and method
CN105260303A (en) * 2015-10-10 2016-01-20 浪潮电子信息产业股份有限公司 Automated-test based agile testing scheme
CN107102937B (en) * 2016-02-19 2021-03-02 腾讯科技(深圳)有限公司 User interface testing method and device
CN105824752B (en) * 2016-03-16 2018-09-14 北京齐尔布莱特科技有限公司 A kind of automatic interface testing method, device and computing device
CN106095663B (en) * 2016-05-26 2017-06-27 西安交通大学 Program based on hierarchical model returns location of mistake method
CN106055480B (en) * 2016-06-02 2021-03-16 腾讯科技(深圳)有限公司 Method and terminal for debugging webpage
CN107885651B (en) * 2016-09-30 2020-11-24 千寻位置网络有限公司 Automatic system regression testing method and device for mobile terminal positioning algorithm
CN106897217A (en) * 2017-02-13 2017-06-27 北京趣拿软件科技有限公司 Method of testing and test device
CN106959925B (en) * 2017-04-25 2020-06-30 北京云测信息技术有限公司 Version testing method and device
CN107870858A (en) * 2017-05-05 2018-04-03 平安科技(深圳)有限公司 Version contrast test method and system
CN109002389B (en) * 2017-06-07 2022-03-04 北京京东尚科信息技术有限公司 Method and device for automatically testing page
CN107153599B (en) * 2017-06-14 2021-02-26 上海点融信息科技有限责任公司 Method and equipment for recording and playing back user operation
CN110362464B (en) * 2018-04-11 2022-02-11 腾讯科技(深圳)有限公司 Software analysis method and equipment
CN109409399A (en) * 2018-08-23 2019-03-01 深圳点猫科技有限公司 A kind of script error book of final entry method and electronic equipment based on educational system
CN109471802A (en) * 2018-11-01 2019-03-15 郑州云海信息技术有限公司 A kind of method and device of abnormality processing in Python webpage
CN109739656B (en) * 2018-11-29 2020-11-27 东软集团股份有限公司 Interface data simulation method and device, storage medium and electronic equipment
CN110083543B (en) * 2019-05-07 2022-08-19 江苏满运软件科技有限公司 Regression testing method, device, electronic equipment and storage medium
CN110333875A (en) * 2019-07-02 2019-10-15 上海企创信息科技有限公司 A kind of service routine update method, device, server and storage medium
CN110471859A (en) * 2019-09-12 2019-11-19 泰康保险集团股份有限公司 Service test method, device, medium and electronic equipment
CN111966592A (en) * 2020-08-11 2020-11-20 网联清算有限公司 Front-end page testing method, device, medium and electronic equipment
CN112506786B (en) * 2020-12-15 2022-04-19 西安中朗智控科技有限公司 Regression testing method and regression testing device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101286119A (en) * 2008-05-27 2008-10-15 华耀环宇科技(北京)有限公司 Method for determining function point changing through code analysis
CN101303664A (en) * 2008-06-19 2008-11-12 腾讯科技(深圳)有限公司 Professional quick test device and method
CN101526916A (en) * 2008-03-03 2009-09-09 阿里巴巴集团控股有限公司 Method and system for using page-based object flow verification in regression test
CN101882107A (en) * 2010-06-28 2010-11-10 山东中创软件商用中间件股份有限公司 Method and device for automatically testing WEB (World Wide Web) application
CN102063374A (en) * 2011-01-07 2011-05-18 南京大学 Method for selecting regression test case for clustering with semi-supervised information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102110048B (en) * 2009-12-28 2014-07-09 国际商业机器公司 Regression testing selection method and device for frame-based application program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101526916A (en) * 2008-03-03 2009-09-09 阿里巴巴集团控股有限公司 Method and system for using page-based object flow verification in regression test
CN101286119A (en) * 2008-05-27 2008-10-15 华耀环宇科技(北京)有限公司 Method for determining function point changing through code analysis
CN101303664A (en) * 2008-06-19 2008-11-12 腾讯科技(深圳)有限公司 Professional quick test device and method
CN101882107A (en) * 2010-06-28 2010-11-10 山东中创软件商用中间件股份有限公司 Method and device for automatically testing WEB (World Wide Web) application
CN102063374A (en) * 2011-01-07 2011-05-18 南京大学 Method for selecting regression test case for clustering with semi-supervised information

Also Published As

Publication number Publication date
CN102902619A (en) 2013-01-30
HK1176147A1 (en) 2013-07-19

Similar Documents

Publication Publication Date Title
CN102902619B (en) The regression testing method of web application and device
Jin et al. Service candidate identification from monolithic systems based on execution traces
US9535823B2 (en) Method and apparatus for detecting software bugs
US9465718B2 (en) Filter generation for load testing managed environments
EP2600250A1 (en) Method and system for performance assurance of applications.
Pezze et al. Generating effective integration test cases from unit ones
Gulzar et al. Perception and practices of differential testing
Schaefer et al. Model-based exploratory testing: a controlled experiment
Nabuco et al. Model-based test case generation for web applications
Oster Feature model-based software product line testing
Shanthi et al. Automated test cases generation for object oriented software
Liu et al. Testing input validation in web applications through automated model recovery
Vos et al. FITTEST: A new continuous and automated testing process for future internet applications
Baker et al. Detect, fix, and verify TensorFlow API misuses
CN115437940A (en) API (application programming interface) testing method suitable for financial cloud platform
Vos et al. The FITTEST tool suite for testing future internet applications
Kanstrén A framework for observation-based modelling in model-based testing
Tiwari et al. Mimicking production behavior with generated mocks
Nahar et al. SSTF: A novel automated test generation framework using software semantics and syntax
Micskei et al. Robustness testing techniques for high availability middleware solutions
Tosi et al. A survey on how well-known open source software projects are tested
Lübke Calculating test coverage for BPEL processes with process log analysis
Majeed et al. Model-based replay testing for event-driven software
Jin et al. Dynamic cohesion measurement for distributed system
Al Dallal Class-based testing of object-oriented framework interface classes

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1176147

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1176147

Country of ref document: HK