Skip to content

Commit c77067b

Browse files
committed
add Guideline
1 parent af3ce4b commit c77067b

2 files changed

Lines changed: 91 additions & 0 deletions

File tree

Guideline.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Guideline
2+
3+
## Labeling Objective
4+
_Given a code change and a bug type, label whether the code change is a **untangled** and **correct** fix for the bug type or not. If yes, briefly summarize the fix._
5+
6+
- Criteria 1: The code change must be **untangled** which means all the modifications are only made for bug fixing.
7+
- Criteria 2: The code change must be **correct** which means it can be explained why the fix works.
8+
9+
## Example: Fixes for Improper String Comparison
10+
11+
Bug Description
12+
13+
> A String is being converted to upper or lowercase, using the platform's default charset. A charset should be specified instead, otherwise it results in improper conversions.
14+
15+
### Example #1
16+
17+
- Code Change:
18+
19+
```
20+
diff --git a/util/src/main/java/com/psddev/dari/util/FormTag.java b/util/src/main/java/com/psddev/dari/util/FormTag.java
21+
index b473a60a..4d974c93 100644
22+
--- a/util/src/main/java/com/psddev/dari/util/FormTag.java
23+
+++ b/util/src/main/java/com/psddev/dari/util/FormTag.java
24+
@@ -5,0 +6 @@ import java.util.LinkedHashMap;
25+
+import java.util.Locale;
26+
@@ -174 +175 @@ public class FormTag extends TagSupport implements DynamicAttributes {
27+
- "method", method.toLowerCase(),
28+
+ "method", method.toLowerCase(Locale.ENGLISH),
29+
```
30+
31+
- Label: **Yes**
32+
- Reason: The code change is ONLY for bug fixing and specify `Locale.ENGLISH` to `toLowerCase()`.
33+
34+
### Example #2
35+
36+
- Code Change:
37+
38+
```diff
39+
diff --git a/src/main/java/br/com/dbsoft/io/DBSDAO.java b/src/main/java/br/com/dbsoft/io/DBSDAO.java
40+
index 70c275b..6ea36fb 100644
41+
--- a/src/main/java/br/com/dbsoft/io/DBSDAO.java
42+
+++ b/src/main/java/br/com/dbsoft/io/DBSDAO.java
43+
@@ -1173 +1173 @@ public class DBSDAO<DataModelClass> extends DBSDAOBase<DataModelClass> {
44+
- xMetaData = DBSIO.getTableColumnsMetaData(this.getConnection(), wCommandTableName);
45+
+ xMetaData = DBSIO.getTableColumnsMetaData(this.getConnection(), wCommandTableName.toUpperCase());
46+
```
47+
48+
- Label: **No**
49+
- Reason: The code change only add a call of the method `toUpperCase()` and does not fix the bug.
50+
51+
52+
## Data Folder Structure
53+
```
54+
ROOT
55+
│ Guideline.pdf
56+
└───bug1
57+
│ │ BUG_DESCRIPTION.html // bug description
58+
│ └───instance1 // named as code change’s unique id
59+
│ │ diff.txt // diff between buggy and fixed version
60+
│ │ pair.info // meta information of the code change
61+
│ │ comMsg.txt // commit message of the code change
62+
│ │ label.csv // file with label result
63+
│ └───old // buggy version of the Java file
64+
│ │ │ [OLD_FILE].java
65+
│ └───new // fixed version of the Java file
66+
│ │ │ [NEW_FILE].java
67+
│ └───instance2
68+
│ │ ...
69+
│ └─── ...
70+
└───bug2
71+
│ └─── ...
72+
└─── ...
73+
```
74+
75+
**Note**:
76+
77+
- Commit messages of the code changes are also provided. Thus, it can also be leveraged as an evidence sometimes. For example, if the commit message already mentions code change is performed with multiple purposes, e.g., _"Bug fix and add new feature..."_, then the code change can be labeled as **No** directly.
78+
- Links like Github issue or pull request which may referenced in commit message are helpful sometimes, because bug is detailed in those Github pages. Thus, you are encouraged to check those pages if metioned.
79+
80+
## Procedure
81+
For each bug type _bug<sub>i</sub>_,
82+
83+
1. Read the bug description in the file _BUG\_DESCRIPTION.html_ to get a basic understanding of natural of _bug<sub>i</sub>_.
84+
2. Follow the sequence of code change ID in _label.csv_, check each of them successively. For each code change _C<sub>i</sub>_,
85+
1. Read the diff file _diff.txt_ to know the code changes of _C<sub>i</sub>_.
86+
2. Identify if _C<sub>i</sub>_ is untangled or not. (see criteria as follow).
87+
3. Record the result in _label.csv_. Also, briefly write down the reason for your judgment. Especially if it is untangled, briefly describe the solution. **Label as `U` (short for "Uncertain") if unsure**.
88+
89+
**Note**, please take at least 10-mins break for every half an hour to mitigate tiredness factor.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ index c9ff80d..8b733ad 100755
3131
| | | Total | 1,023 |
3232

3333

34+
## Label
3435

36+
* [Guideline](Guideline.md)

0 commit comments

Comments
 (0)