A Code Embedding-Based Java Software Risk Detection Method
Software risk detection is a critical aspect of ensuring software security and reliability. However, challenges remain in effectively capturing complex structural and semantic relationships in source code, modeling latent risk patterns, and integrating diverse code representation techniques. To address these issues, this paper proposes a Java software risk detection method based on code embedding techniques. We leverage Abstract Syntax Trees (ASTs) for structural code representation, CodeBert for capturing semantic information in source code, and Latent Dirichlet Allocation (LDA) for modeling latent risk topics. The proposed method integrates syntactic, semantic, and contextual information to assess and detect potential risks in Java code. We evaluate the method on benchmark datasets, where our MLP-based detection model outperforms traditional classification models. Ablation studies demonstrate the critical contributions of CodeBert and LDA in enhancing code embeddings. Additionally, parameter sensitivity experiments validate the method’s robustness in detecting subtle risk indicators within complex code structures. The results highlight the effectiveness of our approach in improving Java software security, offering a reliable and practical solution for real-world software risk detection.
Authors
- Hanyu Rao
- Xiaojun Shen (ORCID: https://orcid.org/0000-0003-1951-0927)
- Ling Wang (ORCID: https://orcid.org/0000-0002-1091-184X)
- Yiliang Wang (ORCID: https://orcid.org/0000-0003-2039-7132)
- Kun Tong (ORCID: https://orcid.org/0000-0002-1697-4681)
- Chen Zhang (ORCID: https://orcid.org/0000-0001-9045-9269)
Institutions
- State Grid Corporation of China (China) (CN)
- Zhejiang Lab (CN)
- Beihang University (CN)
Publication Details
- Published
- 2025-05-09
- DOI
- https://doi.org/10.1109/ids66066.2025.00010
- Primary Topic
- Advanced Malware Detection Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00