Git Product home page Git Product logo

Comments (3)

mernst avatar mernst commented on June 10, 2024

The given file contract.JSON is not a valid JSON file and does not conform to the example at https://randoop.github.io/randoop/manual/net_connection_spec.json . So, this looks like a duplicate of #934.

from randoop.

Amirfarhad-Nilizadeh avatar Amirfarhad-Nilizadeh commented on June 10, 2024

Thank you so much for your time.

from randoop.

Amirfarhad-Nilizadeh avatar Amirfarhad-Nilizadeh commented on June 10, 2024

Hi,

I hope you are doing well.

I am talking to a Master's student about potential work on translating JML to JSON for Randoop. However, we have a problem writing a contract in JSON to introduce an array with a primitive type (like the earlier CoppyArray attached file that has two array arguments with int type). The following JSON file is valid using this link https://jsonlint.com/.

However, Randoop cannot parse this JSON file. Also, I could not find any example that shows how array types should be defined in Randoop. (Bold part in the following JSON)

[{
"operation": {
"classname": "org.CopyArray",
"name": "CopyArray",
"parameterTypes": [
"int[]", "int", "int", "int[]"
]

},
"identifiers": {
"parameters": [
"b", "iBegin", "iEnd", "a"
]
},
"post": [],
"pre": [{
"guard": {
"description": "the code must be positive",
"condition": "iBegin >= 0"
}
},
{
"guard": {
"description": "the code must be positive",
"condition": "iEnd >= 0"
}
},
{
"guard": {
"description": "iEnd can be larger or equal to iBegin",
"condition": "iEnd >= iBegin"
}

	}
]

}]

Output:

java -ea -classpath /home/amirfarhad/Desktop/ProgramAnalysis/codes/Randoop/CopyArray/bin:/home/amirfarhad/Desktop/ProgramAnalysis/Tools/randoop-4.2.6/randoop-all-4.2.6.jar randoop.main.Main gentests --testclass=org.CopyArray --specifications=contract.JSON
Randoop for Java version "4.2.6, local changes, branch master, commit 5beca45, 2021-05-03".
Error in specifications: Could not load specification operation: {
"classname": "org.CopyArray",
"name": "CopyArray",
"parameterTypes": "[int[], int, int, int[]]"
} while reading file contract.JSON: int[]

from randoop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.