CN116561016A - Test case screening system based on line coverage data - Google Patents

Test case screening system based on line coverage data Download PDF

Info

Publication number
CN116561016A
CN116561016A CN202310844658.XA CN202310844658A CN116561016A CN 116561016 A CN116561016 A CN 116561016A CN 202310844658 A CN202310844658 A CN 202310844658A CN 116561016 A CN116561016 A CN 116561016A
Authority
CN
China
Prior art keywords
test
target
case
test case
row
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310844658.XA
Other languages
Chinese (zh)
Other versions
CN116561016B (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.)
Chengdu Rongjian Software Technology Co ltd
Beijing Yunshu Innovation Software Technology Co ltd
Shanghai Hejian Industrial Software Group Co Ltd
Original Assignee
Chengdu Rongjian Software Technology Co ltd
Beijing Yunshu Innovation Software Technology Co ltd
Shanghai Hejian Industrial Software Group 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 Chengdu Rongjian Software Technology Co ltd, Beijing Yunshu Innovation Software Technology Co ltd, Shanghai Hejian Industrial Software Group Co Ltd filed Critical Chengdu Rongjian Software Technology Co ltd
Priority to CN202310844658.XA priority Critical patent/CN116561016B/en
Publication of CN116561016A publication Critical patent/CN116561016A/en
Application granted granted Critical
Publication of CN116561016B publication Critical patent/CN116561016B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention relates to the technical field of electronic design automation, in particular to a test case screening system based on row coverage data, which comprises a coverage database DB of N test case cases in a database, wherein DB i Includes multiple test records, the mth test record test m The method comprises the steps of testing source files and line identifiers of testing lines; the computer program is realized when executed by a processor: obtaining source file na to be tested k The modified D row identifications in (a); according to na k And each row identification searches test records in all row coverage files in the DB to obtain all target test records associated with each row identification; obtaining all target test cases associated with each row identification according to each target test record, the test is performed using the target test case, the method has the advantages that the equivalent effect is obtained, meanwhile, the resources occupied by the test cases are greatly reduced, the test efficiency is improved, and the consumption of hardware resources is reduced.

Description

Test case screening system based on line coverage data
Technical Field
The invention relates to the technical field of electronic design automation, in particular to a test case screening system based on row coverage data.
Background
Line coverage, also known as statement coverage, is the ability to ensure that each line of code in a source file under test is executed at least once by designing enough test cases. In practical applications, there may be thousands of test cases corresponding to the same source file, which is maintained by multiple users. If a line in the source file is modified, then the line coverage needs to be retested.
In this case, all test cases of the test source file are retested with the row coverage rate, which results in retesting of a large number of test cases unrelated to the modified source file, which wastes a large amount of time and consumes a large amount of hardware resources.
Disclosure of Invention
Aiming at the technical problems, the invention adopts the following technical scheme: a test case screening system based on row coverage data, the system comprising a database, a processor and a memory storing a computer program, wherein the database comprises a coverage database DB of N test case cases, wherein case= { case 1 ,case 2 ,…,case i ,…,case N },case i For the ith test case, the value range of i is 1 to N; db= { DB 1 ,DB 2 ,…,DB i ,…,DB N },DB i Is a case i Is a coverage database of (a); DB (database) i Including a line overlay file i ,fil i Store M test records { test } 1 ,test 2 ,…,test m ,…,test M },test m For the M-th test record, the value range of M is 1 to M; test m Including the j-th source file na of the test j And testing na j Line identification nl for the h-th line in the list h J is 1 to J, J is the total number of source files, H is 1 to H, and H is na j The total number of rows in (a); when the computer program is executed by a processor, the following steps are implemented:
S100, obtaining a source file na to be tested k The modified D rows in (1) identify nl= { NL 1 ,nl 2 ,…,nl d ,…,nl D "where nl is d For the D-th modified row, D has a value in the range of 1 to D.
S200, searching the DB, and acquiring all line coverage files in the DB.
S300 according to na k And searching test records in all line coverage files in the coverage database DB by each line identifier in NL to obtain all target test records associated with each line identifier in NL.
S400, sequentially searching a row coverage file, a coverage database and test cases according to each target test record associated with each row identifier, and obtaining all target test cases associated with each row identifier in NL.
Compared with the prior art, the test case screening system based on the line coverage data has obvious beneficial effects, can achieve quite technical progress and practicality, has wide industrial application value, and has at least the following beneficial effects:
the invention provides a test case screening system based on line coverage data, which is characterized in that test records of each test case test are stored in a database, a matched target test record can be obtained by searching the test records according to a modified line identifier and a source file to be tested, the target test case associated with each modified line identifier is obtained by reversely searching the test cases through the target test records, and the target test case is re-executed to obtain line coverage data of the source file to be tested, so that the problems of long test time and high hardware resource consumption caused by directly adopting all the test cases related to the source file to re-test the line coverage in the prior art are solved, the test efficiency is improved, and the consumption of hardware resources is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a test case screening step based on line coverage data according to an embodiment of the present invention;
fig. 2 is a flowchart of a step of a source file modification positioning system according to a second embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
In order to solve the problem that all test cases need to be retested due to the fact that a certain row in a source file is modified, a large amount of time is wasted, and a large amount of hardware resources are consumed.
Example 1
The embodiment of the invention provides a test case screening system based on row coverage data, which comprises a database, a processor and a memory storing a computer program, wherein the database comprises coverage database DB of N test case cases, wherein case= { case 1 ,case 2 ,…,case i ,…,case N },case i For the ith test case, the value range of i is 1 to N; db= { DB 1 ,DB 2 ,…,DB i ,…,DB N },DB i Is a case i Is a coverage database of (a); DB (database) i Including a line overlay file i ,fil i Store M test records { test } 1 ,test 2 ,…,test m ,…,test M },test m For the M-th test record, the value range of M is 1 to M; test m Including the j-th source file na of the test j And measuringTry na j Line identification nl for the h-th line in the list h J is 1 to J, J is the total number of source files, H is 1 to H, and H is na j Is a total number of rows in the column.
Wherein DB i The overlay file comprises a plurality of overlay indexes of different types, each overlay index corresponds to one overlay file, and the overlay indexes comprise a conditional overlay index, a row overlay index, an assertion overlay index, a finite state machine overlay index, a flip overlay index or a function overlay index and the like.
Alternatively na j The full path name includes the name of the path the source file stores and the source file, for the name of the source file, the unique identity of the source file, or the full path name of the source file.
Wherein nl is h For na j The number of each row in (a).
Referring to fig. 1, the following steps are implemented when a computer program is executed by a processor:
s100, obtaining a source file na to be tested k The modified D rows in (1) identify nl= { NL 1 ,nl 2 ,…,nl d ,…,nl D "where nl is d For the D-th modified row, D has a value in the range of 1 to D.
It should be noted that, the DB includes all coverage databases of test cases, and each test case generates a corresponding coverage database after execution. na (na) k The corresponding test cases are also in the overlay database, and na k The associated line overlay data is stored in the corresponding line overlay file.
When na k After a certain line of the line is modified, if na k All relevant test cases are executed for one time, so that a large amount of resources are occupied, the test efficiency is low, and the occupied resources are large. To solve this problem, the present invention obtains the modified row-related target test cases through S200-S400.
S200, searching the DB, and acquiring all line coverage files in the DB.
Optionally, the database is opened and the data is read through an API interface conforming to the database standard. It is noted that when the database file meets the uci standard, the API interface meets the uci standard.
S300 according to na k And searching test records in all line coverage files in the coverage database DB by each line identifier in NL to obtain all target test records associated with each line identifier in NL.
Wherein, in S300, nl is obtained d The step of associating all target test records includes: according to na k And nl d When searching test records in all line coverage files in the coverage database DB, na will be included at the same time k And nl d Is recorded as nl d An associated target test record.
S400, sequentially searching a row coverage file, a coverage database and test cases according to each target test record associated with each row identifier in NL to obtain all target test cases associated with each row identifier in NL.
It should be noted that, according to the association relationship between the data in the database, the row coverage file of each target test record is sequentially searched through the reverse index, and each row coverage file belongs to the coverage database and each test case that each coverage database belongs to.
The target test case is utilized for testing, so that the resources occupied by the test case are greatly reduced while the same effect is obtained, the testing efficiency is improved, and the occupation of hardware resources is reduced.
When the line coverage rate is tested, only one test case is covered and counted as being covered, so that redundancy is generated when a plurality of test cases cover the same line of data, and the redundant test cases also occupy a large amount of hardware resources. Therefore, after S400, it further includes: and screening all target test cases associated with each row of the identification in the NL according to the time complexity and the association weight to obtain a final test case associated with each row of the identification in the NL. Wherein the time complexity of each test case is known. Including the following several preferred embodiments.
As a preferred embodiment, the target test cases are filtered by using the time complexity and combining the associated weights, and the following steps of S400 are further included:
s500, when nl d When the number Q of the associated target test cases is larger than 1, acquiring the time complexity of the Q target test cases, wherein L target test cases corresponding to the minimum value of the time complexity are nl d And L associated candidate target test cases. And selecting a target test case through the time complexity, wherein the larger the time complexity is, the longer the test time is, so that the test case with the minimum time complexity is selected as the candidate target test case.
Further, when L is equal to 1, the candidate target test case is nl d Final test cases of (3). The test case with the minimum time complexity is selected, so that the test efficiency can be improved. When L is greater than 1, the step of obtaining the final test case includes:
s510, counting the association times of all the target test cases associated with the D rows in NL, and acquiring the association weight of each target test case according to the association times. It should be noted that, by counting the number of times each target test case is associated is equivalent to obtaining the modified row identifier covered by each target test case, the more the number of association times, the greater the association weight.
Optionally, the association weight of each target test case is a ratio of the association number of each target test case to the total association number of the D row identifiers.
S520, obtaining nl d The associated weights of the L candidate target test cases are the nl candidate target test cases with the largest associated weights d The associated final test case. Under the condition of the same time complexity, the target test case with the largest association weight is selected as the final test case, so that the test case with the shortest test time can be obtained, the modified row can be subjected to the coverage test by the minimum test case, and the consumption of hardware resources can be further reduced on the basis of improving the test efficiency.
As a preferred embodiment, the filtering of the target test case by balancing the time complexity and the size of the associated weight, S400 further includes:
s600, when nl d Associated target test casesWhen the number Q is greater than 1, acquiring the time complexity of Q target test cases; obtaining a minimum value of time complexity, and obtaining target time complexity by adding all time complexity in a preset time threshold range to the minimum value, wherein a target test case corresponding to the target time complexity is nl d And L associated candidate target test cases. The preset time threshold is a time threshold preset in advance, so that a plurality of target test cases with relatively close time complexity are used as candidate target test cases, and further screening is facilitated by combining the association weights.
Further, when L is equal to 1, the candidate target test case is nl d Final test cases of (a); when L is greater than 1, the step of obtaining the final test case includes:
s610, obtaining the duty ratio of the target time complexity, and obtaining the time weight of each target test case according to the duty ratio of the target time complexity, wherein the time weight is inversely related to the duty ratio of the target time complexity. Specifically, the duty cycle of the target time complexity is the ratio of the target time complexity to the sum of all the target time complexities. The larger the duty cycle of the temporal complexity, the smaller the temporal weight. Optionally, the temporal weight is the inverse of the duty cycle of the target temporal complexity. Preferably, the time weight w satisfies: w=e (-1+(1/(1+x))) Wherein x is the duty ratio of the target time complexity, the difference between the time weights with the time complexity close to each other can be increased by the calculation method, and the difference between the time weights with the larger time complexity difference can be reduced.
S620, counting the association times of all the target test cases associated with the D rows in NL, and acquiring the association weight of each target test case according to the association times. It should be noted that, by counting the number of times each target test case is associated is equivalent to obtaining the modified row identifier covered by each target test case, the more the number of times is associated, the greater the weight is.
Optionally, the association weight of each target test case is a ratio of the association number of each target test case to the total association number of the D row identifiers.
S630, according to the time weightThe product of the weight and the associated weight yields nl d The combined weight of each candidate target test case is associated, and the candidate target test case corresponding to the maximum combined weight is nl d The associated final test case. The comprehensive weight can balance time complexity and associated times in the selection process, so that the selected final test case can balance efficiency and consumption of hardware resources.
As a preferred embodiment, the further screening is performed by associating weights alone, and S400 further includes:
s710, counting the association times of all the target test cases associated with the D row identification in NL, and acquiring the weight of each target test case according to the association times.
S720, obtaining weights of all target test cases associated with each row of the NL, wherein the target test case with the largest weight is the best test case associated with each row of the NL.
After S400, the test cases are selected by the means of S710-S720 directly, so that retesting of the modified rows can be achieved through the least test cases, and the consumption of hardware resources is reduced.
The source file is typically commonly maintained by multiple users, and when one of the users modifies a certain line of code, it may result in a test case test failure associated with the verification. Since the source files are commonly maintained, it cannot be determined which modification caused the test failure of those test cases, and it cannot be located. In order to solve this problem, the present invention provides embodiment two.
Example two
In the second embodiment of the invention, the identity mark modified each time, the file associated with the identity mark and the modification mapping relation of the modification position are stored in a first sub-database, and the association mapping relation of the source file and the test position of the test case test is stored in a second sub-database; when the test case fails to be tested, reversely searching a source file and a test position related to the test case through the second sub-database, and acquiring related candidate identity marks according to the corresponding information in the first sub-database matched with the searched source file and the test position, so as to acquire a target identity mark according to the candidate identity marks.
The following specifically describes a specific scheme of a source file modification positioning system provided by the invention with reference to the accompanying drawings.
An embodiment of the present invention provides a source file modification positioning system, including: a database, a processor and a memory storing a computer program, wherein the database comprises a first sub-database and a second sub-database. The first sub-database comprises the identity IDs of N modification lists, and the identity ID of the ith modification list in the IDs i The binding modification mapping relation comprises modification of the user U i And M modification lists mf i First-order mapping relation, mf between i Of the j-th modification list mf i,j Including file fi i,j And K modified positions loc i,j Is a secondary mapping relationship of (2); wherein, the value range of i is 1 to N, and the value range of j is 1 to M. The second sub-database comprises an associated information list TC of R test cases, and the R test case in the TC r Associated information list tc of (a) r Comprising T association lists af r ,af r The t-th association list in (1) comprises a file fi r,t And H associated positions loc r,t Is a mapping relation of the association of the two; wherein, the value range of R is 1 to R, and the value range of T is 1 to T.
Each identity in the identity ID of the modification list is a unique number of the source file which is modified once. By modifying the user U i File fi i,j And modifying the position loc i,j Binding id i Is to store each time of modification information for subsequent passing of lock id i In which way the location code was modified to produce the wrong result.
The second sub-database stores the file name of each test case for testing and the file position of each test case. Where the file location is the row under test or the range of rows under test.
Optionally, the modification location loc i,j Is a modified row identifier or a modified row identifier range.
Optionally, the associated location loc r,t Each associated position in (a) is case r The row identification or range of row identifications tested.
Preferably, the id in the first sub-database i The binding modification mapping relation also comprises modification user U i Time of modification T i And M modification lists mf i A first-level mapping relation between the two. The modification time enables the identities of the modification list to be ordered according to the modification time.
Referring to fig. 2, further, when the computer program is executed by the processor, the following steps are implemented:
p100, according to the test case of test failure r Searching the second sub-database to obtain a case r Associated information list tc of (a) r . It should be noted that, when the user modifies some rows in the source file, the test case may fail to be tested again by using the test case. When the test case fails, which modified identity is required to be caused clearly, the associated source file and the associated position thereof can be searched through the P100.
P200 according to tc respectively r And searching the secondary mapping relation in the first sub-database by using all the association mapping relations in the first sub-database to obtain the secondary mapping relation matched with each association mapping relation.
Optionally, the step of obtaining the mapping relationship matched with each association mapping relationship includes: searching a secondary mapping relation through file names in the association mapping relation to obtain a plurality of candidate secondary mapping relations with the same file names; and taking an intersection of each association position in the association mapping relation and the modification position in the candidate secondary mapping relation, and obtaining a matched secondary mapping relation when the intersection is not empty.
As a preferred embodiment, the first sub-database is id i The binding modification mapping relation also comprises modification user U i Time of modification T i And M modification lists mf i A first-level mapping relation between the two; when a plurality of different identities in the first sub-database bind to the same modification location, the P200 further includes: according to tc respectively r Searching for secondary mapping relations in the first sub-database according to all the association mapping relations in the first sub-database to obtain secondary mapping relations matched with each association mapping relation; when one incidence mapping relation is matched to obtain a plurality of candidate secondary mapping relations, the modification time of each candidate secondary mapping relation is obtained and is matched with a case r And the candidate secondary mapping relation corresponding to the closest modification time is used as the final secondary mapping relation. Recording the id of each modification in a first sub-database as the positioning system is updated in real time i But due to id i The modification position in (a) is not necessarily related to the test case which fails in the test, so that only the modification position related to the test case which is modified last time needs to be searched when searching.
And P300, obtaining a candidate identity identification set of the modification list according to the first-level mapping relation to which each second-level mapping relation belongs.
And P400, determining the target identity according to the data change of the test before and after modification of each candidate identity binding file in the candidate identity set.
It should be noted that the result obtained in steps P100-P400 may be one target identity or may be multiple target identities, and the source file related to the test case and modified can be located at this time.
As a preferred embodiment, the P100-P200 is capable of locating modified source files related to test cases, but the modified source files do not necessarily cause test case test failures, so in order to further find modification identities that cause test case test failures, the P400 further includes:
p420, respectively obtaining the current test data and last case of each modification position in all files bound by each candidate identity mark r Reference test data at the time of test pass.
Preferably, the current test data and the reference test data are coverage data, waveform data or netlist data. Other types of test data tested by using test cases in the prior art fall within the protection scope of the invention.
And P440, comparing the data difference between the current test data and the reference test data of the same modification position, and taking all candidate identity identifiers corresponding to the current test data with the data difference as target identity identifiers.
When the same modification position modifies data differently, it is explained that the modification position is one of the reasons that the source file is subject to test case test and the test failure is caused.
As a preferred embodiment, tc r Also comprises a case r Data type tag for testing r . Wherein tag r Type tags for coverage data, waveform data, or netlist data. Other types of test data tested by using test cases in the prior art fall within the protection scope of the invention.
As a preferred embodiment, wherein:
p100 also includes a test case according to test failure r Searching the second sub-database to obtain a case r Associated information list tc of (a) r And tag r
P400 further comprises:
p420 according to tag r Respectively acquiring current test data and last case of each modification position in all files bound by each candidate identity mark r Reference test data at the time of test pass.
And P440, comparing the data difference between the current test data and the reference test data of the same modification position, and taking all candidate identity identifiers corresponding to the current test data with the data difference as target identity identifiers.
The data type tag of the test case test is added into the second sub-database, so that the data type tag can be directly passed through r It is determined which data type the test data aligned in P400 is. For example, when the data type tag is a tag of coverage data, the coverage data of each modification position and the last case can be directly obtained in the P400 r Reference coverage rate data when the test passes, and no external intervention is required to specify the type of the test dataThe whole process is more prone to being automatically completed.
According to the test case of the test failure, the second sub-database is searched to obtain the associated file and the associated position, and then the modified identity identifications in the first sub-database comprise the associated source files and the associated positions, so that the target identity identification is obtained. The method can quickly locate the target identity, and quickly find out the reason of the failure of the test after the target identity is obtained, thereby shortening the verification period and improving the verification efficiency.
Based on the same inventive concept as the above system, the embodiments of the present invention also provide a non-transitory computer readable storage medium having at least one instruction or at least one program stored therein, wherein: the at least one instruction or the at least one program is loaded and executed by the processor to implement a source file modification positioning system according to the method embodiment in the first embodiment, where a source file modification positioning system is described in detail in the first embodiment and is not described in detail.
While certain specific embodiments of the invention have been described in detail by way of example, it will be appreciated by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the invention. Those skilled in the art will also appreciate that many modifications may be made to the embodiments without departing from the scope and spirit of the invention. The scope of the present disclosure is defined by the appended claims.

Claims (8)

1. A test case screening system based on row coverage data, the system comprising a database, a processor and a memory storing a computer program, wherein the database comprises a coverage database DB of N test case cases, wherein case= { case 1 ,case 2 ,…,case i ,…,case N },case i For the ith test case, the value range of i is 1 to N; db= { DB 1 ,DB 2 ,…,DB i ,…,DB N },DB i Is a case i Is covered by (a)A lid database; DB (database) i Including a line overlay file i ,fil i Store M test records { test } 1 ,test 2 ,…,test m ,…,test M },test m For the M-th test record, the value range of M is 1 to M; test m Including the j-th source file na of the test j And testing na j Line identification nl for the h-th line in the list h J is 1 to J, J is the total number of source files, H is 1 to H, and H is na j The total number of rows in (a);
when the computer program is executed by a processor, the following steps are implemented:
s100, obtaining a source file na to be tested k The modified D rows in (1) identify nl= { NL 1 ,nl 2 ,…,nl d ,…,nl D "where nl is d For the D-th modified row, D has a value in the range of 1 to D;
s200, searching a DB, and acquiring all line coverage files in the DB;
s300 according to na k Searching test records in all line coverage files in the coverage database DB by each line identifier in NL to obtain all target test records associated with each line identifier in NL;
s400, sequentially searching a row coverage file, a coverage database and test cases according to each target test record associated with each row identifier in NL to obtain all target test cases associated with each row identifier in NL.
2. The system of claim 1, further comprising, after S400: and screening all target test cases associated with each row of the identification in the NL according to the time complexity and the association weight to obtain a final test case associated with each row of the identification in the NL.
3. The system of claim 2, wherein nl d The step of acquiring the associated final test case comprises the following steps:
s500, when nl d When the number Q of the associated target test cases is greater than 1, Q target test cases are obtainedThe time complexity of the cases, and L target test cases corresponding to the minimum value of the time complexity are nl d The L associated candidate target test cases; when L is equal to 1, the candidate target test case is nl d Final test cases of (a); when L is greater than 1, the step of obtaining the final test case includes:
s510, counting the association times of all the target test cases associated with the D rows in NL, and acquiring the association weight of each target test case according to the association times;
s520, obtaining nl d The associated weights of the L candidate target test cases are the nl candidate target test cases with the largest associated weights d The associated final test case.
4. The system of claim 2, wherein nl d The step of acquiring the associated final test case comprises the following steps:
s600, when nl d When the number Q of the associated target test cases is larger than 1, acquiring the time complexity of the Q target test cases; obtaining a minimum value of time complexity, and obtaining target time complexity by adding all time complexity in a preset time threshold range to the minimum value, wherein a target test case corresponding to the target time complexity is nl d The L associated candidate target test cases; when L is equal to 1, the candidate target test case is nl d Final test cases of (a); when L is greater than 1, the step of obtaining the final test case includes:
s610, obtaining the duty ratio of the target time complexity, and obtaining the time weight of each target test case according to the duty ratio of the target time complexity, wherein the time weight is inversely related to the duty ratio of the target time complexity, and the duty ratio of the target time complexity is the ratio of the target time complexity to the sum of all the target time complexities;
s620, counting the association times of all the target test cases associated with the D rows in NL, and acquiring the association weight of each target test case according to the association times;
s630, obtaining nl according to the product of the time weight and the associated weight d The combined weight of each candidate target test case is associated, and the candidate target test case corresponding to the maximum combined weight is nl d The associated final test case.
5. The system of claim 3 or 4, wherein the association weight is a ratio of a number of associations per target test case to a total number of D row identification associations.
6. The system of claim 4, wherein the time weight w satisfies: w=e (-1+(1/(1+x))) Where x is the duty cycle of the target time complexity.
7. The system of claim 1, wherein S400 further comprises, after:
s710, counting the association times of all the target test cases associated with the D row identifiers in NL, and acquiring the weight of each target test case according to the association times;
s720, obtaining weights of all target test cases associated with each row of the NL, wherein the target test case with the largest weight is the best test case associated with each row of the NL.
8. The system of claim 1, wherein nl is obtained in S300 d The step of associating all target test records includes: according to na k And nl d When searching test records in all line coverage files in the coverage database DB, na will be included at the same time k And nl d Is recorded as nl d An associated target test record.
CN202310844658.XA 2023-07-11 2023-07-11 Test case screening system based on line coverage data Active CN116561016B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310844658.XA CN116561016B (en) 2023-07-11 2023-07-11 Test case screening system based on line coverage data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310844658.XA CN116561016B (en) 2023-07-11 2023-07-11 Test case screening system based on line coverage data

Publications (2)

Publication Number Publication Date
CN116561016A true CN116561016A (en) 2023-08-08
CN116561016B CN116561016B (en) 2023-11-03

Family

ID=87488352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310844658.XA Active CN116561016B (en) 2023-07-11 2023-07-11 Test case screening system based on line coverage data

Country Status (1)

Country Link
CN (1) CN116561016B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6536036B1 (en) * 1998-08-20 2003-03-18 International Business Machines Corporation Method and apparatus for managing code test coverage data
US20030061581A1 (en) * 2001-06-26 2003-03-27 International Business Machines Corporation Method of evaluating test cases in a simulation environment by harvesting
US20190196952A1 (en) * 2017-12-21 2019-06-27 Verizon Patent And Licensing Inc. Systems and methods using artificial intelligence to identify, test, and verify system modifications
CN112256553A (en) * 2019-07-22 2021-01-22 百度(中国)有限公司 Application software testing method and device and electronic equipment
CN113342651A (en) * 2021-06-01 2021-09-03 南京大学 Recovery method for testing case defect and case fuzzy association relation
CN114490404A (en) * 2022-02-10 2022-05-13 中国农业银行股份有限公司 Test case determination method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6536036B1 (en) * 1998-08-20 2003-03-18 International Business Machines Corporation Method and apparatus for managing code test coverage data
US20030061581A1 (en) * 2001-06-26 2003-03-27 International Business Machines Corporation Method of evaluating test cases in a simulation environment by harvesting
US20190196952A1 (en) * 2017-12-21 2019-06-27 Verizon Patent And Licensing Inc. Systems and methods using artificial intelligence to identify, test, and verify system modifications
CN112256553A (en) * 2019-07-22 2021-01-22 百度(中国)有限公司 Application software testing method and device and electronic equipment
CN113342651A (en) * 2021-06-01 2021-09-03 南京大学 Recovery method for testing case defect and case fuzzy association relation
CN114490404A (en) * 2022-02-10 2022-05-13 中国农业银行股份有限公司 Test case determination method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN116561016B (en) 2023-11-03

Similar Documents

Publication Publication Date Title
CN107665171B (en) Automatic regression testing method and device
CN102855259B (en) Parallelization of massive data clustering analysis
CN104756107B (en) Using location information profile data
US7640222B2 (en) Rules base systems and methods with circumstance translation
Liang et al. Automatic construction of an effective training set for prioritizing static analysis warnings
US8577849B2 (en) Guided data repair
CN112596964B (en) Disk fault prediction method and device
CN110716539B (en) Fault diagnosis and analysis method and device
CN112818162A (en) Image retrieval method, image retrieval device, storage medium and electronic equipment
Jahan et al. Version specific test case prioritization approach based on artificial neural network
US20150355888A1 (en) Acquiring identification of an application lifecycle management entity associated with similar code
CN116561016B (en) Test case screening system based on line coverage data
CN114238085A (en) Interface testing method and device, computer equipment and storage medium
CN110362569A (en) The method of calibration and device of tables of data, electronic equipment, storage medium
Ostrand et al. A Tool for Mining Defect-Tracking Systems to Predict Fault-Prone Files.
US11875234B2 (en) Systems and/or methods for machine-learning based data correction and completion in sparse datasets
CN116822424B (en) Source file modifying and positioning system and readable storage medium
US20230087098A1 (en) Data analysis method, apparatus and device
CN106569731B (en) Limit storage method, device and equipment
CN110990267B (en) Data processing method and device
CN107025615B (en) Learning condition statistical method based on learning tracking model
US20190114252A1 (en) Code coverage testing utilizing test-to-file maps
CN110221971B (en) Search engine testing method and device, electronic equipment and storage medium
CN114116729B (en) Test data processing method and equipment
CN115827324B (en) Data backup method, network node and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant