CMPS115 Winter 2004 Exam #2 OPEN BOOK/NOTE WORK ALONE (NO TEAMS) COVERS: Lectures 6 17

Similar documents
Name: Instructions. Problem 1 : Short answer. [48 points] CMU / Storage Systems 25 Feb 2009 Spring 2010 Exam 1

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.

University of California, Berkeley College of Engineering

CPSC 310: Sample Final Exam Study Questions 2014S1 (These are in addition to the Study Questions listed at the end of some lectures)

2. You are required to enter a password of up to 100 characters. The characters must be lower ASCII, printing characters.

Midterm Exam Solutions and Grading Guidelines March 3, 1999 CS162 Operating Systems

CS 113 MIDTERM EXAM 2 SPRING 2013

CSE 332 Winter 2015: Midterm Exam (closed book, closed notes, no calculators)

a. The following method would allow an object of the static type List<String> to be passed to it as an argument.

Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently.

ECSE 321 Assignment 2

CPS 310 first midterm exam, 2/26/2014

CS 4349 Lecture October 18th, 2017

ECE368 Exam 2 Spring 2016

CSE 143, Winter 2009 Final Exam Thursday, March 19, 2009

Lecture 1 Getting Started with SAS

CSSE 220 Day 13. Encapsulation Coupling and Cohesion Scoping. Please download EncapsulationExamples from your SVN

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators)

York University AS/AK/ITEC INTRODUCTION TO DATA STRUCTURES. Midterm Sample I. Examiner: S. Chen Duration: One Hour and 30 Minutes

Final Exam. COMP Summer I June 26, points

CSIS 10B Lab 2 Bags and Stacks

Repetition Algorithms

CSE 332 Autumn 2013: Midterm Exam (closed book, closed notes, no calculators)

CSE331 Autumn 2011 Midterm Examination October 28, 2011

FORM 2 (Please put your name and form # on the scantron!!!!)

Design Patterns: State, Bridge, Visitor

CSE373 Winter 2014, Final Examination March 18, 2014 Please do not turn the page until the bell rings.

CSE332 Summer 2010: Final Exam

Object- Oriented Analysis, Design and Programming

STUDENT NAME: STUDENT ID: Problem 1 Problem 2 Problem 3 Problem 4 Problem 5 Total

Final Score Name SOLUTION ID Extra Credit. 15% of course grade

Midterm II CS164, Spring 2006

CS 455 Final Exam Fall 2012 [Bono] Dec. 17, 2012

CSE331 Winter 2014, Midterm Examination February 12, 2014

Q1: Functions / 33 Q2: Arrays / 47 Q3: Multiple choice / 20 TOTAL SCORE / 100 Q4: EXTRA CREDIT / 10

Faculty of Engineering Computer Engineering Department Islamic University of Gaza C++ Programming Language Lab # 6 Functions

Practice Problems. Review, with SOME solutions

CS159. Nathan Sprague

CSE373 Winter 2014, Final Examination March 18, 2014 Please do not turn the page until the bell rings.

CS 455 Midterm Exam 1 Fall 2016 [Bono] Thursday, Sept. 29, 2016

CPSC 211, Sections : Data Structures and Implementations, Honors Final Exam May 4, 2001

RECITATION SECTION: YOUR CDA 3101 NUMBER:

Testing. Christopher Simpkins Chris Simpkins (Georgia Tech) CS 2340 Objects and Design CS / 13

CSE331 Winter 2014, Midterm Examination February 12, 2014

RANDOM NUMBER GAME PROJECT

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Midterm 1

Lecture 10: Introduction to Correctness

CSE 143, Winter 2009 Sample Midterm Exam #2

1 Inheritance (8 minutes, 9 points)

CS61BL. Lecture 1: Welcome to CS61BL! Intro to Java and OOP Testing Error-handling

Total Score /20 /20 /20 /25 /15 Grader

CSE351 Winter 2016, Final Examination March 16, 2016

Classes, interfaces, & documentation. Review of basic building blocks

CSE 332 Spring 2014: Midterm Exam (closed book, closed notes, no calculators)

CS 455 Midterm Exam 1 Fall 2015 [Bono] Thursday, Oct. 1, 2015

University of Virginia Department of Computer Science. CS 4501: Information Retrieval Fall 2015

MCS-378 Intraterm Exam 1 Serial #:

Project 1. due date Sunday July 8, 2018, 12:00 noon

Grade Weights. Language Design and Overview of COOL. CS143 Lecture 2. Programming Language Economics 101. Lecture Outline

Survey #2. Variable Scope. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings. Scope Static.

CSE 331 Final Exam 12/9/13

CSE 331 Midterm Exam Sample Solution 2/13/12

University of Toronto Department of Electrical and Computer Engineering. Midterm Examination. ECE 345 Algorithms and Data Structures Fall 2012

Question Points Score TOTAL 50

Introduction to Computing II (ITI 1121) Final Examination

Exam 3 Practice Problems

CS 1301 Exam 1 Fall 2010

CSE 143, Winter 2010 Final Exam Thursday, March 18, 2010

Computer Science 210: Data Structures

CPS104 Computer Organization Lecture 1. CPS104: Computer Organization. Meat of the Course. Robert Wagner

Computer Science E-119 Practice Midterm

Final Exam, CS130 Fall 2008

Project Compiler. CS031 TA Help Session November 28, 2011

Final Score ID Extra Credit. 15% of course grade

Survey #2. Assignment #3. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings. Static Interface Types.

CMSC411 Fall 2013 Midterm 1

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Note that there are questions printed on both sides of each page!

Programming Project 1

CPS104 Computer Organization Lecture 1

4. Use a loop to print the first 25 Fibonacci numbers. Do you need to store these values in a data structure such as an array or list?

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

THE UNIVERSITY OF WESTERN ONTARIO CS212b: Introduction to Software Engineering Final Examination: Marking Scheme

Largest Online Community of VU Students

CSE 70 Final Exam Fall 2009

CS6963: Parallel Programming for GPUs Midterm Exam March 25, 2009

WORKING WITH PIVOT TABLES

Introduction to Spring 2007 Artificial Intelligence Midterm Solutions

CS 112 Midterm Exam Fall 2016

CS 61B Summer 2005 (Porter) Midterm 2 July 21, SOLUTIONS. Do not open until told to begin

CMPE012 Computer Engineering 12 (and Lab) Computing Systems and Assembly Language Programming. Summer 2009

Data Structures and Algorithms Winter Semester

CS : Programming for Non-Majors, Fall 2018 Programming Project #5: Big Statistics Due by 10:20am Wednesday November

CSE 410 Final Exam 6/09/09. Suppose we have a memory and a direct-mapped cache with the following characteristics.

Q1: Multiple choice / 20 Q2: C input/output; operators / 40 Q3: Conditional statements / 40 TOTAL SCORE / 100 EXTRA CREDIT / 10

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

COMP Data Structures

CSE 331 Final Exam 3/16/15 Sample Solution

COMP Data Structures

Problem Score Max Score 1 Syntax directed translation & type

Transcription:

1. Coupling Example (20 pts) Given a set a modules that print or store student status reports, with data-flow connections as shown in the diagram and table below (arrow direction is In flow, and Out flow is counter-arrow), determine the coupling type between modules (filling in the COUPLING TYPE table) # 2 3 4 The file F.TMP is used by modules #, ", and. Modules # and both write Student data to the file as well as read from it, while module " only reads from the file. 1 " ( 5 # ( "!" #!$%%&!$% %!$%' # ( " (a) DATA or STAMP (a) DATA if all fields of Stduent used, else STAMP (c) DATA or STAMP depending on whether all of F.TMP used (d) Due to read/write coupling through F.TMP (h) DATA if all field of StudentReport used else STAMP (j) DATA if all of F.TMP data used by module s, else STAMP (b) CONTROL (c) DATA or (d) STAMP COMMON (e) -- (f) -- (g) DATA (h) DATA or STAMP (i) -- (j) DATA or STAMP

(e) 2. True/False (10 pts): Statement a) Java interfaces are useful for providing partial implementations of methods F b) White-box C 2 path test coverage ensures no bugs remain in a program F c) The key to meeting performance goals is early code optimization on a generic platform d) Distributed application performance is independent of network effects F e) SCM systems resolve merge conflicts according to the Application Specification priorities f) Informational cohesion is too weak for use with ADT implementation modules F g) A System/Application Acceptance Test Plan should be independent of the individual performance of each implementation module h) According to the Stable Abstraction Principle, stable packages should be concrete T i) High Reliability implies High Availability F j) Pipe and Filter architecture provides good support for concurrent execution T T/F F F T 3. Equivalence Classes (5 pts) You are given a method signature and need to generate test cases for it; the method signature is: public float squareroot(int x) throws IllegalArgumentException; List the input equivalence classes for testing this function: Class LT: x < 0 Class GT: x >= 0 List boundary values tests (input->expected response): LT: GT: Most-negative integer in your language -> IllegalArgumentException -1 -> IllegalArgumentException 0 -> 0 1 -> 1 2 -> 1.414 3 -> 1.73 max integer for your language -> 2^^16 in Java EXTRA CREDIT: +2 pts for answers recognizing that the result is an approximation and has to be within some tolerance of the correct answer maybe: x -> v (abs(v * v x) < epsilon

4. Performance Analysis (10 pts) An application operates by receiving requests, creating a 5-MB size temp file for each request to hold interim results, then sending back the results and deleting the temp file. The processing time averages 12 seconds per request. Supposing you want to handle a throughput of 750 requests/sec, how much disk space should you expect the temp files to take, on average? (Your answer should be a simple calculation resulting in a size.) From Little s Law, work units in system = work units/time * processing time, we see that there are 12 * 750 = 9000 requests in the system (on average). At 5 MB per request, you should expect an average load of 45GB. 5. Robustness Analysis (5 pts) Given this sentence in a use case:! " #$ %&' What, if any, changes would robustness analysis require? (Your answer should a short sentence or two, and a rewritten bit of use case text..) Add a Boundary object and add a Controller between the Boundary object and the ClassListEntity. Result might be:! " #( )* +, " #"! " #$ %&

6. Lecture Review UML (20 pts) You may review a lecture for extra credit! Your review is graded 0.. 3, just as a regular paper review and with the same criteria, but the points awarded are 1/2 the points of a required review. So you can get 0, 5, 8, or 10 points for writing up a lecture. Each student can only review each lecture once; each lecture can be reviewed by any number of students. (Would diagramming that make a good UML question for the Final Exam?) Yes, it would but we ll only do part of it for a Midterm. In the approach taken below, the TA is the central Factory the TA learns of Reviewable things (lecture notes, perhaps) from the external Instructor actor, and tells the Students about them; if/when a Student decides to submit a Review, they ask the TA for a blank Review for that Reviewable, fill out the Review, and submit it to the TA for scoring and record-keeping. The Student keeps track of the scores he/she has received. A Reviewable object tracks which Students have submitted Reviews of that Reviewable. You are to draw out: (A) [10 pts] a UML static structure diagram including the classes shown below plus other classes you decide you need to capture the structural relationships described above (my guess is you ll have between 7 and10 total classes). You may indicate cardinality constraints with multiplicity annotations on associations, and/or using Notes achored to associations and/or constraints; or, of course, you may elect other UML mechanisms as well. (B) Two UML sequences covering the scenarios of: (1) [5 pts] a normal review sequence beginning with the Instructor creating a Reviewable opportunity (named r_able ) and notifying the TA of r_able s existance, followed by the TA telling a student named s about r_able, then s doing what he/she needs in order to submit a Review for grading. (The TA assigns it a 3 and that s the end of that sequence.) (2) [5 pts] a later (asynchronous) attempt by Student s to submit another Review for r_able, which terminates when the TA assigns a score of 0 to the rejected Review. Note that in the sequence diagramming part you aren t asked to show the complete lifecycle of a Reviewable and a Review and a Student, etc just get the Reviews generated and turned in. You do not, for example, have to deal with the eventual grading and reporting; nor do you have to sort out how the TA knows if the Reviewable is assigned or is extra credit the Instructor and the TA have some channel for that, all you need to do is show that the TA checks for that status at the correct time. You may combine parts (B)(1) and (B)(2) on one sequence diagram (put a horizontal line on the diagram to separate the sequences) or you may do them as separate diagrams. You may need to create new methods on the implementation classes. Modeling hint: Showing an Exception return can be done using an explicit return value arrow labelled with the type ( :IllegalArgumentException ), or just an asynchronous message from the recipient back to the caller, as though the original message had returned but then the exception was thrown.

You are given the following class definitions to get started with: interface Reviewable { // addreview throws an Exception to indicate the Student argument // is unacceptable; either an invalid or an already-seen Student void addreview(student s) throws IllegalArgumentException; String getsubject(); } interface Review { Reviewable getsubject(); Student getauthor(); void settext(string); // add review content void setgrade0(); void setgrade1(); void setgrade2(); void setgrade3(); int getpoints(); } interface Student{ void doreview(reviewable r); // creates Review and submits to TA for score int getscore(reviewable r); // score on single Reviewable int gettotalscore(); // sum of all scores } interface TA{ // combines TA and ReviewFactory for simplicity void newreviewableexists(reviewable r); // Review getblankreview(reviewable r); // Review factory behavior int receivereview(review r, Student s); // returns score }

(B)(1) (B)(2) 7. Parallelism (10 pts) Suppose we have a program that runs on a single-processor machine in 10 seconds. The program has some parts which can be efficiently split into parallel processes across the network, but there is a part at the beginning and at the end which happens on just one processor (splitting data up for the parallel work, and combining the results.) One the single-processor machine, these two parts take 1 and 3 seconds, respectively. You ve been given a boatload of money to make this overall program run faster you can add a lot of very fast parallel computers, and even use the new InfiniteSpeed/ZeroLatency network The single-cpu part of the program, though, has to stay on the exitsing computer (for security reasons). What s the shortest period of time you can hope to make this program take? Your answer should be a very short calculation invoking a well-known Law of operational research.

You can solve this one of two ways: Amdahl s Law, or common sense. By common sense, the fastest we can hope for is to drive the parallel work part to zero time, leaving us with the unchanged serail part (4 seconds). Gene Amdahl codifies this observation (you can only speed up the parallel part) in what other folks named Amdahl s Law (Lecture 14, slide 29). With Amdahl s Law if N is very very large, S = 1/B. Here B = 4 sec/10 sec = 0.4, so S = 10/4 = 2.5, and we can hope to speed up the 10-second process to 10/2.5 = 4 seconds. Free Questions! (0 pts) (0 pt) How do you get a development team to optimize for a particular characteristic? (0 pt) What question took you the longest to answer, and how long was it? (0 pt) How long did the entire test take you?