CN107153601A - Unit performance method of testing and equipment - Google Patents
Unit performance method of testing and equipment Download PDFInfo
- Publication number
- CN107153601A CN107153601A CN201710118033.XA CN201710118033A CN107153601A CN 107153601 A CN107153601 A CN 107153601A CN 201710118033 A CN201710118033 A CN 201710118033A CN 107153601 A CN107153601 A CN 107153601A
- Authority
- CN
- China
- Prior art keywords
- unit
- tested
- performance test
- time
- attribute
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
Abstract
It is an object of the invention to provide a kind of unit performance method of testing and equipment, the application passes through in unit testing framework, according to the attribute and start multithreading the unit to be tested test to obtain the performance test results, it can realize and performance test is done to not deployed unit, in addition, by in unit testing framework, the performance test results are compared with the desired value, judgement is successfully tested or failure, it can realize and the performance test results are estimated automatically, it is convenient to assess again and the application can return execution, without manpower intervention.
Description
Technical field
The present invention relates to computer realm, more particularly to a kind of unit performance method of testing and equipment.
Background technology
Traditional unit testing framework such as Junit etc. can not execution performance test, wherein Junit is a Java language
Unit testing framework.And traditional performance testing tool such as Jmeter, loadrunner etc., typically require that system is deployed
Work(could be tested, that is, the system for having clear and definite " entrance ", and " entrance " more refers to one kind side that can be accessed remotely through computer networks
Formula, such as http, rpc etc., in addition, traditional performance testing tool is when execution performance is tested, only return to the performance test results, and
The performance test results can not be estimated, it is necessary to artificial carry out secondary-confirmation to results of property and write performance test report,
Waste time and energy.
The content of the invention
It is an object of the present invention to provide a kind of unit performance method of testing and equipment, it can solve the problem that to not deployed
The problem of unit does performance test and is estimated automatically to the performance test results.
According to an aspect of the invention, there is provided a kind of unit performance method of testing, this method includes:
Define the attribute of the performance test of unit to be tested and the desired value of the performance test results;
In unit testing framework, according to the attribute and start multithreading the unit to be tested is tested
The performance test results;
In unit testing framework, the performance test results are compared with the desired value, judgement is successfully tested or lost
Lose.
Further, in the above method, after judgement is successfully tested or failed, in addition to:
Test report is generated according to the result of judgement.
Further, in the above method, the attribute includes:
Number of times that unit to be tested is performed, while the Thread Count, the interval time for increasing thread, the loaded that perform own
The time of thread and whether there is meeting point.
Further, in the above method, the attribute includes:
Test is performed in the range of at the appointed time always, while the Thread Count performed, the interval time for increasing thread, loading
Finish the time of all threads and whether there is meeting point.
Further, in the above method, the attribute of the performance test of unit to be tested is defined, including:
The attribute and performance test knot of the performance test of unit to be tested are defined in unit to be tested in the way of note
The desired value of fruit.
Further, in the above method, the performance test results include:The actual average handling capacity of unit to be tested and
One kind or any combination in the response time of the actual average of unit to be tested each time.
Further, in the above method, the performance test results include:In all execution number of times of unit to be tested
One kind in maximum actual response time in all execution number of times of the actual response time of 50% time and unit to be tested or
Any combination.
Further, in the above method, according to the attribute and start multithreading the unit to be tested is tested
The performance test results are obtained, including:
According to the attribute and start multithreading the unit to be tested is tested;
Obtain the sampling response time of unit to be tested in test;
When the real response of 50% time in all execution number of times of unit to be tested is calculated according to the sampling response time
Between and unit to be tested all execution number of times in maximum actual response time in one kind or any combination.
Further, in the above method, the response time includes the duration that unit to be tested is performed each time in test
With every 1 second in the number of times that performs of unit to be tested.
Further, in the above method, the unit testing framework is the framework based on Junit.
According to another aspect of the present invention, a kind of unit performance test equipment is additionally provided, the equipment includes:
Definition device, attribute and the desired value of the performance test results for the performance test that defines unit to be tested;
Unit testing framework, for according to the attribute and starting multithreading and being tested the unit to be tested
The performance test results and the performance test results are compared with the desired value, judgement is successfully tested or failure.
Further, in the said equipment, the equipment also includes test report device, for judging to be successfully tested or failing
Afterwards, test report is generated according to the result of judgement.
Further, in the said equipment, the attribute includes:
Number of times that unit to be tested is performed, while the Thread Count, the interval time for increasing thread, the loaded that perform own
The time of thread and whether there is meeting point.
Further, in the said equipment, the attribute includes:
Test is performed in the range of at the appointed time always, while the Thread Count performed, the interval time for increasing thread, loading
Finish the time of all threads and whether there is meeting point.
Further, in the said equipment, the definition device is treated for being defined in the way of note in unit to be tested
The attribute of the performance test of test cell and the desired value of the performance test results.
Further, in the said equipment, the performance test results include:The actual average handling capacity of unit to be tested and
One kind or any combination in the response time of the actual average of unit to be tested each time.
Further, in the said equipment, the performance test results include:In all execution number of times of unit to be tested
One kind in maximum actual response time in all execution number of times of the actual response time of 50% time and unit to be tested or
Any combination.
Further, in the said equipment, according to the attribute and start multithreading the unit to be tested is tested
The performance test results are obtained, including:
According to the attribute and start multithreading the unit to be tested is tested;
Obtain the sampling response time of unit to be tested in test;
When the real response of 50% time in all execution number of times of unit to be tested is calculated according to the sampling response time
Between and unit to be tested all execution number of times in maximum actual response time in one kind or any combination.
Further, in the said equipment, the response time includes the duration that unit to be tested is performed each time in test
With every 1 second in the number of times that performs of unit to be tested.
Further, in the said equipment, the unit testing framework is the framework based on Junit.
According to the one side of the application, a kind of unit performance test equipment is additionally provided, wherein, the equipment includes:
Processor;And it is arranged to store the memory of computer executable instructions, the executable instruction is being held
Make the processor during row:
Define the attribute of the performance test of unit to be tested and the desired value of the performance test results;
According to the attribute and start multithreading the unit to be tested test and obtain the performance test results and will
The performance test results are compared with the desired value, and judgement is successfully tested or failure.
Compared with prior art, the application is by unit testing framework, according to the attribute and starts multithreading pair
The unit to be tested test obtaining the performance test results, can realize and do performance test to not deployed unit, separately
Outside, by the way that in unit testing framework, the performance test results are compared with the desired value, judgement is successfully tested or lost
Lose, can realize and the performance test results are estimated automatically, and the application can return execution, it is convenient to assess again, without people
Work is intervened.
Brief description of the drawings
By reading the detailed description made to non-limiting example made with reference to the following drawings, of the invention is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 shows a kind of flow chart of unit performance method of testing according to one aspect of the invention;
Fig. 2 shows the schematic diagram of a preferred embodiment of the invention;
Fig. 3 shows a kind of module map of unit performance test equipment according to a further aspect of the present invention
Fig. 4 is shown according to a kind of module map of the preferred embodiment of unit performance test equipment one of the invention.
Same or analogous reference represents same or analogous part in accompanying drawing.
Embodiment
The present invention is described in further detail below in conjunction with the accompanying drawings.
In one typical configuration of the application, terminal, the equipment of service network and trusted party include one or more
Processor (CPU), input/output interface, network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moved
State random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic cassette tape, magnetic disk storage or other magnetic storage apparatus or
Any other non-transmission medium, the information that can be accessed by a computing device available for storage.Defined according to herein, computer
Computer-readable recording medium does not include the data-signal and carrier wave of non-temporary computer readable media (transitory media), such as modulation.
As shown in figure 1, the application provides a kind of unit performance method of testing, this method includes:
Step S1, defines the attribute and the desired value of the performance test results of the performance test of unit to be tested;
Step S2, in unit testing framework, according to the attribute and starts multithreading the unit to be tested is carried out
Test obtains the performance test results;
Step S3, in unit testing framework, the performance test results are compared with the desired value, and judgement is tested into
Work(or failure.Here, the unit to be tested is to include an independent method or module or not deployed system etc.,
The present embodiment according to the attribute and starts multithreading the unit to be tested is tested by unit testing framework
The performance test results are obtained, can realize and performance test is done to not deployed unit, in addition, by unit testing framework
In, the performance test results are compared with the desired value, judgement is successfully tested or failure, can realized automatic to performance survey
Test result is estimated, and the present embodiment can return execution, convenient to assess again, without manpower intervention.
In the preferred embodiment of unit performance method of testing one of the application, after judgement is successfully tested or failed, also wrap
Include:
Test report is generated according to the result of judgement, so as to realize that generation visualization is more intuitively according to Performance Evaluation
Performance test is reported, intuitively returns to conclusion.If for example, as shown in Fig. 2 result of the comparison is generated into meet desired value
Work(test report S28;If result of the comparison, can be red by the item mark of test crash in test report to be undesirably worth
S27。
In the preferred embodiment of unit performance method of testing one of the application, the attribute includes:
Number of times (Invocations) that unit to be tested is performed, while the Thread Count (Threads), the increase thread that perform
Interval time (RampUp), the time (warmUp) of all threads of loaded and whether there is meeting point (barrier).Specifically
, when being provided with meeting point, it is another afterwards that each thread can wait other threads to perform same unit to be tested (test2)
Play the test for the unit (test2) to be tested for concurrently performing next round.
In the preferred embodiment of unit performance method of testing one of the application, the attribute includes:
Test (Duration) is performed in the range of at the appointed time always, while Thread Count (Threads), the increase of execution
The interval time (RampUp) of thread, the time (warmUp) of all threads of loaded and whether there is meeting point (barrier).
This, number of times (Invocations) that unit to be tested is performed and performed always in specified time range test (Duration) because
To be conflicting, as long as so selecting a definition in defined attribute.For example ,@PerfTest (threads=can be defined
10, duration=60000, rampUp=1000, warmUp=9000, barrier=true), 10 threads are represented, are run
60S (second), initial thread is 1, increases a thread every 1S, there is meeting point.
In the preferred embodiment of unit performance method of testing one of the application, the category of the performance test of unit to be tested is defined
Property, including:
The attribute and performance test knot of the performance test of unit to be tested are defined in unit to be tested in the way of note
The desired value of fruit.This definition mode is simple, convenient, as shown in Fig. 2 subsequent cell test frame can obtain fixed by explaining
The attribute S21 of the performance test of the unit to be tested of justice, then by unit testing framework progress performance test S22, and after
Continuous unit testing framework obtains the desired value S25 of the performance test results defined by explaining, and is compared with the performance test results
To S26, realization is estimated to the performance test results.
In the preferred embodiment of unit performance method of testing one of the application, in unit testing framework, the performance is surveyed
Test result includes:In the response time of the actual average handling capacity of unit to be tested and the actual average of unit to be tested each time
One kind or any combination.Accordingly, the desired value includes the expectation average throughput of unit to be tested
(throughoutput), it is compared for the follow-up actual average handling capacity with unit to be tested;The desired value also includes
The expectation average response time (average) each time of unit to be tested, for follow-up and unit to be tested actual average
Response time each time is compared.For example ,@Required (throughoutput=20) can be set, represent to be tested
The expectation average throughput of unit reaches 20, can also set@Required (average=20), represents unit to be tested
It is 20m to expect the average response time each time.Here, due to unit to be tested perform number of times (Invocations) and refer to
Test (Duration) is performed in the range of fixing time always because conflicting, as long as selecting a definition in defined attribute i.e.
Can, if so the attribute above set is the number of times (Invocations) that unit to be tested is performed, then unit to be tested
The time spent in number of times/execution that actual average handling capacity=unit to be tested is performed complete all number of times;If above set
Attribute be at the appointed time in the range of perform test (Duration) always, then the actual average handling capacity of unit to be tested=
Specify number of times/specified time range that unit to be tested is performed in time range.Here all test institutes are completed actual complete
Into total time be probably to be determined by the duration set, it is also possible to according to the invocation being provided with, run institute
Total response time determines obtained by some invocation.In addition, the average response each time of expectation of unit to be tested
Time (average) is the inverse of the expectation average throughput (throughoutput) of unit to be tested.
In the preferred embodiment of unit performance method of testing one of the application, the performance test results include list to be tested
Maximum in all execution number of times of member in the actual response time of 50% time and all execution number of times of unit to be tested is actual
One kind or any combination in response time.Here, in all execution number of times of unit to be tested during the real response of 50% time
Between can be obtained according to the interval of all time actual response times.Corresponding, the desired value includes at least 50% execution
Response time, refer to that the response time of 50% time in all execution number of times of unit to be tested is less than or equal to preset value
(median), at least 50% response time performed was used to be compared with the actual response time of 50% time in all execution number of times
Compared with;The greatest hope response time (max) in the desired value also all execution number of times including unit to be tested, refer to be measured
The maximum response time is less than in preset value, all execution number of times of unit to be tested in all execution number of times of examination unit
The greatest hope response time be used for be compared with the maximum actual response time in all execution number of times of unit to be tested.
For example ,@Required (median=20) can be set, represent that the expectation of 50% time in all execution number of times of test cell rings
Between seasonable within 20ms, it can also set in@Required (max=200), all execution number of times of unit to be tested most
The big expected response time is no more than 200ms (millisecond).
In the preferred embodiment of unit performance method of testing one of the application, according to the attribute and start multithreading to institute
Unit to be tested is stated test obtaining the performance test results, including:
According to the attribute and start multithreading the unit to be tested is tested;
Obtain the sampling response time of unit to be tested in test;
When the real response of 50% time in all execution number of times of unit to be tested is calculated according to the sampling response time
Between and unit to be tested all execution number of times in maximum actual response time in one kind or any combination.For example, such as Fig. 2
It is shown, Junit performances original test result data S23, Junit here can be collected after calling Junit to carry out pressure survey S22
The original test result data of performance is to include the sampling response time of unit to be tested in test.Assuming that test run 300S,
The test for treating test cell of 1000 times may have been run in so 300S, the test that test cell will be treated every time is spent
The time of expense is all recorded, then can just count the actual response time of 50% time in all execution number of times.Here, root
The performance test results can be accurately obtained according to the sampling response time of unit to be tested.
In the preferred embodiment of unit performance method of testing one of the application, the response time includes to be tested in test
Duration that unit is performed each time and it is every 1 second in the number of times that performs of unit to be tested.
In the preferred embodiment of unit performance method of testing one of the application, the unit testing framework is based on Junit
Framework.Here, the framework based on Junit, all support Junit continuous integrating framework can be run, each run has
Visual result is preserved, and can call Junit's to assert that method is compared actual test result with desired value, can also be right
Each time result is contrasted, and realizes the performance test of sustainable recurrence.
As shown in figure 3, according to the another side of the application, a kind of unit performance test equipment is also provided, wherein, the equipment
100 include:
Definition device 1, attribute and the desired value of the performance test results for the performance test that defines unit to be tested;
Unit testing framework 2, for according to the attribute and starting multithreading and carrying out testing to the unit to be tested
It is compared to the performance test results and by the performance test results with the desired value, judgement is successfully tested or failure.Here, institute
It is to include an independent method or module or not deployed system etc. to state unit to be tested, and the present embodiment passes through in list
In first test frame, according to the attribute and start multithreading the unit to be tested test to obtain performance test knot
Really, it can realize and performance test is done to not deployed unit, in addition, by unit testing framework, by performance test knot
Fruit is compared with the desired value, and judgement is successfully tested or failure, can realize and the performance test results are estimated automatically,
It is convenient to assess again and the present embodiment can return execution, without manpower intervention.
As shown in figure 4, in a kind of preferred embodiment of unit performance test equipment one of the application, the equipment 100 is also
Including test report device 3, after judging to be successfully tested or failing, test report is generated according to the result of judgement, so that
Realize that, according to Performance Evaluation, more intuitively performance test is reported for generation visualization, intuitively returns to conclusion.For example, such as Fig. 2 institutes
Show, if result of the comparison generates successfully test report S28 to meet desired value;If result of the comparison is not meet the phase
Prestige value, can be in test report by the red S27 of item mark of test crash.
In a kind of preferred embodiment of unit performance test equipment one of the application, the attribute includes:
Number of times (Invocations) that unit to be tested is performed, while the Thread Count (Threads), the increase thread that perform
Interval time (RampUp), the time (warmUp) of all threads of loaded and whether there is meeting point (barrier).Specifically
, when being provided with meeting point, it is another afterwards that each thread can wait other threads to perform same unit to be tested (test2)
Play the test for the unit (test2) to be tested for concurrently performing next round.
In a kind of preferred embodiment of unit performance test equipment one of the application, the attribute includes:
Test (Duration) is performed in the range of at the appointed time always, while Thread Count (Threads), the increase of execution
The interval time (RampUp) of thread, the time (warmUp) of all threads of loaded and whether there is meeting point (barrier).
This, number of times (Invocations) that unit to be tested is performed and performed always in specified time range test (Duration) because
To be conflicting, as long as so selecting a definition in defined attribute.For example ,@PerfTest (threads=can be defined
10, duration=60000, rampUp=1000, warmUp=9000, barrier=true), 10 threads are represented, are run
60S (second), initial thread is 1, increases a thread every 1S, there is meeting point.
In a kind of preferred embodiment of unit performance test equipment one of the application, the definition device 1, for note
Mode defined in unit to be tested unit to be tested performance test attribute and the desired value of the performance test results.It is this
Definition mode is simple, convenient, as shown in Fig. 2 subsequent cell test frame can obtain the unit to be tested of definition by explaining
Performance test attribute S21, performance test S22, and subsequent cell test frame are then carried out by unit testing framework
By explaining the desired value S25 for the performance test results for obtaining definition, S26 is compared with the performance test results, realizes to property
Energy test result is estimated.
In a kind of preferred embodiment of unit performance test equipment one of the application, the performance test results include:Treat
One kind or any in the response time of the actual average handling capacity of test cell and the actual average of unit to be tested each time
Combination.Accordingly, the desired value includes the expectation average throughput (throughoutput) of unit to be tested, for follow-up
It is compared with the actual average handling capacity of unit to be tested;The desired value also expectation including unit to be tested is average each
The secondary response time (average), it is compared for the response time of the follow-up actual average with unit to be tested each time.
For example ,@Required (throughoutput=20) can be set, represent that the expectation average throughput of unit to be tested reaches
20 ,@Required (average=20) can also be set, the expectation average response time each time of unit to be tested is represented
For 20m.Here, due to performing test always in the number of times (Invocations) and specified time range of unit to be tested execution
(Duration) because conflicting, as long as selecting a definition in defined attribute, if so category above set
Property be number of times (Invocations) that unit to be tested is performed, then the actual average handling capacity of unit to be tested=to be tested
The time spent in number of times/execution complete all number of times that unit is performed;If the attribute above set be at the appointed time in the range of
Test (Duration) is performed always, then the actual average handling capacity of unit to be tested=specify execution in time range to be measured
Try number of times/specified time range of unit.Here it is probably by setting to complete all tests actually accomplished total time
Duration determine, it is also possible to according to the invocation being provided with, run obtained by all invocation always
Response time determine.In addition, the expectation average response time (average) each time of unit to be tested is list to be tested
The inverse of the expectation average throughput (throughoutput) of member.
In a kind of preferred embodiment of unit performance test equipment one of the application, the performance test results include:Treat
In all execution number of times of test cell in the actual response time of 50% time and all execution number of times of unit to be tested most
One kind or any combination in big actual response time.Here, the reality of 50% time in all execution number of times of unit to be tested
Response time can obtain according to the interval of the actual response time of all times.Corresponding, the desired value includes at least 50%
The response time of execution, refer to that the response time of 50% time in all execution number of times of unit to be tested is less than or equal to preset value
(median), at least 50% response time performed was used to be compared with the actual response time of 50% time in all execution number of times
Compared with;The greatest hope response time (max) in the desired value also all execution number of times including unit to be tested, refer to be measured
The maximum response time is less than in preset value, all execution number of times of unit to be tested in all execution number of times of examination unit
The greatest hope response time be used for be compared with the maximum actual response time in all execution number of times of unit to be tested.
For example ,@Required (median=20) can be set, represent that the expectation of 50% time in all execution number of times of test cell rings
Between seasonable within 20ms, it can also set in@Required (max=200), all execution number of times of unit to be tested most
The big expected response time is no more than 200ms (millisecond).
In a kind of preferred embodiment of unit performance test equipment one of the application, according to the attribute and start multithreading
The unit to be tested test obtaining the performance test results, including:
According to the attribute and start multithreading the unit to be tested is tested;
Obtain the sampling response time of unit to be tested in test;
When the real response of 50% time in all execution number of times of unit to be tested is calculated according to the sampling response time
Between and unit to be tested all execution number of times in maximum actual response time in one kind or any combination.For example, such as Fig. 2
It is shown, Junit performances original test result data S23, Junit here can be collected after calling Junit to carry out pressure survey S22
The original test result data of performance is to include the sampling response time of unit to be tested in test.Assuming that test run 300S,
The test for treating test cell of 1000 times may have been run in so 300S, the test that test cell will be treated every time is spent
The time of expense is all recorded, then can just count the actual response time of 50% time in all execution number of times.Here, root
The performance test results can be accurately obtained according to the sampling response time of unit to be tested.
In a kind of preferred embodiment of unit performance test equipment one of the application, the response time includes treating in test
Duration that test cell is performed each time and it is every 1 second in the number of times that performs of unit to be tested.
In a kind of preferred embodiment of unit performance test equipment one of the application, the unit testing framework 2 be based on
Junit framework.Here, the framework based on Junit, all support Junit continuous integrating framework can be run, transport every time
Row has visual result to preserve, and can call Junit's to assert that method is compared actual test result with desired value, may be used also
To be contrasted to each result, the performance test of sustainable recurrence is realized.
In summary, the application is by unit testing framework, according to the attribute and starts multithreading and is treated to described
Test cell test obtaining the performance test results, can realize and do performance test to not deployed unit, in addition, passing through
In unit testing framework, the performance test results are compared with the desired value, judgement is successfully tested or failure, Neng Goushi
Now the performance test results are estimated automatically, and the application can return execution, it is convenient to assess again, without manpower intervention.
In addition, present invention also provides a kind of unit performance test equipment, wherein, the equipment includes:
Processor;And it is arranged to store the memory of computer executable instructions, the executable instruction is being held
Make the processor during row:
Define the attribute of the performance test of unit to be tested and the desired value of the performance test results;
According to the attribute and start multithreading the unit to be tested test and obtain the performance test results and will
The performance test results are compared with the desired value, and judgement is successfully tested or failure.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the application to the application
God and scope.So, if these modifications and variations of the application belong to the scope of the application claim and its equivalent technologies
Within, then the application is also intended to comprising including these changes and modification.
It should be noted that the present invention can be carried out in the assembly of software and/or software and hardware, for example, can adopt
Realized with application specific integrated circuit (ASIC), general purpose computer or any other similar hardware device.In one embodiment
In, software program of the invention can realize steps described above or function by computing device.Similarly, it is of the invention
Software program (including related data structure) can be stored in computer readable recording medium storing program for performing, for example, RAM memory,
Magnetically or optically driver or floppy disc and similar devices.In addition, some steps or function of the present invention can employ hardware to realize, example
Such as, as coordinating with processor so as to performing the circuit of each step or function.
In addition, the part of the present invention can be applied to computer program product, such as computer program instructions, when its quilt
When computer is performed, by the operation of the computer, the method according to the invention and/or technical scheme can be called or provided.
And the programmed instruction of the method for the present invention is called, it is possibly stored in fixed or moveable recording medium, and/or pass through
Broadcast or the data flow in other signal bearing medias and be transmitted, and/or be stored according to described program instruction operation
In the working storage of computer equipment.Here, including a device according to one embodiment of present invention, the device includes using
In the memory and processor for execute program instructions of storage computer program instructions, wherein, when the computer program refers to
When order is by the computing device, method and/or skill of the plant running based on foregoing multiple embodiments according to the present invention are triggered
Art scheme.
It is obvious to a person skilled in the art that the invention is not restricted to the details of above-mentioned one exemplary embodiment, Er Qie
In the case of without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter
From the point of view of which point, embodiment all should be regarded as exemplary, and be nonrestrictive, the scope of the present invention is by appended power
Profit is required rather than described above is limited, it is intended that all in the implication and scope of the equivalency of claim by falling
Change is included in the present invention.Any reference in claim should not be considered as to the claim involved by limitation.This
Outside, it is clear that the word of " comprising " one is not excluded for other units or step, and odd number is not excluded for plural number.That is stated in device claim is multiple
Unit or device can also be realized by a unit or device by software or hardware.The first, the second grade word is used for table
Show title, and be not offered as any specific order.
Claims (21)
1. a kind of unit performance method of testing, wherein, this method includes:
Define the attribute of the performance test of unit to be tested and the desired value of the performance test results;
In unit testing framework, according to the attribute and start multithreading the unit to be tested test to obtain performance
Test result;
In unit testing framework, the performance test results are compared with the desired value, judgement is successfully tested or failure.
2. according to the method described in claim 1, wherein, judgement be successfully tested or failure after, in addition to:
Test report is generated according to the result of judgement.
3. according to the method described in claim 1, wherein, the attribute includes:
Number of times that unit to be tested is performed, while the Thread Count, the interval time for increasing thread, all threads of loaded that perform
Time and whether there is meeting point.
4. according to the method described in claim 1, wherein, the attribute includes:
Test is performed in the range of at the appointed time always, while the Thread Count, the interval time for increasing thread, the loaded that perform
The time of all threads and whether there is meeting point.
5. according to the method described in claim 1, wherein, define the attribute of the performance test of unit to be tested, including:
The attribute and the performance test results of the performance test of unit to be tested are defined in unit to be tested in the way of note
Desired value.
6. according to the method described in claim 1, wherein, the performance test results include:The actual average of unit to be tested
One kind or any combination in the response time of the actual average of handling capacity and unit to be tested each time.
7. according to the method described in claim 1, wherein, the performance test results include:All execution of unit to be tested
In maximum actual response time in number of times in all execution number of times of the actual response time of 50% time and unit to be tested
A kind of or any combination.
8. method according to claim 7, wherein, according to the attribute and start multithreading the unit to be tested is entered
Row test obtains the performance test results, including:
According to the attribute and start multithreading the unit to be tested is tested;
Obtain the sampling response time of unit to be tested in test;
Calculated according to the sampling response time in all execution number of times of unit to be tested the actual response time of 50% time and
One kind or any combination in maximum actual response time in all execution number of times of unit to be tested.
9. method according to claim 8, wherein, the response time includes unit to be tested in test and performed each time
Duration and it is every 1 second in the number of times that performs of unit to be tested.
10. according to the method described in claim 1, wherein, the unit testing framework be the framework based on Junit.
11. a kind of unit performance test equipment, wherein, the equipment includes:
Definition device, attribute and the desired value of the performance test results for the performance test that defines unit to be tested;
Unit testing framework, for according to the attribute and starting multithreading and to the unit to be tested test obtaining performance
Test result and the performance test results are compared with the desired value, judgement is successfully tested or failure.
12. equipment according to claim 11, wherein, the equipment also includes test report device, for judging test
After success or failure, test report is generated according to the result of judgement.
13. equipment according to claim 11, wherein, the attribute includes:
Number of times that unit to be tested is performed, while the Thread Count, the interval time for increasing thread, all threads of loaded that perform
Time and whether there is meeting point.
14. equipment according to claim 11, wherein, the attribute includes:
Test is performed in the range of at the appointed time always, while the Thread Count, the interval time for increasing thread, the loaded that perform
The time of all threads and whether there is meeting point.
15. equipment according to claim 11, wherein, the definition device, in the way of note in list to be tested
The attribute and the desired value of the performance test results of the performance test of unit to be tested are defined in first.
16. equipment according to claim 11, wherein, the performance test results include:The reality of unit to be tested is put down
One kind or any combination in the response time of the actual average of equal handling capacity and unit to be tested each time.
17. equipment according to claim 11, wherein, the performance test results include:The all of unit to be tested hold
In maximum actual response time in places number in all execution number of times of the actual response time of 50% time and unit to be tested
One kind or any combination.
18. equipment according to claim 17, wherein, according to the attribute and start multithreading to the unit to be tested
Progress, which is tested, obtains the performance test results, including:
According to the attribute and start multithreading the unit to be tested is tested;
Obtain the sampling response time of unit to be tested in test;
Calculated according to the sampling response time in all execution number of times of unit to be tested the actual response time of 50% time and
One kind or any combination in maximum actual response time in all execution number of times of unit to be tested.
19. equipment according to claim 18, wherein, the response time includes unit to be tested in test and held each time
Capable duration and it is every 1 second in the number of times that performs of unit to be tested.
20. equipment according to claim 11, wherein, the unit testing framework is the framework based on Junit.
21. a kind of unit performance test equipment, wherein, the equipment includes:
Processor;
And it is arranged to store the memory of computer executable instructions, the executable instruction makes the place when executed
Manage device:
Define the attribute of the performance test of unit to be tested and the desired value of the performance test results;
According to the attribute and start multithreading the unit to be tested test and obtain the performance test results and by performance
Test result is compared with the desired value, and judgement is successfully tested or failure.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610116407X | 2016-03-02 | ||
CN201610116407 | 2016-03-02 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107153601A true CN107153601A (en) | 2017-09-12 |
CN107153601B CN107153601B (en) | 2021-04-09 |
Family
ID=59792366
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710118033.XA Active CN107153601B (en) | 2016-03-02 | 2017-03-01 | Unit performance test method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107153601B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108255738A (en) * | 2018-04-09 | 2018-07-06 | 平安普惠企业管理有限公司 | Automated testing method, device, computer equipment and storage medium |
CN110865937A (en) * | 2019-11-08 | 2020-03-06 | 腾讯音乐娱乐科技(深圳)有限公司 | Application testing method and device and storage medium |
CN113760709A (en) * | 2020-09-29 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Automatic testing method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8276122B2 (en) * | 2008-09-24 | 2012-09-25 | International Business Machines Corporation | Method to speed up creation of JUnit test cases |
CN104182333A (en) * | 2013-05-23 | 2014-12-03 | 阿里巴巴集团控股有限公司 | Performance testing method and equipment |
CN105045710A (en) * | 2015-06-30 | 2015-11-11 | 吉林大学 | Method for automatically generating test data in cloud computing environment |
-
2017
- 2017-03-01 CN CN201710118033.XA patent/CN107153601B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8276122B2 (en) * | 2008-09-24 | 2012-09-25 | International Business Machines Corporation | Method to speed up creation of JUnit test cases |
CN104182333A (en) * | 2013-05-23 | 2014-12-03 | 阿里巴巴集团控股有限公司 | Performance testing method and equipment |
CN105045710A (en) * | 2015-06-30 | 2015-11-11 | 吉林大学 | Method for automatically generating test data in cloud computing environment |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108255738A (en) * | 2018-04-09 | 2018-07-06 | 平安普惠企业管理有限公司 | Automated testing method, device, computer equipment and storage medium |
CN110865937A (en) * | 2019-11-08 | 2020-03-06 | 腾讯音乐娱乐科技(深圳)有限公司 | Application testing method and device and storage medium |
CN110865937B (en) * | 2019-11-08 | 2023-11-24 | 腾讯音乐娱乐科技(深圳)有限公司 | Application testing method, device and storage medium |
CN113760709A (en) * | 2020-09-29 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Automatic testing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN107153601B (en) | 2021-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11947448B2 (en) | Test case reduction for code regression testing | |
US7747987B1 (en) | System and method of analyzing risk in risk-based software testing | |
CN109542789B (en) | Code coverage rate statistical method and device | |
CN104035863B (en) | A kind of browser testing method and device | |
CN109614324A (en) | A kind of method for generating test case and device | |
CN109145981B (en) | Deep learning automatic model training method and equipment | |
CN107153601A (en) | Unit performance method of testing and equipment | |
WO2019056720A1 (en) | Automated test case management method and apparatus, device, and storage medium | |
CN106201856A (en) | A kind of multi version performance test methods and device | |
CN104503912A (en) | Monitoring method and device for service responding process | |
CN103152391A (en) | Journal output method and device | |
CN109753428A (en) | Service test method, device, computer equipment and readable storage medium storing program for executing | |
CN111400164B (en) | Software testing method and device | |
WO2017172667A1 (en) | Privilege test and monitoring | |
CN110096445A (en) | A kind of model is in ring test method and device | |
CN110334012B (en) | Risk assessment method and device | |
CN107220165A (en) | The method and apparatus of pressure test on a kind of artificial line | |
US9501390B1 (en) | Enhancing automated mobile application testing | |
CN104298589B (en) | A kind of performance test methods and equipment | |
US10417113B1 (en) | System, method, and computer program for web testing and automation offline storage and analysis | |
CN117234916A (en) | Workflow application testing method and device, electronic equipment and storage medium | |
CN107943682A (en) | Submit the method and device of bug | |
CN110188793B (en) | Data anomaly analysis method and device | |
CN111400131A (en) | Performance detection method and system of AI server, electronic equipment and storage medium | |
CN107590039A (en) | A kind of continuous test method, device and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |