Identifying use cases in source code
Lu Zhang,Tao Qin,Zhiying Zhou,Dan Hao,Jiasu Sun
DOI: https://doi.org/10.1016/j.jss.2006.02.032
IF: 3.5
2006-01-01
Journal of Systems and Software
Abstract:Understanding the behavior of a software system is an important problem in software maintenance. As use cases have been accepted as an effective means for describing behavioral requirements for a software system, it should be helpful for maintainers to acquire the use case model from source code. In this paper, we propose a novel approach to identifying use cases in source code. The central idea of our approach is based on the observation that branch statements are a primary mechanism to separate one use case from another in source code. Following this idea, we design a static representation of software systems through incorporating branch information into the traditional call graph, which is named the Branch-Reserving Call Graph (BRCG). To effectively use this representation for use case identification, branches that do not serve as the separations of use cases should be pruned off in the BRCG. In this paper, we also provide a metric-based heuristic to automate this pruning. From the pruned BRCG, use cases, which may just undergo some modifications from human experts, can be generated through traversing the pruned BRCG. Overall, our method can effectively reduce the intensive human involvement in use case identification. We have also performed two case studies for this method on two shareware systems. The results from the case studies can confirm the effectiveness of our approach.