Prevalence of Code Smells in Reinforcement Learning Projects

03/17/2023
by   Nicolás Cardozo, et al.
0

Reinforcement Learning (RL) is being increasingly used to learn and adapt application behavior in many domains, including large-scale and safety critical systems, as for example, autonomous driving. With the advent of plug-n-play RL libraries, its applicability has further increased, enabling integration of RL algorithms by users. We note, however, that the majority of such code is not developed by RL engineers, which as a consequence, may lead to poor program quality yielding bugs, suboptimal performance, maintainability, and evolution problems for RL-based projects. In this paper we begin the exploration of this hypothesis, specific to code utilizing RL, analyzing different projects found in the wild, to assess their quality from a software engineering perspective. Our study includes 24 popular RL-based Python projects, analyzed with standard software engineering metrics. Our results, aligned with similar analyses for ML code in general, show that popular and widely reused RL repositories contain many code smells (3.95 the projects' maintainability. The most common code smells detected are long method and long method chain, highlighting problems in the definition and interaction of agents. Detected code smells suggest problems in responsibility separation, and the appropriateness of current abstractions for the definition of RL algorithms.

READ FULL TEXT
research
06/05/2023

A General Perspective on Objectives of Reinforcement Learning

In this lecture, we present a general perspective on reinforcement learn...
research
04/06/2021

Why? Why not? When? Visual Explanations of Agent Behavior in Reinforcement Learning

Reinforcement Learning (RL) is a widely-used technique in many domains, ...
research
07/01/2021

Distilling Reinforcement Learning Tricks for Video Games

Reinforcement learning (RL) research focuses on general solutions that c...
research
12/17/2018

An Atari Model Zoo for Analyzing, Visualizing, and Comparing Deep Reinforcement Learning Agents

Much human and computational effort has aimed to improve how deep reinfo...
research
06/27/2019

From self-tuning regulators to reinforcement learning and back again

Machine and reinforcement learning (RL) are being applied to plan and co...
research
12/12/2022

Evaluating Model-free Reinforcement Learning toward Safety-critical Tasks

Safety comes first in many real-world applications involving autonomous ...
research
07/10/2019

Executability of Python Snippets in Stack Overflow

Online resources today contain an abundant amount of code snippets for d...

Please sign up or login with your details

Forgot password? Click here to reset