Carrano chapter 1
1 / 21

Carrano : Chapter 1 - PowerPoint PPT Presentation

  • Uploaded on

Carrano : Chapter 1. Software Engineering and Object-Oriented Design Topics: Solutions Modules Key Programming Issues Development Methods Object-Oriented Principles. What is a Good Solution?. A solution is good if: The total cost it incurs over all phases of its life cycle is minimal

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Carrano : Chapter 1' - kolya

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Carrano chapter 1
Carrano: Chapter 1

Software Engineering and Object-Oriented Design

  • Topics:

    • Solutions

    • Modules

    • Key Programming Issues

    • Development Methods

    • Object-Oriented Principles

What is a good solution
What is a Good Solution?

  • 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

What is a module
What is a Module?

  • 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.

Structure of a module
Structure of a Module

  • 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.

How to evaluate a module
How to Evaluate a Module

  • 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.

Seven key issues in programming
Seven Key Issues in Programming

  • Modularity

  • Style

  • Modifiability

  • Ease of Use

  • Fail-safe programming

  • Debugging

  • Testing

1 modularity
1) Modularity

  • Modularity has a favorable impact on

    • Constructing programs

    • Debugging programs

    • Reading programs

    • Modifying programs

    • Eliminating redundant code

    • Reuse of code

2 style
2) Style

Programming Style can enhance code with:

  • Use of private data members

  • Proper use of reference arguments

  • Proper use of functions

  • Avoidance of global variables in modules

  • Error handling

  • Readability

  • Documentation

3 modifiability
3) Modifiability

  • Modifiability is easier through the use of

    • Named constants

    • The typedefstatement

4 ease of use
4) Ease of Use

  • 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

5 fail safe programming
5) Fail-Safe Programming

  • 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

6 debugging
6) Debugging

  • 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

7 testing
7) Testing

  • 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

Development methods waterfall
Development Methods, Waterfall

  • One simple but somewhat outdated method is the Waterfall Method.

  • 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.

Development methods iterative
Development Methods, Iterative

  • 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

Development methods iterative1
Development Methods, Iterative

  • 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)

Object oriented programming
Object-Oriented Programming

  • 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.

Principles of object oriented programming oop
Principles of Object-Oriented Programming (OOP)

  • 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.



Principles of object oriented programming
Principles of Object-Oriented Programming

  • 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

Object oriented analysis and design
Object-Oriented Analysis and Design

  • 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.

Applying the uml to ooa d
Applying the UML to OOA/D

  • 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: