Chapter 1 t Software Engineering and Computer Programming t Course presentations are available for view and downloading on the course web page: t

Slides:



Advertisements
Similar presentations
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
Advertisements

10 Software Engineering Foundations of Computer Science ã Cengage Learning.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Alternate Software Development Methodologies
Software Engineering and Design Principles Chapter 1.
Introduction To System Analysis and Design
Fall 2007CS 225 Introduction to Software Design Chapter 1.
Chapter 3 Data Abstraction: The Walls. © 2005 Pearson Addison-Wesley. All rights reserved3-2 Abstract Data Types Modularity –Keeps the complexity of a.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Department of Computer Science University of Maryland, College Park
Software Requirements
Fall 2007CS 2251 Software Engineering Intro. Fall 2007CS 2252 Topics Software challenge Life-cycle models Design Issues Documentation Abstraction.
Software Engineering For Beginners. General Information Lecturer, Patricia O’Byrne, office K115A. –
Overview of Software Requirements
1 CMSC 132: Object-Oriented Programming II Nelson Padua-Perez William Pugh Department of Computer Science University of Maryland, College Park.
Chapter 1 Principles of Programming and Software Engineering.
Chapter 1 Software Engineering. Homework ► Read Section 2.2 (pages 79-98) ► Answer questions: ► 7, 8, 11, 12, & 13 on page 134. ► Answer on paper, hand.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Spring 2009CS 225 Introduction to Software Design Chapter 1.
Problem with Software Requirements are complex The client does not know the functional requirements in advance Requirements may be changing Technology.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 1 Requirements engineering l The process of establishing the services that the.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
C++ fundamentals.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Data Structures and Programming.  John Edgar2.
Introduction To System Analysis and design
Comp 245 Data Structures Software Engineering. What is Software Engineering? Most students obtain the problem and immediately start coding the solution.
Managing the development and purchase of information systems (Part 1)
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Putting together a complete system Chapter 10. Overview  Design a modest but complete system  A collection of objects work together to solve a problem.
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Introduction To System Analysis and Design
Chapter 1 Introduction to Computers and C++ Programming Goals: To introduce the fundamental hardware and software components of a computer system To introduce.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Systems Analysis and Design in a Changing World, Fourth Edition
Developing Business/IT Solutions Chapter 12 McGraw-Hill/IrwinCopyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved.
Chapter 4 Software Requirements
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Systems Development Life Cycle
CSCI 1100/1202 April 1-3, Program Development The creation of software involves four basic activities: –establishing the requirements –creating.
Data Structures Using C++ 2E
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
90-723: Data Structures and Algorithms for Information Processing Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 1: Introduction Data.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
Software Engineering, COMP201 Slide 1 Software Requirements BY M D ACHARYA Dept of Computer Science.
Chapter 2 Principles of Programming and Software Engineering.
Your Interactive Guide to the Digital World Discovering Computers 2012 Chapter 12 Exploring Information System Development.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Unit 1 - Introducing Abstract Data Type (ADT) Part 1.
Software Design and Development Development Methodoligies Computing Science.
1 Software Requirements Descriptions and specifications of a system.
Principles of Programming & Software Engineering
The Development Process of Web Applications
C++ Plus Data Structures
Data Abstraction: The Walls
Principles of Programming and Software Engineering
Systems Analysis and Design
About the Presentations
Lecture 2 of Computer Science II
C++.
Need for the subject.
Chapter 1 Introduction(1.1)
The Programming Process
Copyright  1997 Oxford University Press All Rights Reserved
Presentation transcript:

Chapter 1 t Software Engineering and Computer Programming t Course presentations are available for view and downloading on the course web page: t

Goals t The goal of CS is the discovery of fundamental principles underlying computer programming t Software Engineering is about the construction of software systems t “pure” versus “applied” science t They also have many common interests

Computer Science t Dates from the 1940’s t Study of algorithms t Algorithm implementation t Tied to mathematics t Tries to discover principles underlying hardware and software

Software Engineering t Dates from late 1960’s t Develop models of systems t Major concerns are –efficiency –reliability t Applies CS principles to construct better systems

Basic processes for all CS professionals t Theory t Abstraction t Design

Theory t Definitions, axioms, theorems, proofs t Interpretation of results t Example: Analysis of algorithm efficiency

Abstraction t Developing models of the world –isolate the essential features of a problem –example: flipping a coin does not need to know denomination, metal, picture simulates only one of two random outcomes t Test problem approaches

Design t Requirements t Specifications t Program design t Program implementation t Testing t Analysis

The The concerns of the computer scientist and the software engineer Theory Abstraction Design Software engineer Computer scientist Data structures

Data Structures and ADT’s

Data structure t Definition: t A ‘data structure’ consists of –A base storage method (i.e. an array) –One or more algorithms that are used to access or modify that data

Program example t Here is a program demonstrating a dice data structure. t This first example is a procedural approach to the problem.

t // Code Example 1-1: t // dice program that does not use an t // abstract data type (adt) t // t // Compare this approach to cx1-2.cpp. t #include "dslib.h" t // standard header files for text t #include

t int main() t { int die1, die2, total; t randomize(); t // pseudorandom number generator t die1 = random(6) + 1; t // random(6) returns random number t // between 0 and 5 t die2 = random(6) + 1; t total = die1 + die2; t cout << "first die: " << die1; t cout << “ second die: " << die2; t cout << endl; t cout << "total for roll is: ”; t cout << total << endl; t return 0; }

Data structures dilemma t Possible dice data structures –two integers, each between 1 and 6 –simple to implement, simple operations t Deck of cards data structure –more difficult, especially operations t Air traffic control system –very difficult –needs a model –high level of “software engineering”

Abstract Data Type (ADT) t Gives us a tool to use to control complexity t Definition: a collection of data and operations –Data characteristics DOES NOT include method of representation –Operations DOES NOT include how implemented

Definition of ADT t An Abstract Data Type (ADT) is –a well-specified collection of data known as the characteristics, or data state –and a group of operations that can be performed upon the data known as behaviors or operations –member functions (C++) –methods (Java)

About ADTs t The ADT’s specification describes –what data can be stored (the characteristics of the ADT), –and how it can be used (the operations), –but not how it is implemented or represented in the program.

Decoupling t ADTs do not specify how the data structure will be implemented t There may be many ways t The data specification has been decoupled from the implementation. t This means that software development can be less complex (fewer details to consider) t Also, software development is more flexible (the actual structure is not fixed)

Dice ADT t Characteristics (data state): Represents a pair of 6-sided dice, that can be rolled to get a random sum between 2 and 12. t Operations: –int roll() Precondition: none. Task: A random value between 1 and 6 is stored for each of the dice. Returns: The sum of the two dice values, lying between 2 and 12.

Dice ADT operations (con’t) –int die1() Precondition: The dice have been rolled at least once. Postcondition: None. Returns: The value of the first die. –int die2() Precondition: The dice have been rolled at least once. Postcondition: None. Returns: The value of the second die.

A program using a Dice ADT t // Illustrates solution to a t // "dice simulation", using t // abstract data types. t // t // Dice ADT t // t // Characteristics: t // Represents a pair of 6-sided dice, t // that can be rolled to get a t // random sum between 2 and 12. t //

Dice ADT operations comments t // Operations: t // int roll() t // Preconditions: none t // Postcondition: random value from 1-6 t // is stored for each of the dice. t // Returns: sum of the two dice values, t // lying between 2 and 12

die1() and die2() operations t // int die1() t // Precondition: dice have been rolled t // at least once. t // Postcondition: None t // Returns: The value of the first die. t // int die2() t // Precondition: dice have been rolled t // at least once. t // Postcondition: None t // Returns: The value of the second die.

Dice ADT program t // Note on encapsulation: t // The representation of the t // dice is contained within global t // variables - we'll see shortly a better t // way to do this. t #include t #include "dslib.h" t int dice_1, dice_2;

Roll() t int roll() t {// note -- you don't really want to call t // randomize every time you roll the dice, t // but for this simplified design you t // don’t have much choice. t randomize(); t dice_1 = random(6) + 1; t dice_2 = random(6) + 1; t return dice_1 + dice_2; t }

die1() and die2() t int die1() t { t return dice_1; t } t int die2() t { t return dice_2; t } t // end of Dice ADT

Client Code (the main program) t int main() t // test program to demonstrate Dice ADT t { t cout << "The value rolled is: ”; t cout << roll() << endl; t cout << "The first die was: ”; t cout << die1() << endl; t cout << "The second die was: ”; t cout << die2() << endl; t return 0; t }

Exercise 1-4, p. 9 t Some games for young children use colored squares on a board and a spinner that, in effect, picks one of the colors at random. Suppose that the game has five colors - red, green, blue, yellow and orange. t Design a spinner ADT. t Do not write any code, just the ADT.

Spinner problem t What is the data state (characteristics) of this ADT? –enumerated type: colors –spinner - of type colors t What are the operations –spin (randomly chooses a color)

Spin() operation t Precondition: –none t Postcondition: –none t Returns: –the value of the spinner

The Software Life Cycle

The waterfall model of software development t Initiation t Analysis t Design t Implementation t Testing t Maintenance

Initiation t Feasibility study t Examination of alternatives t Cost-benefit analysis t Make-or-buy study

Analysis t Determines the exact requirements of the system t Systems analyst (liaison between domain experts and software engineers) t Domain experts know the goals and purposes of the software t Software engineers will build the system t Analyst creates functional specifications document

Functional specifications t Specifies exact functions the system must provide t Specifies special requirements –minimum performance limits t Legal requirements which must be met

Design t Uses functional specifications as a blueprint t Systems architect t Deliverable is a technical, or coding specification t This is the most critical step in the process –bad design may be impossible to implement –difficult to maintain (i.e. Y2K)

Implementation t Writing the code t Must meet coding specifications t Develop system and user documentation

Testing t Must start with a test plan –sample input: expected output –compares observed to expected t May use separate staff t Final line of defense against unreliable software

Maintenance t Latent errors –Only become apparent after testing is finished t Adaptive maintenance –Changes to fit new environments –new OS, hardware, software t Enhancements –improved functionality –often for least experienced programmers

The waterfall model of software development Initiation Analysis Design Implementation Testing Maintenance

The waterfall model: A summary of the players and the deliverables

Critiques of waterfall method t Expensive t Slow t Unrealistic t No emphasis on prototypes t No connection with end users

Prototyping t Often built with 4GL to provide GUI t May only be a shell –no functionality t Implementation –Direct –Parallel –Phased –Pilot

Reusability t Programmers often “reinvent the wheel” t No equivalent of “interchangeable parts” t Software often not reusable in other apps t OOP addresses these concerns –inheritance t New design techniques: design patterns –provide a library of recurring designs –example: STL in C++ –we will not use the STL in this class

Documentation t How much? On what? What form? t Three levels of documenters –Technical writers –System documentation Software engineers/programmers Internal and external –Client documentation

Internal documentation t Precondition –The assumed state of the data structures t Postcondition –The effects on the data structures –What the function has done t Returns –The value(s) returned

Why C++? t Easy data abstraction t OOP t More features than C

Evolution t ADT concept –Specification and implementation of a data structure aren’t the same –But they are related and should be kept together –Pascal, C and other procedural languages do not allow this. –Languages like Modula-2 and ADA allow you to make ‘modules’ containing both

Evolution (continued) t C++ supports the module concept by allowing you define classes and instantiate them as objects t Objects may be created that inherit characteristics from other objects t You can use an object without knowing how it is implemented –Exact implementation may take many forms (polymorphism)