Title: Test with comment 'This test fails because ... java.lang.ArithmeticException' does not fail · Issue #1272 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Test with comment 'This test fails because ... java.lang.ArithmeticException' does not fail · Issue #1272 · UnitTestBot/UTBotJava
X Title: Test with comment 'This test fails because ... java.lang.ArithmeticException' does not fail · Issue #1272 · UnitTestBot/UTBotJava
Description: Description UTBot could find situations which leads to arithmetic overflow and generate tests for such cases adding comment that such test would fail, but actually such test pass. To Reproduce Steps to reproduce the behavior: Open utbot ...
Open Graph Description: Description UTBot could find situations which leads to arithmetic overflow and generate tests for such cases adding comment that such test would fail, but actually such test pass. To Reproduce Step...
X Description: Description UTBot could find situations which leads to arithmetic overflow and generate tests for such cases adding comment that such test would fail, but actually such test pass. To Reproduce Step...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/1272
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Test with comment 'This test fails because ... java.lang.ArithmeticException' does not fail","articleBody":"**Description**\r\n\r\nUTBot could find situations which leads to arithmetic overflow and generate tests for such cases adding comment that such test would fail, but actually such test pass.\r\n\r\n**To Reproduce**\r\n\r\nSteps to reproduce the behavior:\r\n\r\n1. Open `utbot` project in IntelliJ Idea\r\n2. In UTBot settings set `Overflow detection:` to `Treat overflows as errors`\r\n3. Set `Test generated method` to 100 % `Symbolic`\r\n4. Generate tests for `org.utbot.examples.math.OverflowExamples#intOverflow` method\r\n5. Open the generated test\r\n\r\n**Expected behavior**\r\n\r\nEither UTBot generates test which causes ArithmeticException during execution \r\nOr it doesn't write that test should fail\r\n\r\n**Actual behavior**\r\n\r\nTest which are supposed to generate errors are generated, but during execution they pass.\r\n\r\nSample of such test:\r\n```java\r\n @Test\r\n @DisplayName(\"intOverflow: x * x * x \u003e 0 -\u003e ThrowArithmeticException\")\r\n public void testIntOverflow_ThrowArithmeticException() {\r\n OverflowExamples overflowExamples = new OverflowExamples();\r\n\r\n /* This test fails because method [org.utbot.examples.math.OverflowExamples.intOverflow] produces [java.lang.ArithmeticException: int * overflow] */\r\n overflowExamples.intOverflow(-11086, 0);\r\n }\r\n```\r\n\r\n**Visual proofs (screenshots, logs, images)**\r\n\r\n\r\n\r\n**Additional context**\r\n\r\nSo this case is more about how to properly present results of UTBot finding. Currently there are at least two problems:\r\n* incorrect comment that test fails\r\n* as test pass it would be difficult to find such test in case of bulk test generation, so overflow problem could be left unnoticed.\r\nProbably we should add `fail()` to such test, so it would actually fail and draw user attention.\r\n","author":{"url":"https://github.com/tyuldashev","@type":"Person","name":"tyuldashev"},"datePublished":"2022-10-31T15:35:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1272/UTBotJava/issues/1272"}
| 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:c37f9768-eaed-94bb-f7c1-e8d1ea283627 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CAC2:19BFE5:185FFD4:1F81113:69908C1D |
| html-safe-nonce | f13acbffd1464de5c53f053e17b926d502ead20e8a79dfabf0ece913670ff08f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQUMyOjE5QkZFNToxODVGRkQ0OjFGODExMTM6Njk5MDhDMUQiLCJ2aXNpdG9yX2lkIjoiMTkzMDE5Njc1MzE0MDcxNDUyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c38e7bdcc3612cee5d1e80ae531efe75112a2bebdd8540d7acc1d1f3529794a4 |
| hovercard-subject-tag | issue:1430052259 |
| 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/1272/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4b91d50e6e829d13b9517a794a2ee460f2037374661bc59d5895ba743e31cd1c/UnitTestBot/UTBotJava/issues/1272 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4b91d50e6e829d13b9517a794a2ee460f2037374661bc59d5895ba743e31cd1c/UnitTestBot/UTBotJava/issues/1272 |
| og:image:alt | Description UTBot could find situations which leads to arithmetic overflow and generate tests for such cases adding comment that such test would fail, but actually such test pass. To Reproduce Step... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tyuldashev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| 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 | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width