Skip to content

Compilation Errrors #4

Description

@yogendrahexo

I'm getting compilation errors. All the D4J projects are failing to compile even at the class level because of the wrong format of test generations. The import statements are getting written inside the class or duplicate imports, causing errors. In some cases, class-level compilation succeeds but only with empty tests. But, Method-level compilation is failing in them.

Compile errors: {'illegal start of type': 17, 'cannot find symbol': 8, '<identifier> expected': 6, 'package org.mockito does not exist': 2, 'repeated modifier': 1}

  1. ERROR: Chart_15 failed compilation even though it was given an empty test class.

  2. Errors related to Mockito:
    You mentioned Mockito 5 in the instructions, but 3.12.4 was the version in the dependency_analyzer script. I tried both versions (5.14.2 and 3.12.4), but I'm still getting Mockito errors in some compilations:
    package org.mockito does not exist
    This error occurred in the Csv project and a few others, but not in all projects.

  3. Method-Level Compilation Failures:

    • method removeDomainMarker not found in org/jfree/chart/plot/CategoryPlot
    • method skip not found in org/apache/commons/codec/binary/BaseNCodecInputStream

Project Setup, Steps followed:

I have the following files in the frameworks/projects/lib directory:
Mockito-core-3.12.4.jar, mockito-core-5.14.2.jar, mockito-junit-jupiter-3.12.4.jar, junit-jupiter-api-5.7.2.jar, junit-jupiter-params-5.0.0.jar, powermock-api-mockito2-1.7.4.jar, powermock-core-1.7.4.jar, apiguardian-api-1.1.0.jar, powermock-module-junit4-1.7.4.jar, byte-buddy-1.14.11.jar, byte-buddy-agent-1.14.11.jar, objenesis-3.3.jar, hamcrest-2.1.jar

  1. Checked out all the D4J repos (buggy and fixed) and placed them in a folder named projectName_id/fixed and projectName_id/buggy.
  2. Copied the source_data.jsonl file into the data/prompts/ folder.
  3. Copied the d4j2_fixed_info folder into the data directory.
  4. Generated prompts using the script rq1/generate_prompts.py and retrieved content from the generated file. I sent this content to the LLM to generate output and added the response in the input data with the completion key. and palced in the data/outputs/gpt4o_comment_extend_full.jsonl
    I'm using GPT-4o right now.

Current Issues:

  • The script is correctly extracting methods, imports, and classes.
  • But, the test generation process is not working as expected:
    • Import statements are sometimes placed inside the class, disrupting the structure of the test template.
    • Duplicate imports, missing functions or different function names.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions