Artificial Intelligence

Measuring cyclomatic complexity of source code using machine learning.

Apr 01, 2024

DOI: https://doi.org/10.18280/ria.380118

Published in: Revue d'Intelligence Artificielle

Publisher: Revue d'Intelligence Artificielle

/ Ayman Odeh Munther Odeh Hussein Odeh Nada Odeh

High-performance, high-quality software is a fundamental goal for all developers. To achieve this, software needs to be built with exceptional quality, featuring a simplified structure, strong coherence, and minimized complexity. Cyclomatic Complexity (CC), critical software metric, quantifies the intricacy of a program's structure and control flow. Traditionally, CC measurement has relied on laborious manual techniques or conventional programming methods, both prone to errors and inefficiency. To overcome these limitations, we present a revolutionary approach that leverages a Multinomial Naive Bayes (MNB) machine learning (ML) algorithm for automated CC measurement. This innovative method offers a more accurate, efficient, and reliable means of software complexity evaluation. Our study utilizes a vast dataset of 3,598 carefully curated programming samples from diverse programming projects across three popular languages: Java, Python, and C++. Training our MNB model on this comprehensive and diverse dataset yielded an outstanding overall accuracy of 97.3%, demonstrating the efficacy and reliability of our approach for CC measurement across different programming languages (PLs). This success can be attributed to the utilization of the NBM learning algorithm, known for its proficiency in classification tasks. Additionally, our study benefits from a larger and more diverse dataset compared to prior research, potentially contributing to the superior results. Our novel approach to CC measurement using machine learning holds significant promise for the development of more accurate and reliable code complexity assessment tools. These encouraging findings suggest that this approach has the potential to shape more effective software development practices in the future.

Other Researches

OpenCV and Its Applications in Artificial Intelligent Systems

This paper explores the utilization of OpenCV (Open-Source Computer Vision Library) in artificial intelligence (AI) systems, elucidating its pivotal role in advancing various applications across diverse domains. OpenCV, renowned for its comprehensiv...

Unmasking deepfakes: Advances in fake video detection

Deepfakes, hyper-realistic synthetic media created using artificial intelligence, pose a growing threat to trust in information and online interactions, serious challenge to the integrity of digital content. This paper delves into the evolving lands...

Exploring Ai Innovations in Automated Software Source Code Generation: Progress, Hurdles, And Future Paths

Artificial Intelligence (AI), as one of the most important fields of computer science, plays a significant role in the software development life cycle process, especially in the implementation phase, where developers require considerable effort to c...

A Comparative Review of AI Techniques for Automated Code Generation in Software Development: Advancements, Challenges, and Future Directions.

–Artificial Intelligence (AI), as one of the most important fields of computer science, plays a significant role in the software development life cycle process, especially in the implementation phase, where developers require considerable ef...

AI Methods Used for Spam Detection in Social Systems – an overview

Over the past few years, AI has emerged as a formidable asset in the battle against spam. AI approaches have demonstrated their potential in improving spam detection in social systems. The importance of AI methods lies in their flexibility and abili...

Enhancement Of Pre-Trained Deep Learning Models To Improve Brain Tumor Classification

The early detection of brain tumors is crucial due to their highly dangerous nature and the potential for life-threatening consequences if left undiagnosed. Brain tumors significantly shorten life expectancy and cause extensive damage. To accur...

Machine Learning Model for Measuring Cyclomatic Complexity of Source Code

Software developers strive to build high-performance and quality software with a very high degree of coherence among its components, simplified structure, and reduced complexity. A cyclomatic complexity measure is used to identify areas of code that...

Using natural language processing for programming language code classification with Multinomial Naive Bayes

Classifying Programming Languages scripts is very important task for several reasons such as: automated analysis, code maintenance, code search, quality assurance, and code understanding; this process is similar to processing natural languages, espe...

Using Multinomial Naïve Bayes Machine Learning Method to Classify, Detect and Recognize Programming Language Source Code,

Processing programming languages are very similar to processing natural languages, especially high-level languages such as Python, Java, C#, C, C++, and others. Therefore, the natural language processing concepts can be applied as one of the most im...

Hand-written text recognition methods: Review study.

The great and rapid development of information technology, Artificial Intelligent, and its daily uses in all areas of our life, requires keeping up with distinguished software tools especially those used in data entry. The handwritten text is an imp...

Increasing the efficiency of online healthcare services software and mobile applications using artificial intelligence technology

The demand for online service applications related to our daily life increases greatly, especially those related to the field of healthcare services, and the importance of these applications during epidemic times rises significantly. This re...

Medical patient appointments management using smart software system in UAE

Taking an appointment means go to the medical center, asking about the suitable doctor for your case, spend a lot of time, or make a phone call, or take an appointment with general doctor, after that let he/she decide to which specialists you have t...

Analytical and Comparison Study of Main Web Programming Languages ASP and PHP

Web applications are growing and websites numbers are increasing, as well. At the same time the requirements on quality and performance are also increasing on the web application development. Every day new programming tools are appearing in the mark...

Online Course File Management System

In the university education process, everything is going to be online, exams, course materials, presentations, assignments, projects, and all types of quizzes; Course file is one of the most important resources used by academic staff, it takes big e...

Modeling of solar thermal cooling system in Hatta-Dubai

The use of solar power to provide cooling requirements is the most appropriate solution for UAE. In this paper, two cooling systems were designed and modelled using TRNSYS. Both systems are similar to each other with one difference which is the chil...

SOURCE CODE POTENTIAL ERRORS AND SOFTWARE QUALITY

Software developers and programmers of the computer language require large instruction for changing the source code. The purpose of this study is to analyze and measure the negative effects of source code potential errors on the quality of source co...

Software Effort and Cost Estimation using Software Requirement Specification

Process of estimating the effort required for the software development process is difficult and very complicated. There are many techniques to estimate the effort and cost of producing software, this article is based on a correct reading and mathema...

Recruiting a Quality Software Developer

Developing quality software is the main concerned of software houses and organizations as well as for clients who are demanding software applications for their business needs. Same way it is also concerned of software houses and organizations to re...

SMSCQA: System for Measuring Source Code Quality Assurance

Today software systems play a critical role in various aspects of human life, and become part of everyday life. Many of these systems are essential for the completion of day-to-day activities. The increased reliance on computer applications, and org...