CN110221968A - Method for testing software and Related product - Google Patents
Method for testing software and Related product Download PDFInfo
- Publication number
- CN110221968A CN110221968A CN201910420389.8A CN201910420389A CN110221968A CN 110221968 A CN110221968 A CN 110221968A CN 201910420389 A CN201910420389 A CN 201910420389A CN 110221968 A CN110221968 A CN 110221968A
- Authority
- CN
- China
- Prior art keywords
- version
- code file
- script
- script code
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/368—Test management for test version control, e.g. updating test cases to a new software version
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
This application involves the improvement of the testing process of software testing technology field, specifically disclose a kind of method for testing software, this method comprises: receiving the test request for being directed to target software;Obtain the first script code file corresponding with the test request and the second script code file, first script code file is the corresponding script code file of released version of the target software, and second script code file is the corresponding script file of version to be measured of the target software;Determine target git diff order corresponding with the test request in comparison in difference git diff command set, the change code according to target git diff order second script code file relative to first script code file;The version to be tested is tested according to the change code.The embodiment of the present application is conducive to simplify testing process, improves user experience.
Description
Technical field
This application involves the field of test technology, and in particular to a kind of method for testing software and Related product.
Background technique
With the increase of user demand, the iteratively faster of product function has become normality, therefore, different in order to meet
Demand needs frequent upgrading products function, and in the rich and varied property of webpage representation product.Currently, in the function of change product
Afterwards, new product function need to be tested, judges whether new product function achieves the desired results, the test to product function
Generally by two ways, first, the bandwagon effect of the product page is tested, judges whether to achieve the desired results, second,
The scripted code of product is tested, judges whether the change function of scripted code is corresponding with desired effect, the first test
When, the test of meeting holiday function, second of test, the code of such as change is more, all change codes can not be accurately positioned,
So in the prior art, cumbersome to the test of product function, accuracy rate is low, poor user experience.
Summary of the invention
The embodiment of the present application provides a kind of method for testing software and Related product, by the comparison of version script code,
Simplify testing process, improves the accuracy of test.
In a first aspect, the embodiment of the present application provides a kind of method for testing software, this method comprises:
Receive the test request for being directed to target software;
Obtain the first script code file corresponding with the test request and the second script code file, first foot
This code file is the corresponding script code file of released version of the target software, and second script code file is
The corresponding script file of version to be measured of the target software;
Determine target git diff order corresponding with the test request in comparison in difference git diff command set, according to
Change of target git diff order second script code file relative to first script code file
Code;
The version to be tested is tested according to the change code.
Second aspect, the embodiment of the present application provide a kind of electronic equipment, which includes:
Receiving unit, for receiving the test request for being directed to target software;
Acquiring unit, for obtaining the first script code file corresponding with the test request and the second scripted code text
Part, first script code file be the target software the corresponding script code file of released version, described second
Script code file is the corresponding script file of version to be measured of the target software;
Comparing unit, for determining target git corresponding with the test request in comparison in difference git diff command set
Diff order, according to target git diff order second script code file relative to the first script generation
The change code of code file;
Determination unit, for being tested according to the change code the version to be tested.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, including processor, memory, communication interface and
One or more programs, wherein one or more of programs are stored in the memory, and are configured by described
It manages device to execute, described program is included the steps that for executing the instruction in method as described in relation to the first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, and storage is handed over for electronic data
The computer program changed, wherein the computer program makes the method for computer execution as described in relation to the first aspect.
Implement the embodiment of the present application, has the following beneficial effects:
As can be seen that in the embodiment of the present application, when testing target software, being determined using git diff order
Change code of the scripted code of version to be tested relative to the scripted code of released version, to be treated according to change code
Beta version is tested, without test in version to be tested with duplicate scripted code in released version, to save
About the testing time, simplify testing process.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is some embodiments of the present application, for ability
For the those of ordinary skill of domain, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 is a kind of flow diagram of method for testing software provided by the embodiments of the present application;
Figure 1A is a kind of schematic diagram of the layout of system warehouse provided by the embodiments of the present application;
Fig. 2 is the flow diagram of another method for testing software provided by the embodiments of the present application;
Fig. 3 is the flow diagram of another method for testing software provided by the embodiments of the present application;
Fig. 4 is a kind of structural schematic diagram of the electronic equipment of software test provided by the embodiments of the present application;
Fig. 5 is that a kind of functional unit of electronic equipment of software test provided by the embodiments of the present application forms block diagram.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiment is some embodiments of the present application, instead of all the embodiments.According to this Shen
Please in embodiment, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall in the protection scope of this application.
The description and claims of this application and term " first ", " second ", " third " and " in the attached drawing
Four " etc. are not use to describe a particular order for distinguishing different objects.In addition, term " includes " and " having " and it
Any deformation, it is intended that cover and non-exclusive include.Such as it contains the process, method of a series of steps or units, be
System, product or equipment are not limited to listed step or unit, but optionally further comprising the step of not listing or list
Member, or optionally further comprising other step or units intrinsic for these process, methods, product or equipment.
Referenced herein " embodiment " is it is meant that the special characteristic, result or the characteristic that describe can wrap in conjunction with the embodiments
It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical
Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and
Implicitly understand, embodiment described herein can be combined with other embodiments.
Electronic equipment in the application may include smart phone (such as Android phone, iOS mobile phone, Windows
Phone mobile phone etc.), tablet computer, palm PC, laptop, mobile internet device MID (Mobile Internet
Devices, referred to as: MID) or wearable device etc., above-mentioned electronic equipment is only citing, and non exhaustive, including but not limited to upper
Electronic equipment is stated, such as can also include: intelligent vehicle mounted terminal, computer equipment etc..
Firstly, refering to fig. 1, Fig. 1 is a kind of flow diagram of test method provided by the embodiments of the present application, this method is answered
With electronic equipment, which can be test platform, etc., this method include as shown in step S101~S104 in
Hold:
Step S101, the test request for being directed to target software is received.
Wherein, the revision ID and the revision ID of released version of version to be measured are carried in the test request, wherein the version
This ID is specially the version sequence number of target software, which is the version just developed, and released version can be for this
The version of the version of last time exploitation, the version of exploitation of upper last time or the exploitation of upper n times.
Optionally, receive and specifically included for the test request of target software: when developer by target software to
When the code file of beta version is uploaded to system warehouse, test request or tester of the automatic trigger to target software
In test, the test request to target software is triggered manually.
Step S102, the first script code file corresponding with the test request and the second script code file are obtained,
First script code file is the corresponding script code file of released version of the target software, second script
Code file is the corresponding script file of version to be measured of the target software.
Optionally, the reality of corresponding with the test request the first script code file and the second script code file is obtained
Existing process can be with are as follows: obtain the released version carried in the test request first version ID and version to be tested second
Revision ID;Determine the first script code file the first of system warehouse according to the first version ID and the second edition ID
The second storage location of storage location and the second script code file in the system warehouse, wherein in the system warehouse
Storage location includes workspace and version repository;First script code file is extracted from first storage location, from described
Second storage location extracts second script code file.
Specifically, code file can be published to system after the code file for writing version to be tested by developer
In warehouse, when being published to system warehouse, generally first addition Add to the workspace of system warehouse, system bin as shown in Figure 1A
The layout in library, after receiving commit order, by the version commit of Add to workspace to version repository, wherein the version
Generally preserved in the master in library the script code file of last commit, the script code file of commit of upper last time or
The script code file of the upper n times commit of person, it is of course also possible to include the script code file of this exploitation.So obtain to
The storage location of version is surveyed, such as it is corresponding need to then to extract the version to be measured to version repository to version to be measured in version repository by commit
The first script file.
In a possible example, when such as the object to be measured software is Webpage, it is not necessary that script code file is mentioned
Scripted code can be obtained by being sent to system warehouse, below the illustrated another script code file for obtaining the page to be tested
Mode, the acquisition of the script code file of test page is consistent with this.
Optionally, the realization process for extracting the scripted code of the page to be tested can be with are as follows: calling is built compiled in advance
Java function obtains the source code of the page to be tested, and the scripted code of the page to be tested is obtained according to the source code.Specifically
For, call the realization process for building the source code that compiled Java function obtains the page to be tested in advance can be with are as follows: to obtain
The uniform resource position mark URL (UniformResource Locator, referred to as: URL) of the webpage to be measured and the page to be tested
The type of coding in face obtains the source code store path to the page to be tested of setting, by the URL, type of coding and deposits
Storage space sets to be input to builds the entering in ginseng of compiled Java function in advance, and the source code of the page to be tested is deposited with .html format
Storage is in the memory space under the store path, wherein and type of coding includes UTF-8, gbk or gb2312, etc..
For example, the header file of Java function compiled in advance is public static boolean
GetHtmlByUrl (" String_u ", " String_charset ", " String_htmlPath "), wherein " String_u ", "
String_charset ", " String_htmlPath " are respectively that name is joined by URL, type of coding and entering for storage location, are such as obtained
Take Baidu's homepage, i.e. URL is www.baidu.com/, the source code when type of coding is gbk, and by the source code store to
In the root of D disk, then String u, Stringcharset are set, String htmlPath enters parameter and is respectively
Https: //www.baidu.com/, gbk, D:baidu.html, wherein baidu.html stores the filename of the source code,
Therefore getHtmlByUrl (" String_u ", " String_charset ", " String_htmlPath ") is initialized as
GetHtmlByUrl (" https: //www.baidu.com/ ", " gbk ", " D:baidu.html "), can extract Baidu's homepage
Source code, and in the entitled baidu.html file of root file that the source code is stored in D disk.
In a possible example, it is embedded in Javascript script edit html web page in the web page, that is, uses
It, can be with according to the realization process that source code obtains the scripted code of the page to be tested when the Javascript script edit page
Are as follows: the scripted code obtained in the source code imports statement, obtains scripted code by the URL imported in statement, wherein script
Code imports the statement declared and can be through the scr attribute reference document form in script tag<script>, therefore can lead to
It crosses detection script tag and obtains scripted code importing statement, for example, when scripted code is JavaScript, scripted code
Statement is imported as < scripttype=" text/javascript "
Src=" https: //ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/
Static/protocol/https/jquery/jquery-1.10.2.min_65682a2.j s "></script>, therefore src is marked
Outpour scripted code and import to declare and be " https: //ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/
Cache/static/protocol/https/jquery/jquery-1.10.2.min_656 82a2.js "></script>, therefore
Obtaining scripted code is https: //ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/
static/protocol/https/jquery/jquery-1.10.2.min_65682a2.js。
Step S103, target gitdiff corresponding with the test request in comparison in difference git diff command set is determined
Order, according to target git diff order second script code file relative to the first scripted code text
The change code of part.
Optionally, target git diff life corresponding with the test request in comparison in difference git diff command set is determined
The realization process of order can be with are as follows: determines the storage for the edition code that each git diff order is to be compared in git diff command set
Position;Obtain git diff order corresponding with first storage location and second storage location;It will be described corresponding
Git diff Command Flags are target git diff order.
The comparison procedure of each git diff order is described in detail below.
Git diff<filename>order, the file for comparing workspace change information;
Git diff HEAD--<filename>order, for comparing the last submission version in workspace and version repository
This file changes information;
Git diff HEAD^--<filename>order, for comparing the file for submitting version in version repository twice recently
Change information;
Git diff HEAD^^--<filename>order, for comparing the last submission and the last submission
The file of upper last version changes information;
git diff HEADn--<filename>order, for comparing the last submission and the last submission
The file of n version changes information.
For example, such as non-commit of version to be measured is to version repository, and having announced version is the last version submitted
When, then it needs to transfer git diff HEAD--<filename>and differentiation comparison is carried out to two script code files, it is such as to be measured
Commit then needs to transfer git diff<filename>order to two script code files progress differences to version repository to version
Change is compared, etc., and other forms no longer illustrate one by one.
Step S104, the version to be tested is tested according to the change code.
Optionally, the realization process tested to the version to be tested according to the change code can be with are as follows: determines
The corresponding objective function of the change code, wherein the objective function include change function contained by code and with change
Function contained by dynamic code has the function of call relation;According to the first mapping relations of objective function and scene and described
Objective function determines the corresponding change scene of the objective function;According to the second mapping relations and institute of scene and test case
It states change scene and determines the corresponding test case of the objective function;The change code is surveyed according to the test case
Examination, obtains the first test result;Obtain the second test result of the released version;Comprehensive first test result and institute
The second test result is stated, the test result of the version to be tested is obtained.
Specifically, since finished product function is realized by function each in scripted code, so script function and field
Scape has certain corresponding relationship, therefore pre-establishes the mapping relations of function and scene, when changing code, determines change generation
The corresponding scene of code, that is, can determine change scene of the version to be tested relative to a upper version, for example, robbing red packet field
In the corresponding released version of scape, the original assignment of field flag corresponding with scene can be 0,1, wherein flag=0 is represented
" please input the red packet amount of money " scene, flag=1 represent the scene of " number that please input red packet ", to the red packet amount of money without limitation, by
User's property safety is protected in the extension knife to product function, increases a limitation red packet amount of money scene, corresponds to change generation
Code is as follows:
Before change:
<Case flag=0>;// please input red packet //
<Case flag=1>;// please input the number of red packet //
After change:
<Case flag=0>;// please input red packet //
<Case flag=1>;// please input the number of red packet //
<Case flag=2>;// red packet the amount of money be more than the upper limit //
Therefore it is based on target git diff order, output change content is<Case flag=2>;// red packet the amount of money is more than upper
Limit //, i.e., increased under former principal function to field flag can assignment quantity, that is, allow to be assigned a value of 2 to flag, due to original
The corresponding function of principal function be that the scene of red packet is robbed in display, therefore determines that change scene be that ought be more than in the red packet amount of money of input
When the upper limit, the prompt page of " the red packet amount of money is more than the upper limit " is jumped to.
As can be seen that in the embodiment of the present application, when testing target software, being determined using git diff order
Change code of the scripted code of version to be tested relative to the scripted code of released version, to be treated according to change code
Beta version is tested, and the corresponding test result of the beta version can be obtained, without testing institute in version to be tested
Some scripted codes have saved the testing time to simplify testing process, improve testing efficiency.
It is to the second script code file of the version to be tested in the test result in a possible example
When logic testing result, the method also includes following steps:
Determine whether the logic testing result matches with logic of propositions;If so, by the second script code file wash with watercolours
Corresponding webpage is dyed, functional test is carried out to the webpage, determines whether the webpage correctly shows the change scene;Such as
It is no, second script code file is subjected to rollback, develops scripted code again.As can be seen that in this example, surveying first
The logicality of scripted code to be tested is tried, that is, whether the scripted code tested in the second script code file meets scripted code
Redaction rule improves the testing efficiency for treating beta version if so, carrying out functional test again.
Optionally, in the examples described above, described before second script code file is rendered to corresponding webpage
Method further include: determine the corresponding change position of the change code;The nested difference predetermined at the change position
Change code, the differentiation code is used for when rendering webpage, highlights change scene, highlight including highlighting
Change scene background color in the web page highlights the field, etc. of the change scene in the web page;It will
The second script code file after nesting is rendered to corresponding webpage, so that tester knows the corresponding change of version to be tested
Scene.
In a possible example, after carrying out functional test to the webpage, the method also includes following steps:
Functional test results are obtained, the functional test results include scrnario testing result and the performance test results, wherein
The performance test results include when running the scripted code in the second script file, to the occupancy of CPU;In the scrnario testing
As a result with the change scene matching, and when the performance test results meet default capabilities standard, herein by the crus secunda
Part is uploaded to server, and instruction server sends prompt information to consumption terminal, and the prompt information is for prompting the consumption terminal
Version updating is carried out to the target software.As can be seen that in this example, carrying out scrnario testing to scripted code and performance being surveyed
Examination, various dimensions are treated beta version and are tested, and stability when version to be tested publication is improved.
Certainly, when mismatching such as the scrnario testing result, prompt information is sent to test platform, the prompt information is used for
Rollback is carried out to second script file, writes change code corresponding with change scene;Not such as the performance test results
When meeting default capabilities standard, code development personnel is prompted to optimize the scripted code in the second script file.
In a possible example, after second script file is uploaded to server, the method also includes:
Receive the more new information of the consumption terminal feedback;Second script code file is adjusted according to the more new information of the feedback.
Referring to Fig.2, Fig. 2 is the flow diagram of another method for testing software provided by the embodiments of the present application, this method
Applying electronic equipment, the electronic equipment can be test platform, etc., and this method includes as shown in step S201~S206
Content:
Step S201, the described electronic equipment receives the test request for being directed to target software.
Step S202, the described electronic equipment obtains the first script code file corresponding with the test request and crus secunda
This code file, first script code file are the corresponding script code file of released version of the target software,
Second script code file is the corresponding script file of version to be measured of the target software.
Step S203, the described electronic equipment determines corresponding with the test request in comparison in difference git diff command set
Target git diff order, according to target git diff order second script code file relative to described
The change code of one script code file.
Step S204, the described electronic equipment tests the version to be tested according to the change code.
Optionally, the version to be tested is tested to obtain test result, wherein the test result is to described
Change the logic testing result of code.
Step S205, when the logic testing result is matched with logic of propositions, the electronic equipment is by the crus secunda
This code file is rendered to corresponding webpage, carries out functional test to the webpage, determines whether the webpage correctly shows institute
State change scene.
Step S206, when the logic testing result and logic of propositions mismatch, the electronic equipment is by described second
Script code file carries out rollback, prompts to develop scripted code again.
It should be noted that the specific implementation process of each step of method shown in Fig. 2 can be found in side described in above-mentioned Fig. 1
The specific implementation process of method, no longer describes herein.
As can be seen that in the embodiment of the present application, when testing target software, being determined using git diff order
Change code of the scripted code of version to be tested relative to the scripted code of released version, to be treated according to change code
Beta version is tested, and the corresponding test result of the beta version can be obtained, without testing institute in version to be tested
Some scripted codes have saved the testing time to simplify testing process;It is tested moreover, carrying out logic to scripted code first
Card, to due to code logic mistake, waste the testing time when avoiding directly testing, improve testing efficiency.
Refering to Fig. 3, Fig. 3 is the flow diagram of another method for testing software provided by the embodiments of the present application, this method
Applying electronic equipment, the electronic equipment can be test platform, etc., and this method includes as shown in step S301~S308
Content:
Step S301, the described electronic equipment receives the test request for being directed to target software.
Step S302, the described electronic equipment obtains the first script code file corresponding with the test request and crus secunda
This code file, first script code file are the corresponding script code file of released version of the target software,
Second script code file is the corresponding script file of version to be measured of the target software.
Step S303, the described electronic equipment determines corresponding with the test request in comparison in difference git diff command set
Target git diff order, according to target git diff order second script code file relative to described
The change code of one script code file.
Step S304, the described electronic equipment tests the version to be tested according to the change code.
Step S305, when the logic testing result is matched with logic of propositions, the electronic equipment is by the crus secunda
This code file is rendered to corresponding webpage, carries out functional test to the webpage, determines whether the webpage correctly shows institute
State change scene.
Step S306, when the logic testing result and logic of propositions mismatch, the electronic equipment is by described second
Script code file carries out rollback, prompts to develop scripted code again.
Step S307, the described electronic equipment obtains functional test results, and the functional test results include scrnario testing knot
Fruit and the performance test results.
Step S308, in the scrnario testing result and the change scene matching, and the performance test results meet
When default capabilities standard, second script file is uploaded to server by the electronic equipment, indicates server to consumption terminal
Prompt information is sent, the prompt information is for prompting the consumption terminal to carry out version updating to the target software.
It should be noted that the specific implementation process of each step of method shown in Fig. 2 can be found in side described in above-mentioned Fig. 1
The specific implementation process of method, no longer describes herein.
As can be seen that in the embodiment of the present application, when testing target software, being determined using git diff order
Change code of the scripted code of version to be tested relative to the scripted code of released version, to be treated according to change code
Beta version is tested, and the corresponding test result of the beta version can be obtained, without testing institute in version to be tested
Some scripted codes have saved the testing time to simplify testing process;It is tested moreover, carrying out logic to scripted code first
Card, to due to code logic mistake, waste the testing time when avoiding directly testing, improve testing efficiency, then right, script
Code carries out functional test, improves the accuracy of test.
It is consistent with above-mentioned Fig. 1, Fig. 2, embodiment shown in Fig. 3, referring to Fig. 4, Fig. 4 is provided by the embodiments of the present application
A kind of structural schematic diagram of the electronic equipment 400 of software test, as shown in figure 4, the electronic equipment 400 includes processor, storage
Device, communication interface and one or more programs, wherein said one or multiple programs are different from said one or multiple applications
Program, and said one or multiple programs are stored in above-mentioned memory, and are configured to be executed by above-mentioned processor, it is above-mentioned
Program includes the instruction for executing following steps:
Receive the test request for being directed to target software;
Obtain the first script code file corresponding with the test request and the second script code file, first foot
This code file is the corresponding script code file of released version of the target software, and second script code file is
The corresponding script file of version to be measured of the target software;
Determine target git diff order corresponding with the test request in comparison in difference git diff command set, according to
Change of target git diff order second script code file relative to first script code file
Code;
The version to be tested is tested according to the change code.
In a possible example, the first script code file corresponding with the test request and the second script are being obtained
When code file, above procedure is specifically used for executing the instruction of following steps:
Obtain the first version ID of the released version carried in the test request and the second edition of version to be tested
ID;
Determine the first script code file the of system warehouse according to the first version ID and the second edition ID
The second storage location of one storage location and the second script code file in the system warehouse, wherein in the system warehouse
Storage location include workspace and version repository;
First script code file is extracted from first storage location, described in second storage location extraction
Second script code file.
In a possible example, the mesh corresponding with the test request in determining comparison in difference git diff command set
When marking git diff order, above procedure is specifically used for the instruction of following steps:
Determine the storage location for the edition code that each git diff order is to be compared in git diff command set;
Obtain git diff order corresponding with first storage location and second storage location;
It is target git diff order by the corresponding git diff Command Flags.
In a possible example, when being tested according to the change code the version to be tested, above-mentioned journey
Sequence is specifically used for the instruction of following steps:
Determine the corresponding objective function of the change code;
Determine that the objective function is corresponding with the first mapping relations of scene and the objective function according to objective function
Change scene;
Determine that the objective function is corresponding with the second mapping relations of test case and the change scene according to scene
Test case;
The change code is tested according to the test case, obtains the first test result;
Obtain the second test result of the released version;
Comprehensive first test result and second test result, obtain the test result of the version to be tested.
It is to the second script code file of the version to be tested in the test result in a possible example
When logic testing result, above procedure is also used to the instruction of following steps:
Determine whether the logic testing result matches with logic of propositions;
If so, second script code file is rendered to corresponding webpage, functional test is carried out to the webpage, really
Whether the fixed webpage correctly shows the change scene;
If not, second script code file is carried out rollback, prompt to develop scripted code again.
In a possible example, above procedure is also used to the instruction of following steps:
Functional test results are obtained, the functional test results include scrnario testing result and the performance test results;
In the scrnario testing result and the change scene matching, and the performance test results meet default capabilities mark
On time, second script file is uploaded to server, instruction server sends prompt information, the prompt letter to consumption terminal
Breath is for prompting the consumption terminal to carry out version updating to the target software.
In a possible example, above procedure is also used to the instruction of following steps:
Receive the more new information of the consumption terminal feedback;
Second script code file is adjusted according to the more new information of the feedback.
A kind of possibility of the electronic equipment 500 of software test involved in above-described embodiment is shown refering to Fig. 5, Fig. 5
Functional unit form block diagram, electronic equipment 500 includes receiving unit 510, acquiring unit 520, comparing unit 530 and determines single
Member 540;
Receiving unit 510, for receiving the test request for being directed to target software;
Acquiring unit 520, for obtaining the first script code file corresponding with the test request and the second script generation
Code file, first script code file is the corresponding script code file of released version of the target software, described
Second script code file is the corresponding script file of version to be measured of the target software;
Comparing unit 530, for determining target corresponding with the test request in comparison in difference git diff command set
Git diff order, according to target git diff order second script code file relative to first foot
The change code of this code file;
Determination unit 540, for being tested according to the change code the version to be tested.
In a possible example, the first script code file corresponding with the test request and the second script are being obtained
When code file, acquiring unit 520 is specifically used for: obtaining the first version of the released version carried in the test request
The second edition ID of ID and version to be tested;The first scripted code is determined according to the first version ID and the second edition ID
File system warehouse the first storage location and the second script code file the system warehouse the second storage location,
In, the storage location in the system warehouse includes workspace and version repository;Described first is extracted from first storage location
Script code file extracts second script code file from second storage location.
In a possible example, the mesh corresponding with the test request in determining comparison in difference git diff command set
When marking git diff order, comparing unit 530 is specifically used for: determine in git diff command set each gitdiff order to than
Compared with edition code storage location;Obtain git diff corresponding with first storage location and second storage location
Order;It is target git diff order by the corresponding git diff Command Flags.
In a possible example, when being tested according to the change code the version to be tested, determine single
Member 540, is specifically used for: determining the corresponding objective function of the change code;It is closed according to the first mapping of objective function and scene
System and the objective function determine the corresponding change scene of the objective function;According to the second mapping of scene and test case
Relationship and the change scene determine the corresponding test case of the objective function;According to the test case to the change
Code is tested, and the first test result is obtained;Obtain the second test result of the released version;Comprehensive described first surveys
Test result and second test result, obtain the test result of the version to be tested.
In a possible example, electronic equipment 500 further includes processing unit 550;
When the test result is the logic testing result to the second script code file of the version to be tested, place
Unit 550 is managed, for determining whether the logic testing result matches with logic of propositions;If so, by second scripted code
File is rendered to corresponding webpage, carries out functional test to the webpage, determines whether the webpage correctly shows the change
Scene;If not, second script code file is carried out rollback, prompt to develop scripted code again.
In a possible example, processing unit 550 is also used to: obtaining functional test results, the functional test results
Including scrnario testing result and the performance test results;In the scrnario testing result and the change scene matching, and the property
When energy test result meets default capabilities standard, second script file is uploaded to server, indicates server to consumption
End sends prompt information, and the prompt information is for prompting the consumption terminal to carry out version updating to the target software.
In a possible example, processing unit 550 is also used to: receiving the more new information of the consumption terminal feedback;According to
The more new information of the feedback adjusts second script code file.
The embodiment of the present application also provides a kind of computer storage medium, wherein the computer storage medium is stored for depositing
Store up computer program, wherein the computer program is executed by processor, as any in recorded in above method embodiment to realize
A kind of some or all of method for testing software step.
The embodiment of the present application also provides a kind of computer program product, and the computer program product includes storing calculating
The non-transient computer readable storage medium of machine program, the computer program are operable to that computer is made to execute such as above-mentioned side
Some or all of any method for testing software recorded in method embodiment step.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because
According to the application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, embodiment described in this description belongs to alternative embodiment, related actions and modules not necessarily the application
It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way
It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of the unit, it is only a kind of
Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit,
It can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also be realized in the form of software program module.
If the integrated unit is realized in the form of software program module and sells or use as independent product
When, it can store in a computer-readable access to memory.According to such understanding, the technical solution of the application substantially or
Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products
Reveal and, which is stored in a memory, including some instructions are used so that a computer equipment
(can be personal computer, server or network equipment etc.) executes all or part of each embodiment the method for the application
Step.And memory above-mentioned includes: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory
The various media that can store program code such as (RAM, Random Access Memory), mobile hard disk, magnetic or disk.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can
It is completed with instructing relevant hardware by program, which can store in a computer-readable memory, memory
May include: flash disk, read-only memory (English: Read-Only Memory, referred to as: ROM), random access device (English:
Random Access Memory, referred to as: RAM), disk or CD etc..
The embodiment of the present application is described in detail above, specific case used herein to the principle of the application and
Embodiment is expounded, the description of the example is only used to help understand the method for the present application and its core ideas;
At the same time, for those skilled in the art can in specific embodiments and applications according to the thought of the application
There is change place, in conclusion the contents of this specification should not be construed as limiting the present application.
Claims (10)
1. a kind of method for testing software, which is characterized in that the described method includes:
Receive the test request for being directed to target software;
Obtain the first script code file corresponding with the test request and the second script code file, the first script generation
Code file is the corresponding script code file of released version of the target software, and second script code file is described
The corresponding script file of version to be measured of target software;
Target git diff order corresponding with the test request in comparison in difference git diff command set is determined, according to described
Change code of target git diff order second script code file relative to first script code file;
The version to be tested is tested according to the change code.
2. the method according to claim 1, wherein described obtain the first script corresponding with the test request
Code file and the second script code file specifically include:
Obtain the first version ID of the released version carried in the test request and the second edition ID of version to be tested;
Determine that the first script code file is deposited the first of system warehouse according to the first version ID and the second edition ID
Storage space sets the second storage location with the second script code file in the system warehouse, wherein depositing in the system warehouse
Storage space is set including workspace and version repository;
First script code file is extracted from first storage location, extracts described second from second storage location
Script code file.
3. according to the method described in claim 2, it is characterized in that, in the determining comparison in difference git diff command set with institute
The corresponding target git diff order of test request is stated to specifically include:
Determine the storage location for the edition code that each git diff order is to be compared in git diff command set;
Obtain git diff order corresponding with first storage location and second storage location;
It is target git diff order by the corresponding git diff Command Flags.
4. method according to claim 1 to 3, which is characterized in that it is described according to the change code to described
Version to be tested carries out test and specifically includes:
Determine the corresponding objective function of the change code;
It determines that the objective function is corresponding with the first mapping relations of scene and the objective function according to objective function to change
Dynamic scene;
The corresponding survey of the objective function is determined according to scene and the second mapping relations of test case and the change scene
Example on probation;
The change code is tested according to the test case, obtains the first test result;
Obtain the second test result of the released version;
Comprehensive first test result and second test result, obtain the test result of the version to be tested.
5. according to the method described in claim 4, it is characterized in that, being the to the version to be tested in the test result
When the logic testing result of two script code files, the method also includes:
Determine whether the logic testing result matches with logic of propositions;
If so, second script code file is rendered to corresponding webpage, functional test is carried out to the webpage, determines institute
State whether webpage correctly shows the change scene;
If not, second script code file is carried out rollback, prompt to develop scripted code again.
6. according to the method described in claim 5, it is characterized in that, the method also includes:
Functional test results are obtained, the functional test results include scrnario testing result and the performance test results;
In the scrnario testing result and the change scene matching, and the performance test results meet default capabilities standard
When, second script file is uploaded to server, instruction server sends prompt information, the prompt information to consumption terminal
For prompting the consumption terminal to carry out version updating to the target software.
7. according to the method described in claim 6, it is characterized in that, the method also includes:
Receive the more new information of the consumption terminal feedback;
Second script code file is adjusted according to the more new information of the feedback.
8. a kind of electronic equipment, which is characterized in that the electronic equipment includes:
Receiving unit, for receiving the test request for being directed to target software;
Acquiring unit, for obtaining the first script code file corresponding with the test request and the second script code file,
First script code file is the corresponding script code file of released version of the target software, second script
Code file is the corresponding script file of version to be measured of the target software;
Comparing unit, for determining target git diff corresponding with the test request in comparison in difference git diff command set
Order, according to target git diff order second script code file relative to the first scripted code text
The change code of part;
Determination unit, for being tested according to the change code the version to be tested.
9. a kind of electronic equipment, which is characterized in that including processor, memory, communication interface and one or more program,
In, one or more of programs are stored in the memory, and are configured to be executed by the processor, described program
Include the steps that requiring the instruction in any one of 1-7 method for perform claim.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has computer journey
Sequence, the computer program are executed by processor to realize the method according to claim 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910420389.8A CN110221968A (en) | 2019-05-20 | 2019-05-20 | Method for testing software and Related product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910420389.8A CN110221968A (en) | 2019-05-20 | 2019-05-20 | Method for testing software and Related product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110221968A true CN110221968A (en) | 2019-09-10 |
Family
ID=67821506
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910420389.8A Pending CN110221968A (en) | 2019-05-20 | 2019-05-20 | Method for testing software and Related product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110221968A (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110990282A (en) * | 2019-12-04 | 2020-04-10 | 中国直升机设计研究所 | Automatic unit testing method |
CN111159030A (en) * | 2019-12-24 | 2020-05-15 | 联想(北京)有限公司 | Program testing method, device, equipment and storage medium |
CN112015645A (en) * | 2020-08-27 | 2020-12-01 | 云账户技术(天津)有限公司 | Function test method and device of web system and electronic equipment |
CN112015640A (en) * | 2020-08-06 | 2020-12-01 | 京东数字科技控股股份有限公司 | Software testing method and system |
CN112631935A (en) * | 2020-12-30 | 2021-04-09 | 中国农业银行股份有限公司 | Version conflict-based test method and device |
CN112947991A (en) * | 2021-03-30 | 2021-06-11 | 建信金融科技有限责任公司 | Method and device for acquiring version difference code file, computer equipment and medium |
CN112947988A (en) * | 2021-03-10 | 2021-06-11 | 中国民航信息网络股份有限公司 | Continuous integration method of mainframe, related device and computer storage medium |
CN113139190A (en) * | 2020-01-17 | 2021-07-20 | Oppo广东移动通信有限公司 | Program file detection method and device, electronic equipment and storage medium |
CN113190442A (en) * | 2021-04-27 | 2021-07-30 | 上海安畅网络科技股份有限公司 | Method and system for measuring test range and checking test coverage |
CN113448862A (en) * | 2021-07-12 | 2021-09-28 | 上海哔哩哔哩科技有限公司 | Software version testing method and device and computer equipment |
CN113485941A (en) * | 2021-07-27 | 2021-10-08 | 山石网科通信技术股份有限公司 | System pressure testing method and device, readable storage medium and processor |
CN113590467A (en) * | 2021-06-30 | 2021-11-02 | 平安健康保险股份有限公司 | Data comparison method, system, computer equipment and computer readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104866424A (en) * | 2015-05-22 | 2015-08-26 | 国云科技股份有限公司 | Method for designing software test cases based on scenario analysis |
US20160062765A1 (en) * | 2014-09-02 | 2016-03-03 | International Business Machines Corporation | Identifying semantic differences between source code versions |
CN106528399A (en) * | 2015-09-15 | 2017-03-22 | 腾讯科技(深圳)有限公司 | Test case determination method and apparatus |
CN106547678A (en) * | 2015-09-16 | 2017-03-29 | 伊姆西公司 | For the method and apparatus of white-box testing |
CN108491331A (en) * | 2018-04-13 | 2018-09-04 | 平安普惠企业管理有限公司 | Method for testing software, device, equipment and computer storage media |
-
2019
- 2019-05-20 CN CN201910420389.8A patent/CN110221968A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160062765A1 (en) * | 2014-09-02 | 2016-03-03 | International Business Machines Corporation | Identifying semantic differences between source code versions |
CN104866424A (en) * | 2015-05-22 | 2015-08-26 | 国云科技股份有限公司 | Method for designing software test cases based on scenario analysis |
CN106528399A (en) * | 2015-09-15 | 2017-03-22 | 腾讯科技(深圳)有限公司 | Test case determination method and apparatus |
CN106547678A (en) * | 2015-09-16 | 2017-03-29 | 伊姆西公司 | For the method and apparatus of white-box testing |
CN108491331A (en) * | 2018-04-13 | 2018-09-04 | 平安普惠企业管理有限公司 | Method for testing software, device, equipment and computer storage media |
Cited By (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110990282A (en) * | 2019-12-04 | 2020-04-10 | 中国直升机设计研究所 | Automatic unit testing method |
CN111159030A (en) * | 2019-12-24 | 2020-05-15 | 联想(北京)有限公司 | Program testing method, device, equipment and storage medium |
CN111159030B (en) * | 2019-12-24 | 2022-02-18 | 联想(北京)有限公司 | Program testing method, device, equipment and storage medium |
CN113139190A (en) * | 2020-01-17 | 2021-07-20 | Oppo广东移动通信有限公司 | Program file detection method and device, electronic equipment and storage medium |
CN112015640A (en) * | 2020-08-06 | 2020-12-01 | 京东数字科技控股股份有限公司 | Software testing method and system |
CN112015640B (en) * | 2020-08-06 | 2024-04-05 | 京东科技控股股份有限公司 | Software testing method and system |
CN112015645A (en) * | 2020-08-27 | 2020-12-01 | 云账户技术(天津)有限公司 | Function test method and device of web system and electronic equipment |
CN112631935A (en) * | 2020-12-30 | 2021-04-09 | 中国农业银行股份有限公司 | Version conflict-based test method and device |
CN112947988A (en) * | 2021-03-10 | 2021-06-11 | 中国民航信息网络股份有限公司 | Continuous integration method of mainframe, related device and computer storage medium |
CN112947988B (en) * | 2021-03-10 | 2024-03-08 | 中国民航信息网络股份有限公司 | Continuous integration method of mainframe, related device and computer storage medium |
CN112947991A (en) * | 2021-03-30 | 2021-06-11 | 建信金融科技有限责任公司 | Method and device for acquiring version difference code file, computer equipment and medium |
CN113190442A (en) * | 2021-04-27 | 2021-07-30 | 上海安畅网络科技股份有限公司 | Method and system for measuring test range and checking test coverage |
CN113590467A (en) * | 2021-06-30 | 2021-11-02 | 平安健康保险股份有限公司 | Data comparison method, system, computer equipment and computer readable storage medium |
CN113590467B (en) * | 2021-06-30 | 2023-07-21 | 平安健康保险股份有限公司 | Data comparison method, system, computer device and computer readable storage medium |
CN113448862A (en) * | 2021-07-12 | 2021-09-28 | 上海哔哩哔哩科技有限公司 | Software version testing method and device and computer equipment |
CN113448862B (en) * | 2021-07-12 | 2022-08-02 | 上海哔哩哔哩科技有限公司 | Software version testing method and device and computer equipment |
CN113485941A (en) * | 2021-07-27 | 2021-10-08 | 山石网科通信技术股份有限公司 | System pressure testing method and device, readable storage medium and processor |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110221968A (en) | Method for testing software and Related product | |
US10108535B2 (en) | Web application test script generation to test software functionality | |
US10592319B2 (en) | API notebook tool | |
KR102317535B1 (en) | Methods and systems for implementing data tracking with software development kits | |
CN111639287A (en) | Page processing method and device, terminal equipment and readable storage medium | |
EP4046000A1 (en) | Methods and systems for integrated development environment editor support with a single code base | |
AU2015218520B2 (en) | Service extraction and application composition | |
CN106815031B (en) | Kernel module loading method and device | |
CN112187558B (en) | Data verification method and device and electronic equipment | |
CN110795697B (en) | Method and device for acquiring logic expression, storage medium and electronic device | |
AU2019283802A1 (en) | Automatic discovery of locations of translated text in localized applications | |
US12079298B2 (en) | Methods and systems for browser extension used to generate relative XPath, absolute XPath and/or CSS selectors | |
CN110647322B (en) | List rendering method and device, electronic equipment and computer readable medium | |
CN106648569A (en) | Target serialization achieving method and device | |
CN117112060A (en) | Component library construction method and device, electronic equipment and storage medium | |
CN110399187A (en) | A kind for the treatment of method and apparatus of language resource | |
CN104050218A (en) | Method and system for providing information to be displayed in user interface | |
CN110889116A (en) | Advertisement blocking method and device and electronic equipment | |
CN110058849A (en) | Generation method, device, computer equipment and the storage medium of flow chart | |
CN113342647A (en) | Test data generation method and device | |
CN112256252B (en) | Interface generation method and device, storage medium and electronic equipment | |
CN110232019A (en) | Page test method and Related product | |
CN115469849B (en) | Service processing system, method, electronic equipment and storage medium | |
CN111090591A (en) | Test method and device, electronic equipment and computer readable storage medium | |
CN116414689A (en) | Interface parameter verification method and system based on reflection mechanism |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |