Download presentation
Presentation is loading. Please wait.
Published bySuharto Rachman Modified over 6 years ago
1
Agenda Warmup Lesson 4.5 (Program Design & Analysis) Independent Practice (Hangman, AP Exam Prep) Closure Activity Students will be able to: Understand the Software Development Life Cycle Identify Object-Oriented Program Design Differentiate between Bottom-Up vs. Top-Down Development See how today's lesson fits into the unit and the course as a whole
2
Warmup What are the 4 main sorting algorithms?
Which one is particularly inefficient for large arrays? Which 2 do not use recursion? What are the 2 main searching algorithms? Which is considered more efficient if the array is sorted? What is the result of the following? String[] x = new String[1]; System.out.println(x[0].length()); 7) What is composition? How is composition different from inheritance? How is composition represented on a UML diagram? Convert to binary: 511 True/False: BK’s veggie burger is delicious.
3
Unit 4 Test: Fri 5/18
4
The Software Development Life Cycle
The SDLC is a process to design, develop, and test software. It is made up of these steps: Specification / Requirements Analysis Design Development / Implementation Testing & Debugging Maintenance
5
Each of these 5 steps can be thought of as being part of a waterfall, with each step “flowing” into the next:
6
Development / Implementation: the actual code-writing phase
Specification / Requirements Analysis: a written description of the project Design: a detailed plan for solving the problem outlined in the specification Development / Implementation: the actual code-writing phase Testing & Debugging: the programmer should test his/her code with a representative set of test data, since it is impossible to test for all possible values. All 3 types of errors should be avoided. Code should be robust – it should error check whenever possible, so that inaccurate results and runtime errors are prevented. Maintenance: Code may have to be changed or upgraded as circumstances change. The code should originally be written (and commented on) so that other programmers can understand it.
7
Object-Oriented Program Design
This programming methodology is made up of 5 steps: Identify classes to be written: Usually, you can identify what classes you will write by finding the nouns in the program specification – nouns that describe the major objects in the specification. Identify methods for each class: Now, find the verbs/behaviors the program description that will solve the programming task. These will become methods. Next, you must decide which methods will be placed in which classes. Determine the relationship between classes: decide if there are any is-a relationships between the classes. If so, create inheritance by using the extends keyword. Do the same for any has-a relationships – create composition. Use UML diagrams to organize these relationships. Write the public method headers for each class. Implement the methods: if several methods require the same task, put that task in a helper method. This process is called procedural abstraction. Use information hiding, which means that most instance variables and helper methods are private. Use temporary “stub” methods and classes to test code before implementing it fully.
8
Bottom-up vs. Top-Down Development
When writing a method, a programmer should list other classes that the method might use. Those classes are collaborators. A class without collaborators is an independent class. Bottom-Up Development means writing and testing independent classes first, then incorporating them into the overall project. Next, classes that only rely on one other class are written, and so on. Top-Down Development means starting with an overview of the project, writing the main (highest-level) class first, then subsidiary classes, eventually finishing with low-level, independent classes. Use stub classes and methods to test code. Essentially, it the opposite of Bottom-Up Development.
15
Assignment Complete #1-20 in Litvin Practice Test A1. You will recognize some of these problems, we have already seen them in our lessons.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.