Here is our customized version of IDEAL, which, in addition to its basic features, provides the ability to detect linguistic antipatterns in Python files. The types of linguistic antipatterns that can be identified through the analysis of the Python language are:
- Not implemented Condition: The comments of a method suggest a conditional behaviour that is not implemented in the code. When the implementation is default this should be documented.
- Attribute Singature and Comment are Opposite: The declaration of an attribute contradicts its documentation.
- Method Signature and Comment are Opposite: The declaration of a method is in contradiction with its documentation.
Docker (recommended)
- Clone the repository
-
Build the Dockerfile
docker build . -t ideal -
Provide the files you wish to analyze in the file src/apps/IDEAL/input.csv
The files you want to analyze should be located in the project's folder or in a mounted volume. The container path /app contains the project's root -
Run the container and mount the root folder to use files from the host directly in the container
Windows:docker run -v "%cd%":/app -it ideal
Linux:docker run -v ./:/app -it ideal
Manual Installation
Note: The following steps have been verified on a Windows 10 operating system.- Install Git
- Install Java JDK
- Install Python 3.7.1
- Install srcML 1.0.0
- Download Stanford JARs 4.2.0
- Clone the repository
-
Install virtual environment:
py -m pip install --user virtualenv -
Create virtual environment:
py -m venv venv -
Activate virtual environment:
.\venv\Script\activate -
Install packages from requirements files:
py -m pip install -r requirements.txt -
Download NLTK data. Enter the following commands:
pythonimport nltknltk.download('wordnet')nltk.download('punkt')quit()
- Update all paaths in config file: src/common/config.txt
-
Update all paths in the run command file: src/apps/IDEALrun.cmd
-
Update all paths in the project config file: src/apps/IDEAL/project1.config
-
Create input.csv file and add paths to the source code files/directories
- Move into src/apps/IDEAL and run:
- Windows: run.cmd
- Linux: run.sh
- See the results of analysis in the file: src/apps/IDEAL/IDEAL_Results.csv
Developers must comprehend the code they will maintain, meaning that the code must be legible and reasonably self-descriptive. Unfortunately, there is still a lack of research and tooling that supports developers in understanding their naming practices; whether the names they choose make sense, whether they are consistent, and whether they convey the information required of them. In this paper, we present IDEAL, a tool that will provide feedback to developers about their identifier naming practices. Among its planned features, it will support linguistic anti-pattern detection, which is what will be discussed in this paper. IDEAL is designed to, and will, be extended to cover further anti-patterns, naming structures, and practices in the near future. IDEAL is open-source and publicly available, with a demo video available at: https://youtu.be/fVoOYGe50zg
The results of our evaluation of IDEAL is available here.
Examples of naming violations currently detected by IDEAL are available here.
Details around the architecture of IDEAL is available here.
If you are using IDEAL in your research, please cite the following paper:
Anthony Peruma, Venera Arnaoudova, and Christian D. Newman, "IDEAL: An Open-Source Identifier Name Appraisal Tool," 37th IEEE International Conference on Software Maintenance and Evolution (ICSME 2021), Luxembourg City, Luxembourg, September 27 - October 1, 2021.