Midterm 1 OverviewOverview of TopicsSoftware Life CycleObject-Oriented DesignUnified Modeling Language (UML)NetworkingAlgorithmic ComplexityMidterm Question FormatsMultiple Choice Question ExampleShort 1-Sentence Answer ExampleClass Design ExampleAnalyze UML ExampleDraw UML ExampleAnalyze Complexity ExampleMidterm 1 Overview Fawzi EmadChau-Wen TsengDepartment of Computer ScienceUniversity of Maryland, College ParkOverview of Topics1. Software development & software life cycle2. Object-oriented design3. Unified Modeling Language (UML)4. Networking5. Algorithmic complexitySoftware Life CyclePhases of cycleSpecification … maintenanceWaterfall modelProgram design methodsTop downObject orientedTestingVerificationEmpiricalUnit, integration, acceptance testsCode coverageObject-Oriented DesignObjects & classesMotivationState, behavior, identityInheritanceFinding classesNouns in problem specificationFinding methodsVerbs in problem specificationUnified Modeling Language (UML)UML ViewsLogical, use-caseClass diagramsAssociation (has a …)Dependency (uses a …)Generalization (is a …)ImplementationMultiplicitySequence diagramsNetworkingNetwork modelPhysical layer … application layerNetwork conceptsIP address, sockets, ports, URLsReliabilityConnections vs. packetsTCP vs. UDPClient / serverJava network supportSocket, ServerSocket, DatagramSocket, URLApplets, Java sandboxAlgorithmic ComplexityBenchmarking vs. analysisAsymptotic analysisBig-O notationAverage & worst caseComparing complexityFinding critical sectionsFinding codeEvaluating complexityRecursive algorithmsMidterm Question FormatsMultiple choice questionsShort 1-sentence answersDesign classes (from specification)Analyze UML class diagramsDraw UML class diagrams (from code)Analyze complexity of code fragmentsMultiple Choice Question ExampleUsing Object-Oriented design, we view a problem as a collection ofObjectsFunctionsNone of the aboveWe find objects in the problem specification by looking forNounsVerbsAll of the aboveShort 1-Sentence Answer ExampleWhat is an IP address?A unique 64-bit number for each computer connected to the internet using the Internet Protocol (IP)How do you get an IP address for your computer?Your IP address is assigned by a server at your service provider when you connect to the internetClass Design ExampleGiven the following problem specificationDesign a heating simulation where each room has a thermostat that controls a heater. The thermostat turns on the heater if the current temperature in the room is lower than the thermostat setting.Design the classes for solving the problemData for each classMethods for each classAnalyze UML ExampleGiven the following UML class diagramWhich classes contain class W?Which classes use class Z?Which classes may change if class Z changes?How many instances of class W does class Y have?Can class X be used wherever class Y is used?X ZY W*Draw UML ExampleDraw UML class diagram for following codeclass foo { go() { class bar b;}}class bar { class foo f;}class test extends foo { }Analyze Complexity ExampleWhat is the complexity of the following codes?for (i = 1; i < n; i++) {for (j = 1; j < 2*n; j++) …}}for (i = 1; i < n; i=i*4) {for (j = 1; j < 100; j++)
View Full Document