CN104133771A - Testing method and device - Google Patents
Testing method and device Download PDFInfo
- Publication number
- CN104133771A CN104133771A CN201410396390.9A CN201410396390A CN104133771A CN 104133771 A CN104133771 A CN 104133771A CN 201410396390 A CN201410396390 A CN 201410396390A CN 104133771 A CN104133771 A CN 104133771A
- Authority
- CN
- China
- Prior art keywords
- data
- test
- sample data
- brake
- sample
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Abstract
The invention provides a testing method and device, and relates to the technical field of calculation and testing. The testing method and device solve the problems that in the prior art, when an existing testing method is adopted, overgeneralization easily occurs and testing is not comprehensive. The method includes the steps of determining data sets corresponding to all tested functions in sample data, wherein the sample data come from an actual running application system; extracting a preset number of sample data from all the data sets respectively to form a test data set, wherein the number ratio of all the sample data extracted from the data sets is equal to the number ratio of elements of all the data sets; generating a test case according to the test data set so as to complete the test.
Description
Technical field
The present invention relates to calculate and technical field of measurement and test, particularly relate to a kind of method of testing and device.
Background technology
Various application programs and system newly developed, generally all need through repeatedly testing to verify its reliability.In existing testing scheme, tester generally needs to work out one group of test data for generating test use case, so that whether test system under test (SUT) meets certain particular demands.But because test data is worked out by tester, the data of itself and actual motion there are differences, and have the situation of taking a part for the whole to a certain degree, test result often can not expose problem comprehensively.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of method of testing and device, easily takes a part for the whole, tests incomplete problem in order to solve method of testing of the prior art.
On the one hand, the invention provides a kind of method of testing, comprising: definite each by the corresponding data acquisition of brake in sample data, described sample data is from the application system of actual motion; From each described data acquisition, extract respectively the sample data of predetermined number to form test data set, the ratio of the quantity of the sample data extracting from each described data acquisition equals the ratio of the number of elements of each described data acquisition; According to described test data set generating test use case (Test Case) to complete test.
Optionally, describedly in sample data, determine and respectively comprised by the corresponding data acquisition of brake: according to the data type of described sample data determine described sample data corresponding by brake, described is the described set being formed by all sample datas corresponding to brake by data acquisition corresponding to brake.
Optionally, the described sample data that extracts respectively predetermined number from each described data acquisition comprises to form test data set: from each described data acquisition, randomly draw respectively the sample data of predetermined number to form test data set.
Optionally, described according to described test data set generating test use case with complete test comprise: according to described test data set generating test use case; Described test case is adjusted.
Further, described definite each by before the corresponding data acquisition of brake in sample data, described method also comprises: gather in Preset Time, all characteristics in running application system are to form sample data.
On the other hand, the present invention also provides a kind of proving installation, comprising: determining unit, and each by the corresponding data acquisition of brake for determining in sample data, described sample data is from the application system of actual motion; Extracting unit, for the sample data that extracts predetermined number from each described data acquisition respectively, to form test data set, the ratio of the quantity of the sample data extracting from each described data acquisition equals the ratio of the number of elements of each described data acquisition; Generation unit, for according to described test data set generating test use case to complete test.
Optionally, described determining unit specifically for: according to the data type of described sample data determine described sample data corresponding by brake, described is the described set being formed by all sample datas corresponding to brake by data acquisition corresponding to brake.
Optionally, described extracting unit specifically for: from each described data acquisition, randomly draw respectively the sample data of predetermined number to form test data set.
Optionally, described generation unit comprises: generation module, for according to described test data set generating test use case; Adjusting module, for adjusting described test case.
Further, described device also comprises: collecting unit, for gathering in Preset Time, all characteristics in running application system are to form sample data.
In the method for testing that the embodiment of the present invention provides and device, form the sample data of test data set and be the application system that is derived from actual motion, like this, the more closing to reality running environment of test case forming, thereby make test more accurate, and because the ratio of the quantity of the sample data extracting from each described data acquisition equals the ratio of the number of elements of each described data acquisition, can also ensure that test case can cover all by brake, thereby system under test (SUT) is carried out accurately to comprehensively test.
Brief description of the drawings
Fig. 1 is a kind of process flow diagram of the method for testing that provides of the embodiment of the present invention;
Fig. 2 is a kind of annexation schematic diagram of testing equipment needed thereby in the preferred embodiment of the present invention;
Fig. 3 is a kind of detail flowchart that the equipment shown in Fig. 2 is carried out method of testing;
Fig. 4 is a kind of structural representation of the proving installation that provides of the embodiment of the present invention.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in detail.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, does not limit the present invention.
As shown in Figure 1, embodiments of the invention provide a kind of method of testing, comprising:
S11, definite each by the corresponding data acquisition of brake in sample data, described sample data is from the application system of actual motion;
S12 extracts respectively the sample data of predetermined number to form test data set from each described data acquisition, and the ratio of the quantity of the sample data extracting from each described data acquisition equals the ratio of the number of elements of each described data acquisition;
S13, according to described test data set generating test use case to complete test.
In the method for testing that the embodiment of the present invention provides, form the sample data of test data set and be the application system that is derived from actual motion, like this, the more closing to reality running environment of test case forming, thereby make test more accurate, and because the ratio of the quantity of the sample data extracting from each described data acquisition equals the ratio of the number of elements of each described data acquisition, can also ensure that test case can cover all by brake, thereby system under test (SUT) is carried out accurately to comprehensively test.
It should be noted that, in embodiments of the invention, referred to the various functions that can be applied in system under test (SUT) by brake.Wherein, system under test (SUT) can be on the basis of original application system, improve or upgrade after system.Owing to having carried out new improvement or upgrading, need to be to the stability of new system, test and verify with the compatibility of original system etc., therefore also just relate to the test to its various functions.
Understandable, in order to verify more fully the various functions of system under test (SUT), the data that need when test data should more be close to the actual motion of system under test (SUT).In view of existing contacting on 26S Proteasome Structure and Function between system under test (SUT) and application system, the data of moving in application system also meet the operation conditions of system under test (SUT) mostly, like this, can be from the application system of actual motion for sample data that system under test (SUT) is tested, namely can be from the application system of actual motion acquisition characteristics data form the sample data of system under test (SUT).For example, in one embodiment of the invention, before step S11, also can comprise: gather in Preset Time, in 1 day, all characteristics in running application system are to form sample data.Collected because all characteristics during this period of time all have no to omit, therefore can contain more all sidedly various by brake.Because system under test (SUT) comprises several functions conventionally, different sections working time may have different functions active, therefore, choosing of Preset Time can be associated with the function of needs test, conventionally within the time period of frequently being called by brake, gathers corresponding characteristic.
Particularly, in step S11, can in sample data, determine each by the corresponding data acquisition of brake according to several different methods.Optionally, can know by analyzing samples data the data type of each sample data, then according to the data type of sample data determine each sample data corresponding by brake, be this by the set that all sample datas formed corresponding to brake by data acquisition corresponding to brake so.For example, if analyze and show that the data type of the part in sample data is geographic coordinate type, can determine this sample data corresponding be positioning function by brake, so positioning function this be the set that all sample datas formed corresponding to positioning function by the corresponding data acquisition of brake.Or, if analyze and show that the data type of the part in sample data is amount of money type, can determine this sample data corresponding be the relevant function of transaction by brake, this is the set that all sample datas formed corresponding to transaction correlation function by the corresponding data acquisition of brake so.
By Analysis deterrmination each by the corresponding data acquisition of brake after, also with regard to clear and definite ratio between element in each data acquisition, in step S12, the data sample that just can extract according to such ratio predetermined number from each data acquisition has formed test data set so.Optionally, for each data acquisition, can be by therefrom extracted data sample of existing the whole bag of tricks, for example evenly extract or according to the extraction of Preset Time section etc., embodiments of the invention do not limit this.Better, preferred for the dispersiveness of selected data sample, can from each described data acquisition, randomly draw respectively the sample data of predetermined number to form test data set.
For example, as shown in Figure 2, in one embodiment of the invention, acquisition system (being for example arranged on service broker's layer) gathers and generates sample data the data of actual motion in the system of practical application.The analytic system pair function relevant to system under test (SUT) call frequency analysis, these functions that gather in the period or in a certain specific time period as analyzed call frequency, and obtain the ratio of calling of these functions, in the sample data of the function corresponding to relevant to system under test (SUT), according to the sample that calls ratio and randomly draw some, generate test data set.Concrete test process can be as shown in Figure 3.In the present embodiment, acquisition system gathers the characteristic of actual motion in application system in time period H, and symbiosis becomes N bar sample data.Analytic system analyzes the corresponding function of the characteristic collecting in time period H and is included as a, b, c, d, e, f, g, and wherein a, b, c, d, e are relevant to system under test (SUT), and f, g and system under test (SUT) are irrelevant.In the characteristic relevant to system under test (SUT), account for 40% of the characteristic gathering in time period H corresponding to the characteristic of a function, account for 20% of the characteristic gathering in time period H corresponding to the characteristic of b function, account for 15% of the characteristic gathering in time period H corresponding to the characteristic of c function, account for 15% of the characteristic gathering in time period H corresponding to the characteristic of d function, account for 10% of the characteristic that gathers in time period H corresponding to the characteristic of e function.Think that the ratio of calling of a function is that the ratio of calling of 40%, b function is that the ratio of calling of 20%, c function is that the ratio of calling of 15%, d function is that the ratio of calling of 15%, e function is 10%.Analytic system analyzes the characteristic that corresponds respectively to a, b, c, d, e function in above-mentioned N bar sample data.As pre-determined, test data is concentrated will comprise m bar sample characteristics data, analytic system will be randomly drawed m × 40% characteristic corresponding to a function in above-mentioned N bar sample data, randomly draw m × 20% characteristic corresponding to b function, randomly draw m × 15% characteristic corresponding to c function, randomly draw m × 15% characteristic corresponding to d function, and randomly draw m × 10% characteristic corresponding to e function.Above-mentioned five Partial Feature data form test data set.
Obtain after test data set, in step S13, can carry out generating test use case according to test data set.Concrete, first test macro needs to dispose test environment, then for system under test (SUT) generating test use case and expected results, then uses this test case to test and obtain test result, thereby generate test report according to test result and expected results.Wherein, test case is a group of test input, executive condition and expected results working out for certain special objective, to test certain Program path or examine whether meet certain particular demands.
Further, in some instances, can also adjust the quantity of the sample data corresponding to some function, thereby make the test case of generation more targeted.Particularly, in step S13, can comprise to complete test according to described test data set generating test use case: according to described test data set generating test use case; Described test case is adjusted.Adjustment mode can be varied, and embodiments of the invention do not limit this, optional, can be according to test purpose, increase or reduce the correlation parameter of quantity or the adjustment characteristic of corresponding some function sample data.For example, if the what's new that the function of test is system under test (SUT), can be to the quantity of sample data corresponding to this function of corresponding increase.If or there is larger variation by the frequency of calling of brake, this also could be adjusted accordingly by the quantity of sample data corresponding to brake.
Accordingly, as shown in Figure 4, embodiments of the invention also provide a kind of proving installation, comprising:
Determining unit 20, each by the corresponding data acquisition of brake for determining in sample data, described sample data is from the application system of actual motion;
Extracting unit 22, for the sample data that extracts predetermined number from each described data acquisition respectively, to form test data set, the ratio of the quantity of the sample data extracting from each described data acquisition equals the ratio of the number of elements of each described data acquisition;
Generation unit 24, for according to described test data set generating test use case to complete test.
In the proving installation that the embodiment of the present invention provides, determining unit 20 can be determined each by the corresponding data acquisition of brake in sample data, this sample data is the application system that is derived from actual motion, like this, the more closing to reality running environment of test case forming, thereby make test more accurate, and the ratio of the quantity of the sample data extracting from each described data acquisition due to extracting unit 22 equals the ratio of the number of elements of each described data acquisition, can also ensure that the test case that generation unit 24 generates can cover all by brake, thereby system under test (SUT) is carried out accurately to comprehensively test.
Optionally, determining unit 20 specifically for: according to the data type of described sample data determine described sample data corresponding by brake, described is the described set being formed by all sample datas corresponding to brake by data acquisition corresponding to brake.
Optionally, extracting unit 22 specifically for: the sample data of randomly drawing respectively predetermined number from each described data acquisition is to form test data set.
Optionally, generation unit 24 comprises: generation module, for according to described test data set generating test use case; Adjusting module, for adjusting described test case.
Further, this proving installation also can comprise: collecting unit, for gathering in Preset Time, all characteristics in running application system are to form sample data.
Although be example object, the preferred embodiments of the present invention are disclosed, it is also possible those skilled in the art will recognize various improvement, increase and replacement, therefore, scope of the present invention should be not limited to above-described embodiment.
Claims (10)
1. a method of testing, is characterized in that, comprising:
Definite each by the corresponding data acquisition of brake in sample data, described sample data is from the application system of actual motion;
From each described data acquisition, extract respectively the sample data of predetermined number to form test data set, the ratio of the quantity of the sample data extracting from each described data acquisition equals the ratio of the number of elements of each described data acquisition;
According to described test data set generating test use case to complete test.
2. method according to claim 1, is characterized in that, describedly in sample data, determines and is respectively comprised by the corresponding data acquisition of brake:
According to the data type of described sample data determine described sample data corresponding by brake, described is the described set being formed by all sample datas corresponding to brake by data acquisition corresponding to brake.
3. method according to claim 1, is characterized in that, the described sample data that extracts respectively predetermined number from each described data acquisition comprises to form test data set:
From each described data acquisition, randomly draw respectively the sample data of predetermined number to form test data set.
4. method according to claim 1, is characterized in that, described according to described test data set generating test use case with complete test comprise:
According to described test data set generating test use case;
Described test case is adjusted.
5. according to the method described in any one in claim 1 to 4, it is characterized in that, described definite each by before the corresponding data acquisition of brake in sample data, described method also comprises:
In collection Preset Time, all characteristics in running application system are to form sample data.
6. a proving installation, is characterized in that, comprising:
Determining unit, each by the corresponding data acquisition of brake for determining in sample data, described sample data is from the application system of actual motion;
Extracting unit, for the sample data that extracts predetermined number from each described data acquisition respectively, to form test data set, the ratio of the quantity of the sample data extracting from each described data acquisition equals the ratio of the number of elements of each described data acquisition;
Generation unit, for according to described test data set generating test use case to complete test.
7. device according to claim 6, is characterized in that, described determining unit specifically for:
According to the data type of described sample data determine described sample data corresponding by brake, described is the described set being formed by all sample datas corresponding to brake by data acquisition corresponding to brake.
8. device according to claim 6, is characterized in that, described extracting unit specifically for:
From each described data acquisition, randomly draw respectively the sample data of predetermined number to form test data set.
9. device according to claim 6, is characterized in that, described generation unit comprises:
Generation module, for according to described test data set generating test use case;
Adjusting module, for adjusting described test case.
10. according to the device described in any one in claim 6 to 9, it is characterized in that, also comprise:
Collecting unit, for gathering in Preset Time, all characteristics in running application system are to form sample data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410396390.9A CN104133771B (en) | 2014-08-13 | 2014-08-13 | A kind of test method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410396390.9A CN104133771B (en) | 2014-08-13 | 2014-08-13 | A kind of test method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104133771A true CN104133771A (en) | 2014-11-05 |
CN104133771B CN104133771B (en) | 2018-07-31 |
Family
ID=51806454
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410396390.9A Active CN104133771B (en) | 2014-08-13 | 2014-08-13 | A kind of test method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104133771B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105118107A (en) * | 2015-09-01 | 2015-12-02 | 国家电网公司 | Application inspection method and device |
CN105374131A (en) * | 2015-10-28 | 2016-03-02 | 深圳怡化电脑股份有限公司 | Method and device for automatic testing |
CN105405220A (en) * | 2015-10-28 | 2016-03-16 | 深圳怡化电脑股份有限公司 | Method and device for automated test |
CN105572604A (en) * | 2016-01-27 | 2016-05-11 | 深圳创维数字技术有限公司 | Power supply testing method and power supply testing system |
CN105988920A (en) * | 2015-02-04 | 2016-10-05 | 阿里巴巴集团控股有限公司 | Test case generating method and device based on data sets |
CN109814517A (en) * | 2017-11-21 | 2019-05-28 | 北京金风科创风电设备有限公司 | Method and system for processing fan operation parameters and computer readable storage medium |
WO2019169760A1 (en) * | 2018-03-06 | 2019-09-12 | 平安科技(深圳)有限公司 | Test case range determining method, device, and storage medium |
CN111125222A (en) * | 2019-12-19 | 2020-05-08 | 北京顺丰同城科技有限公司 | Data testing method and device |
CN112084106A (en) * | 2019-06-14 | 2020-12-15 | 中国移动通信集团浙江有限公司 | Test data selection method and device, computing equipment and computer storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080184206A1 (en) * | 2007-01-31 | 2008-07-31 | Oracle International Corporation | Computer-implemented methods and systems for generating software testing documentation and test results management system using same |
CN101770423A (en) * | 2009-12-25 | 2010-07-07 | 中兴通讯股份有限公司 | Test data generation method and test system |
CN101847120A (en) * | 2010-03-31 | 2010-09-29 | 中兴通讯股份有限公司 | Design method and system of test case |
-
2014
- 2014-08-13 CN CN201410396390.9A patent/CN104133771B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080184206A1 (en) * | 2007-01-31 | 2008-07-31 | Oracle International Corporation | Computer-implemented methods and systems for generating software testing documentation and test results management system using same |
CN101770423A (en) * | 2009-12-25 | 2010-07-07 | 中兴通讯股份有限公司 | Test data generation method and test system |
CN101847120A (en) * | 2010-03-31 | 2010-09-29 | 中兴通讯股份有限公司 | Design method and system of test case |
Non-Patent Citations (2)
Title |
---|
梁晟等: "一种模拟驱动的Web应用程序性能测试方法", 《计算机研究与发展》 * |
贺昱: "基于分层抽样确定软件可靠性测试最小测试量项目管理研究", 《信息技术与信息化》 * |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105988920B (en) * | 2015-02-04 | 2018-07-24 | 阿里巴巴集团控股有限公司 | A kind of test cases generation method and its device based on data set |
CN105988920A (en) * | 2015-02-04 | 2016-10-05 | 阿里巴巴集团控股有限公司 | Test case generating method and device based on data sets |
CN105118107A (en) * | 2015-09-01 | 2015-12-02 | 国家电网公司 | Application inspection method and device |
CN105118107B (en) * | 2015-09-01 | 2018-04-20 | 国家电网公司 | Using method for inspecting and device |
CN105374131A (en) * | 2015-10-28 | 2016-03-02 | 深圳怡化电脑股份有限公司 | Method and device for automatic testing |
CN105405220A (en) * | 2015-10-28 | 2016-03-16 | 深圳怡化电脑股份有限公司 | Method and device for automated test |
CN105572604A (en) * | 2016-01-27 | 2016-05-11 | 深圳创维数字技术有限公司 | Power supply testing method and power supply testing system |
CN109814517A (en) * | 2017-11-21 | 2019-05-28 | 北京金风科创风电设备有限公司 | Method and system for processing fan operation parameters and computer readable storage medium |
WO2019169760A1 (en) * | 2018-03-06 | 2019-09-12 | 平安科技(深圳)有限公司 | Test case range determining method, device, and storage medium |
CN112084106A (en) * | 2019-06-14 | 2020-12-15 | 中国移动通信集团浙江有限公司 | Test data selection method and device, computing equipment and computer storage medium |
CN112084106B (en) * | 2019-06-14 | 2023-08-01 | 中国移动通信集团浙江有限公司 | Method and device for selecting test data, computing equipment and computer storage medium |
CN111125222A (en) * | 2019-12-19 | 2020-05-08 | 北京顺丰同城科技有限公司 | Data testing method and device |
CN111125222B (en) * | 2019-12-19 | 2023-05-02 | 北京顺丰同城科技有限公司 | Data testing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN104133771B (en) | 2018-07-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104133771A (en) | Testing method and device | |
CN106294120B (en) | Method, apparatus and computer program product for testing code | |
US9183123B2 (en) | Performance tests in a continuous deployment pipeline | |
CN104375937A (en) | Continuous integration method and system of automated testing results | |
CN106326108A (en) | New application testing method and device | |
CN104503910A (en) | Product test method by monitoring users' using behavior | |
CN106201882A (en) | Automated operating system method of testing based on Jenkins and system | |
CN107102949B (en) | Application program offline testing method and tool | |
CN102393834B (en) | A kind of method of testing of digital man-machine interface of nuclear power station and system | |
WO2019169760A1 (en) | Test case range determining method, device, and storage medium | |
CN109165153A (en) | A kind of performance test methods of high emulation securities business transaction class system | |
CN108153672A (en) | The automatization test system and test method of a kind of mobile application | |
CN105740142A (en) | Pressure test management system for SSR (Server Security Reinforcement) centralized management platform | |
CN104063326A (en) | Software testing data analysis oscilloscope and method | |
CN106021113A (en) | Precise test implementation method | |
CN106713069A (en) | System resource monitoring and bottleneck identification method | |
CN104123397A (en) | Automatic test device and method for Web page | |
Zhao et al. | Systematically testing and diagnosing responsiveness for android apps | |
CN110726542B (en) | Analysis method for fatigue life of spring | |
CN110008072A (en) | A kind of method and device of testing hard disk performance and programming count result | |
CN111045938A (en) | Reliability modeling method for introducing open-source software based on Pareto distributed faults | |
CN109634851A (en) | A kind of system-level real-time method for obtaining tested program internal operation data | |
US9348733B1 (en) | Method and system for coverage determination | |
CN105405220A (en) | Method and device for automated test | |
CN115576831A (en) | Test case recommendation method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |