CN102662806B - Adaptive testing method directed at different performance indicators of Java card - Google Patents
Adaptive testing method directed at different performance indicators of Java card Download PDFInfo
- Publication number
- CN102662806B CN102662806B CN201210049266.6A CN201210049266A CN102662806B CN 102662806 B CN102662806 B CN 102662806B CN 201210049266 A CN201210049266 A CN 201210049266A CN 102662806 B CN102662806 B CN 102662806B
- Authority
- CN
- China
- Prior art keywords
- test
- java card
- test terminal
- testing
- performance
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 98
- 230000003044 adaptive effect Effects 0.000 title abstract description 6
- 238000013100 final test Methods 0.000 claims abstract description 4
- 238000011056 performance test Methods 0.000 claims description 13
- 238000000034 method Methods 0.000 abstract description 14
- 230000008569 process Effects 0.000 abstract description 4
- 230000008901 benefit Effects 0.000 abstract description 2
- 230000001351 cycling effect Effects 0.000 abstract 1
- 230000007246 mechanism Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006854 communication Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000007429 general method Methods 0.000 description 1
- 230000036314 physical performance Effects 0.000 description 1
- 238000010561 standard procedure Methods 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention discloses an adaptive testing method directed at different performance indicators of a Java card, comprising the following steps of: 1) sending an application command of Java Card Applet which is used for testing performance to a Java card by a test terminal; 2) setting a required degree of accuracy on the test terminal; 3) setting the value of cycle test times to be 0 by the test terminal, setting the value of cycle test times to be 1 after testing the time spent by the Java card on executing the Java Card Applet, and testing execution time of the Java Card Applet of the Java card; 4) calculating a reasonable number of cycle test times C which is suitable for the performance testing by the test terminal by using a formula; 5) setting the value of cycle test times to be C, and testing execution time of the Java Card Applet after cycling the Java card C times; and 6) calculating the average value of the execution time of a test function by the test terminal by using the formula, wherein the average value is a final test result. The adaptive testing method of the invention has the advantages that the value of the cycle test times can be adaptively determined and testing process can be executed intelligently in the performance testing process of the Java card, the adaptive testing method is not influenced by changes of testing environment, and the like.
Description
Technical field
The present invention relates to technical field of intelligent card, especially relate to a kind of self-adapting testing method for Java card different performance index.
Background technology
In recent years, Java smart card is with the advantage such as simplification, application program dynamic download of its good platform-neutral, the support of many application, good security feature, OO programmed environment, application and development, be widely used in the every field of social life, have broad application prospects at numerous areas.Such as, domestic Local finance bank card business development is very rapid, and have 192 in 220 card sending mechanism in the whole nation for Local finance mechanism, Local finance mechanism issued volume reaches 300,000,000, and trading volume accounts for about 1/5th of national total amount.In the face of so huge card producing system, for different business demand, suitable card vendor is selected to be a difficult selection for decision maker.The test that this situation of Java card impels card developer and card provider more and more to pay attention to Java card performance.
At present, on market in the test of the non-physical performances such as Java smart card stability, application function and basic security, most employing PC/SC specification.PC/SC system is made up of three critical pieces: operating system, read write line (IFD), smart card (ICC).But in the specific implementation of its test, also there is no the recognized standard method.Comparatively general method is, the JavaCard Applet that can embody a certain performance of Java card is installed on card, send a series of APDU order by the outer terminal of card and carry out system testing, finally using the time that the interior execution test of card spends as the index of test result, its time set is present in outside card, and is connected with Java card by card reader.Therefore, there is the interference of call duration time between card reader and card in the Java card performance test methods of this Based PC/SC in its result.
For addressing this problem, comparatively simple method carries out loop test to same performance in a communication process of Java card and card reader, then get the mean value of result, so just can reduce call duration time proportion in test result, improve the precision of test result.But cannot determine fast and effectively the value of cycle index in this loop test: usually in the scope once arriving several ten thousand times, test can be increased progressively every certain number of times unit (as 100 times), if there is stable value in period in the set of test result, then stop test, and record this stationary value as a result; Or directly blindly cycle index is increased to up to ten thousand times for the consideration of result accuracy, after averaging like this, also more accurately can obtains the execution time of instruction.But which kind of method no matter, the cycle index of use is all targetedly, and when test environment changes (such as, change a card or test another performance), the possibility of result using same cycle index to obtain is inaccurate; They may be all with the longer test duration for cost, and this is unacceptable in a large amount of test.
And in fact, want the test result being met accuracy requirement, the required testing time of the properties of same Java card is different.Compared with call duration time, if the time that performance index spend is less, then need more testing time, otherwise test result will not reach accuracy requirement; Otherwise, then need less testing time, otherwise greatly will reduce testing efficiency.
Summary of the invention
For above-mentioned technical matters, the present invention proposes a kind of self-adapting testing method for Java card different performance index.
In order to solve the problems of the technologies described above, technical scheme of the present invention is as follows;
For a self-adapting testing method for Java card different performance index, comprise the steps:
1) test terminal sends the JavaCard Applet utility command being used for performance test to Java card;
2) required precision is set in test terminal;
3) test terminal is by loop test number of times for arranging 0, measures Java card and performs described JavaCard Applet time T
0after, by loop test number of times for arranging 1, measure JavaCard Applet execution time T described in Java card
1;
4) formula is utilized
test terminal calculates the reasonable loop test number of times C of this performance test applicable;
5) loop test number of times is set to C by test terminal, measures the execution time T of Java card described JavaCardApplet after C circulation
c;
6) according to formula
test terminal calculates the execution time mean value of trial function, described in
be final testing result.
Further, described test terminal judges whether to perform next step according to the status word fed back from Java card.
Beneficial effect of the present invention is:
Ease for use: this method can carry out self-adaptation value to cycle index and intelligent execution test process in Java card performance test, is easy to use and operate.
Versatility: this method not impact of changing of tested person environment (card, card reader and terminal device), supports the test to different performance in different test environment of different Java card.
Controllability: the number of significant digit of this method measured result is determined by cycle index, and the value of cycle index is obtained by the preset value calculation of accuracy requirement, so can require by Adjustment precision the precision controlling test result.
Clarity: this method seems quick and precisely in the value of cycle index, and the working time of whole test is estimated, seem more clear, clear and definite.
Credible: the precision of the adaptive testing gained net result of this method, the experiment proved that it is accurately.
Accompanying drawing explanation
Fig. 1 is the operational process of performance cycle test;
Fig. 2 is loop test framework of the present invention.
Embodiment
Below in conjunction with the drawings and specific embodiments, the present invention is described further.
Fig. 1 indicates the main implementation of Java card performance test in card of Based PC/SC: test terminal sends power up order makes Java card sheet power on, selective gist order is sent again after completing Deng initial work in Java card, choose the JavaCard Applet for performance test, then terminal test program automatically sends and arranges cycle index order, after in card, Applet receives this order, arrange cycle index, if success, terminal test program given in return state word 90 00.Terminal test program then sends startup test command, starts timing simultaneously.Execution performance test in card, after terminating, return state word 90 00.Last terminal record receives the time of 90 00, terminates timing simultaneously, and this performance test terminates.Twice timing gained mistiming is execution time of trial function.
Embodiment one
As shown in Figure 2, at the FunctionTest () function needing to be provided with in performance test JavaCard Applet, this function is the trial function that will perform, as an arithmetical operation or a cryptographic calculation; C (cycles) is for running the cycle index of FunctionTest () in Java card.
Suppose that, when calculating execution and once testing the time used, the minimum value that note measuring error allows is Δ, and true elapsed time is T, T
0when then representing that cycle index is 0, the time required for test, then T/ Δ is claimed to be the accuracy requirement tested, be designated as p (precision, general value is 0.1,0.01,0.001), when p is 0.001, mean that the precision of test result is three position effective digitals.
According to following formula
for measured value, T is actual value, when
namely
time, test is satisfactory, therefore will calculate C and the T meeting accuracy requirement
0, p, T be relevant, T can be measured by arranging cycle index C=0 in test terminal
0one not containing the pretreatment time value (including call duration time) of trial function execution time; Make C=1, measure execution time T
1, namely perform the time (including call duration time) needed for a trial function.T is then the value that requirement is measured, then can draw an approximate value of T:
T≈T
1-T
0
So
For improving testing efficiency, getting difference is 1,
Now C is the appropriate value of loop test number of times, obtains the number of significant figures of result, can meet accuracy requirement with its test.Accuracy requirement p is a relative concept, and have nothing to do with the concrete trial function execution time, such as, work as p=0.001, the magnitude that the reality of trial function is consuming time is Millisecond, then p is 0.001 millisecond.
Such as remembering that the cycle index of setting is Cycles, is below the adaptive testing step of the Java card performance index of the present invention's proposition:
(1) setting accuracy requirement, here to get 0.001;
(2) make Cycles=0, measure execution time T
0;
(3) make Cycles=1, measure execution time T
1;
(4) formula is utilized
Calculate C;
(5) by performing SetCount method, making Cycles=C, then performing StartTest method and measuring execution time T
c;
(6) calculate
be final testing result, i.e. the execution time mean value of trial function.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, without departing from the inventive concept of the premise; can also make some improvements and modifications, these improvements and modifications also should be considered as in scope.
Claims (2)
1. for a self-adapting testing method for Java card different performance index, it is characterized in that, comprise the steps:
1) test terminal sends the JavaCard Applet utility command being used for performance test to Java card;
2) required precision is set in test terminal;
3) loop test number of times is set to 0 by test terminal, measures Java card and performs described JavaCard Applet time T
0after, loop test number of times is set to 1, measures Java card and perform described JavaCard Applet time T
1;
4) formula is utilized
test terminal calculates the reasonable loop test number of times C of this performance test applicable;
5) loop test number of times is set to C by test terminal, measures the execution time T of Java card described JavaCard Applet after C circulation
c;
6) according to formula
test terminal calculates the execution time mean value of trial function, described in be final testing result.
2. a kind of self-adapting testing method for Java card different performance index according to claim 1, it is characterized in that, described test terminal judges whether to perform next step according to the status word fed back from Java card, when test terminal sends, cycle index order is set, after in Java card, Applet receives this order, arrange cycle index, if success, return state word is to test terminal; Test terminal then sends startup test command, starts timing simultaneously, execution performance test in Java card, and after terminating, return state word, test terminal record receives the time of status word, and terminate timing, this performance test terminates simultaneously.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210049266.6A CN102662806B (en) | 2012-02-29 | 2012-02-29 | Adaptive testing method directed at different performance indicators of Java card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210049266.6A CN102662806B (en) | 2012-02-29 | 2012-02-29 | Adaptive testing method directed at different performance indicators of Java card |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102662806A CN102662806A (en) | 2012-09-12 |
CN102662806B true CN102662806B (en) | 2015-06-24 |
Family
ID=46772303
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210049266.6A Active CN102662806B (en) | 2012-02-29 | 2012-02-29 | Adaptive testing method directed at different performance indicators of Java card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102662806B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105630668A (en) * | 2014-12-01 | 2016-06-01 | 深圳市腾讯计算机系统有限公司 | Test method and apparatus |
CN106339308A (en) * | 2015-07-10 | 2017-01-18 | 北京中电华大电子设计有限责任公司 | Test method of Java Card transaction mechanism |
CN106021088A (en) * | 2015-07-10 | 2016-10-12 | 北京中电华大电子设计有限责任公司 | Method and device for atomicity test on JAVA card |
CN110008134A (en) * | 2019-04-18 | 2019-07-12 | 上海计算机软件技术开发中心 | A kind of Java card standard API method for testing security |
CN114579208B (en) * | 2022-05-05 | 2022-08-26 | 广州万协通信息技术有限公司 | Self-adaptive adjustment execution speed increasing method for Java card |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101821715A (en) * | 2007-08-31 | 2010-09-01 | 金雅拓股份有限公司 | System and method for browser-based access to smart cards |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060059548A1 (en) * | 2004-09-01 | 2006-03-16 | Hildre Eric A | System and method for policy enforcement and token state monitoring |
-
2012
- 2012-02-29 CN CN201210049266.6A patent/CN102662806B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101821715A (en) * | 2007-08-31 | 2010-09-01 | 金雅拓股份有限公司 | System and method for browser-based access to smart cards |
Non-Patent Citations (1)
Title |
---|
基于JC3 Classic虚拟机的程序运行时间的估计;吴刚;《中国优秀硕士学位论文全文数据库信息科技辑》;20111115;I137-6 * |
Also Published As
Publication number | Publication date |
---|---|
CN102662806A (en) | 2012-09-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102662806B (en) | Adaptive testing method directed at different performance indicators of Java card | |
CN102141960B (en) | Automatic test method based on Android | |
Hu et al. | Lightweight energy consumption analysis and prediction for android applications | |
CN103605606B (en) | A kind of embedded software test use-case batch execution method that can automatically change | |
CN103678067A (en) | Test method and device for intelligent card power failure and tested device | |
CN102073609A (en) | Virtual instrument technology-based test method of power system test instrument and application thereof to integrated automatic device and synchronous detection device | |
CN102110013A (en) | Method and apparatus for efficiently generating processor architecture model | |
CN103941207A (en) | Electric power measurement automation terminal detection method and system | |
CN104915297A (en) | APP electricity consumption automatic test method for android device | |
CN102520785A (en) | Energy consumption management method and system for cloud data center | |
CN105487960B (en) | A kind of mobile terminal APP load energy consumption method for automatic measurement based on physics actual measurement | |
CN115422826A (en) | Intelligent energy-saving regulation and control method, device, equipment and storage medium for data center | |
CN112418700B (en) | Electric power capacity market demand curve design method, device and equipment | |
CN106610873B (en) | Method for predicting energy consumption of application program on Android device | |
CN106708167A (en) | Clock adjustment method and controller | |
CN101901192B (en) | On-chip and off-chip data object static assignment method | |
CN105446877A (en) | Method and apparatus for testing power consumption of mobile application | |
CN102662807A (en) | Java card stack performance test application program and making method for framework thereof | |
CN106056254A (en) | Wind power prediction error simulation method considering influence of power output level | |
CN104199771A (en) | Central processing unit performance testing method and system | |
CN105868092A (en) | Log file processing method and device | |
CN112798859B (en) | Ammeter and ammeter chip thereof | |
HengJun et al. | Wireless remote water meter design of automatic meter reading system | |
CN110688299A (en) | Automatic test platform for application software of nuclear power plant | |
CN105930269B (en) | Scheduling automation system parallel test verification method based on remote terminal mode |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |