Title: Fuzzing is generating a false test for Random · Issue #1135 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Fuzzing is generating a false test for Random · Issue #1135 · UnitTestBot/UTBotJava
X Title: Fuzzing is generating a false test for Random · Issue #1135 · UnitTestBot/UTBotJava
Description: Description Fuzzing is generating a test for Random without mocks - when Mock everything outside class is checked. The test asserts the value returned by Random and fails. To Reproduce Run a project in IntelliJ Idea 2022.1.3 - 2022.2.2 I...
Open Graph Description: Description Fuzzing is generating a test for Random without mocks - when Mock everything outside class is checked. The test asserts the value returned by Random and fails. To Reproduce Run a projec...
X Description: Description Fuzzing is generating a test for Random without mocks - when Mock everything outside class is checked. The test asserts the value returned by Random and fails. To Reproduce Run a projec...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/1135
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fuzzing is generating a false test for Random","articleBody":"**Description**\r\n\r\nFuzzing is generating a test for Random without mocks - when Mock everything outside class is checked. \r\nThe test asserts the value returned by Random and fails.\r\n\r\n**To Reproduce**\r\n\r\n1. Run a project in IntelliJ Idea 2022.1.3 - 2022.2.2\r\n2. Install [RC plugin build](https://github.com/UnitTestBot/UTBotJava/actions/runs/3217740096) \r\n3. Set Fuzzing to 100% (in File -\u003e Settings -\u003e Tools -\u003e UnitTestBot)\r\n4. Generate tests with UnitTestBot for utbot-sample/src/main/java/org/utbot/examples/mock/MockRandomExamples.java\r\nfor useSecureRandom() - check Mock everything outside class. \r\n\r\n**Expected behavior**\r\n\r\nThere should be only valid tests generated.\r\n\r\n*Possible solutions*\r\n\r\nFuzzer can use mock Random(?)\r\nGenerated tests should be double-checks that they return same results(?)\r\nother solution(?)\r\n\r\n**Actual behavior**\r\n\r\nFuzzing is generating a test for Random without mocks. It asserts the value returned by Random and fails.\r\n\r\n**Visual proofs**\r\n\r\nThe following test is generated by Fuzzer:\r\n\r\n```java\r\n ///region FUZZER: SUCCESSFUL EXECUTIONS for method useSecureRandom()\r\n\r\n @Test\r\n @DisplayName(\"useSecureRandom: arg_0 = MockRandomExamples() -\u003e return 1\")\r\n public void testUseSecureRandomReturnsOne() {\r\n MockRandomExamples mockRandomExamples = new MockRandomExamples();\r\n\r\n int actual = mockRandomExamples.useSecureRandom();\r\n\r\n assertEquals(1, actual);\r\n }\r\n ///endregion\r\n\r\n```\r\n\r\n**Environment**\r\n\r\nWindows 10 Pro\r\nIntelliJ IDEA 2022.2.2\r\n\r\n**Additional context**\r\n\r\n_Originally posted by @alisevych in https://github.com/UnitTestBot/UTBotJava/issues/1102#issuecomment-1269804477_\r\n ","author":{"url":"https://github.com/alisevych","@type":"Person","name":"alisevych"},"datePublished":"2022-10-11T13:02:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1135/UTBotJava/issues/1135"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:692f6802-6661-577c-163b-9df6ff04335f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D838:3F54A8:2890A2:357696:698E5DC9 |
| html-safe-nonce | 6c78cd7545bd12f03e23bf68cd0e09882fff1685e6609a54a27861709d43785b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODM4OjNGNTRBODoyODkwQTI6MzU3Njk2OjY5OEU1REM5IiwidmlzaXRvcl9pZCI6IjI2NDYwMTUxMjI2NDQ5MDQ0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 65f6f0b82c9bb84cae7ee6753bc21633f9252acc04fe07afb7939c34abbb7c3c |
| hovercard-subject-tag | issue:1404607173 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/UnitTestBot/UTBotJava/1135/issue_layout |
| twitter:image | https://opengraph.githubassets.com/042b4ad273bcee6a0cc005cbcb9f98dc76fdf8b2bb33d514385070ea6c4fb7cd/UnitTestBot/UTBotJava/issues/1135 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/042b4ad273bcee6a0cc005cbcb9f98dc76fdf8b2bb33d514385070ea6c4fb7cd/UnitTestBot/UTBotJava/issues/1135 |
| og:image:alt | Description Fuzzing is generating a test for Random without mocks - when Mock everything outside class is checked. The test asserts the value returned by Random and fails. To Reproduce Run a projec... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alisevych |
| hostname | github.com |
| expected-hostname | github.com |
| None | 666e30cc1de8ebdf458084bf731e95deba4f074a5008f91b50803aa9a71e3725 |
| turbo-cache-control | no-preview |
| go-import | github.com/UnitTestBot/UTBotJava git https://github.com/UnitTestBot/UTBotJava.git |
| octolytics-dimension-user_id | 87413538 |
| octolytics-dimension-user_login | UnitTestBot |
| octolytics-dimension-repository_id | 480810501 |
| octolytics-dimension-repository_nwo | UnitTestBot/UTBotJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 480810501 |
| octolytics-dimension-repository_network_root_nwo | UnitTestBot/UTBotJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f2d67bd549813f8aceb31f205ebdb434e9d46d38 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width