Update README.md
Browse files
README.md
CHANGED
|
@@ -40,3 +40,65 @@ tags:
|
|
| 40 |
- code
|
| 41 |
---
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
- code
|
| 41 |
---
|
| 42 |
|
| 43 |
+
## Dataset Description
|
| 44 |
+
Microsoft created this large dataset of Java Junit test cases with its corresponding focal methods.
|
| 45 |
+
It contains 780k pairs of JUnit test cases and focal methods which were extracted from a total of 91K
|
| 46 |
+
Java open source project hosted on GitHub.
|
| 47 |
+
|
| 48 |
+
The mapping between test case and focal methods are based heuristics rules and Java developer's best practice.
|
| 49 |
+
|
| 50 |
+
More information could be found here:
|
| 51 |
+
- [methods2test Github repo](https://github.com/microsoft/methods2test)
|
| 52 |
+
- [Methods2Test: A dataset of focal methods mapped to test cases](https://arxiv.org/pdf/2203.12776.pdf)
|
| 53 |
+
|
| 54 |
+
## Dataset Schema
|
| 55 |
+
```
|
| 56 |
+
target: <TEST_CASE>
|
| 57 |
+
src_fm: <FOCAL_METHOD>
|
| 58 |
+
src_fm_fc: <FOCAL_CLASS_NAME> <FOCAL_METHOD>
|
| 59 |
+
src_fm_fc_co: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS>
|
| 60 |
+
src_fm_fc_ms: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES>
|
| 61 |
+
src_fm_fc_ms_ff: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES> <FIELDS>
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Focal Context
|
| 65 |
+
- fm: this representation incorporates exclusively the source
|
| 66 |
+
code of the focal method. Intuitively, this contains the most
|
| 67 |
+
important information for generating accurate test cases for
|
| 68 |
+
the given method.
|
| 69 |
+
- fm+fc: this representations adds the focal class name, which
|
| 70 |
+
can provide meaningful semantic information to the model.
|
| 71 |
+
- fm+fc+c: this representation adds the signatures of the constructor methods of the focal class. The idea behind this
|
| 72 |
+
augmentation is that the test case may require instantiating
|
| 73 |
+
an object of the focal class in order to properly test the focal
|
| 74 |
+
method.
|
| 75 |
+
- fm+fc+c+m: this representation adds the signatures of the
|
| 76 |
+
other public methods in the focal class. The rationale which
|
| 77 |
+
motivated this inclusion is that the test case may need to
|
| 78 |
+
invoke other auxiliary methods within the class (e.g., getters,
|
| 79 |
+
setters) to set up or tear down the testing environment.
|
| 80 |
+
- fm+fc+c+m+f : this representation adds the public fields of
|
| 81 |
+
the focal class. The motivation is that test cases may need to
|
| 82 |
+
inspect the status of the public fields to properly test a focal
|
| 83 |
+
method.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
|
| 87 |
+
The different levels of focal contexts are the following:
|
| 88 |
+
```
|
| 89 |
+
FM: focal method
|
| 90 |
+
FM_FC: focal method + focal class name
|
| 91 |
+
FM_FC_CO: focal method + focal class name + constructor signatures
|
| 92 |
+
FM_FC_MS: focal method + focal class name + constructor signatures + public method signatures
|
| 93 |
+
FM_FC_MS_FF: focal method + focal class name + constructor signatures + public method signatures + public fields
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
## Lmitations
|
| 97 |
+
The original authors validate the heuristics by inspecting a
|
| 98 |
+
statistically significant sample (confidence level of 95% within 10%
|
| 99 |
+
margin of error) of 97 samples from the training set. Two authors
|
| 100 |
+
independently evaluated the sample, then met to discuss the disagreements. We found that 90.72% of the samples have a correct
|
| 101 |
+
link between the test case and the corresponding focal method
|
| 102 |
+
|
| 103 |
+
## Contribution
|
| 104 |
+
All the thanks to the original authors.
|