DACOS - Dataset
收藏资源简介:
<strong>DACOS - DAtaset of COde Smells</strong> The dataset offers annotated code snippets for three code smells— multifaceted abstraction, complex method, and long parameter list. In addition to a manually annotated dataset on potentially subjective snippets, we offer a larger set of snippets containing the snippets that are either definitely benign or smelly. The upload contains three files : DACOSMain.sql - This is the SQL file containing the main DACOS dataset. DACOSExtended.sql - This is the SQL file containing the Extended DACOS dataset. Files.zip - The zip file containing all the source code files. <strong>Required Software</strong> The dataset is created in MySQL. Hence a local or remote installation of MySQL is needed with privileges to create and modify schemas. <strong>Importing the Dataset</strong> The dataset is a self-contained SQL file. To import the dataset, run the following command: <pre><code>mysql -u username -p database_name < DACOSMain.sql mysql -u username -p database_name < DACOSExtended.sql</code></pre> <strong>Understanding the Datasets</strong> Both the datasets differ in architecture. The main dataset contains a table named annotations that contains every annotation collected from users. The sample table contains the samples presented to the user for annotation. The class_metrics and method_metrics contain the tables for class and method metrics respectively. These were used to filter samples that are likely to contain smells and hence can be shown to users. The extended dataset is created by selecting samples that are below or above the selected metric range for each smell. Hence, these samples are definitely smelly or benign. The extended version of the dataset does not contain a table for annotation since they were not presented to user. It instead has an 'entry' table where each sample is classified according to the smell it contains. The codes for identifying smells are as below: Condition smell Id Multifaceted Abstraction Present 1 Multifaceted Abstraction not detected 4 Long Parameter List Present 2 Long Parameter List Absent 5 Complex Method Present 3 Complex Method Absent 6
**DACOS——代码异味数据集(DAtaset of COde Smells)** 本数据集提供了针对三种代码异味(code smells)——多面抽象(multifaceted abstraction)、复杂方法(complex method)与长参数列表(long parameter list)——的带注释代码片段。除面向存在主观判定空间的代码片段所构建的人工标注数据集外,本数据集还提供了规模更大的片段集,其中涵盖明确无害或存在代码异味的代码片段。 本次上传包含三个文件: 1. DACOSMain.sql:存储主DACOS数据集的SQL文件; 2. DACOSExtended.sql:存储扩展DACOS数据集的SQL文件; 3. Files.zip:包含全部源代码文件的压缩包。 **所需软件** 本数据集基于MySQL构建,因此需部署本地或远程MySQL实例,且需具备创建与修改数据库模式的权限。 **数据集导入方法** 本数据集为自包含SQL文件。导入数据集请执行以下命令: mysql -u username -p database_name < DACOSMain.sql mysql -u username -p database_name < DACOSExtended.sql **数据集详情说明** 两款数据集在架构上存在显著差异。主数据集包含一张名为`annotations`的表,用于存储从用户处收集的全部标注信息;另有一张`sample`表,存储用于向用户征集标注的代码样本。`class_metrics`与`method_metrics`两张表分别存储类与方法的度量指标,二者用于筛选大概率存在代码异味的样本,以供用户标注。 扩展数据集则通过选取超出或低于各代码异味对应度量阈值范围的样本构建而成,因此此类样本要么明确存在代码异味,要么完全无害。扩展数据集未设置标注表,因该数据集的样本未向用户征集标注;其取而代之的是一张`entry`表,每条样本均根据其所包含的代码异味进行分类。 代码异味识别编码规则如下: | 代码异味类型 | 存在状态 | 编码ID | |-----------------------------|----------------|--------| | 多面抽象(Multifaceted Abstraction) | 存在 | 1 | | 多面抽象(Multifaceted Abstraction) | 未检测到 | 4 | | 长参数列表(Long Parameter List) | 存在 | 2 | | 长参数列表(Long Parameter List) | 不存在 | 5 | | 复杂方法(Complex Method) | 存在 | 3 | | 复杂方法(Complex Method) | 不存在 | 6 |



