Update README.md
Browse files
README.md
CHANGED
@@ -393,30 +393,32 @@ tags:
|
|
393 |
---
|
394 |
|
395 |
## Dataset Description
|
396 |
-
Microsoft created the methods2test dataset, consisting of Java Junit test cases with
|
397 |
-
It contains 780k pairs of JUnit test cases and focal methods which were extracted from a total of 91K
|
398 |
-
Java open source project hosted on GitHub.
|
399 |
|
400 |
-
This is smaller subset of the assembled version of the methods2test dataset.
|
401 |
It provides convenient access to the different context levels based on the raw source code (e.g. newlines are preserved). The test cases and associated classes are also made available.
|
402 |
The subset is created by randomly selecting only one sample from each of the 91k projects.
|
403 |
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
More information could be found here:
|
408 |
- [methods2test Github repo](https://github.com/microsoft/methods2test)
|
409 |
- [Methods2Test: A dataset of focal methods mapped to test cases](https://arxiv.org/pdf/2203.12776.pdf)
|
410 |
|
411 |
## Dataset Schema
|
412 |
```
|
413 |
t: <TEST_CASE>
|
414 |
-
t+tc: <
|
415 |
fm: <FOCAL_METHOD>
|
|
|
416 |
fm+fc: <FOCAL_CLASS_NAME> <FOCAL_METHOD>
|
|
|
417 |
fm+fc+c: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS>
|
|
|
418 |
fm+fc+c+m: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES>
|
|
|
419 |
fm+fc+c+m+f: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES> <FIELDS>
|
|
|
420 |
```
|
421 |
|
422 |
## Focal Context
|
@@ -424,41 +426,30 @@ fm+fc+c+m+f: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES
|
|
424 |
code of the focal method. Intuitively, this contains the most
|
425 |
important information for generating accurate test cases for
|
426 |
the given method.
|
427 |
-
- fm+fc: this
|
428 |
can provide meaningful semantic information to the model.
|
429 |
- fm+fc+c: this representation adds the signatures of the constructor methods of the focal class. The idea behind this
|
430 |
augmentation is that the test case may require instantiating
|
431 |
an object of the focal class in order to properly test the focal
|
432 |
method.
|
433 |
- fm+fc+c+m: this representation adds the signatures of the
|
434 |
-
other public methods in the focal class. The rationale
|
435 |
-
motivated this inclusion is that the test case may need to
|
436 |
invoke other auxiliary methods within the class (e.g., getters,
|
437 |
setters) to set up or tear down the testing environment.
|
438 |
-
- fm+fc+c+m+f
|
439 |
the focal class. The motivation is that test cases may need to
|
440 |
inspect the status of the public fields to properly test a focal
|
441 |
method.
|
442 |
|
443 |
-
|
|
|
|
|
444 |
|
445 |
The different levels of focal contexts are the following:
|
446 |
```
|
447 |
-
|
448 |
-
t+tc: test case + test class name
|
449 |
-
FM: focal method
|
450 |
fm+fc: focal method + focal class name
|
451 |
fm+fc+c: focal method + focal class name + constructor signatures
|
452 |
fm+fc+c+m: focal method + focal class name + constructor signatures + public method signatures
|
453 |
fm+fc+c+m+f: focal method + focal class name + constructor signatures + public method signatures + public fields
|
454 |
```
|
455 |
-
|
456 |
-
## Limitations
|
457 |
-
The original authors validate the heuristics by inspecting a
|
458 |
-
statistically significant sample (confidence level of 95% within 10%
|
459 |
-
margin of error) of 97 samples from the training set. Two authors
|
460 |
-
independently evaluated the sample, then met to discuss the disagreements. We found that 90.72% of the samples have a correct
|
461 |
-
link between the test case and the corresponding focal method
|
462 |
-
|
463 |
-
## Contribution
|
464 |
-
All thanks to the original authors.
|
|
|
393 |
---
|
394 |
|
395 |
## Dataset Description
|
396 |
+
Microsoft created the methods2test dataset, consisting of Java Junit test cases with their corresponding focal methods.
|
397 |
+
It contains 780k pairs of JUnit test cases and focal methods which were extracted from a total of 91K Java open-source projects hosted on GitHub.
|
|
|
398 |
|
399 |
+
This is a smaller subset of the assembled version of the methods2test dataset.
|
400 |
It provides convenient access to the different context levels based on the raw source code (e.g. newlines are preserved). The test cases and associated classes are also made available.
|
401 |
The subset is created by randomly selecting only one sample from each of the 91k projects.
|
402 |
|
403 |
+
The mapping between test case and focal methods is based on heuristics rules and Java developer's best practice.
|
404 |
+
More information can be found here:
|
|
|
|
|
405 |
- [methods2test Github repo](https://github.com/microsoft/methods2test)
|
406 |
- [Methods2Test: A dataset of focal methods mapped to test cases](https://arxiv.org/pdf/2203.12776.pdf)
|
407 |
|
408 |
## Dataset Schema
|
409 |
```
|
410 |
t: <TEST_CASE>
|
411 |
+
t+tc: <TEST_CLASS_NAME> <TEST_CASE>
|
412 |
fm: <FOCAL_METHOD>
|
413 |
+
fm+t: <FOCAL_METHOD>
|
414 |
fm+fc: <FOCAL_CLASS_NAME> <FOCAL_METHOD>
|
415 |
+
fm+fc: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <TEST_CLASS_NAME> <TEST_CASE>
|
416 |
fm+fc+c: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS>
|
417 |
+
fm+fc+c: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <TEST_CLASS_NAME> <TEST_CASE>
|
418 |
fm+fc+c+m: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES>
|
419 |
+
fm+fc+c+m: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES> <TEST_CLASS_NAME> <TEST_CASE>
|
420 |
fm+fc+c+m+f: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES> <FIELDS>
|
421 |
+
fm+fc+c+m+f+t+tc: <FOCAL_CLASS_NAME> <FOCAL_METHOD> <CONTRSUCTORS> <METHOD_SIGNATURES> <FIELDS> <TEST_CLASS_NAME> <TEST_CASE>
|
422 |
```
|
423 |
|
424 |
## Focal Context
|
|
|
426 |
code of the focal method. Intuitively, this contains the most
|
427 |
important information for generating accurate test cases for
|
428 |
the given method.
|
429 |
+
- fm+fc: this representation adds the focal class name, which
|
430 |
can provide meaningful semantic information to the model.
|
431 |
- fm+fc+c: this representation adds the signatures of the constructor methods of the focal class. The idea behind this
|
432 |
augmentation is that the test case may require instantiating
|
433 |
an object of the focal class in order to properly test the focal
|
434 |
method.
|
435 |
- fm+fc+c+m: this representation adds the signatures of the
|
436 |
+
other public methods in the focal class. The rationale that motivated this inclusion is that the test case may need to
|
|
|
437 |
invoke other auxiliary methods within the class (e.g., getters,
|
438 |
setters) to set up or tear down the testing environment.
|
439 |
+
- fm+fc+c+m+f: this representation adds the public fields of
|
440 |
the focal class. The motivation is that test cases may need to
|
441 |
inspect the status of the public fields to properly test a focal
|
442 |
method.
|
443 |
|
444 |
+
The test case along with the class name is also provided for each focal context.
|
445 |
+
|
446 |
+
![image/pdf](https://huggingface.co/datasets/andstor/methods2test/resolve/main/focal_context.png)
|
447 |
|
448 |
The different levels of focal contexts are the following:
|
449 |
```
|
450 |
+
fm: focal method
|
|
|
|
|
451 |
fm+fc: focal method + focal class name
|
452 |
fm+fc+c: focal method + focal class name + constructor signatures
|
453 |
fm+fc+c+m: focal method + focal class name + constructor signatures + public method signatures
|
454 |
fm+fc+c+m+f: focal method + focal class name + constructor signatures + public method signatures + public fields
|
455 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|