Randoop Creating Contracts

30 views
Skip to first unread message

Jonathan Youssef

unread,
Dec 7, 2016, 9:30:12 AM12/7/16
to randoop-d...@googlegroups.com
Dear Members of the Randoom Team,

Hi! my name is Jonathan, and I'm currently doing my Masters in CS at UVA. I've been studying random test generaators and find Randoop to be a fantastic one. I'm currently working on incorporating my own contracts into Randoop for a project, but I'm a little confused about the process. I see that the contracts are to be added to src/main/java/randoop.contract in the dev kit, but I don't know how to actually write one. I couldn't find any helpful documentation in the manual or elsewhere, do you think you could point me to, or  maybe even provide, some instructions or tips?

Normally I'd take more time to really experiment with and go through all the existing contract code, but my first deadline major deadline is Thursday. 

Any and all help is very appreciated. Thanks!
Jonathan Youssef

Michael Ernst

unread,
Dec 7, 2016, 9:39:41 AM12/7/16
to Randoop Developers, Jonathan Youssef
Jonathan-

The Randoop Developer's Manual says to look at ObjectContract; have you
read its documentation? The Java files in the directory you mentioned
implement that interface, so you could mimic them.

We'd like to help you, but a vague question that doesn't indicate what you
have tried gives us nothing to go on. Do you have a concrete question
that you could ask? Or is there a specific aspect that you are stuck on?

-Mike


> Subject: Randoop Creating Contracts
> From: Jonathan Youssef <jay...@virginia.edu>
> To: randoop-d...@googlegroups.com
> Date: Tue, 6 Dec 2016 23:07:12 -0500
> *
> Jonathan Youssef
>
> --
> You received this message because you are subscribed to the Google
> Groups "Randoop Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to randoop-develop...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Michael Ernst

unread,
Dec 7, 2016, 6:37:05 PM12/7/16
to Randoop Developers
Hi Michael,

Thanks for getting back to me. I went over the developer manual, but I must have missed the line on the ObjectContract interface. I will try and figure it out from there. I apologize for my vagueness, I do have a few specific questions:

1. When adding my own contract, is it enough to simply add the class to the contract folder? I did a quick project search, and I see that some contracts are imported in OperationModel.java
2. Somewhat unrelated, I am trying to run Randoop on java.util.Collections and Treeset as demonstrated in the manual, but I don't know how to go about doing this as those classes are not accessible via command line. How did you accomplish this?

Sorry if these are basic questions; this is my first venture into test generation. Thank you so much for the help! 

Jonathan

On Wed, Dec 7, 2016 at 9:39 AM, Michael Ernst <mer...@cs.washington.edu> wrote:
Jonathan-

The Randoop Developer's Manual says to look at ObjectContract; have you read its documentation?  The Java files in the directory you mentioned implement that interface, so you could mimic them.

We'd like to help you, but a vague question that doesn't indicate what you have tried gives us nothing to go on.  Do you have a concrete question that you could ask?  Or is there a specific aspect that you are stuck on?

                    -Mike


Subject: Randoop Creating Contracts
From: Jonathan Youssef <jay...@virginia.edu>

Date: Tue, 6 Dec 2016 23:07:12 -0500

Dear Members of the Randoom Team,

Hi! my name is Jonathan, and I'm currently doing my Masters in CS at UVA. I've been studying random test generaators and find Randoop to be a fantastic one. I'm currently working on incorporating my own contracts into Randoop for a project, but I'm a little confused about the process. I see that the contracts are to be added to src/main/java/randoop.contract in the dev kit, but I don't know how to actually write one. I couldn't find any helpful documentation in the manual or elsewhere, do you think you could point me to, or maybe even provide, some instructions or tips?

Normally I'd take more time to really experiment with and go through all the existing contract code, but my first deadline major deadline is Thursday.

Any and all help is very appreciated. Thanks!
*
Jonathan Youssef


--
You received this message because you are subscribed to the Google Groups "Randoop Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to randoop-developers+unsubscribe@googlegroups.com.

bjke...@cs.washington.edu

unread,
Dec 7, 2016, 7:12:07 PM12/7/16
to Randoop Developers
Jonathan,

1. Contracts must be added in randoop.reflection.OperationModel like the others.  If they are not added, they will not be checked.

2. Classes for which tests are generated must occur in the classpath and their names given with --testclass or --classlist. The JDK classes in the document are located in /src/testinput/java/java2.util2/. If you want to use the JDK classes for your JVM, they are already in the classpath and you can indicate them with --testclass or --classlist.  

Hope that helps.
Ben

On Wednesday, December 7, 2016 at 3:37:05 PM UTC-8, Michael Ernst wrote:
Hi Michael,

Thanks for getting back to me. I went over the developer manual, but I must have missed the line on the ObjectContract interface. I will try and figure it out from there. I apologize for my vagueness, I do have a few specific questions:

1. When adding my own contract, is it enough to simply add the class to the contract folder? I did a quick project search, and I see that some contracts are imported in OperationModel.java
2. Somewhat unrelated, I am trying to run Randoop on java.util.Collections and Treeset as demonstrated in the manual, but I don't know how to go about doing this as those classes are not accessible via command line. How did you accomplish this?

Sorry if these are basic questions; this is my first venture into test generation. Thank you so much for the help! 

Jonathan
On Wed, Dec 7, 2016 at 9:39 AM, Michael Ernst  wrote:
Jonathan-

The Randoop Developer's Manual says to look at ObjectContract; have you read its documentation?  The Java files in the directory you mentioned implement that interface, so you could mimic them.

We'd like to help you, but a vague question that doesn't indicate what you have tried gives us nothing to go on.  Do you have a concrete question that you could ask?  Or is there a specific aspect that you are stuck on?

                    -Mike


Subject: Randoop Creating Contracts
From: Jonathan Youssef
To: randoop-developers@googlegroups.com
Date: Tue, 6 Dec 2016 23:07:12 -0500

Dear Members of the Randoom Team,

Hi! my name is Jonathan, and I'm currently doing my Masters in CS at UVA. I've been studying random test generaators and find Randoop to be a fantastic one. I'm currently working on incorporating my own contracts into Randoop for a project, but I'm a little confused about the process. I see that the contracts are to be added to src/main/java/randoop.contract in the dev kit, but I don't know how to actually write one. I couldn't find any helpful documentation in the manual or elsewhere, do you think you could point me to, or maybe even provide, some instructions or tips?

Normally I'd take more time to really experiment with and go through all the existing contract code, but my first deadline major deadline is Thursday.

Any and all help is very appreciated. Thanks!
*
Jonathan Youssef


--
You received this message because you are subscribed to the Google Groups "Randoop Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to randoop-developers+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages