Warm Up CS 2212 Software Engineering 1 What

  • Slides: 25
Download presentation
Warm Up – CS 2212 Software Engineering 1. What do you think the term

Warm Up – CS 2212 Software Engineering 1. What do you think the term “Software Engineering” implies that is different from the typical program you wrote in cs 1026 or cs 1027 Some Possible Answers: • Size of the project is much bigger • Team work required • We want reliable software which implies we must do lots of testing • It would be nice if we also had reusable code • The program may be in use for several year (needs to be long lasting) • Engineering implies a systematic approach Warm ups for cs 2212 1

Warm Up Questions: 1. 2. 3. 4. 5. 6. 7. 8. What are the

Warm Up Questions: 1. 2. 3. 4. 5. 6. 7. 8. What are the 5 key attributes of “Quality” software? List 3 of the 4 parts of the textbook’s definition of the term “Software Engineering” What will format will the quiz be and what will it be testing? When will the quiz be? What day will you meet with your group…IT IS VERY IMPORTANT YOU SHOW UP THAT DAY IF YOU WANT YOUR GROUP TO PICK A MEETING TIME THAT SUITS YOUR SCHEDULE! When is the individual assignment due? When is the GUI workshop? When is the first group assignment due? Warm ups for cs 2212 n ANSWERS 1. Usability, Reliability, Efficiency, Maintainability, Reusability -Solving problems, systematic development, -large high quality software, -within a time/cost constraint Multiple choice, your knowledge of the project specifications -8 See course outline… 2. 3. 4. 2

Warm Up Question Chapter 11: Draw a PERT diagram for the following tasks: Task

Warm Up Question Chapter 11: Draw a PERT diagram for the following tasks: Task Preceding Task Description Duration A None Write CS 212 Exams 10 B A Photocopy Exam 2 C None Book Exam Room 1 D C Hire Proctors 4 E B, D Proctor Exam 3 Answer: 0 1 0 A 10 C 1 Warm ups for cs 2212 2 10 10 B 2 D 3 1 8 12 4 12 E 3 5 15 15 4 3

Warm Up Question Chapter 11: Draw a Gantt diagram for the following tasks: Task

Warm Up Question Chapter 11: Draw a Gantt diagram for the following tasks: Task Preceding Task Description Duration A None Write CS 212 Exams 10 B A Photocopy Exam 2 C None Book Exam Room 1 D C Hire Proctors 4 E B, D Proctor Exam 3 Answer: Warm ups for cs 2212 4

Warm Up Chapter 11 1. 2. 3. Name at least 2 software process models/methodologies

Warm Up Chapter 11 1. 2. 3. Name at least 2 software process models/methodologies Name/describe at least 2 of the cost estimations given in the text book Explain the difference between the following two PERT nodes: 7 10 13 7 13 13 Answers: n n n Waterfall, Agile, Spiral, Phased Release, Evolutionary, Concurrent Divide and Conquer, Include all activities, Previous Experiences, Account for Differences, Anticipate Worst Case, Combine Independent Estimates, Revise as you go The first one has 3 hours of possible slack/give time, the second has NO give time. Warm ups for cs 2212 5

Warm Up Chapter 2 n Organize each of the following items into sets of

Warm Up Chapter 2 n Organize each of the following items into sets of inheritance hierarchies of classes. Remember the isa rule, you may need to add extra classes to act as super classes, you may want to remove things, you may find that two items correspond to the same class, you may find some classes are actually instances. Insurance Policy Renewal Deductible Insurance Client Insured Property Auto Policy Home Policy Life Insurance Claim Beneficiary Insurance. Policy Auto. Policy Home. Policy Transaction Life. Ins. Policy Claim Policy. Renewal Person Deductable Insurance. Client Warm ups for cs 2212 Beneficiary Insured. Property 6

Warm Up Chapter 4 n Classify the following requirements statement into one of: F

Warm Up Chapter 4 n Classify the following requirements statement into one of: F (functional), Q (non functional, quality requirements), PL (non functional, platform (environment/technology/system), PR (non functional, process (project plan/development methods) or X (should not be in the requirements document) 1. The userid must be 6 characters long 1. F 2. DB 2 will be used to store the data 2. PL 3. The software must run using less than 50 MB of memory 3. Q 4. A bubble sort will be used to order the last names of customers 4. X 5. The spiral methodology will be used when developing the software 5. 6. Only 2 minutes of downtime per week will be permitted 6. Q 7. Flight fares must include 7% GST and 7%PST 7. F Warm ups for cs 2212 PR 7

Warm Up Chapter 4 Draw a Use Case diagram for the following scenario: A

Warm Up Chapter 4 Draw a Use Case diagram for the following scenario: A customer goes to an ATM and enters his/her pin number. The customer can withdraw cash, get the balance of an account, pay bills or deposit cheques. A teller can change set up the system to allow the customer to change his/her pin number. n Enter PIN Account Empty Change PIN <<exclude>> Withdraw Cash Prepare For PIN Change Deposit Cheque <<include>> Pick Account <<include>> Customer Get Balance <<include>> Teller Warm ups for cs 2212 8

Warm Up Chapter 4 n Draw a Use Case diagram for the following scenario

Warm Up Chapter 4 n Draw a Use Case diagram for the following scenario (you must have at least 3 actors, 5 use cases, 1 extension and 1 inclusion): Write a new email reader and composer/sender like PINE or Outlook. Invalid Email Address Compose Email <<exclude>> Send Email Modify Address Sender Delete Address Internet Address <<include>> Receiver Warm ups for cs 2212 Read Email 9

Warm Up Chapter 5 n Put the multiplicity markers on the following associations, be

Warm Up Chapter 5 n Put the multiplicity markers on the following associations, be prepared to justify your answer: Has rented Customer Car Currently renting Customer * Has rented 0. . 1 Currently renting Warm ups for cs 2212 * 0. . 1 Car 10

Warm Up Chapter 5 n n Assume we have to make a UML class

Warm Up Chapter 5 n n Assume we have to make a UML class diagram for a Bridge Card Game Tournament. In bridge there are 4 players, players partner with the person across the table from them and every player gets 13 cards. Assume our classes are: PLAYER, CARD, GAME and our associations are: DEALT, PARTNERS, PLAY partners 1 1 Player 4 dealt 1 Card plays 1 Warm ups for cs 2212 13 Game 11

Warm Up Chapter 5 n 1. 2. . . A directed graph is a

Warm Up Chapter 5 n 1. 2. . . A directed graph is a set of vertices, some of which are connected by arrows. Draw a class diagram for this graph to the right Draw a class diagram if the graph is undirected Vertex * end Vertex Warm ups for cs 2212 2 * start connects . . Vertex joins * to from * * Arrow Edge 12

Warm Up Chapter 5 n If we were modeling a courier system (like Fed.

Warm Up Chapter 5 n If we were modeling a courier system (like Fed. Ex), what might be some of the possible classes and associations. Draw a class diagram. Courier Warm ups for cs 2212 1. . * delivering * Package * Destination 1 addressed to 13

Warm Up Chapter 5 n Assume we have 2 classes: MAN and WOMAN, draw

Warm Up Chapter 5 n Assume we have 2 classes: MAN and WOMAN, draw a class diagram for the association “has married” for each of the following three scenarios: ¨ ¨ ¨ There is no such thing as divorce ( or widows remarrying ) There is divorce We want to show the association “currently married to” MAN 0. . 1 has married 0. . 1 WOMAN 0. . * has married 0. . & WOMAN 0. . 1 WOMAN Warm ups for cs 2212 currently married to 14

Warm Up Chapter 7 n Think of at least 5 of the 12 Guidelines

Warm Up Chapter 7 n Think of at least 5 of the 12 Guidelines for design an interface: 1. Do not rely on guidelines, test with users 2. Base GUI design on use cases 3. Make sure user can complete a task as simply as possible 4. Ensure user knows what to do next 5. Give good feedback and good error messages 6. Ensure user can go back or undo 7. Ensure response time is adequate 8. Use clear encoding techniques 9. Ensure UI is uncluttered 10. Consider needs of different types of users 11. Provide help 12. Be consistent Warm ups for cs 2212 15

Warm Up Chapter 7 n Find two ways to improve the following user interface

Warm Up Chapter 7 n Find two ways to improve the following user interface (red is the user’s data entry) CUSTOMER MENU Enter Customer First Name: Homer 1. Add Customer Enter Customer Last Name: <enter> 2. Modify Customer Error, Try Again 3. Delete Customer Enter your choice: 1 Enter Customer Last Name: Simpson Done Answers: 1. Commands should NOT be numbers 2. No way to quit 3. Useless error message 4. System is in control, not the user Warm ups for cs 2212 16

Warm Up: Unix Commands 1. What Unix command allows you to see which groups

Warm Up: Unix Commands 1. What Unix command allows you to see which groups you are assigned too? 2. What Unix command lists the groups for each file in a directory? 3. What would you type to put the file test 1. c into the group fytemarkers 4. What would you type to allow other members in the fytemarkers group to have READ access to that file? 5. Can someone in the fytemarkers group READ the file called Read. Me. txt? Warm ups for cs 2212 YES Why? 17

n Chapter 8 Warm Up: Sequence Diagram Draw a sequence diagram to allow a

n Chapter 8 Warm Up: Sequence Diagram Draw a sequence diagram to allow a customer to book a hotel room for several days based on the following class diagram: Hotel. Chain Constructor book. Hotel(dates, hotel) cancel. Booking(dates, hotel) 1 1 Constructor make. Reservation(date) room. Available(date) cancel. Reservation(date) 1. . * Confirmation 1 * Reservation 1 Constructor notify. Customer() Constructor a. Hotel. Chain: Hotel. Chain a. Hotel: Hotel loop book. Hotel(date, a. Hotel) make. Reservation(date) start. Date…end. Date a. Reservation: Reservation room. Available(date) a. Confirmation: Confirmation create notify. Customer Warm ups for cs 2212 18

Chapter 8 Warm Up State Diagram n n Draw a state diagram for a

Chapter 8 Warm Up State Diagram n n Draw a state diagram for a door. The door can be in 1 of 3 states: Opened, Closed, or Locked. NOTE: trigger[guard]/effect or action What causes the object to move from one state to another state. Must be true to move to the next state. Represents the task that ran causing the transition. Eg. 1 reached. Second. Speed[drive. Selected] Eg. 2 do/play. Music closed/[doorway is empty] install door Opened Closed open/ lock/ unlock/ Locked Warm ups for cs 2212 19

Warm Up – Coupling and Cohesion 1. We want ______ coupling 2. We want

Warm Up – Coupling and Cohesion 1. We want ______ coupling 2. We want ______ cohesion 3. What is wrong, in terms of coupling and cohesion with the following function header: void junk (int a, int b, int c, int d, char x, char y, char z, char w); Answers 1. Low 2. High 3. Too many parameters (data coupling), bad function name, clearly trying to do to many things (no functional cohesion), bad parameter names Warm ups for cs 2212 20

Warm Up – Coupling and Cohesion 1. Name 3 types of coupling listed in

Warm Up – Coupling and Cohesion 1. Name 3 types of coupling listed in the book (there are 8 to choose from) 2. Name 3 types of cohesion listed in the book (there are 7 to choose from) 3. Which type of coupling involves global variable? 4. Which type of cohesion involves passing data that was output from one method as input to another method? Answers: • Content, Common, Control, Stamp, Data, Type, Import/Inclusion, External • Functional, Layer, Communicational, Sequential, Procedural, Temporal, Utility • Common • Sequential Warm ups for cs 2212 21

Warm Up – Testing 1. If you plan to test all the functions and

Warm Up – Testing 1. If you plan to test all the functions and methods at the lowest levels, you would need to write lots of ______ to test those functions. 2. Functional testing is: a) Black box testing b) White box testing 3. Unit testing is the last type of testing done: TRUE OR FALSE Answers: • Drivers • a) • False Warm ups for cs 2212 22

Warm Up – Testing 1. gcov finds bugs: TRUE or FALSE 2. gcov generates

Warm Up – Testing 1. gcov finds bugs: TRUE or FALSE 2. gcov generates extra files: TRUE or FALSE 3. Node coverage is stronger than edge cover: TRUE or FALSE 4. A whole c program could be on 1 line (no carriage returns) and thus always give 100% line coverage via gcov: TRUE or FALSE Answers: • FALSE • TRUE Warm ups for cs 2212 23

Warm Up – Testing 1. Which lines would NOT be included in gcov’s counting

Warm Up – Testing 1. Which lines would NOT be included in gcov’s counting of the lines executed 2. In this situation, is line coverage for the above program the same as statement coverage? 3. What is the minimal number of test case(s) (show those test cases) to get 100% line coverage (if 100% line coverage is possible)? Answers: int main() //1 { //2 int x; //3 int y; //4 int z=0; //5 printf("n. Enter x: "); //6 scanf ("%d", &x); //7 printf("n. Enter y: "); //8 scanf("%d", &y); //9 z = x+y; //10 if (z>x) //11 printf("n. Hi"); //12 else //13 printf("n. Bye"); //14 if (z>y) printf ("n. Yes"); //15 else //16 printf("n. No"); //17 printf("n. All Done"); //18 return 0; //19 } //20 • The following lines are NOT counted: 1, 3, 4, 13, 16, 20 (for some reason, it counts line 2 BUT NOT line 20? ? ? ) • No because of line 15 • You would need 2 test cases: Test case 1: x=-1, y=2 Test case 2: x=3, y=-1 Warm ups for cs 2212 24

Warm Up – Functional Testing NOTE: this question was from the 2000 final exam)

Warm Up – Functional Testing NOTE: this question was from the 2000 final exam) Create a minimal list of test cases for size and arr to thoroughly test the functionality of this function: int second (int arr[], /* arr is an array integers stored in value found in the indicates an error Possible Answer: arr 7 8 9 10 7 7 int size) of at most 5 integers; size is the actual number of arr. second returns the position of the second largest first “size” locations of arr. A return value of -1 */ size Expected Result Tests 5 2 Typical case 1 -1 No second largest exists 0 -1 Empty array 9 12 15 4 -1 Size incorrect for num of elements in arr 11 15 20 -1 -1 Size negative 2 4 1 6 -1 Size bigger than possible arr 7 8 2 0 Only 2 elements, does it still work? 7 7 3 0 or 1 or 2 All numbers the same 9 7 7 Warm ups for cs 2212 25