Writing a Program Chapter 1. Introduction We all “start” by learning how to code in some programming language. –With a small, hypothetical, and fairly.

Slides:



Advertisements
Similar presentations
College of Information Technology & Design
Advertisements

Contest format 5 hours, around 8-12 problems One computer running (likely)Linux, plus printer 3 people on one machine No cell phones, calculators, USB.
Test Inventory A “successful” test effort may include: –Finding “bugs” –Ensuring the bugs are removed –Show that the system or parts of the system works.
1 Software Testing and Quality Assurance Lecture 13 - Planning for Testing (Chapter 3, A Practical Guide to Testing Object- Oriented Software)
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2 - Problem Solving
Chapter 2 - Problem Solving
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Al-Karma Language School Computer Department Prep. 3.
1 CSI 101 Elements of Computing Fall 2009 Lecture #4 Using Flowcharts Monday February 2nd, 2009.
Academic Advisor: Prof. Ronen Brafman Team Members: Ran Isenberg Mirit Markovich Noa Aharon Alon Furman.
Chapter 1 Program Design
Problem Solving Chapter 2. What is an algorithm? n A solution to a problem that is: –Precise –Effective –Terminating.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
PRE-PROGRAMMING PHASE
The Fundamentals: Algorithms, the Integers & Matrices.
Why Metrics in Software Testing? How would you answer questions such as: –Project oriented questions How long would it take to test? How much will it cost.
1 Design and Analysis of Algorithms تصميم وتحليل الخوارزميات (311 عال) Chapter 1 Introduction to Algorithms.
Nyhoff, ADTs, Data Structures and Problem Solving with C++, Second Edition, © 2005 Pearson Education, Inc. All rights reserved Software.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
PYTHON PROGRAMMING Week 10 – Wednesday. TERMS – CHAPTER 1 Write down definitions for these terms:  Computation  Computability  Computing  Artificial.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
An Introduction to Programming and Algorithms. Course Objectives A basic understanding of engineering problem solving process. A basic understanding of.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
1 Conditions Logical Expressions Selection Control Structures Chapter 5.
Algorithms and Algorithm Analysis The “fun” stuff.
Developing an Algorithm
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
Systems Analysis and Design in a Changing World, Fourth Edition
Chapter 10 Verification and Validation of Simulation Models
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Introduction to Software Architecture.
The Software Development Process
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
EGR 115 Introduction to Computing for Engineers Branching & Program Design – Part 1 Monday 29 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Introduction to Testing CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Structured Programming (4 Credits)
Data Structure Introduction Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2010.
Fall 2014 (both sections) Assignment #1 Feedback Elapsed time (How long): –Ranged from 45 minutes to 10 days –About 1/4 said less than 1 day –About 1/2.
Chapter 2 - VB 2005 by Schneider- modified by S. Jane '081 Chapter 2 - Problem Solving 2.1 Program Development Cycle 2.2 Programming Tools.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
Introduction to Computing Systems and Programming Programming.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
1 Week 1 Introduction, Writing a Program, Building a System Software Engineering Spring Term 2016 Marymount University School of Business Administration.
1 Week 1 Introduction, Writing a Program, Building a System Software Engineering Fall Term 2015 Marymount University School of Business Administration.
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
Introduction to Algorithms
ICS 3UI - Introduction to Computer Science
EGR 115 Introduction to Computing for Engineers
School of Business Administration Writing a Program, Building a System
Lecture 2 Introduction to Programming
Some Simple Definitions for Testing
Predicates Predicate: A Boolean (yes-no) function. Example:
Understand the Programming Process
Unit# 9: Computer Program Development
Introduction to Problem Solving
Understand the Programming Process
Introduction to Algorithms
Introduction – “Writing A Program”
Software Development Chapter 1.
CHAPTER 6 Testing and Debugging.
Chapter 1: Creating a Program.
Presentation transcript:

Writing a Program Chapter 1

Introduction We all “start” by learning how to code in some programming language. –With a small, hypothetical, and fairly well defined problem –Usually the code is within one module We then learn that the program usually does not work on the first try, second try may be even 5 th or 6 th try! –We learn about “testing” the program –We learn about re-reading and re-thinking the (problem) requirements more carefully --- then find that we may not have all the answers –We learn about tracing and “debugging” the program –Then ---- somehow magically ---- we decide that it’s “good enough !” Perhaps Not In This Order

A “Simple” Set of Steps 1) Understand the problem – requirements –Functionalities –Non-functionalities: performance, security, modifiability, marketability, etc. 2) Perform Some Design --- based on requirements –Organizing the functionalities in some sequence; possibly using some diagrams –Focus on input/output ( data, formats, organization) –Think about some constraints (non-functionalities) such as speed, UI looks, programming language, dependencies, etc. –any specific algorithm and improvements on sequence of functionalities.

A “Simple” Set of Steps (cont.) 3) Code/Implement – Turning the design into actual code –Depending on how much design is completed, one may either directly engage in conversion to code (language dependent) or do some more designing. A) Converting input/output to specific UI Interface or I/O format B) Sequencing the processing in the desired order C) Ensuring and converting the processing “algorithm” correctly to the target language construct. D) figure out how to use language library (properly)

A “Simple” Set of Steps (cont.) 4) Validate/Test the program – check the program results (via output) with some predetermined set of inputs. –The pre-determined inputs are “test cases” and requires some thinking. –If the results do not match what is expected then: “Debug” Fix Retest ---- revalidate –Stop when all test cases produce the expected results. Question ---- How many test cases should we develop & run ---?

What Really Happens ? Problem Definition/ Understanding Solution Design Solution Implementation/ coding Solution Testing Problem Definition/ Understanding Solution Design Solution Implementation/ Coding Solution Testing “Imagined” – Ideal Situation “Actual” - Happening

Code is “Done!” What Else Matters? How Long (elapsed time) did it take to complete the work? How much effort (total person hours) is expended to do the work? Does the solution solve the complete problem? How “good” is the work – (code, design, documentation, testing, etc.)? based on ?

Consider A “Simple” Problem (your assignment #1) Write a “program” in your favorite language that will accept numerical numbers as inputs, compute the average, and output the answer. Answer these questions in class: How long (in elapsed-time) would it take you to implement this solution? How much overall effort (in person-hours) will this take? How well will your solution match the problem? How good is your code/design/documentation/testing?

Past Class Answers How long (in elapsed-time) would it take you to implement this solution? –Class Answer: 10 min. (Greg); 15 min (Frankie); 1 hr. (Mark); How much overall effort (in person-hours) will this take? –Class Answer: 10 person min. ; 15 person min. ; 1 person hour; 3 person-hrs Will your solution match the problem? –Class Answer: YES! How “good” will your solution be? –Class Answer: Awesome! Let’s see how your “real” individual data come out in your Assignment 1

Some “Previous Class” Inputs How long do you think assignment #1 would take? –1 hr people –2 hrs people –3 hrs people –10 hrs people Real data from class: –Elapsed time: range was 5 days to 46 minutes – mostly between 1 to 3 hours –Effort: range was 8 person-hours to 40 person-minutes – mostly between 1 person-hour to 3 person-hours