Software Engineering Principles - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Software Engineering Principles

Description:

Requirements definition specify what program will do ... Information Hiding. Hiding the details of a function or data structure with the goal of controlling ... – PowerPoint PPT presentation

Number of Views:41
Avg rating:3.0/5.0
Slides: 28
Provided by: radU5
Category:

less

Transcript and Presenter's Notes

Title: Software Engineering Principles


1
Software Engineering Principles
  • CSC 2110 - Data Structures Abstraction
  • Spring/Summer 2001
  • Wayne State University
  • Instructor Anne-Marie Bosneag

2
Content
  • The software life cycle
  • Goals of quality software
  • Functional object-oriented design
  • Software verification
  • Detecting and solving different types of errors

3
Programming Life Cycle Activities
  • Problem analysis understand the problem
  • Requirements definition specify what
    program will do
  • High- and low-level design how it meets
    requirements
  • Implementation of design code it
  • Testing and verification detect errors, show
    correct
  • Delivery turn over to customer
  • Operation use the program
  • Maintenance change the program

4
Software Engineering
  • A disciplined approach to the design, production,
    and maintenance of computer programs that are
    developed on time and within cost estimates,
    using tools that help to manage the size and
    complexity of the resulting software products.

5
An Algorithm Is . . .
  • A logical sequence of discrete steps that
    describes a complete solution to a given problem
    computable in a finite amount of time.

6
Goals of Quality Software
  • It works.
  • It can be read and understood.
  • It can be modified.
  • It is completed on time and within budget.

7
Detailed Program Specification
  • Tells what the program must do, but not how it
    does it.
  • Is written documentation about the program.

8
Detailed Program Specification Includes
  • Inputs
  • Outputs
  • Processing requirements
  • Assumptions

9
Abstraction
  • A model of a complex system that includes only
    the details essential to the perspective of the
    viewer of the system.

10
Information Hiding
  • Hiding the details of a function or data
    structure with the goal of controlling access to
    the details of a module or structure.
  • PURPOSE To prevent high-level designs from
    depending on low-level design details that may be
    changed.

11
Two Approaches to Building Manageable Modules
OBJECT-ORIENTED DESIGN
  • FUNCTIONALDECOMPOSITION

FOCUS ON processes FOCUS ON data
objects
12
Functional Design Modules
Main
Get Data
Prepare File for Reading
Print Data
Print Heading
13
Object-Oriented Design
A technique for developing a program in which the
solution is expressed in terms of objects --
self- contained entities composed of data and
operations on that data.
ltlt
gtgt
setf
get
Private data
Private data
. . .
. . .
ignore
cout
cin
14
More about OOD
  • Languages supporting OOD include C, Java,
    Smalltalk, Eiffel, and Object-Pascal.
  • A class is a programmer-defined data type and
    objects are variables of that type.
  • In C, cin is an object of a data type (class)
    named istream, and cout is an object of a class
    ostream. Header files iostream and fstream
    contain definitions of stream classes.

15
Procedural vs. Object-Oriented Code
  • Read the specification of the software you
    want to build. Underline the verbs if you are
    after procedural code, the nouns if you aim for
    an object-oriented program.
  • Grady Booch, What is and Isnt Object
    Oriented Design, 1989.

16
Program Verification
  • Program Verification is the process of
    determining the degree to which a software
    product fulfills its specifications.

SPECIFICATIONS Inputs
Outputs Processing
Requirements Assumptions
PROGRAM
17
Verification vs. Validation
  • Program verification asks,
  • Are we doing the job right?
  • Program validation asks,
  • Are we doing the right job?
  • B. W. Boehm, Software Engineering
    Economics, 1981.

18
Program Testing
  • Testing is the process of executing a program
    with various data sets designed to discover
    errors.

DATA SET 4 . . .
19
Various Types of Errors
  • Design errors occur when specifications are wrong
  • Compile errors occur when syntax is wrong
  • Run-time errors result from incorrect
    assumptions, incomplete understanding of the
    programming language, or unanticipated user
    errors.

20
Robustness
  • Robustness is the ability of a program to recover
    following an error the ability of a program to
    continue to operate within its environment.

21
An Assertion
  • Is a logical proposition that is either true or
    false (not necessarily in C code).
  • EXAMPLES
  • studentCount is greater than 0
  • sum is assigned count gt 0
  • response has value y or n
  • partNumber 5467

22
Preconditions and Postconditions
  • The precondition is an assertion describing what
    a function requires to be true before beginning
    execution.
  • The postcondition describes what must be true at
    the moment the function finishes execution.
  • The caller is responsible for ensuring the
    precondition, and the function code must ensure
    the postcondition.

23
Example
  • void PrintList ( ofstream dataFile,
    UnsortedType list)
  • // Pre list has been initialized.
  • // dataFile is open for writing.
  • // Post Each component in list has been
    written to dataFile.
  • // dataFile is still open.
  • int length
  • ItemType item
  • list.ResetList()
  • length list.LengthIs()
  • for (int counter 1 counter lt length
    counter)
  • list.GetNextItem(item)
  • item.Print(dataFile)

24
A Walk-Through
  • Is a verification method using a team to perform
    a manual simulation of the program or design,
    using sample test inputs, and keeping track of
    the programs data by hand.
  • Its purpose is to stimulate discussion about the
    programmers design or implementation .

25
Tasks within each test case
  • determine inputs that demonstrate the goal.
  • determine the expected behavior for the input.
  • run the program and observe results.
  • compare expected behavior and actual behavior.
    If they differ, we begin debugging.

26
Integration Testing
  • Is performed to integrate program modules that
    have already been independently unit tested.

Main
Get Data
Print Weighted Average
Prepare File for Reading
Find Weighted Average
Print Data
Print Heading
27
Integration Testing Approaches
BOTTOM-UP
  • TOP-DOWN

Ensures individual modules work together
correctly, beginning with the lowest level.
Ensures correct overall design logic.
USES placeholder USES a test
driver to call module stubs to test
the functions being tested. the order of
calls.
Write a Comment
User Comments (0)
About PowerShow.com