Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify scope of EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS test suite #1133

Closed
alisevych opened this issue Oct 11, 2022 · 9 comments · Fixed by #1250
Closed

Clarify scope of EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS test suite #1133

alisevych opened this issue Oct 11, 2022 · 9 comments · Fixed by #1250
Assignees
Labels
comp-summaries Something related to the method names, code comments and display names generation comp-ui Improvements of plugin UI appearence and functionality ctg-bug Issue is a bug

Comments

@alisevych
Copy link
Member

alisevych commented Oct 11, 2022

Description

Clarify scope of generated suite with EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS.

Expected behavior

Is it correct that only explicitly thrown exceptions without try-catch should be located in this suite?

Environment

Fuzzing is on.

Context

Example:

Test with String.repeat(-1) throws [java.lang.IllegalArgumentException: count is negative: -1]

Expected result

The test should be put into FUZZING: IMPLICITLY_THROWN_UNCHECKED_EXCEPTIONS region.

Actual result

The test is currently put into FUZZING: EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS region.

Originally posted by @alisevych in #1102 (comment)

@korifey korifey moved this to Todo in UTBot Java Oct 11, 2022
@alisevych alisevych changed the title Clarify scope of EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS region Clarify scope of EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS test suite Oct 11, 2022
@alisevych alisevych added this to the 2022.11 Release milestone Oct 11, 2022
@amandelpie
Copy link
Collaborator

I am happy to discuss about clusters for fuzzing tests bazed on the utExecution.result.

At this moment all unsuccessful fuzzing execution are grouped to the one cluster with the name "EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS", probably the common name is incorrect

Also, I could create a separate clusters for all types of utExecution.result

  • UtConcreteExecutionFailure
  • UtExplicitlyThrownException
  • UtImplicitlyThrownException
  • UtOverflowFailure
  • UtSandboxFailure
  • UtTimeoutException
    But @Markoutte looks like not all results are possible for Fuzzing execution, am I right?

@Markoutte
Copy link
Collaborator

If it collects exceptions of any kind, I'd prefer name like "EXCEPTIONS_THROWN" without any details about checked/unchecked.

@korifey
Copy link
Contributor

korifey commented Oct 12, 2022

If it collects exceptions of any kind, I'd prefer name like "EXCEPTIONS_THROWN" without any details about checked/unchecked.

We should at least differentiate Error suite from regression suite

@alisevych alisevych added ctg-bug Issue is a bug comp-summaries Something related to the method names, code comments and display names generation labels Oct 17, 2022
@alisevych
Copy link
Member Author

As a suggestion:
EXPECTED_EXCEPTIONS
UNEXPECTED_EXCEPTIONS

@amandelpie
Copy link
Collaborator

@alisevych what do you mean under EXPECTED_EXCEPTIONS and UNEXPECTED_EXCEPTIONS from the following list?
Is it the same as the proposed by @korifey the splitting of exceptions and errors (failures)?

Am I right?

  1. UtConcreteExecutionFailure (UNEXPECTED_EXCEPTIONS)
  2. UtExplicitlyThrownException (EXPECTED_EXCEPTIONS)
  3. UtImplicitlyThrownException (EXPECTED_EXCEPTIONS)
  4. UtOverflowFailure (UNEXPECTED_EXCEPTIONS)
  5. UtSandboxFailure (UNEXPECTED_EXCEPTIONS)
  6. UtTimeoutException (EXPECTED_EXCEPTIONS)

@amandelpie
Copy link
Collaborator

amandelpie commented Oct 24, 2022

@korifey is it correct to say that all result types could be grouped in Errors and Exceptions?

Exceptions:
UtExplicitlyThrownException
UtImplicitlyThrownException
UtTimeoutException

Failures:
UtOverflowFailure
UtSandboxFailure
UtConcreteExecutionFailure

@amandelpie
Copy link
Collaborator

amandelpie commented Oct 24, 2022

@korifey @Markoutte @alisevych

Also as a varinat we could unify it with the clusters produced by the Symbolic Engine.
It has the following logic based on type of exceptions (checked/unchecked)

    is UtExecutionSuccess -> ExecutionGroup.SUCCESSFUL_EXECUTIONS
    is UtImplicitlyThrownException -> if (this.exception.isCheckedException) ExecutionGroup.CHECKED_EXCEPTIONS else ExecutionGroup.ERROR_SUITE
    is UtExplicitlyThrownException -> if (this.exception.isCheckedException) ExecutionGroup.CHECKED_EXCEPTIONS else ExecutionGroup.EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS
    is UtOverflowFailure -> ExecutionGroup.OVERFLOWS
    is UtTimeoutException -> ExecutionGroup.TIMEOUTS
    is UtConcreteExecutionFailure -> ExecutionGroup.CRASH_SUITE
    is UtSandboxFailure -> ExecutionGroup.SECURITY

@alisevych
Copy link
Member Author

@amandelpie @Markoutte @korifey
Please correct me if needed:

As for Overflow exceptions - they should be treated as errors or ignored - based on the setting:
image
Also , what is meant by "ignored": just skipped?

From my point of view implicitly thrown (by other classes/packages) and explicitly thrown (by user code) - should be in different suites.
Implicitly - possible errors. Should be added to error suite (?)
Explicitly - expected ones. Should be treated as regression suite - add to successful executions (?)

Sandbox failures should be shown separately - with distinct explanation how to add permissions and regenerate the tests if needed.

Timeout exceptions should be added to error suite.

Concrete execution failures - are UnitTestBot issues. Should be shown in error suite or separately.

Repository owner moved this from Todo to Done in UTBot Java Nov 8, 2022
@alisevych alisevych added the comp-ui Improvements of plugin UI appearence and functionality label Nov 30, 2022
@alisevych
Copy link
Member Author

alisevych commented Feb 27, 2023

@rudolf101 @zishkaz
Currently generated test cases for Java are divided into the following regions:

image

<Source name> : <Suite name> for method <Method signature>

You can find some details in PR - #1250.

Also there is Errors report region to collect internal errors from concrete execution (only count, full details should be in logs).

Let's consider and discuss an appropriate solution for JavaScript test cases division into suites and their naming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-summaries Something related to the method names, code comments and display names generation comp-ui Improvements of plugin UI appearence and functionality ctg-bug Issue is a bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants