错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Design Pattern Representation and Detection Based on Heterogeneous Information Network

  • Tao Lu,
  • Xiaomeng Wang,
  • Tao Jia

摘要

Design patterns (DPs) represent an abstract design approach and are commonly reflected in software code. Design pattern detection (DPD) can help programmers quickly grasp the main structure of the code, thereby reducing the difficulty of software understanding. Micro-structures (MSs), are basic components of the code, have smaller granularity and clearer semantics, and can be used for the DPD task. This paper proposes a syntax-independent code design semantic representation method based on the heterogeneous information network (HIN). A representation and classification of micro-structures is given based on meta-paths of HIN, based on which a DP can be decomposed into MSs. The DPD procedure is then implemented through three steps of DP decomposition, MS matching and MS combination. The method is evaluated on three open-source systems with four other detection tools. The results show that our approach effectively detects DP instances and alleviates the variant problem, which also shows the great potential of applying network science methods to software engineering.