IP Library Granted Patent US 9,684,584
Granted Patent B2
US 9,684,584 · App. 14/587,797 · Granted Jun 20, 2017

Managing assertions while compiling and debugging source code

Inventors: Cary L. Bates (Rochester, MN); Lee Helgeson (Rochester, MN); Justin K. King (Rochester, MN); Michelle A. Schlicht (Rochester, MN)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F11/3624G06F11/3664G06F8/41
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 9,684,584
App. No.
14/587,797
Granted
Jun 20, 2017
Kind
B2
Abstract

The present disclosure relates to maintaining assertions in an integrated development environment (IDE) tool. According to one embodiment, while the IDE tool is compiling the source code of a development project, the IDE tool generates at least a first compiler warning. The first compiler warning generally corresponds to at least one line of source code in a first source code component of the development project. A first set of assertions to add to the source code of the development project is determined based on the line of source code that resulted in the first compiler warning. The IDE tool adds the first set of assertions to the source code of the development project. The first set of assertions are compiled as part of the source code of the development project.

Claims (37)

1. A computer-implemented method for managing assertions included in an executable program compiled from source code, the method comprising:

while compiling the source code of a development project:

generating at least a first compiler warning, wherein the first compiler warning corresponds to at least one line of source code in a first source code component of the development project;

determining, based on the line of source code that resulted in the first compiler warning, a first set of assertions to add to the source code of the development project; and

adding the first set of assertions to the source code of the development project, wherein the first set of assertions are compiled as part of the executable program.

2. The method of claim 1 , wherein determining the first set of assertions to add to the source code of the development project comprises:

determining a location of the first compiler warning in a control flow graph;

identifying, from the control flow graph, one or more source code components reachable from the location of the first compiler warning in the control flow graph; and

including assertions associated with the identified source code components in the first set of assertions.

3. The method of claim 1 , wherein the first set of assertions includes assertions that are associated with the first source code component in the development product which follow the line of source code that resulted in the first compiler warning.

4. The method of claim 1 , further comprising:

generating a notification of the first set of assertions added to the source code of the development project, wherein the notification is included with the first compiler warning.

5. The method of claim 1 , further comprising:

launching a debugger to execute the compiled source code of the development project.

6. The method of claim 5 , further comprising:

while the debugger is performing line-by-line execution of the compiled source code:

receiving a request to insert a breakpoint at a specified location in the source code;

determining a second set of assertions to insert in the source code;

adding a breakpoint for each assertion in the second set of assertions at a location associated with each assertion; and

executing an assertion in the second set of assertions when the debugger reaches one of the added breakpoints.

7. The method of claim 1 , further comprising:

receiving a request to insert a breakpoint at a specified location in the source code;

determining a second set of assertions to include in the source code based on the specified location; and

adding the second set of assertions to the source code, wherein the second set of assertions are compiled as part of the executable program.

8. The method of claim 7 , wherein the second set of assertions includes one or more assertions which precede the specified location of the breakpoint.

9. A computer implemented method for managing assertions, comprising:

receiving a request to check out one or more source code components of a development project identified in a defect ticket;

identifying a first set of assertions to insert into the source code components at compile time based on data included in the defect ticket;

checking out the code components; and

presenting at least a first one of the code components in an editing tool, wherein the editing tool presents an indication of each assertion in the first code component at a location associated with each assertion.

10. The method of claim 9 , wherein identifying the first set of assertions to include in the code components comprises:

identifying functions listed in a stack trace included in the defect ticket; and

including assertions associated with at least one of the identified functions.

11. The method of claim 9 , wherein identifying the first set of assertions to activate in the code components comprises:

identifying a location in the source code of an error specified in the defect ticket; and

including one or more assertions in the source code.

12. The method of claim 9 , wherein the one or more assertions include one or more keywords, and wherein the identifying one or more assertions is further based on whether the assertions include at least one of the one or more keywords.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 21, 2015
From: BATES, CARY L.; HELGESON, LEE; KING, JUSTIN K.; SCHLICHT, MICHELLE A.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 034767/0416 →
Continuity (2)
Continuation 14585771 · Dec 30, 2014
Related Publication 20160188440A1 · Jun 30, 2016