IP Library Granted Patent US 11,755,463
Granted Patent B2
US 11,755,463 · App. 16/970,671 · Granted Sep 12, 2023

Method to generate test suite for source-code

Inventors: David Mentre (Rennes, FR); Denis Cousineau (Rennes, FR); Eric Lavillonniere (Rennes, FR)
Assignee: MITSUBISHI ELECTRIC CORPORATION
G06F11/3684G06F11/3676G06F17/11
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,755,463
App. No.
16/970,671
Granted
Sep 12, 2023
Kind
B2
Abstract

A method ( 100 ) to generate test suite for a source-code ( 1 ). The method comprises: a) implementing a structural analysis ( 101 ) of said source-code ( 1 ) to obtain a completed source-code ( 1 ) including: —parsing the source-code, —addition of annotations defining tests objectives, —generation of stubs; b) implementing at least one semantic analysis algorithm including categorizing each set of tests objectives as satisfied, impossible to satisfy or unsatisfied; c) feeding a first list ( 11 ) with satisfied test cases; d) feeding a second list ( 21 ) with test objectives impossible to satisfy, e) implementing at least one mathematical optimization algorithm ( 103 ) on parts corresponding to unsatisfied test objectives; —identifying test cases ( 113 ) that satisfy at least a part of said test objectives, —feeding said first list of set of test cases with them, —categorizing said test objectives as satisfied; f) providing a test suite comprising the two lists.

Claims (38)

1. A method to generate a test suite for a source-code, test cases being stored on a memory accessible to a computer, the method being implemented by said computer, said method comprising:

a) implementing a structural analysis of said source-code to obtain a completed source-code including:

parsing the source-code,

adding annotations defining test objectives into the source-code, and

generating stubs corresponding to the source-code;

b) implementing at least one semantic analysis algorithm on said completed source-code including categorizing the test objectives into the following categories:

i) a first set test objectives that are satisfied by using as inputs test cases including test parameters stored on the memory;

ii) a second set of test objectives that are impossible to satisfy with any test case; and

iii) a third set test objectives that are, at least temporarily, unsatisfied;

c) feeding a first list of a set of test cases with test cases that satisfy the test objectives of the category i;

d) feeding a second list of test objectives with test objectives that are impossible to satisfy and pertaining to the category ii,

e) implementing at least one mathematical optimization algorithm, on a basis of a presence of the set of test objectives in the category iii, on parts of said completed source-code corresponding to the test objectives of the category iii including:

identifying test cases that satisfy at least a part of said test objectives in the category iii,

feeding said first list of the set of test cases with test cases that satisfy said test objectives in the category iii; and

f) providing the test suite, the test suite comprising said first list obtained in the step c and completed in the step e and said second list obtained in the step d, wherein

each of the first, second and third sets of test objectives in the categories i, ii and iii comprises at least one of the test objectives.

2. The method according to claim 1 , further comprising a supplementary preliminary step before the step b, the supplementary preliminary step comprising:

implementing at least one second semantic analysis algorithm; and

implementing at least one second mathematical optimization algorithm on second parts of said completed source-code, the implementing at least one second mathematical optimization algorithm including:

identifying test cases that satisfy at least a part of said test objectives defined in the annotations, and

feeding said first list of the set of test cases with test cases that satisfy said test objectives defined in the annotations.

3. The method according to claim 1 , wherein the step e is implemented a first time with a first mathematical optimization algorithm, and then, the step e is implemented at least a second time with a second mathematical optimization algorithm different from the first mathematical optimization algorithm.

4. The method according to claim 1 , wherein the step e is implemented at least one time with the at least one mathematical optimization algorithm, and then, before step f, a series of the following steps b′, c′ and d′ is implemented at least one time:

b′) implementing at least one supplementary semantic analysis algorithm on the parts of said completed source-code corresponding to the test objectives of the category iii to categorize at least a second part of said test objectives into the categories i or ii;

c′) feeding said first list of the set of test cases with second test cases that satisfy the test objectives of the category i; and

d′) feeding said second list of test objectives with second test objectives that are impossible to satisfy and pertaining to the category ii.

5. The method according to claim 1 , wherein the step d further comprises associating, with each of the test objectives impossible to satisfy and pertaining to the category ii, information about a reason of impossibility to be satisfied, said information being in a natural language.

6. The method according to claim 1 , wherein the at least one semantic analysis algorithm is one of the following:

a Value Analysis module of an abstract interpretation based analyzer,

a Bounded Model-Checking based analyzer, and

a concolic based analyzer module of the abstract interpretation based analyzer.

7. The method according to claim 1 , comprising the following steps in the following order:

implementing a Value Analysis module of an abstract interpretation based analyzer on said completed source-code;

if the category iii is not empty, implementing a genetic algorithm on the parts of said completed source-code corresponding to the test objectives of the category iii;

implementing a Bounded Model-Checking based analyzer analysis algorithm; and

implementing a concolic based analyzer analysis algorithm of the abstract interpretation based analyzer.

8. A system comprising a processor and a memory storing computer-executable instructions, which implement the method of claim 1 .

9. A non-transitory computer-readable recording medium on which a software is registered to implement the method according to claim 1 when the software is executed by a processor.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 19, 2020
From: MENTRE, DAVID; COUSINEAU, DENIS; LAVILLONNIERE, ERIC
To: MITSUBISHI ELECTRIC R&D CENTRE EUROPE B.V.
Reel/Frame 053536/0460 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 19, 2020
From: MITSUBISHI ELECTRIC R&D CENTRE EUROPE B.V.
To: MITSUBISHI ELECTRIC CORPORATION
Reel/Frame 053536/0503 →
Priority Claims (1)
EP 18305333 · Mar 26, 2018 · regional
Continuity (1)
Related Publication 20200379888A1 · Dec 3, 2020
Cited By (1)
US 12,405,880