Skip to content

antgioia/ProjectSunshine

 
 

Repository files navigation

Docker Image CI codecov Quality Gate Status

IDEAL

An Open-Source Identifier Name Appraisal Tool

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.

Usage

Docker (recommended)
  1. Clone the repository
  2. Build the Dockerfile
    docker build . -t ideal
  3. 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
  4. 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
The image is also available on DockerHub at this link.
Manual Installation Note: The following steps have been verified on a Windows 10 operating system.

Prerequisites

  1. Install Git
  2. Install Java JDK
  3. Install Python 3.7.1
  4. Install srcML 1.0.0
  5. Download Stanford JARs 4.2.0

Setup IDEAL

  1. Clone the repository
  2. Install virtual environment: py -m pip install --user virtualenv
  3. Create virtual environment: py -m venv venv
  4. Activate virtual environment: .\venv\Script\activate
  5. Install packages from requirements files: py -m pip install -r requirements.txt
  6. Download NLTK data. Enter the following commands:
    1. python
    2. import nltk
    3. nltk.download('wordnet')
    4. nltk.download('punkt')
    5. quit()

  7. Update all paaths in config file: src/common/config.txt

Configure and Run IDEAL For Project

  1. Update all paths in the run command file: src/apps/IDEALrun.cmd
  2. Update all paths in the project config file: src/apps/IDEAL/project1.config
  3. Create input.csv file and add paths to the source code files/directories
  4. Move into src/apps/IDEAL and run:
    1. Windows: run.cmd
    2. Linux: run.sh
  5. See the results of analysis in the file: src/apps/IDEAL/IDEAL_Results.csv

Abstract

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

Evaluation Results

The results of our evaluation of IDEAL is available here.

Naming Violation Examples

Examples of naming violations currently detected by IDEAL are available here.

IDEAL Architecture

Details around the architecture of IDEAL is available here.

Naming Violations

Cite IDEAL

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.

About

IDEAL - An Open-Source Identifier Name Appraisal Tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.4%
  • Dockerfile 0.8%
  • Java 0.3%
  • C# 0.3%
  • Shell 0.1%
  • Batchfile 0.1%