CN102981958B - Method for testing software and proving installation - Google Patents

Method for testing software and proving installation Download PDF

Info

Publication number
CN102981958B
CN102981958B CN201210557000.2A CN201210557000A CN102981958B CN 102981958 B CN102981958 B CN 102981958B CN 201210557000 A CN201210557000 A CN 201210557000A CN 102981958 B CN102981958 B CN 102981958B
Authority
CN
China
Prior art keywords
testing procedure
testing
procedure
information
retry
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
CN201210557000.2A
Other languages
Chinese (zh)
Other versions
CN102981958A (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.)
Juhaokan Technology Co Ltd
Original Assignee
Qingdao Hisense Media Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Hisense Media Network Technology Co Ltd filed Critical Qingdao Hisense Media Network Technology Co Ltd
Priority to CN201210557000.2A priority Critical patent/CN102981958B/en
Publication of CN102981958A publication Critical patent/CN102981958A/en
Application granted granted Critical
Publication of CN102981958B publication Critical patent/CN102981958B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of method for testing software and proving installation, described method comprises: resolve the test case script of tested software; Performing in the process of each testing procedure successively according to analysis result, if current testing procedure is for needing verification step, then perform information and executing this testing procedure complete according to the step of this testing procedure, after obtaining execution result, the method that the verification method name referring calling this testing procedure shows, and the expectation value of this testing procedure and identifying object information are passed in the method described execution result is verified.Because tester according to checking demand, can configure corresponding verification method title easily in test case script; After test case script is resolved, checking demand can be realized according to the verification method title dynamic call correlation method of configuration; In this process, tester need not relate to programming, makes tester more be absorbed in the relevant content of test logic, completes complicated test assignment efficiently, fast.

Description

Method for testing software and proving installation
Technical field
The present invention relates to software test field, particularly relate to a kind of method for testing software and proving installation.
Background technology
Software test, always is that very crucial in software development is also a very loaded down with trivial details ring; How efficiently along with the development of software company, product line constantly expands, and software redaction is constantly released, and the platform of support is more and more abundanter, carry out test fast become institute of software test team problems faced to software product.Increasing project team carries out Automation regression testing in consideration to software product, considers the automation tools choosing oneself project team applicable.In the face of various, the miscellaneous automation tools of number, selection neither part thing easily.Automated test tool of increasing income has the testing tools such as Selenium, Watir, and the testing tool of business is as SilkTest of Rational Functional Tester, the Rational Robot of International Business Machine Corporation (IBM) IBM, QuickTest Professional, Borland company of Hewlett-Packard Corporation of Hewlett-Packard etc.Open-Source Tools use cost is lower, but function is abundant not as business tool.Business tool can provide powerful recording function, and by beginner is liked, but recording script is not automatic test optimal case.Record test data in script and shell script mixed in together, be difficult to safeguard; In addition, when larger change occurs test case, maintenance use case and the energy that recording use-case spends again are made no distinction of rank.But no matter use automated test tool that is that increase income or business, all need tester to be familiar with exploitation programming language.Programming threshold outstanding operational trials expert greatly can only be stopped to automatic test look at afar.
Therefore, at Wb(network) application software or Android(Android) field tests of application software, how increasing test macro development teams allows the business expert being unfamiliar with programming also can write Automation regression testing use-case in research.The mode of operation of current trend is: tester uses XML(ExtensiveMakeupLanguage, extensible markup language) maintenance test use-case, the content that only needs maintenance test logic associated with the data; Test macro developer provides the testing engine of processing XML use-case script file.Tester uses testing engine to perform XML use-case script file and completes test process.
But under the test sight of complexity, correctly perform in order to ensure testing procedure, need to increase various check post.Such as, the control needing to verify in Web page whether exist or need to compare expectation value whether equal with actual characters string, whether comprise, whether comprise prefix, suffix or needs compare expect whether equal with real figure, whether be greater than, equal, be less than.But the testing engine based on XML case script of prior art can not provide the function verified check post; In order to verify testing procedure execution result, tester has to carry out complicated programing work to realize the automatic Verification of check post; This makes tester cannot be absorbed in the relevant content of test logic, and, also efficiently, fast cannot complete test assignment.
In sum, the method for testing based on XML case script of prior art cannot provide the function of validation test step execution result for tester, makes tester cannot complete the test assignment of more complicated efficiently, fast.
Summary of the invention
The embodiment provides a kind of method for testing software and proving installation, in order to provide the method for testing based on test case script of the function with validation test step execution result, so that tester completes the test assignment of more complicated efficiently, fast.
According to an aspect of the present invention, provide a kind of method for testing software, comprising:
The test case script of tested software is resolved; The step execution information for each testing procedure configures is described in described test case script, and be the step authorization information needing verification step to configure in described testing procedure, described step authorization information comprises: verification method title, expectation value, identifying object information;
Performing in the process of each testing procedure successively according to analysis result, if current testing procedure is for needing verification step, then perform information and executing this testing procedure complete according to the step of this testing procedure, after obtaining execution result, the method that the verification method name referring calling this testing procedure shows, and the expectation value of this testing procedure and identifying object information are passed in the method described execution result is verified.
Wherein, described identifying object information is specially variable name; And
The method that the described verification method name referring calling this testing procedure shows, and the expectation value of this testing procedure and identifying object information are passed in the method described execution result is verified, be specially:
The method that the verification method name referring calling this testing procedure shows, and by the expectation value of this testing procedure, and the identifying object information of this testing procedure is passed in the method; The method, according to described expectation value, is verified the value of the variable indicated by described variable name in described execution result;
Or described identifying object information is specially the locating information of identifying object; And
The method that the described verification method name referring calling this testing procedure shows, and the expectation value of this testing procedure and identifying object information are passed in the method described execution result is verified, be specially:
The method that the verification method name referring calling this testing procedure shows, and by the expectation value of this testing procedure, and the locating information of the identifying object of this testing procedure is passed in the method, by the method according to the locating information of described identifying object from as locating verification object the page of execution result, and to verify according to the value of described expectation value to the identifying object of location.
Further, described step authorization information also comprises: number of retries setting value; And
After the described expectation value by this testing procedure is passed to and verifies described execution result in the method, also comprise:
If the result that the method returns is unsuccessfully, then the number of retries setting value according to this testing procedure carries out retry:
In a retry procedure, again after performing this testing procedure of information and executing according to the step of this testing procedure, the method that the verification method name referring calling this testing procedure again shows, verifies according to the execution result of expectation value to this testing procedure of this testing procedure again;
The result that in this retry procedure, the method returns if determine is still unsuccessfully, then, after determining that the number of times of retry is less than the number of retries setting value of this testing procedure, carry out next retry procedure;
The result that in this retry procedure, the method returns if determine is successfully, then determine that the final the result of this testing procedure is successfully.
Further, described step authorization information also comprises: check post classification; And
After the described number of retries setting value according to this testing procedure carries out retry, also comprise:
If the final the result of this testing procedure obtained is unsuccessfully, then:
If determine, the check post classification of this testing procedure is for asserting classification, then stop the execution of described test case script, report failure result;
If determine, the check post classification of this testing procedure is for checking classification, then perform the next testing procedure of information and executing according to the step of next testing procedure.
Further, described step authorization information also comprises: verification tool information; And
Before the method that the described verification method name referring calling this testing procedure shows, also comprise:
Determine instrument belonging to described method; And
Described test case script is extensible markup language XML format.
According to another aspect of the present invention, additionally provide a kind of software testing device, comprising:
Test case parsing module, for resolving the test case script of tested software; The step execution information for each testing procedure configures is described in described test case script, and be the step authorization information needing verification step to configure in described testing procedure, described step authorization information comprises: verification method title, expectation value, identifying object information;
Testing execution module, for performing in the process of each testing procedure successively according to the analysis result of described test case parsing module, if current testing procedure is for needing verification step, then perform information and executing this testing procedure complete according to the step of this testing procedure, after obtaining execution result, the method that the verification method name referring calling this testing procedure shows, and by the expectation value of this testing procedure and and identifying object information be passed in the method described execution result verified.
Further, described step authorization information also comprises: number of retries setting value; And
Described testing execution module is after the described expectation value by this testing procedure is passed to and verifies described execution result in the method, if also for determining that the result that the method returns is unsuccessfully, then the number of retries setting value according to this testing procedure carries out retry:
In a retry procedure, after described testing execution module performs this testing procedure of information and executing according to the step of this testing procedure again, the method that the verification method name referring calling this testing procedure again shows, verifies according to the execution result of expectation value to this testing procedure of this testing procedure again;
If described testing execution module determines that the result that in this retry procedure, the method returns is still unsuccessfully, then, after determining that the number of times of retry is less than the number of retries setting value of this testing procedure, carry out next retry procedure;
If described testing execution module determines that the result that in this retry procedure, the method returns is successfully, then determine that the final the result of this testing procedure is successfully.
Further, described step authorization information also comprises: check post classification; And
Described testing execution module is also for after the described number of retries setting value according to this testing procedure carries out retry, if the final the result of this testing procedure obtained is unsuccessfully, then: if determine, the check post classification of this testing procedure is for asserting classification, then stop the execution of described test case script, report failure result; If determine, the check post classification of this testing procedure is for checking classification, then perform the next testing procedure of information and executing according to the step of next testing procedure.
Wherein, described testing execution module comprises: testing procedure performance element, authentication unit, retry unit;
Described testing procedure performance element is used for performing in the process of each testing procedure successively according to described analysis result, if current testing procedure is for needing verification step, then perform information and executing this testing procedure complete according to the step of this testing procedure, after obtaining execution result, send checking notice;
Described authentication unit is used for after receiving the checking notice of described testing procedure performance element transmission, the method that the verification method name referring calling this testing procedure shows, and by the expectation value of this testing procedure and and identifying object information be passed in the method described execution result verified; And
Described authentication unit also for after being passed in the described expectation value by this testing procedure and verifying described execution result in the method, if also for determining that the result that the method returns is unsuccessfully, then sends retry notice to described retry unit;
Described retry unit is used for counting the number of retries of this testing procedure, and after the described retry notice of reception, if determine, the number of retries of this testing procedure is less than the number of retries setting value of this testing procedure, then determine to carry out a retry to this testing procedure, send retry notice to described testing procedure performance element;
Described testing procedure performance element also for after receiving described retry notice, performs this testing procedure of information and executing according to the step of this testing procedure again, and after obtaining execution result, sends described checking notice; And
Described retry unit is also for after the described retry notice of reception, if determine, the number of retries of this testing procedure is equal to or greater than the number of retries setting value of this testing procedure, then: if determine, the check post classification of this testing procedure is for asserting classification, then termination notice is sent to described testing execution module; If determine, the check post classification of this testing procedure is for checking classification, then send to described testing execution module and continue notice; And
Described testing procedure performance element also for according to described termination notice, stops the execution of described test case script, report failure result; Or perform next testing procedure according to described continuation notice.
Further, described device also comprises:
Test cases technology module, for receiving the step execution information that tester is each testing procedure configuration, and the step authorization information needing verification step in testing procedure; Information according to receiving generates described test case script by predetermined format;
Test case memory module, for storing the test case script of described Test cases technology CMOS macro cell; And
Described test case parsing module is also for obtaining described test case script according to test instruction from described test case memory module.
In the technical scheme of the embodiment of the present invention, because tester according to checking demand, can configure corresponding verification method title in test case script; After test case script is resolved, utilize the characteristic of Java reflex mechanism dynamic call method, class, realize the function calling correlation method according to the verification method title of configuration, thus realize checking demand; In the process, tester need not relate to programming, and only need understand the title that some can realize the method for checking demand, makes tester more be absorbed in the relevant content of test logic, can complete the test assignment of more complicated efficiently, fast.
Further, tester also can configure number of retries predetermined value in test case script; Control according to the number of retries predetermined value of configuration the number of times verifying retry, tester can realize the repeatedly retry verified easily; Contribute to the test assignment that tester completes more complicated efficiently, fast further.
Accompanying drawing explanation
Fig. 1 is the method flow diagram tested tested software of the embodiment of the present invention;
Fig. 2 is the inner structure block diagram of the software testing device of the embodiment of the present invention;
Fig. 3 is the inner structure block diagram of the testing execution module of the embodiment of the present invention.
Embodiment
For making object of the present invention, technical scheme and advantage clearly understand, enumerate preferred embodiment referring to accompanying drawing, the present invention is described in more detail.But it should be noted that, the many details listed in instructions are only used to make reader to have a thorough understanding, even if do not have these specific details also can realize these aspects of the present invention to one or more aspect of the present invention.
The term such as " module " used in this application, " system " is intended to comprise the entity relevant to computing machine, such as but not limited to hardware, firmware, combination thereof, software or executory software.Such as, module can be, but be not limited in: the thread of the process that processor runs, processor, object, executable program, execution, program and/or computing machine.For example, application program computing equipment run and this computing equipment can be modules.One or more module can be positioned at an executory process and/or thread, and module also and/or can be distributed on a computing machine between two or more platform computing machines.
The present inventor finds that checking demands different in test process needs different power functions to realize; And most checking demand is by utilizing Java(object oriented program language) power function that provides of reflex mechanism dynamic call realizes.
Such as, for the checking demand whether Confirmation Controls exists, for the automated test tool Selenium of open source code, the method that can call comprises as follows:
IsElementPresent (String arg0), for judging whether certain page elements exists;
IsAlertPresent (String arg0), for judging whether certain prompted dialog frame exists;
IsConfirmationPresent () (String arg0), for judging that certain confirms whether dialog box exists;
IsTextPresent (String arg0), for judging whether certain the text field exists.
For the checking demand of character string, then can utilize the unit testing framework of JUnit(Java language) assertThat assert grammer, its method that can call comprises as follows:
AssertThat (testedString, containsString (" expected value ")), for judging whether character string comprises;
AssertThat (testedString, endsWith (" suffix ")), for judging whether character string comprises certain suffix;
AssertThat (testedString, startsWith (" prefix ")), for judging whether character string comprises certain prefix;
AssertThat (testedValue, equalToIgnoringCase (expectedValue)), for judging that whether character string is equal, and ignorecase.
For the checking demand of numerical value, the method called that grammer provides comprises to utilize JUnit assertThat to assert:
AssertThat (testedNumber, greaterThan (16.0)), for judging whether numerical value is greater than certain numeric ratio as numerical value 16.0;
AssertThat (testedNumber, lessThan (16.0)), for judging whether numerical value is less than certain numeric ratio as numerical value 16.0;
AssertThat (testedNumber, greaterThanOrEqualTo (16.0)), for judging whether numerical value is more than or equal to certain numeric ratio as numerical value 16.0;
AssertThat (testedNumber, lessThanOrEqualTo (16.0)), for judging whether numerical value is less than or equal to certain numeric ratio as numerical value 16.0;
What JUnit assertThat asserted that grammer provides can also support other checking demands by call method, such as set and list etc.
What utilize the dynamic call of Java reflex mechanism Selenium, JUnit etc. to provide has preferably readable method, and tester just can recognize the general function of the method according to the method name of certain method; If tester calls these methods according to checking demand coding code, testing efficiency can not be significantly improved; But, if the method name allowing tester can realize the method for checking demand is configured in test case script; And after test case script is resolved, utilize the characteristic of Java reflex mechanism dynamic call method, class, realize the function calling correlation method according to the method name of configuration, thus realize checking demand.Like this, tester, when realizing checking demand, only need configure corresponding method name, and need not relate to programming in test case script; Make tester more be absorbed in the relevant content of test logic, the test assignment of more complicated can be completed efficiently, fast.
The technical scheme of the embodiment of the present invention is described in detail below in conjunction with accompanying drawing.The software testing device that the embodiment of the present invention provides can provide the configuration interface of test case for tester; By configuration interface, the step that tester can input each testing procedure performs information; The step of testing procedure performs information and can comprise: number of steps (index), step type (type), step title (name), step parameter.If involved by testing procedure is page control, then step parameter is the locating information of test elements object, with XPath(XML Path Language in test case script, and XML path language) labeled marker; If testing procedure needs to input data, then step parameter is the data needing input, with VALUE(data) labeled marker.
For needing verification step in testing procedure, tester, also by configuration interface, inputs the step authorization information of this testing procedure.The step authorization information of testing procedure can comprise: verification method title, expectation value;
Further, the step authorization information of testing procedure also can comprise: the locating information of number of retries setting value, check post classification, identifying object; Further, step authorization information also can comprise: verification tool information.
Configuration interface is after the relevant information of each testing procedure that have received tester's input, and software testing device presses predetermined format generating test use case script.
The following shows the test case script example of a concrete XML format:
In above-mentioned test case script example, the first row is XML statement, the version (1.0) which defining XML and the coding (UTF-8) used; Afterwards, that the processing instruction of specifying is provided with XLST (Extensible Stylesheet Language Transformations, extensible stylesheet table code-switching) conversion, the viewed device of test case XML file energy can be made to open and be shown as HTML(HypertextMarkup Language, HTML (Hypertext Markup Language)) form.XSLT is a W3C standard, XML can be converted to other form, such as html format.Each SUITE(protos test suite PROTOS) element configuration information that use-case can be specified to perform, the automated test tool Selenium information etc. of such as browser and open source code.Each TEST(test) element correspond to a test case, each TEST comprises some STEP(steps) element, correspond to different testing procedures.Each STEP labeled marker goes out the relevant information of testing procedure, comprises step and performs information and step authorization information.Such as, in example, step 1 is for inputting user account title, and step 2 is for inputting the password of user, and step 3, for clicking login button, completes login feature.Wherein step 3 is for needing verification step, and the check post classification in the step authorization information of this testing procedure is verified by VERIFY() labeled marker for checking classification; If the check post classification in the step authorization information of other testing procedure is asserted by ASSERT() labeled marker, then show that this check post classification is for asserting classification; Verification method title is by METHOD(method) labeled marker, be equalToIgnoringCase, whether equal for judging two string datas; Expectation value is by ARGUMENT(parameter) labeled marker, for " welcoming you, keeper! "; The locating information of identifying object is by actual(actual value) labeled marker, for //span [@name=' welcome '], indicate the locating information of identifying object in display page; Number of retries setting value is by retry(retry) labeled marker; Verification tool information is by type(type) labeled marker.In above-mentioned example, type=' assertThat ' represents that use JUnit assertThat asserts that semantic tools are verified; Type=' Selenium ' can be specified in other situation, adopt automated test tool Selenium to the checking of page control element, etc.
According to above-mentioned test case script, the concrete grammar flow process that the software testing device that the embodiment of the present invention provides is tested tested software, as shown in Figure 1, comprises the steps:
S101: the test case script of tested software is resolved, makes i=1, number of retries j=1.
In this step, the test case script of software testing device to tested software is resolved, therefrom parse the step execution information for each testing procedure configures, and be the step authorization information needing verification step to configure in described testing procedure, as analysis result.
After obtaining analysis result, software testing device will perform each testing procedure according to following steps according to analysis result successively; Before each testing procedure of execution, software testing device makes i=1, number of retries j=1.
S102: perform i-th testing procedure.
In this step, software testing device performs information according to the step of current testing procedure, and namely the step of i-th testing procedure performs this testing procedure of information and executing; After this testing procedure is finished, obtain execution result.Automated test tool all provides the mode of location Web page control, for Selenium, it can pass through CSS (Cascading Style Sheets, CSS (cascading style sheet)), client-side scripting language Javascript and XPath orient control, and mode is very abundant.Step type correspond to the application programming interface API(Application Program Interface of testing tool, application programming interfaces), the API that testing tool all provides the similar Click of clicking, double-clicks DoubleClick, pulls DragAndDown, inputs the type action such as data.Particularly, software testing device calls corresponding Selenium method according to step type, and imports step parameter into the method and complete testing procedure.
Such as, the software test step for Web application can be perform certain action to page control; Such as control can be input frame, login button, and the action of execution can be input data, or clicks;
Such as, in above-mentioned test case script example, the testing procedure of index=" 1 " is the 1st testing procedure, indicating test elements object according to step type type=" Type.INPUT " is control input frame, according to test elements objects location information <XPATH>//input [@id='user'] </XPATH> in step parameter can assignment test element object in the position of the page, the data of input frame input are indicated according to the data <VALUE>admin</VA LUE> of the needs input in step parameter, the testing procedure performing information and executing according to the step of this testing procedure is: at the id attribute of the page be ' input " admin " in the input frame of user '.
The technology how to be well known to those skilled in the art according to the step execution information and executing testing procedure of testing procedure, repeats no more herein.
S103: judge that whether i-th testing procedure be for needing verification step; If so, perform step S104 to verify; Otherwise, perform the execution that step S110 carries out next testing procedure.
In this step, software testing device can according to whether there is the step authorization information of i-th testing procedure in analysis result to judge that whether current testing procedure is for needing verification step; Such as, for above-mentioned test case script example, in the testing procedure of the testing procedure in index=" 1 ", index=" 2 ", the step authorization information do not indicated with check post classification VERIFY or ASSERT; Then there is the step authorization information indicated with VERIFY in the testing procedure of index=" 3 "; Thus, can judge the testing procedure of index=" 3 ", namely the 3rd testing procedure is for needing verification step.
After software testing device determines that current testing procedure is verification step, perform step S104 and verify; Otherwise, perform the execution that step S110 carries out next testing procedure.
S104: the execution result of i-th testing procedure is verified.
Determine that current testing procedure is for after needing verification step at software testing device, in this step, software testing device is verified the execution result obtained in step S102: software testing device utilizes reflex mechanism Dynamic Acquisition Matchers(to mate) example of class, and the method that the verification method name referring calling this testing procedure shows, and the expectation value of this testing procedure and identifying object information are passed in the method described execution result is verified.
Particularly, described identifying object information can be variable name, method in the Java reflex mechanism that the verification method name referring calling this testing procedure shows, and the variable name in the expectation value of this testing procedure and identifying object information is passed in the method described execution result is verified; After namely calling the method, the value of the variable indicated by described variable name in the expectation value imported into and execution result compares by the method, thus the value of the variable indicated by described variable name in described execution result is verified, be verified result and return.
Or described identifying object information can be the locating information of identifying object; Identifying object is generally the control on the page; Method in the Java reflex mechanism that the verification method name referring calling this testing procedure shows, and the expectation value of this testing procedure and the locating information of identifying object are passed in the method, by the method according to the locating information of described identifying object from as locating verification object the page of execution result, and to verify according to the value of described expectation value to the identifying object of location.
The step authorization information according to the 3rd testing procedure of above-mentioned test case script example carries out the process verified: call the method indicated by equalToIgnoringCase, imports expectation value into and " welcome you, keeper in the method such as! ", and the locating information of identifying object " //span [@name=' welcome '] "; The method, after navigating to the identifying object on the page according to " //span [@name=' welcome '] ", obtains the value of identifying object; If the value of identifying object is consistent with expectation value, then return successful the result; Otherwise, return the result of failure.
Further, the execution result obtained in software testing device is to step S102 is verified, before the method that the verification method name referring calling this testing procedure shows, can also by the verification tool information in step authorization information, determine it is call the method in which instrument, namely determine instrument belonging to the method that verification method name referring shows; Like this, first according to verification tool information determination corresponding tool, then the correlation method in this instrument can be called according to verification method title.
S105: carry out in determining step S104 verifying that obtained the result is successfully or failure; If success, then perform the execution that step S110 carries out next testing procedure; If failure, then perform step S106 and carry out retry according to number of retries setting value.
Software testing device judges that the result that the method called returns is success or failure; If success, then perform the execution that step S110 carries out next testing procedure; If failure, then perform step S106 and carry out retry according to number of retries setting value.
S106: judge whether j is less than the number of retries setting value of i-th testing procedure; If so, make j=j+1 and jump to step S102 and again perform i-th testing procedure; Otherwise, perform step S107 and terminate retry.
The number of retries setting value of current testing procedure has indicated the number of times that this testing procedure is allowed to retry; If software testing device judges that number of retries j is less than the number of retries setting value of current testing procedure, make j=j+1 and jump to step S102 and again perform i-th testing procedure; Otherwise, perform step S107 and terminate retry.
S107: the check post classification judging i-th testing procedure; If the classification of asserting, then perform step S120 and terminate test, report unsuccessfully; If checking classification, then perform the execution that step S110 carries out next testing procedure.
Particularly, the check post classification of testing procedure can be two kinds, and one asserts classification, and another kind is checking classification; Assert that classification instruction stops this test, the instruction of checking classification can proceed test.
If software testing device judging that the check post classification of current testing procedure is for asserting classification, performing step S120 and terminating test, reporting unsuccessfully; If checking classification, then perform the execution that step S110 carries out next testing procedure.
S110: judge whether i-th testing procedure is last testing procedure; If so, jump to step S111 and complete test; Otherwise, after making i=i+1, number of retries j=1, jump to the execution that step S102 carries out next testing procedure.
S111: complete test, report test result.
After all testing procedures that is finished, the execution result of each testing procedure, the result, number of retries etc. can be generated test result report as test result by proving installation shows.Proving installation can html page form be shown, or shows in other forms.
S120: terminate test, report unsuccessfully.
The inner structure block diagram of the software testing device that the embodiment of the present invention provides, as shown in Figure 2, comprising: test case parsing module 201, testing execution module 202.
Test case parsing module 201 is for resolving the test case script of tested software; The step execution information for each testing procedure configures is described in described test case script, and be the step authorization information needing verification step to configure in described testing procedure, described step authorization information comprises: verification method title, expectation value, identifying object information; Further, described step authorization information also can comprise: number of retries setting value, check post classification;
Testing execution module 202 is for performing in the process of each testing procedure successively according to the analysis result of test case parsing module 201, if current testing procedure is for needing verification step, then perform information and executing this testing procedure complete according to the step of this testing procedure, after obtaining execution result, the method that the verification method name referring calling this testing procedure shows, and by the expectation value of this testing procedure and and identifying object information be passed in the method described execution result verified.
Further, testing execution module 202 is after the described expectation value by this testing procedure is passed to and verifies described execution result in the method, if also for determining that the result that the method returns is unsuccessfully, then the number of retries setting value according to this testing procedure carries out retry:
In a retry procedure, after testing execution module 202 performs this testing procedure of information and executing according to the step of this testing procedure again, the method that the verification method name referring calling this testing procedure again shows, verifies according to the execution result of expectation value to this testing procedure of this testing procedure again;
If testing execution module 202 determines that the result that in this retry procedure, the method returns is still unsuccessfully, then, after determining that the number of times of retry is less than the number of retries setting value of this testing procedure, carry out next retry procedure;
If testing execution module 202 determines that the result that in this retry procedure, the method returns is successfully, then determine that the final the result of this testing procedure is successfully.
Further, testing execution module 202 is also for after the described number of retries setting value according to this testing procedure carries out retry, if the final the result of this testing procedure obtained is unsuccessfully, then: if determine, the check post classification of this testing procedure is for asserting classification, then stop the execution of described test case script, report failure result; If determine, the check post classification of this testing procedure is for checking classification, then perform the next testing procedure of information and executing according to the step of next testing procedure.
Further, also can comprise in software testing device: Test cases technology module 203, test case memory module 204.
Test cases technology module 203 is for receiving the step execution information that tester is each testing procedure configuration, and the step authorization information needing verification step in testing procedure; Information according to receiving generates described test case script by predetermined format; Such as, Test cases technology module 203 can provide a patterned XML use-case editing machine for tester, can friendly, the quick test case script that must generate XML format according to the input of tester.
Testing execution module 202 generates test result report after performing each testing procedure successively according to the analysis result of test case parsing module 201.
The test case script that test case memory module 204 generates for On-board test use-case generation module 203; And
Test case parsing module 201 is also for obtaining described test case script according to test instruction from described test case memory module.
Further, also can comprise in software testing device: test case script display module 205, test result display module 206.
Test case script display module 205 is for showing the test case script stored in test case memory module 204; Such as, for the test case script of XML format, use XSLT technology, be converted into html format, use browser to show.
The test result report that testing execution module 202 generates by test result display module 206 is shown.
Inner structure block diagram in above-mentioned testing execution module 202 can as shown in Figure 3, comprise: testing procedure performance element 301, authentication unit 302, retry unit 303.
Testing procedure performance element 301 is for performing in the process of each testing procedure successively according to described analysis result, if current testing procedure is for needing verification step, then perform information and executing this testing procedure complete according to the step of this testing procedure, after obtaining execution result, send checking notice;
Authentication unit 302 is for after receiving the checking notice of testing procedure performance element 301 transmission, the method that the verification method name referring calling this testing procedure shows, and by the expectation value of this testing procedure and and identifying object information be passed in the method described execution result verified; And
Authentication unit 302 also for after being passed in the described expectation value by this testing procedure and verifying described execution result in the method, if also for determining that the result that the method returns is unsuccessfully, then sends retry notice to retry unit 303;
Retry unit 303 is for counting the number of retries of this testing procedure, and after the described retry notice of reception, if determine, the number of retries of this testing procedure is less than the number of retries setting value of this testing procedure, then determine to carry out a retry to this testing procedure, send retry notice to testing procedure performance element 301;
Testing procedure performance element 301 also for after receiving described retry notice, performs this testing procedure of information and executing according to the step of this testing procedure again, and after obtaining execution result, sends described checking notice; And
Retry unit 303 is also for after the described retry notice of reception, if determine, the number of retries of this testing procedure is equal to or greater than the number of retries setting value of this testing procedure, then: if determine, the check post classification of this testing procedure is for asserting classification, then termination notice is sent to testing execution module 301; If determine, the check post classification of this testing procedure is for checking classification, then send to testing execution module 301 and continue notice; And
Testing procedure performance element 301 also for according to described termination notice, stops the execution of described test case script, report failure result; Or perform next testing procedure according to described continuation notice.
In the technical scheme of the embodiment of the present invention, because tester according to checking demand, can configure corresponding verification method title in test case script; After test case script is resolved, utilize the characteristic of Java reflex mechanism dynamic call method, class, realize the function calling correlation method according to the verification method title of configuration, thus realize checking demand; In the process, tester need not relate to programming, and only need understand the title that some can realize the method for checking demand, makes tester more be absorbed in the relevant content of test logic, can complete the test assignment of more complicated efficiently, fast.
Further, tester also can configure number of retries predetermined value in test case script; Control according to the number of retries predetermined value of configuration the number of times verifying retry, tester can realize the repeatedly retry verified easily; Contribute to the test assignment that tester completes more complicated efficiently, fast further.
One of ordinary skill in the art will appreciate that all or part of step realized in above-described embodiment method is that the hardware that can carry out instruction relevant by program has come, this program can be stored in a computer read/write memory medium, as: ROM/RAM, magnetic disc, CD etc.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (4)

1. a method for testing software, comprising:
The test case script of tested software is resolved; The step execution information for each testing procedure configures is described in described test case script, and be the step authorization information needing verification step to configure in described testing procedure, described step authorization information comprises: verification method title, expectation value, identifying object information, number of retries setting value and check post classification;
Performing in the process of each testing procedure successively according to analysis result, if current testing procedure is for needing verification step, then perform information and executing this testing procedure complete according to the step of this testing procedure, after obtaining execution result, the method that the verification method name referring calling this testing procedure shows, and the expectation value of this testing procedure and identifying object information are passed in the method described execution result is verified; Wherein, described identifying object information is specially variable name; And
The method that the described verification method name referring calling this testing procedure shows, and the expectation value of this testing procedure and identifying object information are passed in the method described execution result is verified, be specially:
The method that the verification method name referring calling this testing procedure shows, and by the expectation value of this testing procedure, and the identifying object information of this testing procedure is passed in the method; The method, according to described expectation value, is verified the value of the variable indicated by described variable name in described execution result;
Or described identifying object information is specially the locating information of identifying object; And
The method that the described verification method name referring calling this testing procedure shows, and the expectation value of this testing procedure and identifying object information are passed in the method described execution result is verified, be specially:
The method that the verification method name referring calling this testing procedure shows, and by the expectation value of this testing procedure, and the locating information of the identifying object of this testing procedure is passed in the method, by the method according to the locating information of described identifying object from as locating verification object the page of execution result, and to verify according to the value of described expectation value to the identifying object of location;
After the described expectation value by this testing procedure is passed to and verifies described execution result in the method:
If the result that the method returns is unsuccessfully, then the number of retries setting value according to this testing procedure carries out retry:
In a retry procedure, again after performing this testing procedure of information and executing according to the step of this testing procedure, the method that the verification method name referring calling this testing procedure again shows, verifies according to the execution result of expectation value to this testing procedure of this testing procedure again;
The result that in this retry procedure, the method returns if determine is still unsuccessfully, then, after determining that the number of times of retry is less than the number of retries setting value of this testing procedure, carry out next retry procedure;
The result that in this retry procedure, the method returns if determine is successfully, then determine that the final the result of this testing procedure is successfully;
If the final the result of this testing procedure obtained is unsuccessfully, then:
If determine, the check post classification of this testing procedure is for asserting classification, then stop the execution of described test case script, report failure result;
If determine, the check post classification of this testing procedure is for checking classification, then perform the next testing procedure of information and executing according to the step of next testing procedure.
2. the method for claim 1, is characterized in that, described step authorization information also comprises: verification tool information; And
Before the method that the described verification method name referring calling this testing procedure shows, also comprise:
Determine instrument belonging to described method; And
Described test case script is extensible markup language XML format.
3. a software testing device, comprising:
Test case parsing module, for resolving the test case script of tested software; The step execution information for each testing procedure configures is described in described test case script, and be the step authorization information needing verification step to configure in described testing procedure, described step authorization information comprises: verification method title, expectation value, identifying object information, number of retries setting value and check post classification;
Testing execution module, for performing in the process of each testing procedure successively according to the analysis result of described test case parsing module, if current testing procedure is for needing verification step, then perform information and executing this testing procedure complete according to the step of this testing procedure, after obtaining execution result, the method that the verification method name referring calling this testing procedure shows, and by the expectation value of this testing procedure and and identifying object information be passed in the method described execution result verified;
Wherein, described step authorization information also comprises: number of retries setting value; And
Described testing execution module is after the described expectation value by this testing procedure is passed to and verifies described execution result in the method, if also for determining that the result that the method returns is unsuccessfully, then the number of retries setting value according to this testing procedure carries out retry:
In a retry procedure, after described testing execution module performs this testing procedure of information and executing according to the step of this testing procedure again, the method that the verification method name referring calling this testing procedure again shows, verifies according to the execution result of expectation value to this testing procedure of this testing procedure again;
If described testing execution module determines that the result that in this retry procedure, the method returns is still unsuccessfully, then, after determining that the number of times of retry is less than the number of retries setting value of this testing procedure, carry out next retry procedure;
If described testing execution module determines that the result that in this retry procedure, the method returns is successfully, then determine that the final the result of this testing procedure is successfully;
Described testing execution module is also for after the described number of retries setting value according to this testing procedure carries out retry, if the final the result of this testing procedure obtained is unsuccessfully, then: if determine, the check post classification of this testing procedure is for asserting classification, then stop the execution of described test case script, report failure result; If determine, the check post classification of this testing procedure is for checking classification, then perform the next testing procedure of information and executing according to the step of next testing procedure;
Described testing execution module comprises: testing procedure performance element, authentication unit, retry unit;
Described testing procedure performance element is used for performing in the process of each testing procedure successively according to described analysis result, if current testing procedure is for needing verification step, then perform information and executing this testing procedure complete according to the step of this testing procedure, after obtaining execution result, send checking notice;
Described authentication unit is used for after receiving the checking notice of described testing procedure performance element transmission, the method that the verification method name referring calling this testing procedure shows, and by the expectation value of this testing procedure and and identifying object information be passed in the method described execution result verified; And
Described authentication unit also for after being passed in the described expectation value by this testing procedure and verifying described execution result in the method, if also for determining that the result that the method returns is unsuccessfully, then sends retry notice to described retry unit;
Described retry unit is used for counting the number of retries of this testing procedure, and after the described retry notice of reception, if determine, the number of retries of this testing procedure is less than the number of retries setting value of this testing procedure, then determine to carry out a retry to this testing procedure, send retry notice to described testing procedure performance element;
Described testing procedure performance element also for after receiving described retry notice, performs this testing procedure of information and executing according to the step of this testing procedure again, and after obtaining execution result, sends described checking notice; And
Described retry unit is also for after the described retry notice of reception, if determine, the number of retries of this testing procedure is equal to or greater than the number of retries setting value of this testing procedure, then: if determine, the check post classification of this testing procedure is for asserting classification, then termination notice is sent to described testing execution module; If determine, the check post classification of this testing procedure is for checking classification, then send to described testing execution module and continue notice; And
Described testing procedure performance element also for according to described termination notice, stops the execution of described test case script, report failure result; Or perform next testing procedure according to described continuation notice.
4. device as claimed in claim 3, is characterized in that, also comprise:
Test cases technology module, for receiving the step execution information that tester is each testing procedure configuration, and the step authorization information needing verification step in testing procedure; Information according to receiving generates described test case script by predetermined format;
Test case memory module, for storing the test case script of described Test cases technology CMOS macro cell; And
Described test case parsing module is also for obtaining described test case script according to test instruction from described test case memory module.
CN201210557000.2A 2012-12-19 2012-12-19 Method for testing software and proving installation Active CN102981958B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210557000.2A CN102981958B (en) 2012-12-19 2012-12-19 Method for testing software and proving installation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210557000.2A CN102981958B (en) 2012-12-19 2012-12-19 Method for testing software and proving installation

Publications (2)

Publication Number Publication Date
CN102981958A CN102981958A (en) 2013-03-20
CN102981958B true CN102981958B (en) 2015-09-30

Family

ID=47856012

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210557000.2A Active CN102981958B (en) 2012-12-19 2012-12-19 Method for testing software and proving installation

Country Status (1)

Country Link
CN (1) CN102981958B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103326930B (en) * 2013-06-24 2016-05-25 青岛海信传媒网络技术有限公司 Open platform interface automatic detecting method and system
CN104915287B (en) * 2014-03-11 2018-07-06 富士施乐实业发展(中国)有限公司 Unit test method and system
CN106649090A (en) * 2016-10-10 2017-05-10 上海瀚之友信息技术服务有限公司 Automated test system and method
CN106776324A (en) * 2016-12-19 2017-05-31 广州酷狗计算机科技有限公司 Interface test method and device
CN108733555A (en) * 2017-04-25 2018-11-02 中移信息技术有限公司 A kind of application testing method and device
CN107506302A (en) * 2017-08-23 2017-12-22 杭州安恒信息技术有限公司 The method and apparatus that multinomial content accuracy is searched for generally based on selenium checkings
CN107783902A (en) * 2017-09-26 2018-03-09 甘肃万维信息技术有限责任公司 A kind of Selenium automated testing methods and system from coding
CN107908559B (en) * 2017-11-15 2021-05-07 中国农业银行股份有限公司 Test case design method and device
CN108491322A (en) * 2018-03-06 2018-09-04 平安科技(深圳)有限公司 Automated testing method, device and storage medium
CN109144856A (en) * 2018-07-27 2019-01-04 北京皮尔布莱尼软件有限公司 A kind of UI automated testing method calculates equipment and storage medium
CN109491919B (en) * 2018-11-28 2021-10-26 中电科西北集团有限公司 Software testing method and testing platform
CN110941546A (en) * 2019-10-12 2020-03-31 平安健康保险股份有限公司 Automatic test method, device, equipment and storage medium for WEB page case
CN112527665A (en) * 2020-12-18 2021-03-19 上海万向区块链股份公司 Method and system for processing dirty data generated by assertion based on FitNesse framework
CN113407460B (en) * 2021-07-16 2023-04-11 抖音视界有限公司 Page testing method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101996131A (en) * 2009-08-19 2011-03-30 航天信息股份有限公司 Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word
CN102819492A (en) * 2012-08-02 2012-12-12 中山大学 Keyword driven automatic testing frame on basis of Android

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101996131A (en) * 2009-08-19 2011-03-30 航天信息股份有限公司 Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word
CN102819492A (en) * 2012-08-02 2012-12-12 中山大学 Keyword driven automatic testing frame on basis of Android

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于脚本的构件测试自动化框架;倪铭等;《计算机工程》;20100331;第36卷(第6期);第94页到第99页 *

Also Published As

Publication number Publication date
CN102981958A (en) 2013-03-20

Similar Documents

Publication Publication Date Title
CN102981958B (en) Method for testing software and proving installation
US7627821B2 (en) Recording/playback tools for UI-based applications
CN103729294B (en) Method and device for testing performance script of application software
CN103049371A (en) Testing method and testing device of Android application programs
CN101996131A (en) Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word
CN102184138A (en) Method and system for automatically reproducing and positioning software error
CN110716870A (en) Automatic service testing method and device
EP3443460B1 (en) Method, apparatus, and computer-readable medium for performing functional testing of software
Singh et al. Automated testing of mobile applications using scripting technique: A study on appium
US11615018B2 (en) Automation testing tool framework
CN102479152A (en) Method and device for obtaining tool automatic test results on basis of Android platform
Menegassi et al. Automated tests for cross‐platform mobile apps in multiple configurations
CN115904989A (en) Interface testing method, device, equipment and readable storage medium
CN103326930A (en) Automatic patrolling method and system for open platform interface
KR101792864B1 (en) System and Method for verifying application
Gupta et al. Model based approach to assist test case creation, execution, and maintenance for test automation
Abbors et al. Tracing requirements in a model-based testing approach
Vuotto et al. Poster: Automatic consistency checking of requirements with reqv
KR20120071175A (en) Mobile phone loading web-platform, method for offering log information using the same mobile phone, verification system and method for web-platform
Martin et al. Automated robustness testing of web services
CN116483730A (en) Service system automatic test method based on domestic software and hardware and open source test tool
KR100969877B1 (en) Test automating system
Bluemke et al. Tool for automatic testing of web services
CN110990286A (en) BDD-based unit test system
CN111309287A (en) Method and system for generating software development scheme

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20170109

Address after: 266100 Shandong Province, Qingdao city Laoshan District Songling Road No. 399

Patentee after: Poly Polytron Technologies Inc

Address before: 266061 Laoshan, Qingdao province Hongkong District No. East Road, room 248, room 131

Patentee before: Hisense Media Networks Co., Ltd.