Skip to content

The engine can not handle some JDK APIs,e.g., Date  #94

Open
@alexeyfridman

Description

@alexeyfridman

Description

SAT-1557

UTBot does not generate any meaningful (branches not leading to NPE) tests for the following code:

/**
 @param dateDate date
 @return String
 */
public static String dateToStr(java.util.Date dateDate) {
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
    return formatter.format(dateDate);
}

To Reproduce

Steps to reproduce the behaviour:

  1. Open any project in IntelliJ Idea
  2. Use the plugin to generate tests
  3. Open the generated tests

Expected behaviour

A test suite with full coverage of the MUT

Actual behaviour

The only branch with NPE

The example is too long due to static initializers, so I've decided not to paste it here.

Environment

Java 1.8
Mocks: disabled
Time limit: 60s

Other options do not matter.

Additional context

Probably, it happens because of too complicated Formatting for the engine.

Metadata

Metadata

Assignees

Labels

comp-symbolic-engineIssue is related to the symbolic execution enginectg-bugIssue is a bugpriority-top-focusTop priority chosen by dev teamspec-release-tailingsFailed to include in the current release, let's include it in the next one

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions