IDEAS home Printed from https://ideas.repec.org/a/baq/taprar/v4y2023i2p33-36.html
   My bibliography  Save this article

Development of an algorithm for code clone detection in source code based on abstract syntax tree

Author

Listed:
  • Yevhenii Kubiuk

    (National Technical University of Ukraine «Igor Sikorsky Kyiv Polytechnic Institute»)

  • Gennadiy Kyselov

    (National Technical University of Ukraine «Igor Sikorsky Kyiv Polytechnic Institute»)

Abstract

The object of research of this work is the algorithm for searching for duplicates in the program code based on the Abstract Syntaxes Tree (AST). The main tasks solved within the framework of this study are the detection of duplicate code and the search for vulnerabilities in the program code.The obtained results showed that the proposed algorithm is resistant to type 1 and 2 clones, which means its effectiveness in detecting similar code fragments with identical or variant text. However, for type 3 and 4 clones, the algorithm may show less efficiency due to the change in the AST structure for these types of clones.Experimental studies of the proposed algorithm showed that the algorithm can detect matches between unrelated files due to the presence of typical AST chains present in many programs. This can lead to a certain level of false positives in the detection of duplicates.Testing of the algorithm in the task of finding vulnerabilities showed that:The best recognition is observed for the «SQL injection» vulnerability, but it also has the highest number of false positives.Memory leak and null pointer dereferencing vulnerabilities are detected with equal effectiveness and false positives.«Buffer overflow» has the lowest recognition rate but fewer false positives compared to «SQL injection».The study showed that the use of AST allows for the effective detection of duplicate code and vulnerabilities in the software code. The developed tool can help software developers reduce maintenance efforts, improve code quality, and ensure software product security.

Suggested Citation

  • Yevhenii Kubiuk & Gennadiy Kyselov, 2023. "Development of an algorithm for code clone detection in source code based on abstract syntax tree," Technology audit and production reserves, PC TECHNOLOGY CENTER, vol. 4(2(72)), pages 33-36, August.
  • Handle: RePEc:baq:taprar:v:4:y:2023:i:2:p:33-36
    DOI: 10.15587/2706-5448.2023.286472
    as

    Download full text from publisher

    File URL: https://journals.uran.ua/tarp/article/download/286472/280637
    Download Restriction: no

    File URL: https://libkey.io/10.15587/2706-5448.2023.286472?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:baq:taprar:v:4:y:2023:i:2:p:33-36. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Iryna Prudius (email available below). General contact details of provider: https://journals.uran.ua/tarp/issue/archive .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.