GT CS 6340 - Lesson 4 Questions Answers

Unformatted text preview:

Automated Test Generation Question 1 Consider the following class public class Lock private final static int UNLOCKED 0 private final static int LOCKED 1 private int state public Lock state UNLOCKED public void acquire assert state UNLOCKED state LOCKED public void release assert state LOCKED state UNLOCKED public int getState return state Consider each of the below five tests as a unit of input to Randoop Answer whether that test can ever possibly be generated by Randoop If yes explain whether Randoop 1 Discards the test as illegal or 2 Reports the test as a bug or 3 Adds the test to components for future extension For simplicity assume that Randoop does not check for redundancy and that the contracts it checks not shown for brevity are standard ones e g equals and hashCode Test Can ever be generated If yes what outcome Lock l new Lock l acquire l release Lock l new Lock int s l getState if s 0 l acquire Lock l new Lock l release Lock l new Lock l release l acquire Lock l new Lock l acquire l release l acquire A Yes B No 1 Discards 2 Reports 3 Adds A Yes B No 1 Discards 2 Reports 3 Adds A Yes B No 1 Discards 2 Reports 3 Adds A Yes B No 1 Discards 2 Reports 3 Adds A Yes B No 1 Discards 2 Reports 3 Adds 1 2 3 4 5 Answer 1 A 3 2 B 3 A 1 4 B 5 A 3


View Full Document

GT CS 6340 - Lesson 4 Questions Answers

Download Lesson 4 Questions Answers
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lesson 4 Questions Answers and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lesson 4 Questions Answers 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?