Movatterモバイル変換


[0]ホーム

URL:


CN106250312B - Data test method and device - Google Patents

Data test method and device
Download PDF

Info

Publication number
CN106250312B
CN106250312BCN201610616980.7ACN201610616980ACN106250312BCN 106250312 BCN106250312 BCN 106250312BCN 201610616980 ACN201610616980 ACN 201610616980ACN 106250312 BCN106250312 BCN 106250312B
Authority
CN
China
Prior art keywords
function
measured
test
address
power
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610616980.7A
Other languages
Chinese (zh)
Other versions
CN106250312A (en
Inventor
张志光
魏学峰
党万春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co LtdfiledCriticalTencent Technology Shenzhen Co Ltd
Priority to CN201610616980.7ApriorityCriticalpatent/CN106250312B/en
Publication of CN106250312ApublicationCriticalpatent/CN106250312A/en
Application grantedgrantedCritical
Publication of CN106250312BpublicationCriticalpatent/CN106250312B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The invention discloses a kind of data test method and devices.Wherein, this method comprises: obtaining the function information for operating in the function to be measured in applications client, wherein function information includes at least: the function address of function to be measured;The first configuration file is generated according to the function address of function to be measured, wherein the first configuration file is used to indicate setting position of the test function in function to be measured, and test function is used to record the test data of function to be measured;When loading applications client, test function is set according to setting position of the instruction of the first configuration file in function to be measured;Function to be measured after operation setting test function, obtains the test data of the function to be measured recorded by test function.The present invention solves the technical issues of can not testing the function to be measured in passive coding.

Description

Data test method and device
Technical field
The present invention relates to computer fields, in particular to a kind of data test method and device.
Background technique
It is applied to the coverage rate test technology of function to be measured at present, usually all place one's entire reliance upon source code.NamelyIt says, usually on the basis of having source code, is based on code line grade, analyzes the above-mentioned implementation coverage for having source code.Wherein, commonlyInclude based on the implementation coverage testing tool for having source code: BullseyeCoverage and Pure Coverage etc..
However, most of function developers are usually will not have source code to open to user for what is developed, that is, forIt can not obtain for the function user of source code, accurate test can not be realized to passive coding function.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides a kind of data test method and device, at least solve can not in passive coding toSurvey the technical issues of function is tested.
According to an aspect of an embodiment of the present invention, a kind of data test method is provided, comprising: acquisition operates in applicationThe function information of function to be measured in client, wherein above-mentioned function information includes at least: the function of above-mentioned function to be measuredLocation;The first configuration file is generated according to the function address of above-mentioned function to be measured, wherein above-mentioned first configuration file is used to indicate surveySetting position of the trial function in above-mentioned function to be measured, above-mentioned test function are used to record the test data of above-mentioned function to be measured;When loading above-mentioned applications client, according to above-mentioned setting position of the instruction of above-mentioned first configuration file in above-mentioned function to be measuredInstall above-mentioned test function;The above-mentioned function to be measured after above-mentioned test function is arranged in operation, obtains and passes through above-mentioned test functionThe test data of the above-mentioned function to be measured of record.
According to another aspect of an embodiment of the present invention, a kind of data test device is additionally provided, comprising: first obtains listMember, for obtaining the function information for operating in the function to be measured in applications client, wherein above-mentioned function information includes at least:The function address of above-mentioned function to be measured;Generation unit, for generating the first configuration text according to the function address of above-mentioned function to be measuredPart, wherein above-mentioned first configuration file is used to indicate setting position of the test function in above-mentioned function to be measured, above-mentioned test letterCount the test data for recording above-mentioned function to be measured;Setting unit is used for when loading above-mentioned applications client, according to above-mentionedAbove-mentioned test function is arranged in above-mentioned setting position of the instruction of first configuration file in above-mentioned function to be measured;Test cell is usedAbove-mentioned function to be measured after above-mentioned test function is arranged in operation, obtains the above-mentioned function to be measured recorded by above-mentioned test functionTest data.
In embodiments of the present invention, obtain operate in the function information of the function to be measured in applications client after, according toThe function address for surveying function generates the first configuration file for being used to indicate setting position of the test function in function to be measured,In, test function is used to record the test data of function to be measured, and when loading above-mentioned applications client, according to the first configuration textAbove-mentioned test function is arranged in setting position of the instruction of part in function to be measured, thus realize after operation setting test function toFunction is surveyed, to obtain the test data of the function to be measured recorded by test function.That is, for source code can not have been obtainedThe case where, test function directly can be used to indicate in function to be measured according to the generation of the function address of function to be measured based on passive codingIn setting position the first configuration file, test function is arranged in function to be measured using first configuration file, realizeTest to function to be measured, and the test data recorded by the test function is obtained, it in the related technology can not be to nothing to overcomeThe problem of function to be measured in source code is tested, to realize the effect accurately tested based on passive coding function to be measuredFruit;Further, in the case where guaranteeing to complete data test, the analysis to obtained test data can also be utilized as a result, rightFunction to be measured in applications client advanced optimizes update, is surveyed with reducing function operation error rate, and then realizing to improveTry the effect of validity.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hairBright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of application environment schematic diagram of optional data test method according to an embodiment of the present invention;
Fig. 2 is a kind of flow chart of optional data test method according to an embodiment of the present invention;
Fig. 3 is the schematic diagram that PDB file is parsed in a kind of optional data test method according to an embodiment of the present invention;
Fig. 4 is the flow chart of another optional data test method according to an embodiment of the present invention;
Fig. 5 is a kind of schematic diagram of optional data test method according to an embodiment of the present invention;
Fig. 6 is the schematic diagram of another optional data test method according to an embodiment of the present invention;
Fig. 7 is a kind of schematic diagram of optional data test device according to an embodiment of the present invention;
Fig. 8 is the flow chart of another optional data test method according to an embodiment of the present invention;
Fig. 9 is a kind of schematic diagram of optional data test terminal according to an embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present inventionAttached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is onlyThe embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill peopleThe model that the present invention protects all should belong in member's every other embodiment obtained without making creative workIt encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this wayData be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein orSequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that coverCover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited toStep or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, productOr other step or units that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of embodiment of data test method is provided, in an alternative embodiment,Above-mentioned data test method can be, but not limited to be applied in network environment as shown in Figure 1, there is using visitor operation in terminal 102Family end obtains the function information for operating in the function to be measured in the applications client, wherein the function information includes at least: toSurvey the function address of function;The first configuration file is generated according to the function address of above-mentioned function to be measured, wherein the first configuration textPart is used to indicate setting position of the test function in function to be measured, and test function is used to record the test data of function to be measured;Then, when loading applications client, test is set according to setting position of the instruction of the first configuration file in function to be measuredFunction;Function to be measured after operation setting test function, obtains the test data of the function to be measured recorded by test function.
In an alternative embodiment, above-mentioned data test method can be, but not limited to be applied to server (or placeThe biggish processor of reason ability) (not shown) in the application scenarios that are interacted by network and terminal, server passes throughNetwork obtains the function information of the function to be measured in applications client from terminal, and generates the first configuration file in the server,With in terminal loads applications client, test function can be arranged according to the first configuration file in server, then setting is surveyedFunction to be measured after trial function is sent to terminal, in the function to be measured after test function is arranged in terminal operating, to realize logicalThe test data that test function obtains function to be measured is crossed, to achieve the purpose that utilize test data analysis function performance to be measured.
In the present embodiment, it obtains after operating in the function information of the function to be measured in applications client, according to letter to be measuredSeveral function addresses generates the first configuration file for being used to indicate setting position of the test function in function to be measured, wherein surveysTrial function is used to record the test data of function to be measured, and when loading above-mentioned applications client, according to the first configuration fileIndicate that above-mentioned test function is arranged in the setting position in function to be measured, to realize the letter to be measured after operation setting test functionNumber, to obtain the test data of the function to be measured recorded by test function.That is, for the feelings that can not obtain source codeCondition directly can be used to indicate test function in function to be measured according to the generation of the function address of function to be measured based on passive codingFirst configuration file of position is set, and test function to be arranged in function to be measured using first configuration file, realization is treatedThe test of function is surveyed, and obtains the test data recorded by the test function, it in the related technology can not be to passive coding to overcomeIn function to be measured the problem of being tested, to realize the effect accurately tested based on passive coding function to be measured;IntoOne step can also utilize the analysis to obtained test data as a result, to application visitor in the case where guaranteeing to complete data testFunction to be measured in the end of family advanced optimizes update, improves test effectively to reduce function operation error rate, and then realizeThe effect of property.
Optionally, in embodiments of the present invention, above-mentioned terminal can include but is not limited at least one of: plate electricityBrain, laptop, desktop PC, DTV and other operations have the hardware device of applications client.Above-mentioned only one kindExample, the present embodiment do not do any restriction to this.
Above-mentioned only a kind of example, the embodiment of the present invention do not do any restriction to this.
In the embodiment of the present invention, a kind of data test method is provided, as shown in Fig. 2, this method comprises:
S202 obtains the function information for operating in the function to be measured in applications client, wherein function information is at least wrappedIt includes: the function address of function to be measured;
S204 generates the first configuration file according to the function address of function to be measured, wherein the first configuration file is used to indicateSetting position of the test function in function to be measured, test function are used to record the test data of function to be measured;
S206, when loading applications client, according to setting position of the instruction of the first configuration file in function to be measuredTest function is set;
The function to be measured after test function is arranged in S208, operation, obtains the survey of the function to be measured recorded by test functionTry data.
Optionally, in the present embodiment, above-mentioned data test method can be, but not limited to be applied to tool-class application,In, tool-class application installation includes function to be measured for the types of functionality application that management terminal is installed in the terminal hereApplications client can be, but not limited to as functional application client, for example, game application client, Video Applications client etc.Deng.Above-mentioned is only a kind of example, does not do any restriction to this in the present embodiment.
It should be noted that in the present embodiment, obtaining the function information for operating in the function to be measured in applications clientAfterwards, the first configuration for being used to indicate setting position of the test function in function to be measured is generated according to the function address of function to be measuredFile, wherein test function is used to record the test data of function to be measured, and when loading above-mentioned applications client, according to theAbove-mentioned test function is arranged in setting position of the instruction of one configuration file in function to be measured, to realize operation setting test letterFunction to be measured after number, to obtain the test data of the function to be measured recorded by test function.That is, in the present embodimentIn, the case where for source code can not have been obtained, it can be directly used for according to the generation of the function address of function to be measured based on passive codingThe first configuration file of setting position of the test function in function to be measured is indicated, to utilize first configuration file in letter to be measuredTest function is set in number, realizes the test to passive coding function to be measured, and obtain the test recorded by above-mentioned test functionData, to overcome the problems, such as in the related technology not testing the function to be measured in passive coding, to realize based on passiveThe effect that code accurately tests function to be measured;Further, in the case where guaranteeing to complete data test to passive coding, may be used alsoWith using the analysis to obtained test data as a result, advanced optimize update to the function to be measured in applications client,To reduce function operation error rate, and then realize the effect for improving test validity.
Optionally, in the present embodiment, the function information of above-mentioned function to be measured can be, but not limited to as program data library textPart (Program Database File, PDB file), PDB file can be, but not limited to using VS (Visual studio, it is micro-The Integrated Development Environment software of soft offer) what is generated is used for the symbol file (program database) of debugging, for savingDebugging message parses the function name and function address that can be, but not limited to obtain function after above-mentioned PDB file.
In addition, in the present embodiment, source code can be, but not limited to refer to the code for writing most original program, and the present embodiment mentionsThe data test method of confession can be, but not limited to the case where being applied to passive coding, can not obtain the code for writing most original programWhen, using from above-mentioned PDB file acquisition to the function address generation of function to be measured be used to indicate where test function position be setThe first configuration file set.
Optionally, in the present embodiment, the function to be measured in above-mentioned applications client can include but is not limited to one orMultiple power functions, above-mentioned test function can be, but not limited to for testing each power function respectively, corresponding, test letterSeveral setting positions can include but is not limited at least one of: before the function first address of power function, be located at functionAfter the function end address of energy function.Optionally, in the present embodiment, above-mentioned first configuration file is used to indicate test functionPosition is set, wherein can be, but not limited to the letter for including: with the associated power function in position being arranged set by the test functionSeveral titles and function address.
It should be noted that in the present embodiment, above-mentioned test function can be, but not limited to be arranged by hook technologyPosition is set, and e.g., Inline hook, above-mentioned test function can be, but not limited to as journaling function.That is, being remembered by logThe test data of function record corresponding function function is recorded, in order to generate the journal file for analysis.Above-mentioned is only that one kind is shown, any restriction is not done to this in the present embodiment.
Optionally, in the present embodiment, the test data of above-mentioned test function record can be, but not limited to it is following at least itOne: number, the power function of the calling mark, power function called execution whether called for identification function function are adjustedInitial time and termination time with execution.For example, it is assumed that the test function can be journaling function F (x), it is arranged in functionCan be after before function f (x) function first address and function end address, then in the process of running, it can be with by test function F (x)Record whether the power function f (x) is called;In the case where called, called number;According to call initial time andIt terminates time acquisition and calls the test datas such as duration.
Optionally, in the present embodiment, generating the first configuration file according to the function address of function to be measured includes:
S1 obtains the function first address of each power function in function to be measured;
S2, judges whether the function statement on the function first address of each power function meets the setting item of pre-configurationPart;
S3 obtains the first object power function for meeting setting condition in function to be measured;
S4, using first object power function function first address and with the matched first function of first object power functionMark generates the first configuration file.
That is, in the present embodiment, can be, but not limited to the function statement according to power function in function first addressWhether satisfaction be pre-configured setting condition judging result, it is determined whether be arranged test function, by the function letter in function to be measuredNumber separation are as follows: for the first object power function of test function to be arranged, and be not provided with the second objective function letter of test functionNumber.
Further, in the present embodiment, it for meeting the first object power function of setting condition in function to be measured, utilizesThe function first address of first object power function and first is generated with first object power function matched first function mark matchSet file;For being unsatisfactory for the second objective function function of setting condition in function to be measured, can be, but not limited to utilize the second meshIt marks the function first address of power function and generates the second configuration file with the matched second function mark of the second objective function function.Wherein, the first configuration file can be, but not limited to include: FLF file, and the second configuration file can be, but not limited to include: JSON textPart.
For example, the QpPlugin.dll in kit, this module is by registration table mode, according to the first configuration file(.flf) and the second configuration file (blacklist) (.json) are to executable file (the exe text in the applications client of load operatingPart) and dll in function to be measured carry out passive coding test, with obtain operation when function execute test data.
Optionally, in the present embodiment, after the test data for obtaining the function to be measured recorded by test function, alsoIt include: using the function performance of function to be measured in test data analysis applications client, to reduce letter to be measured in applications clientThe error rate of number operation, by optimizing update to the function to be measured, to realize the effect for improving test validity.
As a kind of optional test scene, in the present embodiment, above-mentioned test data can be, but not limited to be used for: according toTest data obtains the quantity for the first object power function being called in function to be measured;By the first object of called mistakeImplementation coverage of the ratio of the sum of power function as function to be measured in the quantity of power function and function to be measured.
As another optional test scene, in the present embodiment, above-mentioned test data can be, but not limited to be used for: rootAccording to test data obtain the called number of the first object power function that was called in function to be measured and it is called whenIt is long;The operation shape of the number and called duration analysis first object power function that are called according to first object power functionState.
Optionally, in the present embodiment, after acquisition operates in the function information of the function to be measured in applications client,Further include: the power function in function to be measured is screened, the power function after being screened, wherein the function after screeningThe execution frequency of function is greater than the second predetermined threshold.
It should be noted that in the present embodiment, passing through the PDB file acquisition function to be measured in parsing applications clientFunction information, such as function name and function address of function to be measured, when loading the client, by above-mentioned test function (such as dayWill records function) it is arranged in function to be measured, and then realize in the function to be measured after test function is arranged in operation, it can recordeThe test data of first object power function in function to be measured, to obtain the calling situation of the first object power function, thusIt realizes when exiting the applications client, generates the journal file for analysis.
Here, it after the function information of parsing PDB file acquisition function to be measured, can be, but not limited to according to execution frequency pairFunction to be measured is screened, and common power function in function to be measured is obtained by filtration, is realized and is carried out to common power functionTest.To achieve the purpose that improve the efficiency of data test;Further, it is also possible to be obtained by analysis, applications client operationThe reason of Caton, in order to be adjusted optimization to corresponding function function, and then realizes the purpose for improving function operation accuracy rate.
Optionally, in the present embodiment, above-mentioned PDB file can be, but not limited to as realized parsing by DIA SDK library, such asShown in Fig. 3, available following at least one information after parsing: module title (obj), data structure information, function information andDebugging message etc..Wherein, above-mentioned function information can be, but not limited to include: function address and function name.In addition, the present embodimentIn, included function can be in above-mentioned function information are as follows: function, overall situation function in class etc..Above-mentioned is only a kind of example, thisAny restriction is not done in embodiment to this.
By embodiment provided by the present application, in the present embodiment, the case where for source code can not have been obtained, can be based onPassive coding, which is directly generated according to the function address of function to be measured, is used to indicate setting position of the test function in function to be measuredFirst configuration file is realized so that test function is arranged in function to be measured using first configuration file to passive coding letter to be measuredSeveral tests, and the test data recorded by above-mentioned test function is obtained, it in the related technology can not be in passive coding to overcomeFunction to be measured the problem of being tested, to realize the effect accurately tested based on passive coding function to be measured;Into oneStep can also utilize the analysis to obtained test data as a result, right in the case where guaranteeing to complete data test to passive codingFunction to be measured in applications client advanced optimizes update, is surveyed with reducing function operation error rate, and then realizing to improveTry the effect of validity.
As a kind of optional scheme, generating the first configuration file according to the function address of function to be measured includes:
S1 obtains the function first address of each power function in function to be measured;
S2, judges whether the function statement on the function first address of each power function meets the setting item of pre-configurationPart;
S3 obtains the first object power function for meeting setting condition in function to be measured;
S4, using first object power function function first address and with the matched first function of first object power functionMark generates the first configuration file.
Optionally, in the present embodiment, it for meeting the first object power function of setting condition in function to be measured, utilizesThe function first address of first object power function and first is generated with first object power function matched first function mark matchSet file;For being unsatisfactory for the second objective function function of setting condition in function to be measured, can be, but not limited to utilize the second meshIt marks the function first address of power function and generates the second configuration file with the matched second function mark of the second objective function function.Wherein, the first configuration file can be, but not limited to include: FLF file, and the second configuration file can be, but not limited to include: JSON textPart.
Optionally, in the present embodiment, it can be, but not limited to obtain each power function by way of dis-assemblingRelevant information, e.g., function name, function size and offset distance etc..For example, passing through interactive decompiler(Interactive Disassembler Professional, IDA) tool is to executable file (the exe text in function to be measuredPart) carry out dis-assembling.
It is specifically illustrated in conjunction with following example, as shown in figure 4, obtaining and text can be performed in function to be measured such as step S402Part (exe file) and PDB file, are then pre-processed by step S404, include: parsing PDB file as pre-processed, and rightExe file carries out dis-assembling, to obtain the relevant information of each power function, such as function name, function size, function addressAnd offset distance, such as step S406-1.Meanwhile such as step S406-2, above-mentioned relevant information is analyzed using script, thenStep S408 is executed, judges whether above-mentioned power function meets setting condition, when judging to meet, obtains the first configuration textPart, such as step S410-1;When judging to be unsatisfactory for, the second configuration file is obtained, such as step S410-2.
Specifically, above-mentioned steps judge whether that meeting setting condition can be, but not limited to: judging each power functionFunction first address on function statement whether meet the setting condition of pre-configuration, if the function statement on function first address meetsSetting condition then determines that the power function can be used as first object power function and test function is arranged using hook technology, such asFlf file can be stored as with the list of hook by being separated into;If the function statement on function first address is unsatisfactory for setting condition, sentenceThe fixed power function, which can be used as the second objective function function, test function is arranged using hook technology, and being such as separated into can notThe list of hook is stored as json file.
Optionally, in the present embodiment, judge whether the function statement on the function first address of each power function is fullThe setting condition being pre-configured enough includes:
S31 repeats following steps, until traversing each power function in function to be measured: obtaining current function letterSeveral function first address;Judge whether the sentence length of the function statement on the function first address of current power function is greater than firstPredetermined threshold;When the sentence length of the function statement on function first address is greater than the first predetermined threshold, current function letter is determinedNumber meets setting condition;When the sentence length of the function statement on function first address is less than or equal to the first predetermined threshold, determineCurrent power function is unsatisfactory for setting condition.
That is, determining whether to meet setting condition by the length of the function statement on function first address, wherein onStating the first predetermined threshold can be, but not limited to be set as different values according to different scenes, for example, the first predetermined threshold can be 5A byte.Above-mentioned is only a kind of example, does not do any restriction to this in the present embodiment.
By embodiment provided by the present application, on the function first address by obtaining each power function of function to be measuredFunction statement, judges whether the power function meets setting condition, to judge that the power function is to make according to judging resultFor the first object power function or the second objective function function for test function to be arranged, to generate corresponding respectivelyCorresponding survey is arranged using above-mentioned first configuration file to realize in one configuration file and the second configuration file in function to be measuredTrial function realizes accurate test to the function to be measured based on passive coding, so overcome in the related technology can not to passive coding intoThe problem of row test.
As a kind of optional scheme, it is arranged according to setting position of the instruction of the first configuration file in function to be measured and surveysTrial function includes:
S1 obtains setting position indicated by the first configuration file, wherein setting position includes: in function to be measuredBefore the function first address of first object power function, and/or, the function end of first object power function in function to be measuredAfter address;
S2 is that test function is arranged in first object power function in setting position.
Optionally, in the present embodiment, test function is arranged for first object power function in setting position includes: to utilizeTest function is arranged in setting position in hook function, wherein test function includes journaling function.That is, passing throughJournaling function is arranged in function to be measured on the corresponding setting position of power function hook technology, to obtain corresponding surveyData are tried, e.g., the calling mark whether called for identification function function, the called number executed of power function, functionThe called initial time executed of function and termination time.Above-mentioned Test data generation journal file is utilized to realize, so as toIn the function performance for analyzing above-mentioned function to be measured in applications client using above-mentioned journal file.
By embodiment provided by the present application, by obtaining setting position indicated by the first configuration file, wherein settingPosition include: before the function first address of first object power function in function to be measured, and/or, be located at function to be measured inIt after the function end address of first object power function, and is first object power function setting test letter in the setting positionNumber realizes the data test to the function grade based on passive coding.
As a kind of optional scheme, after the test data for obtaining the function to be measured recorded by test function, alsoInclude:
S1 obtains the quantity for the first object power function being called in function to be measured according to test data;
S2, by the ratio of the sum of power function in the quantity of the first object power function of called mistake and function to be measuredImplementation coverage as function to be measured.
Optionally, in the present embodiment, above-mentioned test data can be, but not limited to for determining above-mentioned first object functionThe implementation coverage of function.Such as formula can be such that
P=Q/SUM (1)
Wherein, P is for indicating implementation coverage, the quantity for the first object power function that Q is used to indicate to be called,SUM is used to indicate the sum of power function in function to be measured.
That is, (being such as used to mark by the test data for utilizing above-mentioned test function (such as journaling function) to recordKnow the calling mark whether power function is called) quantity of first object power function that statistics was called, it realizes and utilizesThe quantity for the first object power function being called obtains the implementation coverage in the function to be measured of the applications client.Here, above-mentioned implementation coverage can be, but not limited to include: version coverage rate, as version accumulates coverage rate and version updating coveringRate, as shown in figure 5, different editions are shown, such as version V1.0, version V2.0 and the respective coverage rate of version V3.0.
In addition, in the present embodiment, step S602-S612 as shown in Figure 6, client 602 can also be by above-mentioned test numberAccording to journal file, and upload server 604 is generated, server 604 is after analyzing journal file, storage analysis result;The end Web606 can show the test result for corresponding to server request test result, after getting the test result.OnStating is only example that a kind of pair of test data is analyzed, is not limited to shown in Fig. 6, request for test result is also possible to clientOr entity is executed, any restriction is not done to this in the present embodiment.
By embodiment provided by the present application, by obtaining be called in function to be measured first according to test dataThe quantity of objective function function, and by power function in the quantity of the first object power function of called mistake and function to be measuredImplementation coverage of the ratio of sum as function to be measured is obtained the function to be measured based on passive coding by test to realizeImplementation coverage further guarantees that test fine granularity is function grade, also ensures the accuracy and validity of test.
As a kind of optional scheme, after acquisition operates in the function information of the function to be measured in applications client,Further include:
S1, screens the power function in function to be measured, the power function after being screened, wherein after screeningThe execution frequency of power function is greater than the second predetermined threshold.
Optionally, in the present embodiment, parsing PDB file acquisition function to be measured function information after, can with but it is unlimitedFunction to be measured is screened according to execution frequency, common power function in function to be measured is obtained by filtration, is realized to normalPower function is tested.To achieve the purpose that improve the efficiency of data test;Further, it is also possible to by analyzingOut, it the reason of applications client operation Caton, in order to be adjusted optimization to corresponding function function, and then realizes and improves functionRun the purpose of accuracy rate.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series ofCombination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described becauseAccording to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also knowIt knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the inventionIt is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementationThe method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very muchIn the case of the former be more preferably embodiment.Based on this understanding, technical solution of the present invention is substantially in other words to existingThe part that technology contributes can be embodied in the form of software products, which is stored in a storageIn medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculateMachine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Embodiment 2
According to embodiments of the present invention, additionally provide it is a kind of for implementing the data test device of above-mentioned data test method,As shown in fig. 7, the device includes:
1) first acquisition unit 702, for obtaining the function information for operating in the function to be measured in applications client,In, function information includes at least: the function address of function to be measured;
2) generation unit 704, for generating the first configuration file according to the function address of function to be measured, wherein first matchesIt sets file and is used to indicate setting position of the test function in function to be measured, test function is used to record the test number of function to be measuredAccording to;
3) setting unit 706 are used for when loading applications client, according to the instruction of the first configuration file in function to be measuredIn setting position be arranged test function;
4) test cell 708, for running the function to be measured after test function is arranged, what acquisition was recorded by test functionThe test data of function to be measured.
Optionally, in the present embodiment, above-mentioned data test method can be, but not limited to be applied to tool-class application,In, tool-class application installation includes function to be measured for the types of functionality application that management terminal is installed in the terminal hereApplications client can be, but not limited to as functional application client, for example, game application client, Video Applications client etc.Deng.Above-mentioned is only a kind of example, does not do any restriction to this in the present embodiment.
It should be noted that in the present embodiment, obtaining the function information for operating in the function to be measured in applications clientAfterwards, the first configuration for being used to indicate setting position of the test function in function to be measured is generated according to the function address of function to be measuredFile, wherein test function is used to record the test data of function to be measured, and when loading above-mentioned applications client, according to theAbove-mentioned test function is arranged in setting position of the instruction of one configuration file in function to be measured, to realize operation setting test letterFunction to be measured after number, to obtain the test data of the function to be measured recorded by test function.That is, in the present embodimentIn, the case where for source code can not have been obtained, it can be directly used for according to the generation of the function address of function to be measured based on passive codingThe first configuration file of setting position of the test function in function to be measured is indicated, to utilize first configuration file in letter to be measuredTest function is set in number, realizes the test to passive coding function to be measured, and obtain the test recorded by above-mentioned test functionData, to overcome the problems, such as in the related technology not testing the function to be measured in passive coding, to realize based on passiveThe effect that code accurately tests function to be measured;Further, in the case where guaranteeing to complete data test to passive coding, may be used alsoWith using the analysis to obtained test data as a result, advanced optimize update to the function to be measured in applications client,To reduce function operation error rate, and then realize the effect for improving test validity.
Optionally, in the present embodiment, the function information of above-mentioned function to be measured can be, but not limited to as program data library textPart (Program Database File, PDB file), PDB file can be, but not limited to using VS (Visual studio, it is micro-The Integrated Development Environment software of soft offer) what is generated is used for the symbol file (program database) of debugging, for savingDebugging message parses the function name and function address that can be, but not limited to obtain function after above-mentioned PDB file.
In addition, in the present embodiment, source code can be, but not limited to refer to the code for writing most original program, and the present embodiment mentionsThe data test method of confession can be, but not limited to the case where being applied to passive coding, can not obtain the code for writing most original programWhen, using from above-mentioned PDB file acquisition to the function address generation of function to be measured be used to indicate where test function position be setThe first configuration file set.
Optionally, in the present embodiment, the function to be measured in above-mentioned applications client can include but is not limited to one orMultiple power functions, above-mentioned test function can be, but not limited to for testing each power function respectively, corresponding, test letterSeveral setting positions can include but is not limited at least one of: before the function first address of power function, be located at functionAfter the function end address of energy function.Optionally, in the present embodiment, above-mentioned first configuration file is used to indicate test functionPosition is set, wherein can be, but not limited to the letter for including: with the associated power function in position being arranged set by the test functionSeveral titles and function address.
It should be noted that in the present embodiment, above-mentioned test function can be, but not limited to be arranged by hook technologyPosition is set, and e.g., Inline hook, above-mentioned test function can be, but not limited to as journaling function.That is, being remembered by logThe test data of function record corresponding function function is recorded, in order to generate the journal file for analysis.Above-mentioned is only that one kind is shown, any restriction is not done to this in the present embodiment.
Optionally, in the present embodiment, the test data of above-mentioned test function record can be, but not limited to it is following at least itOne: number, the power function of the calling mark, power function called execution whether called for identification function function are adjustedInitial time and termination time with execution.For example, it is assumed that the test function can be journaling function F (x), it is arranged in functionCan be after before function f (x) function first address and function end address, then in the process of running, it can be with by test function F (x)Record whether the power function f (x) is called;In the case where called, called number;According to call initial time andIt terminates time acquisition and calls the test datas such as duration.
Optionally, in the present embodiment, generation unit includes: (1) first acquisition module, every in function to be measured for obtainingThe function first address of one power function;(2) judgment module, the letter on function first address for judging each power functionWhether number sentence meets the setting condition of pre-configuration;(3) second obtain module, meet setting condition in function to be measured for obtainingFirst object power function;(4) first generation modules, for the function first address using first object power function and with theThe matched first function mark of one objective function function generates the first configuration file.
That is, in the present embodiment, can be, but not limited to the function statement according to power function in function first addressWhether satisfaction be pre-configured setting condition judging result, it is determined whether be arranged test function, by the function letter in function to be measuredNumber separation are as follows: for the first object power function of test function to be arranged, and be not provided with the second objective function letter of test functionNumber.
Wherein, above-mentioned apparatus further include: (1) second acquisition unit, for meeting setting condition in obtaining function to be measuredFirst object power function when, obtain the second objective function function that setting condition is unsatisfactory in function to be measured;(2) second is rawAt unit, for using the second objective function function function first address and with the second matched second function of objective function functionMark generates the second configuration file.
Further, in the present embodiment, it for meeting the first object power function of setting condition in function to be measured, utilizesThe function first address of first object power function and first is generated with first object power function matched first function mark matchSet file;For being unsatisfactory for the second objective function function of setting condition in function to be measured, can be, but not limited to utilize the second meshIt marks the function first address of power function and generates the second configuration file with the matched second function mark of the second objective function function.Wherein, the first configuration file can be, but not limited to include: FLF file, and the second configuration file can be, but not limited to include: JSON textPart.
For example, the QpPlugin.dll in kit, this module is by registration table mode, according to the first configuration file(.flf) and the second configuration file (blacklist) (.json) are to executable file (the exe text in the applications client of load operatingPart) and dll in function to be measured carry out passive coding test, with obtain operation when function execute test data.
Optionally, in the present embodiment, after the test data for obtaining the function to be measured recorded by test function, alsoIt include: using the function performance of function to be measured in test data analysis applications client, to reduce letter to be measured in applications clientThe error rate of number operation, by optimizing update to the function to be measured, to realize the effect for improving test validity.
As a kind of optional test scene, in the present embodiment, above-mentioned test data can be, but not limited to be used for: according toTest data obtains the quantity for the first object power function being called in function to be measured;By the first object of called mistakeImplementation coverage of the ratio of the sum of power function as function to be measured in the quantity of power function and function to be measured.
As another optional test scene, in the present embodiment, above-mentioned test data can be, but not limited to be used for: rootAccording to test data obtain the called number of the first object power function that was called in function to be measured and it is called whenIt is long;The operation shape of the number and called duration analysis first object power function that are called according to first object power functionState.
Optionally, in the present embodiment, after acquisition operates in the function information of the function to be measured in applications client,Further include: the power function in function to be measured is screened, the power function after being screened, wherein the function after screeningThe execution frequency of function is greater than the second predetermined threshold.
It should be noted that in the present embodiment, passing through the PDB file acquisition function to be measured in parsing applications clientFunction information, such as function name and function address of function to be measured, when loading the client, by above-mentioned test function (such as dayWill records function) it is arranged in function to be measured, and then realize in the function to be measured after test function is arranged in operation, it can recordeThe test data of first object power function in function to be measured, to obtain the calling situation of the first object power function, thusIt realizes when exiting the applications client, generates the journal file for analysis.
Here, it after the function information of parsing PDB file acquisition function to be measured, can be, but not limited to according to execution frequency pairFunction to be measured is screened, and common power function in function to be measured is obtained by filtration, is realized and is carried out to common power functionTest.To achieve the purpose that improve the efficiency of data test;Further, it is also possible to be obtained by analysis, applications client operationThe reason of Caton, in order to be adjusted optimization to corresponding function function, and then realizes the purpose for improving function operation accuracy rate.
Optionally, in the present embodiment, above-mentioned PDB file can be, but not limited to as realized parsing by DIA SDK library, such asShown in Fig. 3, available following at least one information after parsing: module title (obj), data structure information, function information andDebugging message etc..Wherein, above-mentioned function information can be, but not limited to include: function address and function name.In addition, the present embodimentIn, included function can be in above-mentioned function information are as follows: function, overall situation function in class etc..Above-mentioned is only a kind of example, thisAny restriction is not done in embodiment to this.
By embodiment provided by the present application, in the present embodiment, the case where for source code can not have been obtained, can be based onPassive coding, which is directly generated according to the function address of function to be measured, is used to indicate setting position of the test function in function to be measuredFirst configuration file is realized so that test function is arranged in function to be measured using first configuration file to passive coding letter to be measuredSeveral tests, and the test data recorded by above-mentioned test function is obtained, it in the related technology can not be in passive coding to overcomeFunction to be measured the problem of being tested, to realize the effect accurately tested based on passive coding function to be measured;Into oneStep can also utilize the analysis to obtained test data as a result, right in the case where guaranteeing to complete data test to passive codingFunction to be measured in applications client advanced optimizes update, is surveyed with reducing function operation error rate, and then realizing to improveTry the effect of validity.
As a kind of optional scheme, generation unit 704 includes:
1) first module is obtained, for obtaining the function first address of each power function in function to be measured;
2) judgment module, it is prewired whether the function statement on function first address for judging each power function meetsThe setting condition set;
3) second module is obtained, for obtaining the first object power function for meeting setting condition in function to be measured;
4) the first generation module, for using first object power function function first address and with first object function letterThe matched first function mark of number generates the first configuration file.
Optionally, in the present embodiment, it for meeting the first object power function of setting condition in function to be measured, utilizesThe function first address of first object power function and first is generated with first object power function matched first function mark matchSet file;For being unsatisfactory for the second objective function function of setting condition in function to be measured, can be, but not limited to utilize the second meshIt marks the function first address of power function and generates the second configuration file with the matched second function mark of the second objective function function.Wherein, the first configuration file can be, but not limited to include: FLF file, and the second configuration file can be, but not limited to include: JSON textPart.
Optionally, in the present embodiment, it can be, but not limited to obtain each power function by way of dis-assemblingRelevant information, e.g., function name, function size and offset distance etc..For example, passing through interactive decompiler(Interactive Disassembler Professional, IDA) tool is to executable file (the exe text in function to be measuredPart) carry out dis-assembling.
It is specifically illustrated in conjunction with following example, as shown in figure 4, obtaining and text can be performed in function to be measured such as step S402Part (exe file) and PDB file, are then pre-processed by step S404, include: parsing PDB file as pre-processed, and rightExe file carries out dis-assembling, to obtain the relevant information of each power function, such as function name, function size, function addressAnd offset distance, such as step S406-1.Meanwhile such as step S406-2, above-mentioned relevant information is analyzed using script, thenStep S408 is executed, judges whether above-mentioned power function meets setting condition, when judging to meet, obtains the first configuration textPart, such as step S410-1;When judging to be unsatisfactory for, the second configuration file is obtained.
Specifically, above-mentioned steps judge whether that meeting setting condition can be, but not limited to: judging each power functionFunction first address on function statement whether meet the setting condition of pre-configuration, if the function statement on function first address meetsSetting condition then determines that the power function can be used as first object power function and test function is arranged using hook technology, such asFlf file can be stored as with the list of hook by being separated into;If the function statement on function first address is unsatisfactory for setting condition, sentenceThe fixed power function, which can be used as the second objective function function, test function is arranged using hook technology, and being such as separated into can notThe list of hook is stored as json file.
Optionally, in the present embodiment, judgment module includes: (1) processing submodule, for repeating following steps,Until traversing each power function in function to be measured: obtaining the function first address of current power function;Judge current function letterWhether the sentence length of the function statement on several function first address is greater than the first predetermined threshold;Function on function first addressWhen the sentence length of sentence is greater than the first predetermined threshold, determine that current power function meets setting condition;On function first addressFunction statement sentence length be less than or equal to the first predetermined threshold when, determine that current power function is unsatisfactory for setting condition.
That is, determining whether to meet setting condition by the length of the function statement on function first address, wherein onStating the first predetermined threshold can be, but not limited to be set as different values according to different scenes, for example, the first predetermined threshold can be 5A byte.Above-mentioned is only a kind of example, does not do any restriction to this in the present embodiment.
By embodiment provided by the present application, on the function first address by obtaining each power function of function to be measuredFunction statement, judges whether the power function meets setting condition, to judge that the power function is to make according to judging resultFor the first object power function or the second objective function function for test function to be arranged, to generate corresponding respectivelyCorresponding survey is arranged using above-mentioned first configuration file to realize in one configuration file and the second configuration file in function to be measuredTrial function realizes accurate test to the function to be measured based on passive coding, so overcome in the related technology can not to passive coding intoThe problem of row test.
As a kind of optional scheme, setting unit 706 includes:
1) third obtains module, for obtaining setting position indicated by the first configuration file, wherein wraps setting positionIt includes: before the function first address of first object power function in function to be measured, and/or, it is located at the first mesh in function to be measuredAfter the function end address for marking power function;
2) setup module, for being that test function is arranged in first object power function in setting position.
Optionally, in the present embodiment, setup module includes: (1) setting submodule, for being arranged using hook functionTest function is arranged in position, wherein test function includes journaling function.
That is, the corresponding setting of power function in function to be measured is arranged in journaling function by hook technologyOn position, to obtain corresponding test data, e.g., the calling mark that whether is called for identification function function, power functionThe called initial time executed of the called number executed, power function and termination time.Above-mentioned test is utilized to realizeData generate journal file, in order to analyze the functionality of above-mentioned function to be measured in applications client using above-mentioned journal fileEnergy.
By embodiment provided by the present application, by obtaining setting position indicated by the first configuration file, wherein settingPosition include: before the function first address of first object power function in function to be measured, and/or, be located at function to be measured inIt after the function end address of first object power function, and is first object power function setting test letter in the setting positionNumber realizes the data test to the function grade based on passive coding.
As a kind of optional scheme, further includes:
1) third acquiring unit, for after obtaining the test data of function to be measured recorded by test function, rootThe quantity for the first object power function being called in function to be measured is obtained according to test data;
2) determination unit, for by power function in the quantity of the first object power function of called mistake and function to be measuredSum implementation coverage of the ratio as function to be measured.
Optionally, in the present embodiment, above-mentioned test data can be, but not limited to for determining above-mentioned first object functionThe implementation coverage of function.Such as formula can be such that
P=Q/SUM (2)
Wherein, P is for indicating implementation coverage, the quantity for the first object power function that Q is used to indicate to be called,SUM is used to indicate the sum of power function in function to be measured.
That is, (being such as used to mark by the test data for utilizing above-mentioned test function (such as journaling function) to recordKnow the calling mark whether power function is called) quantity of first object power function that statistics was called, it realizes and utilizesThe quantity for the first object power function being called obtains the implementation coverage in the function to be measured of the applications client.Here, above-mentioned implementation coverage can be, but not limited to include: version coverage rate, as version accumulates coverage rate and version updating coveringRate, as shown in figure 5, different editions are shown, such as version V1.0, version V2.0 and the respective coverage rate of version V3.0.
In addition, in the present embodiment, step S602-S612 as shown in Figure 6, client 602 can also be by above-mentioned test numberAccording to journal file, and upload server 604 is generated, server 604 is after analyzing journal file, storage analysis result;The end Web606 can show the test result for corresponding to server request test result, after getting the test result.OnStating is only example that a kind of pair of test data is analyzed, is not limited to shown in Fig. 6, request for test result is also possible to clientOr entity is executed, any restriction is not done to this in the present embodiment.
By embodiment provided by the present application, by obtaining be called in function to be measured first according to test dataThe quantity of objective function function, and by power function in the quantity of the first object power function of called mistake and function to be measuredImplementation coverage of the ratio of sum as function to be measured is obtained the function to be measured based on passive coding by test to realizeImplementation coverage further guarantees that test fine granularity is function grade, also ensures the accuracy and validity of test.
As a kind of optional scheme, further includes:
1) screening unit, for treating after acquisition operates in the function information of the function to be measured in applications clientThe power function surveyed in function is screened, the power function after being screened, wherein power function after screening executes frequencyRate is greater than the second predetermined threshold.
Optionally, in the present embodiment, above-mentioned test data can be, but not limited to for determining above-mentioned first object functionThe implementation coverage of function.Such as formula can be such that
P=Q/SUM (1)
Wherein, P is for indicating implementation coverage, the quantity for the first object power function that Q is used to indicate to be called,SUM is used to indicate the sum of power function in function to be measured.
That is, (being such as used to mark by the test data for utilizing above-mentioned test function (such as journaling function) to recordKnow the calling mark whether power function is called) quantity of first object power function that statistics was called, it realizes and utilizesThe quantity for the first object power function being called obtains the implementation coverage in the function to be measured of the applications client.Here, above-mentioned implementation coverage can be, but not limited to include: version coverage rate, as version accumulates coverage rate and version updating coveringRate, as shown in figure 5, different editions are shown, such as version V1.0, version V2.0 and the respective coverage rate of version V3.0.
In addition, in the present embodiment, step S602-S612 as shown in Figure 6, client 602 can also be by above-mentioned test numberAccording to journal file, and upload server 604 is generated, server 604 is after analyzing journal file, storage analysis result;The end Web606 can show the test result for corresponding to server request test result, after getting the test result.OnStating is only example that a kind of pair of test data is analyzed, is not limited to shown in Fig. 6, request for test result is also possible to clientOr entity is executed, any restriction is not done to this in the present embodiment.
By embodiment provided by the present application, by obtaining be called in function to be measured first according to test dataThe quantity of objective function function, and by power function in the quantity of the first object power function of called mistake and function to be measuredImplementation coverage of the ratio of sum as function to be measured is obtained the function to be measured based on passive coding by test to realizeImplementation coverage further guarantees that test fine granularity is function grade, also ensures the accuracy and validity of test.
Embodiment 3
The application environment of the embodiment of the present invention can be, but not limited to referring to the application environment in embodiment 1, in the present embodimentThis is repeated no more.The embodiment of the invention provides a kind of optional concrete applications for implementing above-mentioned data test method to showExample.
As a kind of optional embodiment, above-mentioned data test method can be, but not limited to be applied to management terminal applicationIn tool-class application, realization tests the function to be measured in types of functionality applications client based on passive coding, as game is answeredUse client.Assuming that here by taking the function to be measured in the applications client to game application App-Game is tested as an example.ByGame developer's used source code in the process of development can not be obtained in gaming operators, thus, in the present embodiment, pass throughFollowing manner, which is realized, carries out data test to the function in game application client based on passive coding, as shown in connection with fig. 8 stepS802-S812 is illustrated:
Firstly, obtaining the PDB file and executable file (exe in game application App-Game such as step S802-S804File), pretreatment operation is executed to above-mentioned file, such as carries out parsing separation for PDB file, dis-assembling is carried out to exe file,The function name and function address of available function (such as full dose function) to be measured after pretreatment.Then pass through DIA SDK library, it willFunction information in PDB file, which analyzes, to be come.In addition, type function here includes the function in class, overall situation function etc..
It should be noted that due to including one or more functions function in the function to be measured in applications client, whereinIt include: a part in above-mentioned power function is the common mathematical function often called.Optionally, in the present embodiment, it obtains above-mentionedThe mode of common mathematical function can be, but not limited to: Screening Treatment is filtered to the power function in the function to be measured got, withThe common mathematical function being often called during a game running process is obtained, further, test analysis is carried out to above-mentioned common mathematical function.Such as, analysis game application App-Game is carried out for the test data of these common mathematical functions (as called situation) Caton phenomenon occurThe reason of, in order to optimize update to the function to go wrong, the error rate of function operation is reduced, and then improve user's bodyIt tests.
Further, such as step S806-S808, the tool that the applications client of above-mentioned game application App-Game uses is generatedPacket, wherein QpPlugin.dll in the kit, this module by registration table mode, according to the first configuration file (.flf) andSecond configuration file (.json) carries out inline hook to function to be measured, runs above-mentioned game application client in tool to realizeWhen end, the test data that the function to be measured after running setting test function obtains is obtained.
Wherein, the step of obtaining the first configuration file and the second configuration file may include following content:
S1 obtains function name, size and the offset distance for executing the function to be measured obtained after pretreatment operation;
S2 utilizes script;
S3, according to setting condition by function to be measured be separated into can hook function store at flf file;By can not hookFunction is stored into json file, wherein setting condition can be the function on the function first address for judge each power functionWhether sentence is greater than the first predetermined threshold;
S4 obtains first object power function and the second objective function function according to judging result, respectively corresponds generation theOne configuration file and the second configuration file.
Then, such as step S810-S814, according to Test data generation journal file, and after obtaining journal file, by dayWill file, which is uploaded onto the server, to be analyzed and is handled.
It should be noted that the journal file of generation is uploaded onto the server by applications client script, server pairJournal file carries out dissection process then will be in function information input database.When receiving what client or the end Web were sentWhen test request, the data in database can be carried out dynamic organization and calculating according to test request by server, to feed back correspondenceTest result.
In the present embodiment, by the case where computer game client passive coding, by PDB file to game applicationFine granularity (function grade) ground test record when being run, to realize to the validity of assessment game test and game testQuality provides the method that can quantify, and then achievees the purpose that the accuracy for guaranteeing test result, and it is effective to improve testThe effect of property.
Embodiment 4
According to embodiments of the present invention, additionally provide it is a kind of for implementing the data test terminal of above-mentioned data test method,As shown in figure 9, the terminal includes:
1) communication interface 902 are set as obtaining the function information for operating in the function to be measured in applications client, whereinFunction information includes at least: the function address of function to be measured;
2) processor 904 are connect with communication interface 902, are set as being matched according to the function address of function to be measured generation firstSet file, wherein the first configuration file is used to indicate setting position of the test function in function to be measured, and test function is for rememberingRecord the test data of function to be measured;It is also configured to when loading applications client, according to the instruction of the first configuration file to be measuredTest function is arranged in setting position in function;Function to be measured after being also configured to operation setting test function, acquisition pass through surveyThe test data of the function to be measured of trial function record;
3) memory 906 are connect with communication interface 902 and processor 904, are set as storing function to be measured and function to be measuredTest data.
Optionally, the specific example in the present embodiment can be shown with reference to described in above-described embodiment 1 and embodiment 2Example, details are not described herein for the present embodiment.
Embodiment 5
The embodiments of the present invention also provide a kind of storage mediums.Optionally, in the present embodiment, above-mentioned storage medium canWith at least one network equipment in multiple network equipments in network.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps:
S1 obtains the function information for operating in the function to be measured in applications client, wherein function information includes at least:The function address of function to be measured;
S2 generates the first configuration file according to the function address of function to be measured, wherein the first configuration file is used to indicate surveySetting position of the trial function in function to be measured, test function are used to record the test data of function to be measured;
S3 is set when loading applications client according to setting position of the instruction of the first configuration file in function to be measuredSet test function;
The function to be measured after test function is arranged in S3, operation, obtains the test of the function to be measured recorded by test functionData.
Optionally, storage medium is also configured to store the program code for executing following steps:
S1 obtains the function first address of each power function in function to be measured;
S2, judges whether the function statement on the function first address of each power function meets the setting item of pre-configurationPart;
S3 obtains the first object power function for meeting setting condition in function to be measured;
S4, using first object power function function first address and with the matched first function of first object power functionMark generates the first configuration file.
Optionally, storage medium is also configured to store the program code for executing following steps: repeating followingStep, until traversing each power function in function to be measured: obtaining the function first address of current power function;Judge current functionWhether the sentence length of the function statement on the function first address of energy function is greater than the first predetermined threshold;On function first addressWhen the sentence length of function statement is greater than the first predetermined threshold, determine that current power function meets setting condition;On the first ground of functionWhen the sentence length of function statement on location is less than or equal to the first predetermined threshold, determine that current power function is unsatisfactory for setting itemPart.
Optionally, storage medium is also configured to store the program code for executing following steps: obtaining the first configurationSetting position indicated by file, wherein setting position includes: that the function of the first object power function in function to be measured is firstBefore address, and/or, after the function end address of first object power function in function to be measured;It is the in setting positionOne objective function function setup test function.
Optionally, storage medium is also configured to store the program code for executing following steps: according to test dataObtain the quantity for the first object power function being called in function to be measured;By the first object power function of called mistakeQuantity and function to be measured in power function sum implementation coverage of the ratio as function to be measured.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to: USB flash disk, read-only memory (ROM,Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk orThe various media that can store program code such as CD.
Optionally, the specific example in the present embodiment can be shown with reference to described in above-described embodiment 1 and embodiment 2Example, details are not described herein for the present embodiment.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
If the integrated unit in above-described embodiment is realized in the form of SFU software functional unit and as independent productWhen selling or using, it can store in above-mentioned computer-readable storage medium.Based on this understanding, skill of the inventionSubstantially all or part of the part that contributes to existing technology or the technical solution can be with soft in other words for art schemeThe form of part product embodies, which is stored in a storage medium, including some instructions are used so that onePlatform or multiple stage computers equipment (can be personal computer, server or network equipment etc.) execute each embodiment institute of the present inventionState all or part of the steps of method.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodimentThe part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed client, it can be by others sideFormula is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, and only oneKind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine orIt is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual itBetween coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or moduleIt connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unitThe component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multipleIn network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unitIt is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated listMember both can take the form of hardware realization, can also realize in the form of software functional units.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the artFor member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answeredIt is considered as protection scope of the present invention.

Claims (18)

CN201610616980.7A2016-07-292016-07-29Data test method and deviceActiveCN106250312B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201610616980.7ACN106250312B (en)2016-07-292016-07-29Data test method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610616980.7ACN106250312B (en)2016-07-292016-07-29Data test method and device

Publications (2)

Publication NumberPublication Date
CN106250312A CN106250312A (en)2016-12-21
CN106250312Btrue CN106250312B (en)2019-01-08

Family

ID=57605495

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201610616980.7AActiveCN106250312B (en)2016-07-292016-07-29Data test method and device

Country Status (1)

CountryLink
CN (1)CN106250312B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7058928B2 (en)*1999-12-232006-06-06Identify Software Ltd.System and method for conditional tracing of computer programs
CN101067798A (en)*2007-06-142007-11-07华南理工大学 A Dynamic Probe Method and Its Application in Embedded System
CN103077112A (en)*2012-10-162013-05-01中兴通讯股份有限公司Software debugging method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7058928B2 (en)*1999-12-232006-06-06Identify Software Ltd.System and method for conditional tracing of computer programs
CN101067798A (en)*2007-06-142007-11-07华南理工大学 A Dynamic Probe Method and Its Application in Embedded System
CN103077112A (en)*2012-10-162013-05-01中兴通讯股份有限公司Software debugging method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Windows系统的动态代码插装技术研究及应用;朱晓东;《中国优秀硕士学位论文全文数据库 信息科技辑》;20080615(第06期);论文第49、59-60页,图4-10

Also Published As

Publication numberPublication date
CN106250312A (en)2016-12-21

Similar Documents

PublicationPublication DateTitle
CN108255847B (en)Page generation method and device
CN106844217A (en)Control to applying bury method and device, readable storage medium storing program for executing a little
CN112612813B (en)Test data generation method and device
CN105302706B (en)Applied program testing method and device
CN108415830B (en)Method and device for generating software test case
CN108717393A (en)A kind of applied program testing method and mobile terminal
CN108459953A (en)test method and device
CN109871326A (en) Method and device for recording a script
CN107145437B (en)Java annotation test method and device
US10089109B2 (en)System and method for evaluating human resources in a software development environment
CN108280022A (en)Performance monitoring method and device
CN105095207B (en)Retrieval, the method and apparatus for obtaining application software content
CN108958992A (en)test method and device
CN106557419B (en)Program testing method and device
CN105787364A (en)Automated testing method, device and system for task
CN113268243B (en)Memory prediction method and device, storage medium and electronic equipment
CN106682910B (en) An information processing method, system and related equipment
CN117435506A (en)Fuzzy test method, electronic device and computer readable storage medium
CN103246606A (en)Method and system for testing performances of ESB (enterprises service bus) platform
US10241902B2 (en)Systems and methods for benchmark based cross platform service demand prediction
CN108536451A (en)Application program buries a method for implanting and device
CN114416545B (en) Method, device and electronic device for determining test code coverage
CN113806231A (en)Code coverage rate analysis method, device, equipment and medium
CN110865941A (en)Interface test case generation method, device and system
CN105045717B (en)Test environment dispositions method, device and system

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp