Programming Life Cycle Problem analysisunderstand the problem Requirements definition specify what program will do High- and low-level designhow it meets.

Slides:



Advertisements
Similar presentations
Chapter 1. The Phases of Software Development. Data Structure 2 Chapter outline  Objectives  Use Javadoc to write a method’s complete specification.
Advertisements

6-1 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer problem-solving process and relate it to Polya’s.
Problem Solving and Algorithm Design
Chapter 6 Problem Solving and Algorithm Design. 6-2 Chapter Goals Determine whether a problem is suitable for a computer solution Describe the computer.
C++ Plus Data Structures
1 Lecture 10 Chapter 7 Functions Dale/Weems/Headington.
© Janice Regan Problem-Solving Process 1. State the Problem (Problem Specification) 2. Analyze the problem: outline solution requirements and design.
1 Chapter 6 Object-Oriented Software Design and Implementation.
1 CMSC 132: Object-Oriented Programming II Software Development II Department of Computer Science University of Maryland, College Park.
Important Definitions Class: A structured data type that is used to represent an abstract data type (ADT) Class member: A components of a class. It can.
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
1 Chapter 7 Functions Dale/Weems/Headington. 2 Functions l Control structures l every C++ program must have a function called main l program execution.
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.
Software Engineering Principles and C++ Classes
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
1 Programming Style Files Lecture 1 Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus Modified by Reneta Barneva, SUNY-Fredonia.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Introduction SWE 619. Why Is Building Good Software Hard? Large software systems enormously complex  Millions of “moving parts” People expect software.
Data Structures and Algorithms What The Course Is About Data structures is concerned with the representation and manipulation of data. All programs manipulate.
1 Chapter 7 Functions. 2 Chapter 7 Topics l Writing a Program Using Functional Decomposition l Writing a Void Function for a Task l Using Function Arguments.
Modular Programming Chapter Value and Reference Parameters t Function declaration: void computesumave(float num1, float num2, float& sum, float&
1 Basic Concepts of Object-Oriented Design. 2 What is this Object ? There is no real answer to the question, but we ’ ll call it a “ thinking cap ”. l.
1 Programming in C++ Dale/Weems/Headington Chapter 7 Functions.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
COP 3530 PROGRAM, FILE & DATA STRUCTURES Syllabus Syllabus Lab Information Lab Information Overrides Overrides Questions? Questions?
1 Chapter-01 Programming Methodologies Procedural/Structured Design Objected-Oriented Design.
1 C++ Plus Data Structures Nell Dale Chapter 1 Software Engineering Principles Modified from the Slides made by Sylvia Sorkin, Community College of Baltimore.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
Chapter 1 Software Engineering Principles. Lecture 2.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Data Structures Using C++1 Chapter 1 -Software Engineering Principles -ADT and Classes.
1 Functions Chapter 7 2 Hope you can function! What is R2D2 doing here? What is his function? Who is Nibble? Can he function? IS he a function? Who is.
1 Functions every C++ program must have a function called main program execution always begins with function main any other functions are subprograms and.
Chapter 8 Functions. Chapter 8 Topics l Writing a Program Using Functional Decomposition l Writing a Void Function for a Task l Using Function Arguments.
1 Functions. 2 Chapter 7 Topics  Writing a Program Using Functional Decomposition  Writing a Void Function for a Task  Using Function Arguments and.
Data Structures Using C++1 Chapter 1 Software Engineering Principles and C++ Classes.
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
1 Chapter 7 Functions Dale/Weems/Headington. 2 Chapter 7 Topics l Writing a Program Using Functional Decomposition l Writing a Void Function for a Task.
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.
Chapter 3 Top-Down Design with Functions Part II J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National.
Data Structures Using C++ 2E
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 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.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
Chapter 1 Data Abstraction: The Walls CS Data Structures Mehmet H Gunes Modified from authors’ slides.
Chapter 1 Software Engineering Principles. Problem analysis Requirements elicitation Software specification High- and low-level design Implementation.
Chapter 2 Principles of Programming and Software Engineering.
Chapter 1 The Phases of Software Development. Software Development Phases ● Specification of the task ● Design of a solution ● Implementation of solution.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
1 CS 132 Spring 2008 Chapter 1 Software Engineering Principles and C++ Classes.
Principles of Programming & Software Engineering
Chapter 8 Functions.
C++ Plus Data Structures
Chapter 1 Data Abstraction: The Walls
Principles of Programming and Software Engineering
About the Presentations
Chapter 1 Software Engineering Principles
Chapter 1 Software Engineering.
Chapter 2. Problem Solving and Software Engineering
Chapter 8 Functions.
Dale/Weems/Headington Program Input and the Software Design Process
Presentation transcript:

Programming Life Cycle Problem analysisunderstand the problem Requirements definition specify what program will do High- and low-level designhow it meets requirements Implementation of designcode it Testing and verificationdetect errors, show correct Deliveryturn over to customer Operationuse the program Maintenancechange the program

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.

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.

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

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

Specification Includes Inputs Outputs Processing requirements Assumptions

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

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.

Two Design Approaches Divides the problem into more easily handled subtasks, until the functional modules (subproblems) can be coded. Identifies various objects composed of data and operations, that can be used together to solve the problem. FUNCTIONAL DECOMPOSITION OBJECT-ORIENTED DESIGN FOCUS ON: processes FOCUS ON: data objects

Find Weighted Average Print Weighted Average Functional Design Modules Main Print Data Print Heading Get Data Prepare File for Reading

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. Private data << setf Private data >> get ignore cincout

More about OOD l Languages supporting OOD include: C++, Java, Smalltalk, Eiffel, and Object-Pascal. l A class is a programmer-defined data type and objects are variables of that type. l 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.h and fstream.h contain definitions of stream classes.

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.” Brady Gooch, “What is and Isn’t Object Oriented Design,” 1989.

Program Verification is the process of determining the degree to which a software product fulfills its specifications. Program Verification PROGRAM SPECIFICATIONS Inputs Outputs Processing Requirements Assumptions

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.

Program Testing Testing is the process of executing a program with various data sets designed to discover errors. DATA SET 1 DATA SET 2 DATA SET 3 DATA SET 4...

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.

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.

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 > 0 response has value ‘y’ or ‘n’ partNumber == 5467

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. FOR 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 <= length; counter++) { list.GetNextItem(item); item.Print(dataFile); } 35

Another Example void GetRoots (float a, float b, float c, float& Root1, float& Root2 ) // Pre: a, b, and c are assigned. // a is non-zero, b*b - 4*a*c is non-zero. // Post: Root1 and Root2 are assigned // Root1 and Root2 are roots of quadratic with coefficients a, b, c { float temp; temp = b * b * a * c; Root1 = (-b + sqrt(temp) ) / ( 2.0 * a ); Root2 = (-b - sqrt(temp) ) / ( 2.0 * a ); return; }

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 program’s data by hand. Its purpose is to stimulate discussion about the programmer’s design or implementation.

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.

Integration Testing Is performed to integrate program modules that have already been independently unit tested. Find Weighted Average Print Weighted Average Main Print Data Print Heading Get Data Prepare File for Reading

Integration Testing Approaches Designed to ensure correct overall design logic. (the big picture) Designed to ensure individual modules work together correctly, beginning with the lowest levels first. (the details) TOP-DOWN BOTTOM-UP USES: placeholder modules USES: a test driver to call called “stubs” to test the the functions being tested. order of calls.