Skip to content

Suggest tests for nested classes & static methods inside abstracts #1400 #1406

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

Merged

Conversation

volivan239
Copy link
Collaborator

Description

Now if we have an abstract class or interface, we propose for testing all methods that can be invoked statically. Note that we also propose all nested classes (because they may contain static methods, although we do not check that they actually do).

Fixes #1400

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manual Scenario

For the class from listing below, g, Inner and Inner2 were proposed for testing, and tests for g and Inner.f were successfully created:

abstract class MyAbsC {
    abstract int h(int x);
    int f(int x) {
        return 0;
    }
    static int g(int x) {
        return x;
    }
    static class Inner {
        int f(int x) {
            return 1;
        }
    }
    class Inner2 {
        int ff(int x) {
            return h(x);
        }
    }
}

Checklist (remove irrelevant options):

This is the author self-check list

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

@volivan239 volivan239 marked this pull request as ready for review November 22, 2022 06:08
@Vassiliy-Kudryashov Vassiliy-Kudryashov enabled auto-merge (squash) November 22, 2022 13:07
@Vassiliy-Kudryashov Vassiliy-Kudryashov merged commit 7a59f54 into main Nov 22, 2022
@Vassiliy-Kudryashov Vassiliy-Kudryashov deleted the volivan239/propose_testable_parts_of_abstract_classes branch November 22, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggest to generate tests for nested classes and static methods found inside interfaces and abstract classes
2 participants