Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles.

Similar presentations


Presentation on theme: "Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles."— Presentation transcript:

1

2 Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles

3 A solution is good if: The total cost it incurs over all phases of its life cycle is minimal The cost of a solution includes: Computer resources that the program consumes Difficulties encountered by users Consequences of a program that does not behave correctly Programs must be well structured and documented Efficiency is one aspect of a solution’s cost

4 A Module is a part of a program that accomplishes a task. In procedural programming, Modules are made up of one or more functions. Large Modules may contain Sub-Modules.

5 Modules have two primary components: an Interface and Internal Components. In procedural programming, a module’s interface is just header of the function that you call to start the module. Internal Components are the sub-modules/functions that do the task the module is designed to do.

6 Cohesion A highly cohesive module performs one well-defined task Leads to modular solutions Reduces Coupling Coupling Modules with low coupling are independent of one another Modules shouldn’t affect other modules when changed. Low coupling increases Cohesion.

7 1. Modularity 2. Style 3. Modifiability 4. Ease of Use 5. Fail-safe programming 6. Debugging 7. Testing

8 Modularity has a favorable impact on Constructing programs Debugging programs Reading programs Modifying programs Eliminating redundant code Reuse of code

9 Programming Style can enhance code with: 1. Use of private data members 2. Proper use of reference arguments 3. Proper use of functions 4. Avoidance of global variables in modules 5. Error handling 6. Readability 7. Documentation

10 Modifiability is easier through the use of Named constants The typedef statement

11 The easier a program is to use, the more impressed users will be with it. In an interactive environment, the program should prompt the user for input in a clear manner A program should always echo its input The output should be well labeled and easy to read

12 Fail-safe programs will perform reasonably no matter how anyone uses them Test for invalid input data and program logic errors Check invariants Enforce preconditions Check argument values

13 Programmers must systematically check a program’s logic to find and correct errors Tools to use while debugging: – Single-stepping – Watches – Breakpoints – cout statements – Dump functions

14 Levels Unit testing: Test functions, then modules Integration testing: Test interactions among modules System testing: Test entire program Acceptance testing: Show that system complies with requirements

15 One simple but somewhat outdated method is the Waterfall Method. AnalysisDesignImplementationTestingDeployment Though it can be used modularly, this design method requires each preceding stage to be complete before progressing to the next stage. In practice, this leads to inflexibility and a constant state of incompleteness.

16 Newer methods are iterative. Many short, fixed-length iterations Each iteration builds on the previous iteration until a complete solution is achieved Each iteration cycles through analysis, design, implementation, testing, and integration of a small portion of the problem domain Early iterations create the core of the system; further iterations build on that core

17 Features of Iterative methods: The partial system at the end of each iteration should be functional and completely tested Each iteration makes relatively few changes to the previous iteration End users can provide feedback at the end of each iteration One specific iterative method is the Rational Unified Process (RUP)

18 The most modern approach to designing modules is the Object-Oriented approach. Instead of creating groups of functions, create classes. Classes are combinations of data sets and methods (functions that operate on the data set) Classes are combined and caused to interact to create solutions.

19 Object-oriented languages enable us to build classes that can be used to instantiate (create) objects A class combines Attributes (characteristics) of objects of a single type Typically data Called data members Behaviors (operations) Typically operate on the data Called methods or member functions An object is an instance of a class. Class: Objects:

20 Three principles of object-oriented programming Encapsulation Objects combine data and operations Hides inner details Inheritance Classes can inherit properties from other classes Existing classes can be reused Polymorphism Objects can determine appropriate operations at execution time

21 Object-Oriented Analysis (OOA) Coming up with the classes that can be used to define the problem. Emphasis on what a solution must do. Object-Oriented Design (OOD) Understanding how the classes can interact and what they can do alone or together.

22 UML (Unified Modeling Language) is very often used in OOA/D to define classes and their interactions. A UML class definition: A UML interaction diagram:


Download ppt "Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles."

Similar presentations


Ads by Google