SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Downloaden Sie, um offline zu lesen
________________________________ _________________________________ _________________________________
NAME ID SIGNATURE
Department of Electrical and Computer Engineering, McGill University
ECSE 321 - Introduction to Software Engineering
Midterm Examination
October 30, 2003, 11:35am-12:50pm
Prof. Radu Negulescu
INSTRUCTIONS
• Do NOT open this booklet until the start and end times of the examination are written on the board
• Write your name, McGill student ID number, and signature on the cover of the answer booklet and at the
top of this page. Both booklets need to be handed in to the proctor at the end of the examination
• This examination is closed book, closed notes. No aids permitted
• Circle one answer only for each multiple-choice question in this examination booklet. Multiple-choice
questions are equally weighted. Each question has only one correct answer, which gets 2 marks. Wrong
answers get 0 marks or 1 mark (partial credit). No answers or multiple answers in a question get 0 marks
for that question
• Write your answers to the essay-type questions in the separate answer booklet provided. Draw a diagonal
line over each scratch sheet in the answer booklet; scratch sheets will not be marked
• This examination has 75 minutes only
Good luck!
Page 2
SECTION I – MULTIPLE-CHOICE QUESTIONS
CIRCLE ONE ANSWER ONLY IN EACH QUESTION
Question 1. Which of the following coding conventions, principles or guidelines will NOT help in the
development or maintenance of Java code?
(a) Lines of code that are logically related should be placed near one another (principle of proximity)
(b) Each method of a class should have comments that clearly explain the relationships to every other method
of that class (one comment for every pair of methods in the class)
(c) Code layout should highlight the logical structure of the code (fundamental principle of code layout)
(d) Four spaces should be used as the unit of indentation (Java coding convention)
(e) Names should be problem-oriented
Answer: (b). Commenting pairs of methods is clearly excessive and it would create massive redundancies by
restating the preconditions of one method in all the callers. The other guidelines are used standard practice.
Question 2. Waived. (All examinees receive 2 marks.)
Question 3. Which of the following statements is true for flat statechart representations of typical software
systems? (By “flat statechart” we mean a statechart that does not use nesting or concurrency.)
(a) The number of states grows exponentially with the number of components in the system
(b) Each state explodes into several outgoing transitions
(c) A single transition might lead to several different states
(d) Large flat statecharts need to have more than one initial state
(e) None of the above
Answer: (a). It reflects an important phenomenon that limits what can be practically specified, by “flat” state
machines or other means. You have experienced some mild state explosion in Assignment 2 Question 1 (b).
Question 4. Which of the following requirements is most likely to occur in a properly stated SRS? (Assume the
SRS is “complete”, i.e., none of the requirements below needs to be “complete” all by itself.)
(a) “The system shall have a professional-looking user interface.”
(b) “Each button in the Formatting toolbar shall have a tooltip.”
(c) “The average time for refreshing the display shall be 4 seconds or less.”
(d) “The maximum time for registering a key press into memory shall be 0.1 seconds or less.”
(e) “The minimum time for refreshing the display shall be 0 seconds, if possible.”
Answer: (b). It meets all the criteria of good requirements, and it is particularly good because it specifies a UI
feature (“tooltips”) decoupled from the functionality features in the “Formatting toolbar” (regardless of the
number of buttons). Option (c) looks good but it is somewhat ambiguous, since it might be interpreted as a
“raster refresh rate” assumption rather than the “repainting graphical elements” obligation. It is important to
avoid multiple “standard” interpretations even if some of them don’t make much sense from a technical
viewpoint.
Question 5. Waived. (All examinees receive 2 marks.)
Page 3
Source
register (Listener)
unregister (Listener)
cast (Event)
Listener
handle (Event)
*1
ConcreteListener
listenerState
handle (Event)
ConcreteSource
subjectState
cast (Event)
* 1
OLVWHQHU6WDWH HYHQWJHW6WDWH
Event
copyState
getState ()
*1
FUHDWH QHZ (YHQW H
IRU HDFK UHJLVWHUHG /LVWHQHU O
OKDQGOHH
event
(YHQW VRXUFH (YHQW OLVWHQHUV
Question 6. Consider the class diagram above, representing a basic event broadcast mechanism. Which of the
following statements is NOT true for this diagram?
(a) ConcreteSource objects can create new Event objects
(b) Listener objects can be added and removed at run time from a list maintained by a Source object
(c) The cast(Event) method of a ConcreteSource object calls the handle(Event) method of each registered
Listener object
(d) ConcreteListener objects update the copyState fields of the Event objects
(e) Each Listener object can be registered with only one Source object
Answer: (d), because in this diagram event objects cannot be updated. Although in some frameworks we could
have listeners registered with multiple sources, Option (e) is not quite right in this diagram because the Source-
Listener association has multiplicity 1-*. This diagram is consistent with the basic (unsophisticated)
implementations of event passing mechanisms.
Question 7. Consider the software driver for a web camera, which captures the video image in real time and
makes it available over the Internet. Which of the following can NOT be an actor for the software driver?
(a) The Internet connection of the local computer
(b) The port used by the video camera
(c) The user
(d) Arnold Schwarzenegger
(e) All of the above are good actors for the web camera software driver
(Hint: do not confuse good actors with actor instances.)
Answer: (d). Arnie is not an actor because the software doesn’t need to be “aware” of him! Even if Arnie were to
purchase the software and use it as a user, Arnie can be at most an actor instance, but not an actor.
Page 4
Question 8. The guideline of 7 +/– 2 submodules per level is considered optimal for the following reason:
(a) It reduces the memory requirements of the program
(b) It matches approximately the number of distinct concepts that can be handled simultaneously by an
average developer
(c) It increases the speed of the program
(d) It appeals to the subjective taste of the average developers
(e) None of the above
Answer: (b). Psychological/cognitive considerations are the basis for many guidelines for improving productivity
in software engineering. This particular guideline has nothing to do with program performance or memory
requirements, and there is nothing subjective about it.
Controller
Model
subscriber
notifier
initiator
*
repository1
1
*
View
Question 9. Which of the following can be a sequence of events involved in the MVC architecture, according to
the class diagram above:
(a) A Model object sends an event to a View object, which notifies a Controller object
(b) A View object sends an event to a Model object, which notifies a Controller object
(c) A Controller object sends an event to a Model object, which notifies several View objects
(d) All of the above
(e) None of the above
Answer: (c). This is the only one consistent with the associations in the diagram and the basic MVC architecture.
In some variations of MVC, controllers might “talk to” views, but, even there, views do not “talk back” to
controllers.
The following two questions refer to the following insertion sort routine. (Array indices start at 1.)
routine insertionSort (A)
for j = 2 to length of array A
// INV: ...
key = A[j]
i = j – 1
while i  0 and A[i]  key do
A[i + 1] = A[i]
i = i – 1
end while
A[i + 1] = key
end for
Page 5
Question 10. Assume the insertionSort routine is used internally by a program. Which of the following
pre- and post-condition pairs is the most appropriate for insertionSort from a maintainability viewpoint?
(a) Pre: none; post: array is sorted
(b) Pre: array is not sorted; post: array is sorted
(c) Pre: array has at least one element; post: array is sorted
(d) Pre: array has at least two elements; post: array is sorted
(e) Pre: array reference is non-null; post: array is sorted
Answer: (e). As per tutorial, array references can (and should) be constrained by assertions. Option (a) is a close
call but Option (e) is more appropriate.
Question 11. Which of the following assertions is valid each time the program reaches the line “INV”?
(a) Items 1 through j are sorted
(b) Items 1 through j – 1 are sorted
(c) key equals A[j]
(d) i equals 0
(e) j equals 1
Answer: (b). All other options can be invalidated at some iteration of the loop.
Question 12. Keeping CRC cards to the size of 4x6 inches is considered important because:
(a) Software engineers prefer even numbers and inch measurement units
(b) This size allows just enough space to describe a class of optimal complexity in large script
(c) This size is conducive to optimal performance in implementing an object-oriented program
(d) All of the above
(e) None of the reasons above
Answer: (b). For this reason, some software developers actually feel very strongly about 4”X6” CRC cards.
Options (a) and (c) are ludicrous.
Question 13. Which of the following applies to the statement “If class X uses defensive programming in each
method, then good programming practice recommends that any subclass Y that inherits from X should also use
defensive programming in each method”
(a) Always true
(b) Always false
(c) It depends on whether or not the subclass is used at the boundary of the system
(d) It depends on whether the class invariant of Y is stronger than that of X or the same
(e) None of the above
Answer: (d). Option (a) is close but not quite right. If class X uses defensive programming in method M then
method M accepts any values for the parameters and the class fields. The Liskov Substitution Principle (LSP)
requires that class Y has method M that can also take any values for the parameters. However, the invariant of
class Y could be stronger, in which case method M can make certain assumptions regarding the values of the
Page 6
class fields, without violating the LSP as long as proper encapsulation avoids direct access to the object’s fields.
The LSP is an excellent rule of thumb for using inheritance.
Question 14. You are developing a command-line user interface. Which of the following design patterns is the
most likely to make it easy to add new commands in later versions of the program?
(a) Command
(b) Composite
(c) Observer
(d) Strategy
(e) Proxy
Answer: (a). The Command pattern is used specifically for the purpose of making it easy to add new commands.
Question 15. Which of the following checks is LEAST likely to detect maintainability problems in an object-
oriented design?
(a) Tracing in the class diagram one scenario for each use case
(b) Tracing each design element to a functional requirement
(c) Checking that none of the design elements can be removed
(d) Checking for naming conflicts
(e) Using calibrated stubs to predict performance
Answer: (e). Calibrated stubs will detect performance problems but not maintainability problems. Tracing
scenarios in the class diagrams and checking for naming conflicts will detect inconsistencies; tracing design
elements and checking for removable design elements will detect redundancies. Inconsistency and redundancy
lead to poor maintainability.
Page 7
SECTION II – ESSAY-TYPE QUESTIONS
WRITE YOUR ANSWERS IN THE ANSWER BOOKLET
Question 16. (Requirements, analysis)
You are developing ThumbsUp, a browser for the newest WebBerry, a popular wireless device that has a color
display and a mouse wheel, but no keyboard and no mouse. ThumbsUp has the following buttons only: “Back”,
“Forward”, “Page”, and “Exit”, in this sequence. Initially, ThumbsUp is in the “buttons” mode of operation, where
moving the wheel cycles through the buttons in the sequence above, and clicking the wheel activates the selected
button. As usual, buttons “Back” and “Forward” move back and forward through a list of recently visited web
pages, and button “Exit” exits the browser. Button “Page” makes the browser go into the “page” mode of
operation where moving the wheel cycles through the hyperlinks on the currently displayed web page and double-
clicking the wheel activates the selected hyperlink and loads and displays a new web page. Triple-clicking the
wheel goes back to the “buttons” mode. The default selections on entry to the “buttons” and “page” modes are the
“Back” button and the first hyperlink of the current page, respectively. The screen scrolls automatically in the
“page” mode to keep the current link within the viewable area. Each time ThumbsUp starts, it displays the home
page of WebBerryWorld.com, which has hyperlinks to several major web directories.
(a) Draw a use case diagram for ThumbsUp. Be sure to cover both stated and implied requirements and give
self-explaining names to the diagram elements. [10]
User
HttpServer
PageRestore
Back
LoadPage
Forward
LoadStartPage
Exit
ButtonsMode
include
include
PageMode
include
include
(b) Draw a sequence diagram for a scenario to visit 3 web pages (including the home page), then go back 1
web page, then go forward 1 web page to the last page visited. [10]

Weitere ähnliche Inhalte

Was ist angesagt?

Software Defined Networking(SDN) and practical implementation_trupti
Software Defined Networking(SDN) and practical implementation_truptiSoftware Defined Networking(SDN) and practical implementation_trupti
Software Defined Networking(SDN) and practical implementation_truptitrups7778
 
Virtualization in cloud computing ppt
Virtualization in cloud computing pptVirtualization in cloud computing ppt
Virtualization in cloud computing pptMehul Patel
 
Event Driven Architectures with Apache Kafka on Heroku
Event Driven Architectures with Apache Kafka on HerokuEvent Driven Architectures with Apache Kafka on Heroku
Event Driven Architectures with Apache Kafka on HerokuHeroku
 
HCI LAB MANUAL
HCI LAB MANUAL HCI LAB MANUAL
HCI LAB MANUAL Um e Farwa
 
SAP-System Application & Products
SAP-System Application & ProductsSAP-System Application & Products
SAP-System Application & ProductsMaheshkumar Darji
 
Class diagram- UML diagram
Class diagram- UML diagramClass diagram- UML diagram
Class diagram- UML diagramRamakant Soni
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering conceptsKomal Singh
 
Role of system analyst
Role of system analystRole of system analyst
Role of system analystShaileshModi9
 
Component and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewComponent and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewRajiv Kumar
 

Was ist angesagt? (20)

scheduling techniques and SLA.pptx
scheduling techniques and SLA.pptxscheduling techniques and SLA.pptx
scheduling techniques and SLA.pptx
 
Software Defined Networking(SDN) and practical implementation_trupti
Software Defined Networking(SDN) and practical implementation_truptiSoftware Defined Networking(SDN) and practical implementation_trupti
Software Defined Networking(SDN) and practical implementation_trupti
 
SAP HANA on Red Hat
SAP HANA on Red HatSAP HANA on Red Hat
SAP HANA on Red Hat
 
Virtualization in cloud computing ppt
Virtualization in cloud computing pptVirtualization in cloud computing ppt
Virtualization in cloud computing ppt
 
Green cloud
Green cloudGreen cloud
Green cloud
 
Event Driven Architectures with Apache Kafka on Heroku
Event Driven Architectures with Apache Kafka on HerokuEvent Driven Architectures with Apache Kafka on Heroku
Event Driven Architectures with Apache Kafka on Heroku
 
Hipo diagram
Hipo diagramHipo diagram
Hipo diagram
 
HCI LAB MANUAL
HCI LAB MANUAL HCI LAB MANUAL
HCI LAB MANUAL
 
Cloud Computing - Introduction
Cloud Computing - IntroductionCloud Computing - Introduction
Cloud Computing - Introduction
 
SAP-System Application & Products
SAP-System Application & ProductsSAP-System Application & Products
SAP-System Application & Products
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
Class diagram- UML diagram
Class diagram- UML diagramClass diagram- UML diagram
Class diagram- UML diagram
 
Comet Cloud
Comet CloudComet Cloud
Comet Cloud
 
SAP BODS Designer PDF
SAP BODS Designer PDFSAP BODS Designer PDF
SAP BODS Designer PDF
 
Component based software engineering
Component based software engineeringComponent based software engineering
Component based software engineering
 
SAP Hana Overview
SAP Hana OverviewSAP Hana Overview
SAP Hana Overview
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
 
Role of system analyst
Role of system analystRole of system analyst
Role of system analyst
 
Component and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief OverviewComponent and Deployment Diagram - Brief Overview
Component and Deployment Diagram - Brief Overview
 
Energy Aware Clouds
Energy Aware CloudsEnergy Aware Clouds
Energy Aware Clouds
 

Andere mochten auch

Science midterm exam (10)
Science midterm exam (10)Science midterm exam (10)
Science midterm exam (10)ariyacca
 
Gereksinimleri Meydana Çıkarma Teknikleri
Gereksinimleri Meydana Çıkarma Teknikleri Gereksinimleri Meydana Çıkarma Teknikleri
Gereksinimleri Meydana Çıkarma Teknikleri Bilge Adam Kurumsal
 
TALAT Lecture 3300: Fundamentals of Metal Forming
TALAT Lecture 3300: Fundamentals of Metal FormingTALAT Lecture 3300: Fundamentals of Metal Forming
TALAT Lecture 3300: Fundamentals of Metal FormingCORE-Materials
 
I p-o in different data processing systems
I p-o in different data processing systemsI p-o in different data processing systems
I p-o in different data processing systemsKinshook Chaturvedi
 
Critical System Specification in Software Engineering SE17
Critical System Specification in Software Engineering SE17Critical System Specification in Software Engineering SE17
Critical System Specification in Software Engineering SE17koolkampus
 
Yazilim mi̇mari̇leri̇(aoy)
Yazilim mi̇mari̇leri̇(aoy)Yazilim mi̇mari̇leri̇(aoy)
Yazilim mi̇mari̇leri̇(aoy)Ahmet Yanik
 
Ian Sommerville, Software Engineering, 9th Edition Ch1
Ian Sommerville,  Software Engineering, 9th Edition Ch1Ian Sommerville,  Software Engineering, 9th Edition Ch1
Ian Sommerville, Software Engineering, 9th Edition Ch1Mohammed Romi
 
Mid term examination -2011 class vi
Mid term examination -2011 class viMid term examination -2011 class vi
Mid term examination -2011 class viAsad Shafat
 
Topic 4 metal forming 160214
Topic 4 metal forming 160214Topic 4 metal forming 160214
Topic 4 metal forming 160214Huai123
 
Ian Sommerville, Software Engineering, 9th Edition Ch 4
Ian Sommerville,  Software Engineering, 9th Edition Ch 4Ian Sommerville,  Software Engineering, 9th Edition Ch 4
Ian Sommerville, Software Engineering, 9th Edition Ch 4Mohammed Romi
 
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelCHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelmohamed khalaf alla mohamedain
 
Requirement elicitation
Requirement elicitationRequirement elicitation
Requirement elicitationvivacemente
 
Enterprise Systems: SCM, CRM, & ERP
Enterprise Systems: SCM, CRM, & ERPEnterprise Systems: SCM, CRM, & ERP
Enterprise Systems: SCM, CRM, & ERPUMaine
 

Andere mochten auch (18)

Science midterm exam (10)
Science midterm exam (10)Science midterm exam (10)
Science midterm exam (10)
 
Gereksinimleri Meydana Çıkarma Teknikleri
Gereksinimleri Meydana Çıkarma Teknikleri Gereksinimleri Meydana Çıkarma Teknikleri
Gereksinimleri Meydana Çıkarma Teknikleri
 
TALAT Lecture 3300: Fundamentals of Metal Forming
TALAT Lecture 3300: Fundamentals of Metal FormingTALAT Lecture 3300: Fundamentals of Metal Forming
TALAT Lecture 3300: Fundamentals of Metal Forming
 
Kssr English Yr 4 Mid term exam
Kssr  English Yr 4 Mid term examKssr  English Yr 4 Mid term exam
Kssr English Yr 4 Mid term exam
 
I p-o in different data processing systems
I p-o in different data processing systemsI p-o in different data processing systems
I p-o in different data processing systems
 
Critical System Specification in Software Engineering SE17
Critical System Specification in Software Engineering SE17Critical System Specification in Software Engineering SE17
Critical System Specification in Software Engineering SE17
 
Yazilim mi̇mari̇leri̇(aoy)
Yazilim mi̇mari̇leri̇(aoy)Yazilim mi̇mari̇leri̇(aoy)
Yazilim mi̇mari̇leri̇(aoy)
 
Ian Sommerville, Software Engineering, 9th Edition Ch1
Ian Sommerville,  Software Engineering, 9th Edition Ch1Ian Sommerville,  Software Engineering, 9th Edition Ch1
Ian Sommerville, Software Engineering, 9th Edition Ch1
 
Mid term examination -2011 class vi
Mid term examination -2011 class viMid term examination -2011 class vi
Mid term examination -2011 class vi
 
U4 p0 overview of metal forming
U4 p0 overview of metal formingU4 p0 overview of metal forming
U4 p0 overview of metal forming
 
Topic 4 metal forming 160214
Topic 4 metal forming 160214Topic 4 metal forming 160214
Topic 4 metal forming 160214
 
Ian Sommerville, Software Engineering, 9th Edition Ch 4
Ian Sommerville,  Software Engineering, 9th Edition Ch 4Ian Sommerville,  Software Engineering, 9th Edition Ch 4
Ian Sommerville, Software Engineering, 9th Edition Ch 4
 
Ch2 sw processes
Ch2 sw processesCh2 sw processes
Ch2 sw processes
 
Semiotics
SemioticsSemiotics
Semiotics
 
Metal forming processes
Metal forming processesMetal forming processes
Metal forming processes
 
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddelCHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
CHAPTER 6 REQUIREMENTS MODELING: SCENARIO based Model , Class based moddel
 
Requirement elicitation
Requirement elicitationRequirement elicitation
Requirement elicitation
 
Enterprise Systems: SCM, CRM, & ERP
Enterprise Systems: SCM, CRM, & ERPEnterprise Systems: SCM, CRM, & ERP
Enterprise Systems: SCM, CRM, & ERP
 

Ähnlich wie Midterm Exam Solutions Fall03

Final Exam Questions Fall03
Final Exam Questions Fall03Final Exam Questions Fall03
Final Exam Questions Fall03Radu_Negulescu
 
Final Exam Solutions Fall02
Final Exam Solutions Fall02Final Exam Solutions Fall02
Final Exam Solutions Fall02Radu_Negulescu
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docxrosemarybdodson23141
 
Session 3 Software Engineering UGC NET.pdf
Session 3 Software Engineering UGC NET.pdfSession 3 Software Engineering UGC NET.pdf
Session 3 Software Engineering UGC NET.pdfsangeethachandran
 
Primilimnary round questions with answers
Primilimnary round questions with answersPrimilimnary round questions with answers
Primilimnary round questions with answersDr. C.V. Suresh Babu
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineersPawel Szulc
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineersPawel Szulc
 
Specialist marketing officer professional knowledge questions.pdf(1)
Specialist marketing officer professional knowledge questions.pdf(1)Specialist marketing officer professional knowledge questions.pdf(1)
Specialist marketing officer professional knowledge questions.pdf(1)Nivi Mohanty
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz QuestionsGanesh Samarthyam
 
Subject name Object Oriented Analysis and DesignMultiple Choice (.pdf
Subject name Object Oriented Analysis and DesignMultiple Choice (.pdfSubject name Object Oriented Analysis and DesignMultiple Choice (.pdf
Subject name Object Oriented Analysis and DesignMultiple Choice (.pdfakilastationarrymdu
 
PGCET Computer science 2017 question paper
PGCET Computer science 2017 question paperPGCET Computer science 2017 question paper
PGCET Computer science 2017 question paperEneutron
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEWshyamuopten
 

Ähnlich wie Midterm Exam Solutions Fall03 (20)

Final Exam Questions Fall03
Final Exam Questions Fall03Final Exam Questions Fall03
Final Exam Questions Fall03
 
Final Exam Solutions Fall02
Final Exam Solutions Fall02Final Exam Solutions Fall02
Final Exam Solutions Fall02
 
BDS_QA.pdf
BDS_QA.pdfBDS_QA.pdf
BDS_QA.pdf
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docx
 
Higher Homework
Higher HomeworkHigher Homework
Higher Homework
 
midterm_fa07.pdf
midterm_fa07.pdfmidterm_fa07.pdf
midterm_fa07.pdf
 
Session 3 Software Engineering UGC NET.pdf
Session 3 Software Engineering UGC NET.pdfSession 3 Software Engineering UGC NET.pdf
Session 3 Software Engineering UGC NET.pdf
 
Semester ii
Semester   iiSemester   ii
Semester ii
 
Primilimnary round questions with answers
Primilimnary round questions with answersPrimilimnary round questions with answers
Primilimnary round questions with answers
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineers
 
Illogical engineers
Illogical engineersIllogical engineers
Illogical engineers
 
Gate-Cs 1994
Gate-Cs 1994Gate-Cs 1994
Gate-Cs 1994
 
Specialist marketing officer professional knowledge questions.pdf(1)
Specialist marketing officer professional knowledge questions.pdf(1)Specialist marketing officer professional knowledge questions.pdf(1)
Specialist marketing officer professional knowledge questions.pdf(1)
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
 
Software Architecture - Quiz Questions
Software Architecture - Quiz QuestionsSoftware Architecture - Quiz Questions
Software Architecture - Quiz Questions
 
Gate-Cs 1992
Gate-Cs 1992Gate-Cs 1992
Gate-Cs 1992
 
final_2014.pdf
final_2014.pdffinal_2014.pdf
final_2014.pdf
 
Subject name Object Oriented Analysis and DesignMultiple Choice (.pdf
Subject name Object Oriented Analysis and DesignMultiple Choice (.pdfSubject name Object Oriented Analysis and DesignMultiple Choice (.pdf
Subject name Object Oriented Analysis and DesignMultiple Choice (.pdf
 
PGCET Computer science 2017 question paper
PGCET Computer science 2017 question paperPGCET Computer science 2017 question paper
PGCET Computer science 2017 question paper
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEW
 

Mehr von Radu_Negulescu

Intro to Software Engineering - Software Quality Assurance
Intro to Software Engineering - Software Quality AssuranceIntro to Software Engineering - Software Quality Assurance
Intro to Software Engineering - Software Quality AssuranceRadu_Negulescu
 
Midterm Exam Solutions Fall02
Midterm Exam Solutions Fall02Midterm Exam Solutions Fall02
Midterm Exam Solutions Fall02Radu_Negulescu
 
Intro to Software Engineering - Life Cycle Models
Intro to Software Engineering - Life Cycle ModelsIntro to Software Engineering - Life Cycle Models
Intro to Software Engineering - Life Cycle ModelsRadu_Negulescu
 
Intro to Software Engineering - Software Testing
Intro to Software Engineering - Software TestingIntro to Software Engineering - Software Testing
Intro to Software Engineering - Software TestingRadu_Negulescu
 
Intro to Software Engineering - Software Quality Assurance
Intro to Software Engineering - Software Quality AssuranceIntro to Software Engineering - Software Quality Assurance
Intro to Software Engineering - Software Quality AssuranceRadu_Negulescu
 
Intro to Software Engineering - Software Design
Intro to Software Engineering - Software DesignIntro to Software Engineering - Software Design
Intro to Software Engineering - Software DesignRadu_Negulescu
 
Intro to Software Engineering - Module Design
Intro to Software Engineering - Module DesignIntro to Software Engineering - Module Design
Intro to Software Engineering - Module DesignRadu_Negulescu
 
Intro to Software Engineering - Requirements Analysis
Intro to Software Engineering - Requirements AnalysisIntro to Software Engineering - Requirements Analysis
Intro to Software Engineering - Requirements AnalysisRadu_Negulescu
 
Intro to Software Engineering - Coding Standards
Intro to Software Engineering - Coding StandardsIntro to Software Engineering - Coding Standards
Intro to Software Engineering - Coding StandardsRadu_Negulescu
 
Software Engineering Practice - Software Quality Management
Software Engineering Practice - Software Quality ManagementSoftware Engineering Practice - Software Quality Management
Software Engineering Practice - Software Quality ManagementRadu_Negulescu
 
Software Engineering Practice - Software Metrics and Estimation
Software Engineering Practice - Software Metrics and EstimationSoftware Engineering Practice - Software Metrics and Estimation
Software Engineering Practice - Software Metrics and EstimationRadu_Negulescu
 
Software Engineering Practice - Software Business Basics
Software Engineering Practice - Software Business BasicsSoftware Engineering Practice - Software Business Basics
Software Engineering Practice - Software Business BasicsRadu_Negulescu
 
Software Engineering Practice - Project management
Software Engineering Practice - Project managementSoftware Engineering Practice - Project management
Software Engineering Practice - Project managementRadu_Negulescu
 
Software Engineering Practice - Configuration management
Software Engineering Practice - Configuration managementSoftware Engineering Practice - Configuration management
Software Engineering Practice - Configuration managementRadu_Negulescu
 
Software Engineering Practice - Advanced Development Methodologies
Software Engineering Practice - Advanced Development MethodologiesSoftware Engineering Practice - Advanced Development Methodologies
Software Engineering Practice - Advanced Development MethodologiesRadu_Negulescu
 

Mehr von Radu_Negulescu (15)

Intro to Software Engineering - Software Quality Assurance
Intro to Software Engineering - Software Quality AssuranceIntro to Software Engineering - Software Quality Assurance
Intro to Software Engineering - Software Quality Assurance
 
Midterm Exam Solutions Fall02
Midterm Exam Solutions Fall02Midterm Exam Solutions Fall02
Midterm Exam Solutions Fall02
 
Intro to Software Engineering - Life Cycle Models
Intro to Software Engineering - Life Cycle ModelsIntro to Software Engineering - Life Cycle Models
Intro to Software Engineering - Life Cycle Models
 
Intro to Software Engineering - Software Testing
Intro to Software Engineering - Software TestingIntro to Software Engineering - Software Testing
Intro to Software Engineering - Software Testing
 
Intro to Software Engineering - Software Quality Assurance
Intro to Software Engineering - Software Quality AssuranceIntro to Software Engineering - Software Quality Assurance
Intro to Software Engineering - Software Quality Assurance
 
Intro to Software Engineering - Software Design
Intro to Software Engineering - Software DesignIntro to Software Engineering - Software Design
Intro to Software Engineering - Software Design
 
Intro to Software Engineering - Module Design
Intro to Software Engineering - Module DesignIntro to Software Engineering - Module Design
Intro to Software Engineering - Module Design
 
Intro to Software Engineering - Requirements Analysis
Intro to Software Engineering - Requirements AnalysisIntro to Software Engineering - Requirements Analysis
Intro to Software Engineering - Requirements Analysis
 
Intro to Software Engineering - Coding Standards
Intro to Software Engineering - Coding StandardsIntro to Software Engineering - Coding Standards
Intro to Software Engineering - Coding Standards
 
Software Engineering Practice - Software Quality Management
Software Engineering Practice - Software Quality ManagementSoftware Engineering Practice - Software Quality Management
Software Engineering Practice - Software Quality Management
 
Software Engineering Practice - Software Metrics and Estimation
Software Engineering Practice - Software Metrics and EstimationSoftware Engineering Practice - Software Metrics and Estimation
Software Engineering Practice - Software Metrics and Estimation
 
Software Engineering Practice - Software Business Basics
Software Engineering Practice - Software Business BasicsSoftware Engineering Practice - Software Business Basics
Software Engineering Practice - Software Business Basics
 
Software Engineering Practice - Project management
Software Engineering Practice - Project managementSoftware Engineering Practice - Project management
Software Engineering Practice - Project management
 
Software Engineering Practice - Configuration management
Software Engineering Practice - Configuration managementSoftware Engineering Practice - Configuration management
Software Engineering Practice - Configuration management
 
Software Engineering Practice - Advanced Development Methodologies
Software Engineering Practice - Advanced Development MethodologiesSoftware Engineering Practice - Advanced Development Methodologies
Software Engineering Practice - Advanced Development Methodologies
 

Kürzlich hochgeladen

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Midterm Exam Solutions Fall03

  • 1. ________________________________ _________________________________ _________________________________ NAME ID SIGNATURE Department of Electrical and Computer Engineering, McGill University ECSE 321 - Introduction to Software Engineering Midterm Examination October 30, 2003, 11:35am-12:50pm Prof. Radu Negulescu INSTRUCTIONS • Do NOT open this booklet until the start and end times of the examination are written on the board • Write your name, McGill student ID number, and signature on the cover of the answer booklet and at the top of this page. Both booklets need to be handed in to the proctor at the end of the examination • This examination is closed book, closed notes. No aids permitted • Circle one answer only for each multiple-choice question in this examination booklet. Multiple-choice questions are equally weighted. Each question has only one correct answer, which gets 2 marks. Wrong answers get 0 marks or 1 mark (partial credit). No answers or multiple answers in a question get 0 marks for that question • Write your answers to the essay-type questions in the separate answer booklet provided. Draw a diagonal line over each scratch sheet in the answer booklet; scratch sheets will not be marked • This examination has 75 minutes only Good luck!
  • 2. Page 2 SECTION I – MULTIPLE-CHOICE QUESTIONS CIRCLE ONE ANSWER ONLY IN EACH QUESTION Question 1. Which of the following coding conventions, principles or guidelines will NOT help in the development or maintenance of Java code? (a) Lines of code that are logically related should be placed near one another (principle of proximity) (b) Each method of a class should have comments that clearly explain the relationships to every other method of that class (one comment for every pair of methods in the class) (c) Code layout should highlight the logical structure of the code (fundamental principle of code layout) (d) Four spaces should be used as the unit of indentation (Java coding convention) (e) Names should be problem-oriented Answer: (b). Commenting pairs of methods is clearly excessive and it would create massive redundancies by restating the preconditions of one method in all the callers. The other guidelines are used standard practice. Question 2. Waived. (All examinees receive 2 marks.) Question 3. Which of the following statements is true for flat statechart representations of typical software systems? (By “flat statechart” we mean a statechart that does not use nesting or concurrency.) (a) The number of states grows exponentially with the number of components in the system (b) Each state explodes into several outgoing transitions (c) A single transition might lead to several different states (d) Large flat statecharts need to have more than one initial state (e) None of the above Answer: (a). It reflects an important phenomenon that limits what can be practically specified, by “flat” state machines or other means. You have experienced some mild state explosion in Assignment 2 Question 1 (b). Question 4. Which of the following requirements is most likely to occur in a properly stated SRS? (Assume the SRS is “complete”, i.e., none of the requirements below needs to be “complete” all by itself.) (a) “The system shall have a professional-looking user interface.” (b) “Each button in the Formatting toolbar shall have a tooltip.” (c) “The average time for refreshing the display shall be 4 seconds or less.” (d) “The maximum time for registering a key press into memory shall be 0.1 seconds or less.” (e) “The minimum time for refreshing the display shall be 0 seconds, if possible.” Answer: (b). It meets all the criteria of good requirements, and it is particularly good because it specifies a UI feature (“tooltips”) decoupled from the functionality features in the “Formatting toolbar” (regardless of the number of buttons). Option (c) looks good but it is somewhat ambiguous, since it might be interpreted as a “raster refresh rate” assumption rather than the “repainting graphical elements” obligation. It is important to avoid multiple “standard” interpretations even if some of them don’t make much sense from a technical viewpoint. Question 5. Waived. (All examinees receive 2 marks.)
  • 3. Page 3 Source register (Listener) unregister (Listener) cast (Event) Listener handle (Event) *1 ConcreteListener listenerState handle (Event) ConcreteSource subjectState cast (Event) * 1 OLVWHQHU6WDWH HYHQWJHW6WDWH
  • 4. Event copyState getState () *1 FUHDWH QHZ (YHQW H IRU HDFK UHJLVWHUHG /LVWHQHU O OKDQGOHH
  • 5. event (YHQW VRXUFH (YHQW OLVWHQHUV Question 6. Consider the class diagram above, representing a basic event broadcast mechanism. Which of the following statements is NOT true for this diagram? (a) ConcreteSource objects can create new Event objects (b) Listener objects can be added and removed at run time from a list maintained by a Source object (c) The cast(Event) method of a ConcreteSource object calls the handle(Event) method of each registered Listener object (d) ConcreteListener objects update the copyState fields of the Event objects (e) Each Listener object can be registered with only one Source object Answer: (d), because in this diagram event objects cannot be updated. Although in some frameworks we could have listeners registered with multiple sources, Option (e) is not quite right in this diagram because the Source- Listener association has multiplicity 1-*. This diagram is consistent with the basic (unsophisticated) implementations of event passing mechanisms. Question 7. Consider the software driver for a web camera, which captures the video image in real time and makes it available over the Internet. Which of the following can NOT be an actor for the software driver? (a) The Internet connection of the local computer (b) The port used by the video camera (c) The user (d) Arnold Schwarzenegger (e) All of the above are good actors for the web camera software driver (Hint: do not confuse good actors with actor instances.) Answer: (d). Arnie is not an actor because the software doesn’t need to be “aware” of him! Even if Arnie were to purchase the software and use it as a user, Arnie can be at most an actor instance, but not an actor.
  • 6. Page 4 Question 8. The guideline of 7 +/– 2 submodules per level is considered optimal for the following reason: (a) It reduces the memory requirements of the program (b) It matches approximately the number of distinct concepts that can be handled simultaneously by an average developer (c) It increases the speed of the program (d) It appeals to the subjective taste of the average developers (e) None of the above Answer: (b). Psychological/cognitive considerations are the basis for many guidelines for improving productivity in software engineering. This particular guideline has nothing to do with program performance or memory requirements, and there is nothing subjective about it. Controller Model subscriber notifier initiator * repository1 1 * View Question 9. Which of the following can be a sequence of events involved in the MVC architecture, according to the class diagram above: (a) A Model object sends an event to a View object, which notifies a Controller object (b) A View object sends an event to a Model object, which notifies a Controller object (c) A Controller object sends an event to a Model object, which notifies several View objects (d) All of the above (e) None of the above Answer: (c). This is the only one consistent with the associations in the diagram and the basic MVC architecture. In some variations of MVC, controllers might “talk to” views, but, even there, views do not “talk back” to controllers. The following two questions refer to the following insertion sort routine. (Array indices start at 1.) routine insertionSort (A) for j = 2 to length of array A // INV: ... key = A[j] i = j – 1 while i 0 and A[i] key do A[i + 1] = A[i] i = i – 1 end while A[i + 1] = key end for
  • 7. Page 5 Question 10. Assume the insertionSort routine is used internally by a program. Which of the following pre- and post-condition pairs is the most appropriate for insertionSort from a maintainability viewpoint? (a) Pre: none; post: array is sorted (b) Pre: array is not sorted; post: array is sorted (c) Pre: array has at least one element; post: array is sorted (d) Pre: array has at least two elements; post: array is sorted (e) Pre: array reference is non-null; post: array is sorted Answer: (e). As per tutorial, array references can (and should) be constrained by assertions. Option (a) is a close call but Option (e) is more appropriate. Question 11. Which of the following assertions is valid each time the program reaches the line “INV”? (a) Items 1 through j are sorted (b) Items 1 through j – 1 are sorted (c) key equals A[j] (d) i equals 0 (e) j equals 1 Answer: (b). All other options can be invalidated at some iteration of the loop. Question 12. Keeping CRC cards to the size of 4x6 inches is considered important because: (a) Software engineers prefer even numbers and inch measurement units (b) This size allows just enough space to describe a class of optimal complexity in large script (c) This size is conducive to optimal performance in implementing an object-oriented program (d) All of the above (e) None of the reasons above Answer: (b). For this reason, some software developers actually feel very strongly about 4”X6” CRC cards. Options (a) and (c) are ludicrous. Question 13. Which of the following applies to the statement “If class X uses defensive programming in each method, then good programming practice recommends that any subclass Y that inherits from X should also use defensive programming in each method” (a) Always true (b) Always false (c) It depends on whether or not the subclass is used at the boundary of the system (d) It depends on whether the class invariant of Y is stronger than that of X or the same (e) None of the above Answer: (d). Option (a) is close but not quite right. If class X uses defensive programming in method M then method M accepts any values for the parameters and the class fields. The Liskov Substitution Principle (LSP) requires that class Y has method M that can also take any values for the parameters. However, the invariant of class Y could be stronger, in which case method M can make certain assumptions regarding the values of the
  • 8. Page 6 class fields, without violating the LSP as long as proper encapsulation avoids direct access to the object’s fields. The LSP is an excellent rule of thumb for using inheritance. Question 14. You are developing a command-line user interface. Which of the following design patterns is the most likely to make it easy to add new commands in later versions of the program? (a) Command (b) Composite (c) Observer (d) Strategy (e) Proxy Answer: (a). The Command pattern is used specifically for the purpose of making it easy to add new commands. Question 15. Which of the following checks is LEAST likely to detect maintainability problems in an object- oriented design? (a) Tracing in the class diagram one scenario for each use case (b) Tracing each design element to a functional requirement (c) Checking that none of the design elements can be removed (d) Checking for naming conflicts (e) Using calibrated stubs to predict performance Answer: (e). Calibrated stubs will detect performance problems but not maintainability problems. Tracing scenarios in the class diagrams and checking for naming conflicts will detect inconsistencies; tracing design elements and checking for removable design elements will detect redundancies. Inconsistency and redundancy lead to poor maintainability.
  • 9. Page 7 SECTION II – ESSAY-TYPE QUESTIONS WRITE YOUR ANSWERS IN THE ANSWER BOOKLET Question 16. (Requirements, analysis) You are developing ThumbsUp, a browser for the newest WebBerry, a popular wireless device that has a color display and a mouse wheel, but no keyboard and no mouse. ThumbsUp has the following buttons only: “Back”, “Forward”, “Page”, and “Exit”, in this sequence. Initially, ThumbsUp is in the “buttons” mode of operation, where moving the wheel cycles through the buttons in the sequence above, and clicking the wheel activates the selected button. As usual, buttons “Back” and “Forward” move back and forward through a list of recently visited web pages, and button “Exit” exits the browser. Button “Page” makes the browser go into the “page” mode of operation where moving the wheel cycles through the hyperlinks on the currently displayed web page and double- clicking the wheel activates the selected hyperlink and loads and displays a new web page. Triple-clicking the wheel goes back to the “buttons” mode. The default selections on entry to the “buttons” and “page” modes are the “Back” button and the first hyperlink of the current page, respectively. The screen scrolls automatically in the “page” mode to keep the current link within the viewable area. Each time ThumbsUp starts, it displays the home page of WebBerryWorld.com, which has hyperlinks to several major web directories. (a) Draw a use case diagram for ThumbsUp. Be sure to cover both stated and implied requirements and give self-explaining names to the diagram elements. [10] User HttpServer PageRestore Back LoadPage Forward LoadStartPage Exit ButtonsMode include include PageMode include include (b) Draw a sequence diagram for a scenario to visit 3 web pages (including the home page), then go back 1 web page, then go forward 1 web page to the last page visited. [10]
  • 10. Page 8 :WheelCtrl :ThumbsUp move :User WebBerryWorld move selectForwardButton getPage loadWebPage selectBackButton selectPageButton pressPageButton click selectHyperlink move activateHyperlink double click getPage HttpServer1 HttpServer2 selectHyperlink move activateHyperlink double click getPage triple click selectBackButton displayPage(page1) move selectForwardButton displayPage(page2) page1 page2 (c) Briefly describe how the requirements above may be changed to make them simpler, easier to implement, and more useful to the user. Keep your description within 1/2 page maximum. Focus on the main functional requirements only; do NOT discuss non-functional requirements, error conditions or secondary flows. Hint: Try to make the user interaction with the browser more uniform. [5] As discussed at the lectures, keeping requirements consistent provides better usability and learning curve for the users AND a simpler system with more general modules and fewer special cases. To avoid inconsistencies between the clicking rules for the buttons and the hyperlinks, hyperlinks should be selected by a single click in the page mode, just like the buttons are selected in the buttons mode. There should be some way of returning to the buttons mode, and the simplest way is by double clicking. (Frequent operations should have simple commands.) Further, for consistency of clicking rules, we can do away with the “Page” button and use a double click to go to the page mode. An option is to keep the “Page” button but also allow switching to the page mode by double click. Another possibility is to have a single loop of buttons and hyperlinks. However, that might make it more difficult to navigate back to the buttons. We can use double clicking instead of triple clicking to go to the Back button from any hyperlink. Question 17. (Design) You are developing WareStar, a software system for tracking warehoused computer subsystems. Subsystems can be assembled on site from parts and from other warehoused subsystems. Subsystems can be removed from WareStar by a user. When the number of subsystems of a certain type falls below a predetermined lower limit, WareStar schedules assembly orders (in-house) or supply orders (to manufacturers) to replenish the inventory up to a predetermined upper limit. (a) Draw a class diagram for a high-level design model for WareStar. Hint: use the Composite pattern. [10]
  • 11. Page 9 recursively remove and order subsystems UI SubSys qty, onOrder, LL, UL addQty removeQty order * Part order CompositeSubSys order * StockCtrl subSys qtyUpdate updateStock checkLowerLimit 1 create OrderCtrl subSys qty issueOrder Order Qty issue SupplyOrder issue AssemblyOrder issue * ManufacturerInfo contactInfo sendOrder create SubSysCatalog newSubSys retrieveSubSys OrderDBAdaptor recordOrder 1 * 1 * 1 * 0..1 1 1 * 1 * 1 1 1 * create issue Inventory ControlBoundary Orders create (b) Draw a statechart representing the lifecycle of a subsystem type maintained by WareStar, to clarify at least the following issues: creation of the type, ordering from the manufacturer, reaching the lower control limit. Make sure this statechart is consistent with the methods in the class diagram in Part (a). [5] Low StocknewSubSys order On Order addQty Full Stock removeQty Check LL [qty=LL] [qtyLL] (c) State any invariants on the data structures involved in Part (a). [5] Invariants: (LL = qty + onOrder = UL) The “manufacturer” is the same for all SupplyOrder-s that are issued by the same SubSys The components of a subsystem are always the same as on creation of that subsystem.