Comp 245 Data Structures

Download Report

Transcript Comp 245 Data Structures

Comp 245
Data Structures
Software
Engineering
What is Software
Engineering?




Most students obtain the problem and
immediately start coding the solution.
What if you are faced with a problem that
will require a “large” coding solution?
Usually requires a team and an organized
plan of attack.
A branch of computer science called
SOFTWARE ENGINNEERING exists
which provides techniques and
methodologies for the construction of
computer programs.
What is the purpose of a
Computer Program?


To SOLVE A PROBLEM!
There are usually two parts to a
program
1.
2.

An algorithm
Data (how do you store and manipulate the
data?)
What makes a good program?
1.
2.
3.
4.
5.
Meets it’s specifications
Cost is minimal over the course of its life cycle
Efficient
Maintenance friendly
Reliable
The Software Life Cycle
The development of good software involves a
lengthy and continual process called the
software life cycle.







Specification – WHAT is the software to do?
Design – HOW will it be done?
Coding – includes syntax debugging
Testing – purpose is to find errors; it is not to prove
your code works
Refinement – fix errors in logic (recode, retest)
Production – people start using it
Maintenance – fixing errors and enhancing
RUP – Rational Unified
Process



Solution is developed incrementally!
An iterative solution – timeboxes.
Phases:





Inception – feasibility, time and cost estimates
Elaboration – more specific, determine
iterations, core architecture
Construction – iterative development
Transition – testing and deployment of system,
beta testing
More complete information
Software Engineering Concept
Achieving a Modular Design


Consider a “sort” function; if you did not
write the function – you only know WHAT it
does – not HOW it is done! We know its
purpose not its implementation.
“Abstraction” is the separation of
purpose from implementation.
The sort function example is an example of
functional abstraction. In the beginning, we
are always concerned more with WHAT we
want to do; not HOW we are going to do it.
Software Engineering Concept
Achieving a Modular Design


There is also data abstraction. This is what
this course is concerned with. A program
has data; WHAT do does the program need
to do with the data?
We will develop ADT’s in this class –
Abstract Data Type (abstract: existing in thought or as an idea
but not having a physical or concrete existence)


This is the combination of data and the
operations that surround the data – the
operations obviously are WHAT we want to
do with the data.
An ADT is a way to modularize our code!
Key Issues in Programming

Modularity





Helps in program construction; facilitates a team
of programmers in development
Easier to isolate and fix errors
Easier for someone else to read your code
Eliminates redundant code
Modifiability



Use Functions – just “plug” in
Constants
Typedef statements (C++)
example: typedef int value;
Key Issues in Programming


Ease of use if program is interactive
Style






Use Functions
Use private data members
Avoiding global variables if possible
Know when to use value and reference
parameters (input to / output from a function)
Error handling (return a value or throw
exception)
Write readable code (descriptive identifiers,
consistency, identation, blank lines, etc…)
Key Issues in Programming

Documentation



It is to help you!
In a professional setting; it is to help
those who must maintain your code.
Debugging


Syntax errors (language proficient)
Logic errors (DESIGN!!)