咨询与建议

看过本文的还看了

相关文献

该作者的其他文献

文献详情 >Context Is All You Need: A Hyb... 收藏

Context Is All You Need: A Hybrid Attention-Based Method for Detecting Code Design Patterns

作     者:Houichime, Tarik El Amrani, Younes 

作者机构:Mohammed V Univ Rabat Lab Software Project Management ENSIAS Rabat 10112 Morocco 

出 版 物:《IEEE ACCESS》 (IEEE Access)

年 卷 期:2025年第13卷

页      面:9689-9707页

核心收录:

主  题:Codes Transformers Vehicle dynamics Source coding Unified modeling language Transformer cores Semantics Context modeling Computer architecture Attention mechanisms Design patterns detection transformers attention mechanism feature engineering 

摘      要:Software reverse engineering plays a crucial role in identifying design patterns and reconstructing software architectures by analyzing system implementations and producing abstract representations across multiple layers. This research introduces a novel feature engineering approach that integrates both behavioral and structural analysis of code, resulting in a feature-rich sequential representation. This transformation enables the effective use of transformers and attention mechanisms to detect design patterns in source code. Our results emphasize the importance of context in distinguishing between various design patterns, demonstrating that the proposed sequence format, with its sensitivity to token order, significantly improves the model s capacity to differentiate between similar patterns. By leveraging the power of attention mechanisms, our approach efficiently discards irrelevant code elements, focusing on the most critical features for accurate patterns detection. Additionally, we show that this sequential code representation can be utilized to augment training data, leading to enhanced model accuracy. Trained on a diverse set of code samples representing all 23 GoF design patterns, sourced from repositories such as GitHub and Bitbucket, our methodology achieved an accuracy of 92%. Evaluation metrics further validate the robustness of the approach. This study underscores the potential of context-driven, feature-engineered representations in advancing design patterns detection and contributes a comprehensive new dataset that supports behavioral code analysis, setting the stage for future research in this area.

读者评论 与其他读者分享你的观点

用户名:未登录
我的评分