Patent ID: 6658643
Filing Date: 2003-12-02
Classification: G06F

Abstract:
A method for determine the complexity of a computer program, the method comprising the steps of:i) inspecting the program to identify occurrences therein of pre-determined program items that are indicative of breaks in the ongoing forward flow of the program, wherein said predetermined program items include any of: a conditional program statement; the head and tail of a loop statement; a call to a su-broutine or function; a memory allocation, reallocation or deallocation operation; aliasing of allocated memory; a statement including the keyword Goto, continue, break, switch, case, default and return, or an equivalent keyword; a pointer returned by a function not in the functions parameter list; a variable within a loop body if the variable is redefined or modified after its first use within a loop iteration; implicit mixed type operations in a statement or expression; division operators using non-constant denominators; a built-in operator which is overloaded by having been applied to a user-defined datatype; communication and file access calls; and nested operations and wherein said predetermined program elements exclude conditions that can be statically evaluated during compilation, constants, and trustworthy code; ii) for each such predetermined program item indicative of breaks in the ongoing forward flow of the program assigning and recording a pre-determined numeric value to the item; and iii) summing the assigned numeric values to define a complexity index indicative of the complexity of the program.