JEdit and PDFSam OSS: Maintenance, Evolution, Code Smell Detection, and Refactoring



Team: Gururaj Mulay and Abhimanyu Chawala

Introduction:

We worked on two open source softwares - JEdit and PDFSam. JEdit is a free and open source mature text editor. PDFsam is also a free and open source application to split, merge, extract pages, rotate and mix PDF files. I have summarized the work we did as a part of Software Maintenance and Evolution class assignments below. The goal of these series of assignment was to familiarize ourselves with the process of software maintenance, evolution, code smell detection, and refactoring the software to get rid of code smells.


1. Software Maintenance and Evolution:

We implemented four change requests: two for JEdit and two for PDFSam. Both software systems are written in Java. Below are the detailed reports on each of four change requests. You can find the source code for these change requests in the Github forks links at the top of this page.


2. Software Quality & Code Smells:

In this section, we analyze the code quality of JEdit and PDFsam. We measure and understand different code metrics, such as cohesion and coupling, and explain code smells detected in both systems. There are several tools or plugins that help detect code smells so that you don't have to do it manually. For example, Eclipse plugins such as Metrics3 and JDeodorant.

Analysing Code Metrics:

  • Compute various code metrics for the original version of both the softwares.
  • Compute the same code metrics for our modified version of both the softwares.
  • Identify changed metrics and explain what constituted those changes.

Coupling and Cohesion:

  • For both the modified softwares, find two classes with highest cohesion
  • For both the modified softwares, find two classes with highest coupling
  • Identify type of cohesion or coupling and explain why.

Detect Code Bad Smells using JDeodorant:

For each modified software, we select one smelly class/method detected by JDeodorant for three different smells (details in the report below). In total, we select six smelly classes/methods. Then, for each smelly code component:

  • Describe the smell.
  • Explain why the method/class is flagged as smelly.

Below is the detailed reports on this section which analyses software quality and code smells.


3. Refactoring OSS (JEdit and PDFsam):

With first section involving implementation of change requests, we familiarized ourselves with the functionality, design, and internal structure of JEdit and PDFsam. Then we assessed the quality of both systems by measuring some of their code properties and by detecting some of their code smells. In this section, we attempt to improve the code quality of these modified software systems by refactoring their code to remove bad smells.

Automatic and Manual Refactoring:

  • Refactor two smelly code components of each software system using automatic refactoring tools available in Eclipse IDE.
  • Refactor two smelly code components of each software system manually.
  • Describe the refactoring in details with rationale of the chosen refactoring operations.

Below is the detailed reports on this section which analyses software quality and code smells.


Note: Some of the content for this post is taken from course material of CS581 (CSU) written by Prof. Laura Moreno.