scieee AI-readable full text Open interactive document viewer

Analyzing Dependency Distribution Changes Arising from Code Smell Interactions

Zhang, Zushuai; Wen, Elliott; Tempero, Ewan

Abstract

This replication package includes the complete dataset used in the paper (in ReplicationPackage.7z), along with the code and instructions needed to fully reproduce the results. Please read the README.pdf file first.

Full text

Please download and extract the ReplicationPackage file before proceeding. Purpose of Each File implementation_details.pdf Contains details on code smell definitions, metric definitions, chosen thresholds for each metric, and detection rules. sizeInfo.csv Contains the number of each code smell and the number of each dependency for each system. sizeInfo2.csv Includes the measurements for NOC, NOM, and LOC metrics for each system. project_info.csv Includes information for the 116 projects we selected. projects This folder contains the dataset for each of the 116 systems, as well as the Union dataset (aggregated_project subfolder). Each dataset is stored in a separate subfolder under the projects folder. SampleOutput The selected code smell instances that we manually verified. code This folder contains the source code used for replication purposes. We demonstrate how to run the code and reproduce the results presented in the paper. The program output will also be stored in this folder. ReplicationInstructions.md The instructions for running the code and fully replicating our results. Some cells in the CSV files are very long and may exceed the cell-length limits of many applications that can view CSV files. We recommend using EmEditor (https://www.emeditor.com/) for viewing. Project Subfolder Structure Each project subfolder contains four main folders (except for aggregated_project): CodeSmells, Dependencies, Interrelations, how_frequent_interact and Comparison. The other folders contain intermediate results. CodeSmells This folder contains CSV files with information on code smells and non-code smells, including details such as smell labels and the fully qualified names of the smelly artifacts. An empty CSV file indicates that certain code smells are absent. To simplify implementation, we use the reverse of a string to represent non-code smells. For example, for "God Class" (GC), GC represents the God Class, while CG represents the non-God Class. The naming conventions are as follows: Brain Class: BC Non Brain Class: CB Brain Method: BM Non Brain Method: MB Data Class: DC Non Data Class: CD Feature Envy: FE Non Feature Envy: EF God Class: GC Non God Class: CG Dependencies This folder contains CSV files with dependency information, such as the relations, source artifact types, and target artifact types. An empty CSV file indicates the absence of certain dependencies. The dependency relations are encoded as follows: Call: cl Create: ce Contain: cn Cast: ct Use: ue Throws: ts Return: rn Parameter: pr Extend: ed Implement: it The types of artifacts are encoded as (we assigned the root artifact type here, and in our code, we further assign the artifact type at the leaf of the hierarchy): Class: c Callable: a Field: f For example, the file pr_a2c.csv contains all parameter dependencies from a callable to a class. Interrelations The interaction set for each interaction type (e.g., BC-BM.csv). For each pair of interacting smelly artifacts, we include the set of all static dependencies that connect them. how_frequent_interact Contains the interaction frequency for each pair of code smells, stored as a matrix in how_frequent_interact/direct_interaction_matrix.csv. Comparison This folder contains the results of general and specific analyses, such as p-values, effect sizes, dependency counts, and the median number of dependencies. An empty CSV file indicates that the interaction set is empty for the given interaction type. Within this folder, there are 10 subfolders, each corresponding to a code smell pair. Each subfolder contains two additional subfolders: rows_direct_interact_same_class: for cases where the code smells appear in the same class. rows_direct_interact_different_class: for cases where the code smells appear in different classes. Each of these subfolders contains six CSV files, except for aggregated_project, which has 12 (more details below). For example, in BC-BM/rows_direct_interact_different_class folder, the following six CSV files are included: BC-BM--BC-MB.csv: Specific analysis for (BC->BM) vs. (BC->nonBM). BM-BC--MB-BC.csv: Specific analysis for (BM->BC) vs. (nonBM->BC). BC-BM--CB-BM.csv: Specific analysis for (BC->BM) vs. (nonBC->BM). BM-BC--BM-CB.csv: Specific analysis for (BM->BC) vs. (BM->nonBC). BC-BM--BC-MB-all-dependency-both-direction.csv: General analysis for (BC-BM) vs. (BC-nonBM), considering both directions and all dependencies. BC-BM--CB-BM-all-dependency-both-direction.csv: General analysis for (BC-BM) vs. (nonBC-BM), considering both directions and all dependencies. In these CSV files, the mann_whitney_p column reports the p-values from the Mann-Whitney U tests, and the delta column reports the corresponding Cliff’s delta values. Union Dataset (aggregated_project folder in projects directory) The difference between aggregated_project and the other project folders is that the aggregated_project folder does not contain a Dependencies subfolder. Since the interactions have already been analyzed in each individual project, we can simply combine the interaction sets. Another difference lies in the Comparison folder: For each code smell pair and relative location, there are six additional CSV files (12 in total). The names of these files match the ones introduced above but include the suffix "-project-comparison". These CSV files combine information from all projects for each specific dependency type, as well as for the total number of dependencies, to provide an overview. For example: BC-BM/rows_direct_interact_different_class/BC-BM--BC-MB-project-comparison.csv combines information for each dependency type found in the specific analysis of (BC->BM) vs. (BC->nonBM) in different classes (BC-BM--BC-MB.csv file). BC-BM--BC-MB-project-comparison.csv has the same number of rows as BC-BM--BC-MB.csv, but each row includes additional columns with combined information from all projects.