<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Keywords</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Software Maintenance</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Software Evolution</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Software Refactoring</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Code Smells</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>To deal with continuous change requests and the strict time-to-market, practitioners and big companies constantly update their software systems to meet users' requirements. This practice force developers to release immature products, neglecting best practices to reduce delivery times. As a possible result, technical debt can arise, i.e., potential design issues that can negatively impact software maintenance and evolution and, in turn, increase both the time-to-market and costs. Code smells-sub-optimal design decisions identifiable by computing software metrics and providing a general overview of code quality -are common symptoms of technical debt. While previous research focused on code smells primarily considering them in the context of Java, the growing popularity of Python, particularly for developing artificial intelligence (AI)-Enabled systems, calls for additional investigations. This preliminary analysis addresses this gap by exploring the difusion of Python-specific code smells, and the activities performed by developers that induce the introduction of code smells in their systems. To perform our preliminary investigation, we selected 200 AI-Enabled systems available in the Niche dataset; We extracted 10,611 information on the releases using PyDriller, and PySmell to extract information about code smells. The results reveal several insights: 1) Code smells related to object-oriented principles are rarely detected in Python; 2) Complex List Comprehension is the most prevalent and the most long-alive smell; 3) The main activities that can induce code smells are evolutionary. This study fills a critical gap in the literature by providing empirical evidence on the evolution of code smells in Python-based AI-enabled systems.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>1. Introduction
2. Background and Related Work
This section describes the background information on Python-specific code smells. In addition,
we overview the current literature.
2.1. Background</p>
      <p>Listing 1: Example of Complex List Comprehension.
• Convert the num from string to integer;
1. Checks whether num is a multiple of 3;
2. Checks whether num has more than 2 digits;
3. Checks that the digit 5 is not contained in the original string;
4. Checks whether the square of num is a palindrome.
1 numbers_str = ["24", "15", "21", "27", "35", "40", "45", "50", "121", "363"]
2 filtered_numbers = []
3 for num in numbers_str:
4 num_int = int(num)
5 if num_int % 3 == 0:
6 if len(num) &gt;= 2:
7 if "5" not in num:
8 square = num_int ** 2
9 if str(square) == str(square)[::-1]:
10 filtered_numbers.append(square)</p>
      <p>Listing 2: Example of Complex List Comprehension refactorized.
2.2. Related Work
3. Method</p>
    </sec>
    <sec id="sec-2">
      <title>NICHE</title>
    </sec>
    <sec id="sec-3">
      <title>Random</title>
    </sec>
    <sec id="sec-4">
      <title>Sampling</title>
    </sec>
    <sec id="sec-5">
      <title>PyDriller</title>
    </sec>
    <sec id="sec-6">
      <title>Releases</title>
    </sec>
    <sec id="sec-7">
      <title>PySmell</title>
    </sec>
    <sec id="sec-8">
      <title>Research</title>
    </sec>
    <sec id="sec-9">
      <title>Question #1</title>
    </sec>
    <sec id="sec-10">
      <title>Answer RQ1</title>
    </sec>
    <sec id="sec-11">
      <title>Research</title>
    </sec>
    <sec id="sec-12">
      <title>Question #2</title>
    </sec>
    <sec id="sec-13">
      <title>Answer RQ2</title>
      <p>Û RQ1. What is the difusion of code smells in AI-Enabled systems?
Û RQ2. What are the activities that most frequently lead to the introduction of code smells
in AI-Enabled systems?
• RQ11 What is the frequency of code smells in AI-Enabled systems?
• RQ12 What is the density of code smells in AI-Enabled systems?
• RQ13 What is the variation of code smells in AI-Enabled systems?
3.1. Dataset Selection</p>
      <p>Unit Test. To ensure a good quality level, all the projects show unit tests used to verify the
correctness of the component.</p>
      <p>Starting from the initial dataset, we focused on the 400 projects labeled as “well-engineered”
and randomly selected a statistically significant sampling of 200 projects, considering a
confidence level of 95%, and a margin error of 5%.
3.2. Data Collection
3.3. Data Analysis
Long Parameter List
Long Method</p>
      <p>LPL</p>
      <p>LM</p>
      <p>Label</p>
      <p>Bug Fixing
Evolutionary Activity</p>
      <p>Refactoring</p>
      <p>Other</p>
      <p>Description</p>
      <p>A commit removes a bug in the source code
A commit that introduces a new feature in the system</p>
      <p>A commit that performs a refactoring activity</p>
      <p>A commit that does not provide suficient information to be labeled
labels—e.g., Bug-Fixing and Refactoring—because, in some cases, the commit messages referred
to more than one activity.
4. Analysis and Discussion of the Results
1000
ycenu
q
e
r
F500
0
12
cpoongLehnangSC
ii
18</p>
      <p>24
ssegagnLoeahnngC
ii
M
cabdaLLnogunnoF
it
m
38
hanneegnoLECm
i
t
l
Name Smel
52</p>
      <p>55
ongLedho
t
M
ittrsLgnoaaeLePm
r
226</p>
      <p>Code Smel Long Lambda Function for Month
ec ra un
D M J
9102− 0202− 0202−</p>
      <p>Date
n
u
J
−
7
1
0
2
p
e
S
−
7
1
0
2
ec ra un
D M J
7102− 8102− 8102−
p
e
S
−
8
1
0
2
ce ra nu
D M J
8201− 9120− 9120−
p
e
S
−
9
1
0
2
p
e
S
−
0
2
0
2
ec ra un
D M J
2020− 0221− 0221−
p
e
S
−
1
2
0
2</p>
      <p>of the variation of Python-specific code smell over time for the month.
noticed that this smell is
period from 2017 to 2023.</p>
      <p>ø
observations that are
also the longest-lived.</p>
      <p>c
e
D
−
0
2
0
2
n
u
J
−
1
2
0
2
g
u
A
−
4.4. RQ2. On the activities that led developers to introduce code smells in</p>
      <p>AI-Enabled systems
10%
''i[ft]r
g
n
o
c
a
e
R
15%
'iit]t
y
v
c
A
y
r
a
n
o
lit
u
o
v
E
'',iif
g
n
x
g
u
B
'[
70%
'iitt]
y
v
c
A
y
r
a
n
o
ilt
u
o
v
E
'[
ø Key findings of RQ 2.
5. Threats to Validity
7. Conclusion and future work</p>
      <p>Acknowledgments</p>
    </sec>
  </body>
  <back>
    <ref-list />
  </back>
</article>