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 — ToString support for abstract collection using makeSymbolic #391 by CaelmBleidd · Pull Request #402 · UnitTestBot/UTBotJava

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Jul 4, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Description

ToString for lists (as well as for other inheritors of AbstractCollection didn't work since it's too complicated for the engine because of StringBuilder usage somewhere inside of it. I've decided to make a temporary solution, implementing this method with makeSymbolic mechanism -- the method should return an unbounded symbolic variable, that will allow us to continue the analysis (in contrast to the executeConcretely). Later, the concrete execution will find the right result for such execution, if it's required.

My suggestion is based on thoughts that people usually use toString on collections just for logging, showing or something like that, and the resulting line won't present in the path constraints. It's not 100% true, but in many cases, it will work.

Fixes #391

Type of Change

  • Breaking change. toString without concrete executor works differently now for the inheritors of the AbstractCollection and HashSet

How Has This Been Tested?

Automated Testing

Added test in the corresponding package.

Manual Scenario

Same test, since it is only about toString method on any collection.

Checklist:

  • 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
  • No new warnings
  • Tests that prove my change is effective
  • All tests pass locally with my changes

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@CaelmBleidd
CaelmBleidd requested review from Damtev and dtim July 4, 2022 15:40
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/tostring-for-lists branch from ca9154e to 0f2779d Compare July 4, 2022 15:41
Damtev
Damtev approved these changes Jul 4, 2022
View reviewed changes
@CaelmBleidd
CaelmBleidd enabled auto-merge (rebase) July 4, 2022 16:00
dtim
dtim approved these changes Jul 4, 2022
View reviewed changes

@dtim dtim left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/tostring-for-lists branch from 0f2779d to dbbdced Compare July 4, 2022 17:32
@CaelmBleidd
CaelmBleidd disabled auto-merge July 4, 2022 17:36
@CaelmBleidd
CaelmBleidd enabled auto-merge (squash) July 4, 2022 17:36
@CaelmBleidd
CaelmBleidd disabled auto-merge July 4, 2022 17:38
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/tostring-for-lists branch from 6fc5f04 to b381486 Compare July 4, 2022 18:14
@CaelmBleidd
ToString support for abstract collection using makeSymbolic #391
9202b80
@CaelmBleidd
CaelmBleidd force-pushed the caelmbleidd/tostring-for-lists branch from b381486 to 9202b80 Compare July 4, 2022 18:17
@CaelmBleidd
CaelmBleidd enabled auto-merge (rebase) July 4, 2022 18:17
@CaelmBleidd
CaelmBleidd merged commit 3b21112 into main Jul 4, 2022
@CaelmBleidd
CaelmBleidd deleted the caelmbleidd/tostring-for-lists branch July 4, 2022 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dtim dtim dtim approved these changes
@Damtev Damtev Damtev approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

UTBot Java
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ArrayList.toString() - fails to generate tests

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@CaelmBleidd @dtim @Damtev
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.