You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Soot artifacts appear in test method display name #437
After that, when it comes to generation of the test method name (org.utbot.utbot.summary.name.SimpleNameBuilder#collectTags), Soot-generated name "bootstrap$" is used as-is and passed to the code generation stage.
"bootstrap$" is clearly a Soot-generated helper code, which should not be used for names seen by user.
We should avoid it by modifying collectTags method.
To Reproduce
Please, fill your step to reproduce here, is the ticket description valid?
Expected behavior
Soot and another internal artifact should not be part of display name, comments or test name
Actual behavior
Now it's a problem and depends on our internals
Additional context
it's ok just filter it, but it will great to propose an approach to avoid another internal stuff
I pulled last changes from the main branch and started debugging org.utbot.examples.collections.ListWrapperReturnsVoidTest#testRunForEach method. I put one breakpoint on line 74 in org.utbot.summary.Summarization#summary method to get jimpleBody and another one on line 150 to see the test method name generated by UTBot.
Actual behavior
Indeed, for org.utbot.examples.collections.ListWrapperReturnsVoidExample#runForEach Soot generates the same Jimple as you attached to the issue. UTBot generated 4 unit tests, here are their names: testRunForEach_ThrowNullPointerException, testRunForEach_Return0OfI, testRunForEach_Return0OfI_1, testRunForEach_Return0OfI_2.
I wrote unit tests for ListWrapperReturnsVoidExample.kt that capture the current behavior related to the generation of summary part of tests. I will open PR in an hour.
Suggestions
I would suggest two improvements for test methods naming:
Use structure type instead of its name in test method name, at least when the name consists of one character.
For example, testRunForEach_Return0OfArray instead of testRunForEach_Return0OfI;
Describe the first element of structures as firstElement, not as 0. The same about the last element.
For example, testRunForEach_ReturnFirstElementOfI instead of testRunForEach_Return0OfI.
Activity
onewhl commentedon Jul 6, 2022
Steps to reproduce:
I pulled last changes from the main branch and started debugging
org.utbot.examples.collections.ListWrapperReturnsVoidTest#testRunForEachmethod. I put one breakpoint on line 74 inorg.utbot.summary.Summarization#summarymethod to get jimpleBody and another one on line 150 to see the test method name generated by UTBot.Actual behavior
Indeed, for
org.utbot.examples.collections.ListWrapperReturnsVoidExample#runForEachSoot generates the same Jimple as you attached to the issue. UTBot generated 4 unit tests, here are their names:testRunForEach_ThrowNullPointerException,testRunForEach_Return0OfI,testRunForEach_Return0OfI_1,testRunForEach_Return0OfI_2.I wrote unit tests for
ListWrapperReturnsVoidExample.ktthat capture the current behavior related to the generation of summary part of tests. I will open PR in an hour.Suggestions
I would suggest two improvements for test methods naming:
For example,
testRunForEach_Return0OfArrayinstead oftestRunForEach_Return0OfI;For example,
testRunForEach_ReturnFirstElementOfIinstead oftestRunForEach_Return0OfI.Please, let me know what you think about it.
amandelpie commentedon Jul 7, 2022
Thanks, @onewhl, for the answer. Probably, this issue is outdated, but I agree, that we need to fix the current behavior in the test.
The improvements regarding the naming could be summarized and discussed separately.
amandelpie commentedon Jul 8, 2022
Looks like the issue is not actual anymore and the current behaviour is fixed with the PR #444