Top Banner

of 22

CSC335-Chapter1

Jun 04, 2018

Download

Documents

frankjamison
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/13/2019 CSC335-Chapter1

    1/22

    1

    Instructor:

    Ahmad Reza Hadaegh

    (Chapter 1Software Development)

    CSC-335

    Data Structures and Algorithms

    The content of this power point lecture has been originallycreated by Christos Kolonis and modified by

    Dr. Ahmad R Hadaegh

  • 8/13/2019 CSC335-Chapter1

    2/22

    2

    Chapter Contents

    1.1 Problem Analysis and Specification1.2 Design

    1.3 Coding

    1.4 Testing, Execution, and Debugging1.5 Maintenance

  • 8/13/2019 CSC335-Chapter1

    3/22

    3

    Chapter Objectives

    Introduce software development approaches Contrast software development in programming course

    with real world

    Study top-down, objected oriented approaches

    Introduce design aspects

    Select or build data types

    Develop algorithms for operations on data

    Investigate error types

    Emphasize importance of testing

    Note time and effort devoted to maintenance

  • 8/13/2019 CSC335-Chapter1

    4/22

    4

    5 Phases of Software Life Cycle

    Waterfall Model

  • 8/13/2019 CSC335-Chapter1

    5/22

    5

    5 Phases of Software Life Cycle

    Realistic Waterfall Model

  • 8/13/2019 CSC335-Chapter1

    6/22

    6

    1.1 Problem Analysis and Specification

    CS courses

    small systems

    few hundred lines ofcode

    simple, straightforward

    self-contained

    Real world large systems

    thousands of lines ofcode

    complex

    many components

    problem initially poorlydefined

    6

  • 8/13/2019 CSC335-Chapter1

    7/22

    7

    1.1 Problem Analysis and Specification

    The specification or "contract" will include Purpose

    Precondition

    Postcondition

    Real world contracts

    Must be precise

    May be required to prove end product meets these

    precise specifications

  • 8/13/2019 CSC335-Chapter1

    8/22

    8

    1.2 Top Down Design

    Original problem partitioned into simpler subproblems

    Each of these sub problems likewise subdivided

  • 8/13/2019 CSC335-Chapter1

    9/22

    9

    1.2 OOD: Object-OrientedDesign

    Identify the objectsinthe problem'sspecification and theirtypes.

    Identify the operationsor tasks to manipulatethe objects

    9

  • 8/13/2019 CSC335-Chapter1

    10/22

    10

    1.2 OOD: Object-OrientedDesign

    UML class diagram

    Fig. 1.7

  • 8/13/2019 CSC335-Chapter1

    11/22

    11

    1.2 Data Types of the Objects

    Simple Structured

    arrays

    structures

    Class objects

    Think of them

    as Containers

  • 8/13/2019 CSC335-Chapter1

    12/22

    12

    1.2 Algorithms

    Pseudo code Must be

    Definite, unambiguous

    Simple

    Finite

    correct and efficient

    well structured

    Cannot separate data structures from algorithms

  • 8/13/2019 CSC335-Chapter1

    13/22

    13

    1.2 Algorithms

    Unstructuredgoto's

    if-else's

    Structured

    while loop

    switch stmt

    Fig. 1.8(a)

    Fig. 1.8(b)

  • 8/13/2019 CSC335-Chapter1

    14/22

    14

    1.3 Coding

    Select language of implementation Encode the design

    Example Figure 1.9 Financial-aid update function

    Figufre 1.10 Test-driver for Financial-aid updatefunction

    Figure 1.11 Header file forFinancialAidAwardclass

    Figure 1.12 Implementation file forFinancialAidAwardclass

    14

    http://localhost/var/www/apps/conversion/tmp/scratch_8//CJK-CORE-2-DUO/MediaServer/School/Templates/CodeSamplesChapter01.htm#Figure%201.9%20Financial%20Aid%20Update%20Functionhttp://localhost/var/www/apps/conversion/tmp/scratch_8//CJK-CORE-2-DUO/MediaServer/School/Templates/CodeSamplesChapter01.htm#Figure%201.10%20Test-Driver%20for%20Financial%20Aid%20Update%20Functionhttp://localhost/var/www/apps/conversion/tmp/scratch_8//CJK-CORE-2-DUO/MediaServer/School/Templates/CodeSamplesChapter01.htm#Figure%201.11%20Header%20File%20for%20the%20FinancialAidAward%20Classhttp://localhost/var/www/apps/conversion/tmp/scratch_8//CJK-CORE-2-DUO/MediaServer/School/Templates/CodeSamplesChapter01.htm#Figure%201.12%20Implementation%20File%20for%20the%20FinancialAidAward%20Classhttp://localhost/var/www/apps/conversion/tmp/scratch_8//CJK-CORE-2-DUO/MediaServer/School/Templates/CodeSamplesChapter01.htm#Figure%201.12%20Implementation%20File%20for%20the%20FinancialAidAward%20Classhttp://localhost/var/www/apps/conversion/tmp/scratch_8//CJK-CORE-2-DUO/MediaServer/School/Templates/CodeSamplesChapter01.htm#Figure%201.11%20Header%20File%20for%20the%20FinancialAidAward%20Classhttp://localhost/var/www/apps/conversion/tmp/scratch_8//CJK-CORE-2-DUO/MediaServer/School/Templates/CodeSamplesChapter01.htm#Figure%201.10%20Test-Driver%20for%20Financial%20Aid%20Update%20Functionhttp://localhost/var/www/apps/conversion/tmp/scratch_8//CJK-CORE-2-DUO/MediaServer/School/Templates/CodeSamplesChapter01.htm#Figure%201.10%20Test-Driver%20for%20Financial%20Aid%20Update%20Functionhttp://localhost/var/www/apps/conversion/tmp/scratch_8//CJK-CORE-2-DUO/MediaServer/School/Templates/CodeSamplesChapter01.htm#Figure%201.10%20Test-Driver%20for%20Financial%20Aid%20Update%20Functionhttp://localhost/var/www/apps/conversion/tmp/scratch_8//CJK-CORE-2-DUO/MediaServer/School/Templates/CodeSamplesChapter01.htm#Figure%201.9%20Financial%20Aid%20Update%20Function
  • 8/13/2019 CSC335-Chapter1

    15/22

    15

    1.3 Coding

    Verify integration combining program units into a complete

    software system.

    Insure quality

    programs must be correct, readable, andunderstandable

    well-structured, documented, formatted for

    readability

  • 8/13/2019 CSC335-Chapter1

    16/22

    16

    1.4 Testing, Execution, and Debugging

    Validation:"Are we building the right product?"

    check that documents, program modules, etc.match the customer's requirements.

    Verification:"Are we building the product right?"

    check that products are correct,

    complete,

    consistent with each other and with those of thepreceding phases.

    16

  • 8/13/2019 CSC335-Chapter1

    17/22

    17

    1.4 Different Kinds Of Tests Required

    Unit tests: Each individual program unit works?

    Program components tested in isolation

    Integration tests :

    Units combined correctly?

    Component interface and information flow tested

    System tests:

    Overall system works correctly?

    17

  • 8/13/2019 CSC335-Chapter1

    18/22

    18

    The "V" Life Cycle Model

    FIG. 1.13

  • 8/13/2019 CSC335-Chapter1

    19/22

    19

    Types of Errors

    Syntax errors errors in the grammar of the programming language

    Ex: forgetting ; at the end of the sentence.

    Run-time errors

    happen during program execution

    Ex: Division by zero

    Logic errors

    errors in algorithm design

    Ex: instead of a = b + c you have written a = b - c

  • 8/13/2019 CSC335-Chapter1

    20/22

    20

    Black Box or Functional Test

    Outputs produced for various inputs

    Checked for correctness

    Do not consider structure of program component

    itself. Program unit is viewed as a black box

    Accepts inputs and produces outputs,

    Inner workings of the box are not visible.

    20

  • 8/13/2019 CSC335-Chapter1

    21/22

    21

    White Box or Structural Test

    Performance is tested examine codes internal structure.

    Test data is carefully selected

    specific parts of the program unit are exercised.

    21

    Shows what

    is going on

  • 8/13/2019 CSC335-Chapter1

    22/22

    22

    Maintenance

    Large % of

    Computer center budgets

    Programmer's time

    Software development cost

    Because

    Includes modifications and enhancements

    Poor structure, poor documentation, poor style

    Bug finding and fixing is tougher

    Delays implementation of enhancements

    22