CMPS 282 Final, Spring 2005

American University of Beirut · Software Engineering · 11 pages

All CMPS 282 files
CMPS 282 Final, Spring 2005, page 1

Stuck on a question? A tutor can walk you through it.

CMPS 282 Final, Spring 2005, page 2 CMPS 282 Final, Spring 2005, page 3 CMPS 282 Final, Spring 2005, page 4 CMPS 282 Final, Spring 2005, page 5 CMPS 282 Final, Spring 2005, page 6 CMPS 282 Final, Spring 2005, page 7 CMPS 282 Final, Spring 2005, page 8 CMPS 282 Final, Spring 2005, page 9 CMPS 282 Final, Spring 2005, page 10

Showing the first 10 of 11 pages. Download the PDF to see all of it.

More CMPS 282 files

Show the text of this final exam
June 8, 2005 CMPS 282 Final Exam ND X 4 rye “ AUPARY OF eeigut eee coll Student Name: Student ID: Signature: Section: There are eleven pages, including this one. The test is out of 100 marks, and the value of each question is provided. Please use this information to manage your time effectively. Question 1: Question 2: Question 3: Question 4: Question 5: Question 6: Total: Marcel R. karam June 8, 2005 CMPS 282 Final Exam Question 1: True or False [10 marks] Answer by placing either a T or F for True and False, respectively. Incorrect answers incur a pen- alty at a floor (2:1) ratio. A) Black-box testing involves testing the functionality of a software component without knowing the details of its internal logic. __ B) In is scenario-based testing, the user tasks described in the use-cases are used to construct the test cases. ___ C) White-box testing involves testing the independent logic paths with full implementation knowledge. __ D) Component-level design defines the data structures, algorithms, interface characteristics, and communication mechanisms allocated to each software component. __ E) Coupling is a qualitative measure of the degree to which classes are connected to one another. __ F) Successful test does not demonstrate compliance with function and performance. __ G) Airline reservation system; library catalog system; and hotel booking system are not an example of Data Centered Architecture. __ H) A GUl-based applications is not an example of an Object-oriented architectures __ 1) All infrastructure requirements are initially visible in the problem or business domain. __ J) The intent of the analysis model is not to provide a description of the required information, functional, and behavioral domains for a computer-based system. __ Marcel R. karam June 8, 2005 CMPS 282 Final Exam Question 2 Analysis & Modeling [20 marks] A) A Library System is used to manage books to be loaned to borrowers. A librarian is a person who manages a library system. A borrower can be either a student or a staff member. To take out a loan, a borrower goes to a librarian at the loans desk with his/her id and the books which he/she would like to borrow. The librarian scans the student id using a barcode scanner. The Library System checks if the borrower has accumulated library fine in excess of $20. If this is the case, the borrower is not allowed to borrow any books. Otherwise, the librarian scans the barcode of each book to be borrowed to record the loan. The System checks if the number of books borrowed against the borrowing limit of the borrower. Once the limit has been reached, the system displays a notification and no more books can be borrowed. To find a book to borrow, a borrower can do a search on the system based on the book's call number, the name of the author or the title of the book. Create the use cases analysis model of the above system. [10 marks] Marcel R. karam 3/11 June 8, 2005 CMPS 282 Final Exam B) One object that has an interesting dynamic behavior in the Library System outlined in (A) isa Book object. Say we get the following additional information about the life of a Book object in the system: * A book is categorized as a reference or non-reference book. A reference book is not avail- able for loan. Once a book has been purchased, it will be catalogued. After it has been cata- logued, a non-reference book will become available for loan. + Whenever a book on loan is returned, it will be put back on the shelves and it will be avail- able for loan. A book on loan is considered overdue if it has not been returned after the due date. When an overdue book is eventually returned, it will be put back on the shelves avail- able for loan. An overdue book which has not been returned !2 months after the due date is considered lost. * When a book is no longer required, it will be disposed of. Design a state diagram to show the dynamic behavior of class Book. [10 marks] Marcel R. karam 4/il . June 8, 2005 CMPS 282 Final Exam Question 3 Object Oriented Design [5 marks] A) How is Responsibility-Driven Design achieved? [| marks] B) What are CRC cards good for? Give an example. [4 marks] Marcel R. karam June 8, 2005 CMPS 282 Final Exam Question 4 Component-based Development [25 marks] A) The following is an example of what a component would look like if a programming language supports it. Take this code, and produce a UML component level design from the code. [6 marks] Component component_A BEGIN Realizes classInterfacexX, classInterfacea; //realizes --> list all the interfaces that implement the component's behavior. Imports componentl, component2; //Imports --> list all the components that are used in this component. Uses class_A, class _B; //uses--> list all classes used to implement component behavior; Exports class_A; //export--> list all classes needed by clients to properly use the component service. begin class A {void do()i}; elass B {void dodo();}; end END B) which pattern is more appropriate to use, when only one instance of an object O needs to be created in a running system S. [4 marks] Marcel R. karam June 8, 2005 CMPS 282 Final Exam C) Give an example of the use of factory pattern. You should present the example in the context of a C++/java/php example and a use case. [7 marks}. Use back page if necessary. D) A basic component design principle, as seen in the UML diagram below, describes an internet job agent component. This component, once enabled by a user, can search for a job based on the job catalog (as seen in the class hierarchy in the left hand side of the UML diagram. This design approach encourages openness for extension and tightness for modification. What type of prin- cipal design is it? And what are its advantages? justify your answer by giving an example that stresses the openness of extension and tightness of modification [8 marks] + JobCatalog —— ZN + Academics + Library | — — i : IT Library Academics 1 (from UML Class Moge)) _ . (trom UML Class Mooe) © (from UML Class Mage!) 7 + e-JobAgent Marcel R. karam June 8, 2005 CMPS 282 Final Exam Question 5 GUI [15 marks] A) Think about two “things” you encounter in your everyday life. These can include things like doors and windows, electronic and mechanical equipment, cars, administrative structures (like registration lines, for example). | would prefer it if you avoid things like computer hardware and software. As you use these “things” | want you to think about which ones are easy to use, learn and remember, and which are hard. For each one of these two “things”, write a few sentences about the ease of use, learning, and remembering. Here you should discuss whether a thing is easy to use, learn or remember, and why. [7 marks] Use back page if necessary. B) Describe a scenario by which a GUI designer can reduce the user's memory load [3 marks] C) Describe in the cqntext of your project, the user interface design process [5 marks] Marcel R. karam , June 8, 2005 CMPS 282 Final Exam Question 6 Testing [25 marks] Given a control flow graph (CFG) G(v,e), where v is the number of vertices, and e the number of edges, E is the entry node of the graph, and X is its exit node. A) Draw the CFG for the following code: [3 marks] Void foo(){ int xX,Y,2; x=25; y=x/5; Z=x*y; if(y <3) printf("%d", x); 1 int£ ("Sd" ; nn else printt( ry) a [x FS io yeny «3 2 bn Lao AR? | 8, / NY or Agia’ a“ ™ B) Extract the all-dus with regards to variables x and y.[3 marks] C) Give a C example that shows, and prove that all-node testing is weaker than all branches. You should draw the CFG [4 marks]. Marcel R. karam 9/11 , June 8, 2005 CMPS 282 Final Exam D) Calculate the cyclomatic complexity of the following CFG. [3 marks] F) In OO testing, give an example to illustrate the challenges of calculating all-dus in the pres- ence of a polymorphic server. [3 marks] Marcel R. karam 10/11