Chapter 2.1 Program Design and Documentation. Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented.

Slides:



Advertisements
Similar presentations
1 ICS102: Introduction To Computing King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science.
Advertisements

Integration testing Satish Mishra
McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 14 Programming and Languages.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Development Software Life Cycle UML Diagrams.
Jump to first page 1 System Design (Finalizing Design Specifications) Chapter 3d.
Fundamentals of Information Systems, Second Edition
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.
System Development Life Cycle (SDLC)
9 1 Chapter 9 Database Design Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
Problem Solving Chapter 2. What is an algorithm? n A solution to a problem that is: –Precise –Effective –Terminating.
Programming and Languages Chapter Competencies (Page 1 of 2) Describe the six steps of programming Discuss design tools including top-down design,
The Software Product Life Cycle. Views of the Software Product Life Cycle  Management  Software engineering  Engineering design  Architectural design.
McGraw-Hill Technology Education © 2006 by the McGraw-Hill Companies, Inc. All rights reserved CHAPTER PROGRAMMING AND LANGUAGES.
1414 CHAPTER PROGRAMMING AND LANGUAGES. © 2005 The McGraw-Hill Companies, Inc. All Rights Reserved Competencies Describe the six steps of programming.
Software System Integration
The Project AH Computing. Functional Requirements  What the product must do!  Examples attractive welcome screen all options available as clickable.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Building Applications.
Your Interactive Guide to the Digital World Discovering Computers 2012.
Chapter 2: Approaches to System Development
1 Chapter 4. To familiarize you with methods used to 1. Access input and output files 2. Read data from an input file 3. Perform simple move operations.
©J.Tiberghien - ULB-VUB Version 2007 Première partie, chap. 4, page 1 Chapitre 1.4 Langages et outils de programmation.
Problem Solving and Algorithms
More with Methods (parameters, reference vs. value, array processing) Corresponds with Chapters 5 and 6.
Chapters 7, 8, & 9 Quiz 3 Review 1. 2 Algorithms Algorithm A set of unambiguous instructions for solving a problem or subproblem in a finite amount of.
Software Life Cycle Requirements and problem analysis. –What exactly is this system supposed to do? Design –How will the system solve the problem? Coding.
Chapter 9 Moving to Design
The Software Development Life Cycle. Software Development SDLC The Software Development Life-Cycle Sometimes called the program development lifecycle.
School of Computer Science & Information Technology G6DICP - Lecture 9 Software Development Techniques.
Chapter 13 Recursion. Learning Objectives Recursive void Functions – Tracing recursive calls – Infinite recursion, overflows Recursive Functions that.
CSE 219 Computer Science III Program Design Principles.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Software Testing. What is Testing? The process consisting of all life cycle activities, both static and dynamic, concerned with planning, preparation.
Computing Essentials 2014 Programming and Languages © 2014 by McGraw-Hill Education. This proprietary material solely for authorized instructor use. Not.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
1 Systems Analysis and Design in a Changing World, Thursday, January 18, 2007.
CPS120 Introduction to Computer Programming The Programming Process.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
I Power Higher Computing Software Development The Software Development Process.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Prof. amr Goneid, AUC1 CSCE 110 PROGRAMMING FUNDAMENTALS WITH C++ Prof. Amr Goneid AUC Part 1. Introduction.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Systems Analysis and Design in a Changing World, Fourth Edition
Program Planning and Design. What is Program Planning and Design? Program planning and design is simply knowing what you want to do and how you want to.
EGR101-34R "lecture on hardware- software" FB 7/10/2004 Digital Electronics Logic Gates Logic gates work with the voltage level of the signals. They are.
Task analysis Chapter 5. By the end of this chapter you should be able to... Describe HTA and its features Explain the purpose of task analysis and modelling.
Data Structures Using C++ 2E
SEM510 Autumn 1996 Software Engineering u What is “Software Engineering” ? u It involves: Software, People, Applications, Methods, Tools and Practices.
Software Engineering CS103 February 13, How Do You Solve Big Problems? Thousands of programmers Thousands of programmers Months or years of coding.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
Large Digital Systems. Outline  Large Digital Systems  Top-Down Approach  Controller and Data Processor  Flowcharts.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
CMSC 2021 Software Development. CMSC 2022 Software Development Life Cycle Five phases: –Analysis –Design –Implementation –Testing –Maintenance.
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.
Chapter 7: Designing solutions to problems OCR Computing for A Level © Hodder Education 2009.
 A car Jack  A wrench  A flat surface Put the car into park and apply the parking brake.
6 Things Every Driver Should Know. 1) How to Change a Tire 1 st : Once you have a flat, stop at a SAFE place to change your tire. 2 ND : Grab the spare,
Chapter One Problem Solving
About the Presentations
Software Design Lecture : 15.
The Programming Process
Programming We have seen various examples of programming languages
No Yes START Do you live in Scotland? Take umbrella See last Flowchart
Overview Activities from additional UP disciplines are needed to bring a system into being Implementation Testing Deployment Configuration and change management.
Presentation transcript:

Chapter 2.1 Program Design and Documentation

Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented design Tools for system/program documentation –Decision tables –Control-flow & Nassi-Shneiderman diagrams –Data-flow diagrams –State diagrams –Unified Modeling Language

Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented design Tools for system/program documentation –Decision tables –Control-flow & Nassi-Shneiderman diagrams –Data-flow diagrams –State diagrams –Unified Modeling Language

System/Program specifications What should the system/program do ? Formally: –Set of all possible inputs {I} –Set of all possible outputs {O} –Function mapping all elements of {I} into elements of {O} Possible for simple and small programs Unfeasible for large scale systems

The effort of Specifying Interactions with other programs Number of users Only the author Many, NoneMany

System/Program specifications Specifications for large scale systems ? 1Make reasonable set of specifications 2REPEAT 2.1 Build prototype 2.2 Evaluate prototype 2.3 Update specifications UNTIL satisfaction of (potential) users 3Write down final specifications

Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented design Tools for system/program documentation –Decision tables –Control-flow & Nassi-Shneiderman diagrams –Data-flow diagrams –State diagrams –Unified Modeling Language

The Cost of Software for large systems During design and coding efforts should be made to reduce the cost of debugging and maintenance

Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented design Tools for system/program documentation –Decision tables –Control-flow & Nassi-Shneiderman diagrams –Data-flow diagrams –State diagrams –Unified Modeling Language

Design Methods Top-down design: From global to detail –Decompose the problem in simpler subproblems –Further decompose subproblems –UNTIL all subproblems have trivial solutions Bottom-up design: From detail to global –Solve some small problems that might be useful for solving the big problem –Use the partial solutions for assembling a global solution

Example : Repairing a flat tire Specifications : –Given : A car with a flat tire –Wanted : Instructions for fixing it Strategy choice : –Wait with a smile until somebody fixes it … –Call a repair service >Try to repair yourself

WHAT IS A PROGRAM ? PROGRAM = Description of data + Actions to perform upon these data

Repairing a flat tire “Data” and Actions “Data” –Car, Defective wheel, Spare wheel, Tools. Actions –All that need to be done with the Car, the Defective wheel, the Spare wheel and the Tools in order to solve the problem.

Repairing a flat tire Top level design of actions Inspect the spare wheel If available and in good condition, –Then, repair yourself –Else, you will need to call help

Repairing a flat tire Refinement of “repair yourself” Fetch the tools Fetch the spare wheel Exchange defective and spare wheels Store defective wheel Store tools

Repairing a flat tire Refinement of “tools” Tools : –Jack : device to lift a car –Wrench : device to loose or fasten bolts

Repairing a flat tire Refinement of “Exchange defective and spare wheels” REPEAT loose one bolt with wrench UNTIL all bolts loose; Lift car with Jack; REPEAT remove one bolt UNTIL all bolts removed; Remove defective wheel; Put spare wheel in place; REPEAT replace one bolt UNTIL all bolts in place; Lower car with Jack; REPEAT fasten one bolt with wrench UNTIL all bolts fastened;

Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented design Tools for system/program documentation –Decision tables –Control-flow & Nassi-Shneiderman diagrams –Data-flow diagrams –State diagrams –Unified Modeling Language

Object oriented Design Problem : –If a data item is slightly changed, the entire program needs to be checked. Solution : –Group data with description of all actions that can be performed upon such data –Access data exclusively through the actions predefined for these data Object = data + actions to access it.

Repairing a flat tire Object-oriented style Instance of the object : MyJack Possible actions : Fetch Inspect Store Lift a car Lower a car Object Jack =

Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented design Tools for system/program documentation –Decision tables –Control-flow & Nassi-Shneiderman diagrams –Data-flow diagrams –State diagrams –Unified Modeling Language

Repairing a flat tire Decision Table Spare Wheel Tools Available & OK No good tools available OKNot OK Repair yourself Get Help Try to borrow tools

Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented design Tools for system/program documentation –Decision tables –Control-flow & Nassi-Shneiderman diagrams –Data-flow diagrams –State diagrams –Unified Modeling Language

Repairing a flat tire Top-level Controlflowchart Spare Wheel OK ? Get Help Repair yourself No Yes

Repairing a flat tire Refinement of “repair yourself” Spare Wheel OK ? Get Help Repair yourself NoYes Get Tools Get Spare Wheel Change Wheel Store Bad Wheel Store Tools

Repairing a flat tire Refinement of “Get Tools” Tools present & OK ? Tools present & OK ? Pick up the Tools Try borrowing Tools NoYes Got Tools or Tired ? Yes No Help Needed !!!

Repairing a flat tire Adapted refinement of “Get Tools” Tools present & OK ? Pick up the Tools Try borrowing Tools NoYes Got Tools or Tired ? Yes No

Repairing a flat tire Improved top-level design Spare Wheel OK ? NoYes Tools OK ? Fetch Tools Yes No Get Help Repair yourself

Selection Statement No selector = a ? Tasks to be done if selector = A Yes No selector = b ? Tasks to be done if selector = B Yes No selector = c ? Tasks to be done if selector = C Yes Tasks to be done if no criteria OK

Selection Statement selector Tasks to be done if selector = A selector = a Tasks to be done if no criteria OK selector # a selector # b selector # c Tasks to be done if selector = B Tasks to be done if selector = C selector = bselector = c selector

Iteration Statement Termination Test Initialization Loopbody, part 1 Loopbody, part 2 Continue Finish

Iteration Statement Initialisation Loopbody Part 1 Loopbody Part 2 Termination Condition

Repairing a flat tire Spare Wheel ? Not OK OK Get Help Fetch Tools Tools ? Get Help Repair Yourself Not OK OK Tools present & OK ? YesNo Get your own tools Try to borrow tools Until You got tools OR you are tired Get spare wheel Change wheel Store bad wheel Return tools

Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented design Tools for system/program documentation –Decision tables –Control-flow & Nassi-Shneiderman diagrams –Data-flow diagrams –State diagrams –Unified Modeling Language

Data-flow Diagrams Bad Wheel Tools Spare Wheel FETCHED STORED MOUNTED STORED REMOVED

Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented design Tools for system/program documentation –Decision tables –Control-flow & Nassi-Shneiderman diagrams –Data-flow diagrams –State diagrams –Unified Modeling Language

State Diagrams Flat tire problem Driving Flat tire Need help Good spare wheel Repairing Try borrow tools Puncture No good Spare wheel Successful help No success Spare wheel OK Done No tools Tools OK Success

State Diagrams Electronic lock First digit entered Waiting 1st digit Testing key Waiting 2nd digit Waiting 3rd digit Second digit entered Third digit entered Wrong Key Opening door Good Key Spontaneous transition

Summary System/Program specifications System/Program design –Top-down & Bottom-up design –Object Oriented design Tools for system/program documentation –Decision tables –Control-flow & Nassi-Shneiderman diagrams –Data-flow diagrams –State diagrams –Unified Modeling Language

Unified Modeling Language Tool for supporting / documenting object oriented designs Applicable to the –Organizational level –System level –Program level Set of different diagrams, including –Class diagrams (= objects and their static relations) –Interaction diagrams –Activity diagrams (= extended control flow diagrams) –State diagrams –Deployment diagrams