Browse Prior Art Database

Method and system to find potential program defect based on run-time variable change analysis

IP.com Disclosure Number: IPCOM000248699D
Publication Date: 2016-Dec-28
Document File: 7 page(s) / 106K

Publishing Venue

The IP.com Prior Art Database

Abstract

This invention discloses a system and method to validate the program execution process based on the key variable value change analysis and match with expected trend/model. System generates a GUI (Graphical User Interface)for developer to select target variables and select/define expected value change trend/model based on variable type. (For each variable type, there are several kinds of predefined change trend/model. Besides, developer can define the change trend/model manually.) System extracts the target variable value change from runtime debug log in order to match the expected value change trend/model. If match fails, system will prompt the corresponding wrong code lines. These code lines generate the unexpected value change of target variable during program execution.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 35% of the total text.

1

Method and system to find potential program defect based on run-time variable change analysis

Function test and unit test is not sufficient to ensure complicated program implemented correctly all the time. Function test focuses on

function level and unit test focuses on method level. It is not possible to check the program execution process. These two methods focus on

the execution result instead of execute process. A program execution result is correct but the execution process doesn’t work correctly in

some test cases. Function test and unit test is not possible to detect .

Traditional debug has lots of limitations though it can check the program on variable level. The biggest problem is that it costs too much time.

Besides, human can’t always remember the variable value change especially when the variable is changed frequently. Besides, some program

scenario is not easy to debug, such as multiple-thread program.

Is there a way to allow developer to check the program execution process to ensure all his /her program works as expected?

This invention discloses a system and method to validate the program execution process based on the key variable value change analysis and

match with expected trend/model.

System generates a GUI for developer to select target variables and select /define expected value change trend/model based on variable type.

(For each variable type, there are several kinds of predefined change trend/model. Besides, developer can define the change trend/model

manually.)

System extracts the target variable value change from run-time debug log in order to match the expected value change trend /model.

If match fails, system will prompt the corresponding wrong code lines. These code lines generate the unexpected value change of target

variable during program execution.

This method can also be used in regression test . In this case, when user selects a variable, system will propose the trend/model according to

running history in the past.

Claim points

 Identify key variable by path: package path + class name + method name + variable + sequence(optional). Sequence is used to distinguish

duplicate variable names within the same method scope.

 A GUI is provided to developers to select target variable and associate variables based on source code scan .

2

 Developer can select/define the expected variable change trend/model based on the variable type. It can also be used in unit test, as a new

type of assertion.

 Locate the source code lines after the actual variable change fails to match the expected change trend /model based on the run-time debug

log.

Advantages:

#1. It costs less time in new test method because it don 't need any breakpoints.

#2. It automatically validates whether the program works as expected and locate the potential wrong code .

 System scans the source code to extract all candidate variables . Each variable has a path. The variable path is defined as following format:

package path + class name + method nam...