gitbugactions / gitbug-java

A Reproducible Benchmark of Recent Java Bugs
MIT License
27 stars 9 forks source link

Class under test retrieval from the classpath of the test present in `failed_tests.classname` of the report file #22

Closed Vladislav0Art closed 8 months ago

Vladislav0Art commented 8 months ago

Is it true that for each test with a classpath of [package-path].[component]Test there is a corresponding class under test named [package-path].[component]? For example:

com.whatsapp.api.impl.WhatsappBusinessCloudApiTest -> com.whatsapp.api.impl.WhatsappBusinessCloudApi

If such a property holds it is a convenient way to retrieve the corresponding CUT to a failed test. Otherwise, what are the intended strategy for retrieving CUTs of the failed tests?

andre15silva commented 8 months ago

AFAIU, that is the most commonly followed convention in at least maven projects: XXXTest.java includes the unit tests for class XXX.java

If such a property holds it is a convenient way to retrieve the corresponding CUT to a failed test. Otherwise, what are the intended strategy for retrieving CUTs of the failed tests?

We do not have an answer to this, however. GitBug-Java ships bugs from different projects and only looks at test results. We do not analyze which methods/classes each test is testing.

Since the included bugs come from different projects you would have to verify yourself if all of them follow the aforementioned convention.