A Dependence Clusters Detection Method Based on Higher-Order Function Summary
Dependence clusters are the largest sets of interdependent program components,where any change in one point of the cluster can trigger a chain reaction in other components.In practical production environments,detecting depen-dence clusters is of great importance for software understanding,testing,and maintenance.Traditional dependence cluster de-tection methods rely on the system dependence graph(SDG)to calculate dependencies,However,constructing an SDG is a complex process that incurs significant time and space costs when analyzing large programs.In order to improve the efficien-cy of cluster detection,this paper proposes a light-weight and efficient dependence cluster detection method based on higher-order functions,which can avoid constructing SDG in the analysis.This method constructs a function summary in the form of a higher-order function for each procedure,where the data dependencies of formal parameters and global variables are used to initialize the dependence inside the procedure.The dependence cluster information between procedures can be obtained by in-stantiating the function summary and passing the dependence through summary parameters at the call site,which avoids the construction of an SDG.To further improve the analysis efficiency of the higher-order function-based detection method,we propose an optimization strategy based on adaptive computing,which significantly reduces the redundant calculations caused by the mutual recursive calls between functions.In the end,we select benchmark test sets with different scales and fields and conduct relevant experiments,which demonstrate that the proposed program dependence cluster detection method based on higher-order functions can improve analysis efficiency by 268.9%and reduce space usage by 35.7%compared with the detec-tion method based on SDG.The optimization strategy based on adaptive computing can reduce redundant calculations by 56.7%and improve analysis efficiency by 23.9%compared with the method based on higher-order functions.