GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Summaries are not generated with default useFuzzing setting · Issue #428 · UnitTestBot/UTBotJava

Summaries are not generated with default useFuzzing setting #428

New issue
Copy link
New issue
Copy link
Closed
#431
Closed
Summaries are not generated with default useFuzzing setting#428
#431
Copy link
Assignees
amandelpie
Labels
comp-summariesSomething related to the method names, code comments and display names generationSomething related to the method names, code comments and display names generationctg-bugIssue is a bugIssue is a bugpriority-top-focusTop priority chosen by dev teamTop priority chosen by dev team

Description

@dtim
dtim
opened on Jul 6, 2022
Issue body actions

Description

When UtSettings::useFuzzing has its default value true, no summaries are generated for test cases created by the symbolic engine. Summaries are correctly generated when useFuzzing settings is set to false.

To Reproduce

Make sure that $HOME/.utbot/settings.properties does not contain useFuzzing = false line (i.e., the default value is used).

Generate tests for a class (e.g., utbot-sample/src/main/java/org/utbot/examples/algorithms/BinarySearch.java).

Expected behavior

Test cases generated by the symbolic engine contain summaries (JavaDoc, @DisplayName, informative method names).

Actual behavior

Tests are sequentially numbered, no JavaDoc is provided, no @DisplayName is provided.

Visual proofs (screenshots, logs, images)

First 3 tests have been generated by the fuzzer and have informative names and @DisplayName.
All other tests have been generated by the symbolic engine and have no summaries.

    @Test
    @DisplayName("leftBinSearch: array = long[10], key = 0L -> return 1")
    public void testLeftBinSearchReturnsOneWithNonEmptyPrimitiveArrayAndCornerCase() {
        BinarySearch binarySearch = new BinarySearch();
        long[] longArray = {
                0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
                0L, 0L
        };

        int actual = binarySearch.leftBinSearch(longArray, 0L);

        assertEquals(1, actual);
    }

    @Test
    @DisplayName("leftBinSearch: array = long[10], key = Long.MAX_VALUE -> return -1")
    public void testLeftBinSearchWithNonEmptyPrimitiveArrayAndCornerCase() {
        BinarySearch binarySearch = new BinarySearch();
        long[] longArray = {
                0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
                0L, 0L
        };

        int actual = binarySearch.leftBinSearch(longArray, Long.MAX_VALUE);

        assertEquals(-1, actual);
    }

    @Test
    @DisplayName("leftBinSearch: array = long[0], key < 0L -> return -1")
    public void testLeftBinSearchWithEmptyPrimitiveArray() {
        BinarySearch binarySearch = new BinarySearch();
        long[] longArray = {};

        int actual = binarySearch.leftBinSearch(longArray, -1L);

        assertEquals(-1, actual);
    }

    @Test
    public void testLeftBinSearch1() {
        BinarySearch binarySearch = new BinarySearch();
        long[] longArray = {-255L};

        int actual = binarySearch.leftBinSearch(longArray, -128L);

        assertEquals(-1, actual);
    }

    @Test
    public void testLeftBinSearch2() {
        BinarySearch binarySearch = new BinarySearch();
        long[] longArray = {-255L};

        int actual = binarySearch.leftBinSearch(longArray, -255L);

        assertEquals(1, actual);
    }

    @Test
    public void testLeftBinSearch3() {
        BinarySearch binarySearch = new BinarySearch();
        long[] longArray = {-255L, -255L};

        int actual = binarySearch.leftBinSearch(longArray, -255L);

        assertEquals(1, actual);
    }

    @Test
    public void testLeftBinSearch4() {
        BinarySearch binarySearch = new BinarySearch();
        
        /* This test fails because executable under testing alg.BinarySearch.leftBinSearch
        produces Runtime exception java.lang.NullPointerException */
        binarySearch.leftBinSearch(null, -255L);
    }

    @Test
    public void testLeftBinSearch5() {
        BinarySearch binarySearch = new BinarySearch();
        long[] longArray = {-251L, -252L};

        assertThrows(IllegalArgumentException.class, () -> binarySearch.leftBinSearch(longArray, -255L));
    }

Environment

UtSettings::useFuzzer should be set to true to reproduce the bug.

Activity

  1. dtim
    added
    ctg-bugIssue is a bugIssue is a bug
    on Jul 6, 2022
  2. dtim
    assigned
    amandelpie
    on Jul 6, 2022
  3. dtim
    added
    priority-top-focusTop priority chosen by dev teamTop priority chosen by dev team
    on Jul 6, 2022
  4. amandelpie commented on Jul 6, 2022

    @amandelpie
    amandelpie
    on Jul 6, 2022
    Collaborator
    More actions

    Related to the #267

  5. amandelpie
    added
    comp-summariesSomething related to the method names, code comments and display names generationSomething related to the method names, code comments and display names generation
    on Jul 6, 2022
  6. amandelpie
    closed this as completedin #431on Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @amandelpie
    amandelpie

Labels

comp-summariesSomething related to the method names, code comments and display names generationSomething related to the method names, code comments and display names generationctg-bugIssue is a bugIssue is a bugpriority-top-focusTop priority chosen by dev teamTop priority chosen by dev team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.