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
UTBot Python cannot find Division by Zero problem #1831
Even when all types are specified UTBot Python doesn't find case when Division by Zero happens. Both UTBotJava and UTBotCPP can find such problem and it seems quite classic example of the problem which could be revealed with static analysis, so I would expect that UTBot Python also find the error.
To Reproduce
Steps to reproduce the behavior:
defdiv(a: int, b: int) ->int:
returna/b
Invoke code generation on code above
Expected behavior
Test which exposes 'Division by Zero' problem is generated among the others.
Actual behavior
No such test is generated, the only test looks like that:
deftest_div(self):
""" a = 4 b = 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 """actual=basics.div(4, 111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111)
self.assertEqual(0.0, actual)
Suggestion is to allow UTBot to proceed test generation/execution till timeout with to hope to find possible errors (exceptions) in the code as it's done in Java UTbot. For sure this can be done only after equal time distribution is implemented #1820.
We should distinguish cases with different results. From the point of our implementation we covered the path, but arithmetic exception and regular exit are different outcome and we must consider them.
Additionally, we can try to work in three modes depending on the task:
Try to cover all paths and exit
If we find an error, let's try to find the non-error execution
We covered everything with non-error executions but still have time, let's spend the time with benefits and try to find possible errors
Activity
tyuldashev commentedon Feb 21, 2023
Suggestion is to allow UTBot to proceed test generation/execution till timeout with to hope to find possible errors (exceptions) in the code as it's done in Java UTbot. For sure this can be done only after equal time distribution is implemented #1820.
denis-fokin commentedon Feb 21, 2023
We should distinguish cases with different results. From the point of our implementation we covered the path, but arithmetic exception and regular exit are different outcome and we must consider them.
Additionally, we can try to work in three modes depending on the task: