Software engineering, program management. The problem  Software is expensive to design! – Industry estimates put software development labor costs at.

Slides:



Advertisements
Similar presentations
ECE 454 Computer Systems Programming Compiler and Optimization (I) Ding Yuan ECE Dept., University of Toronto
Advertisements

Unit 6 Assignment 2 Chris Boardley.
Chapter 1 - An Introduction to Computers and Problem Solving
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Documentation 1 Comprehending the present – Investing in the future.
Software Engineering and Design Principles Chapter 1.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 4 Sec. 4.1, 4.2, 4.4 Procedures (User-defined)
Chapter 3 Planning Your Solution
The Program Design Phases
BPC.1 Basic Programming Concepts
CODING Research Data Management. Research Data Management Coding When writing software or analytical code it is important that others and your future.
Design, Implementation and Maintenance
Software Reengineering 2003 년 12 월 2 일 최창익, 고광 원.
Software Re-engineering
Introduction to High-Level Language Programming
Programmer Defined Functions Matthew Verleger. Windows It’s estimated that Window’s XP contains 45 million lines of code (and it’s over 10 years old).
Program development & programming languages Chapter 13.
OOP- OBJECT OBJECT PROGRAMMING By KRATI SHARMA 02 XI-B ✏✏✏✏ ☺☻☺☻☺☻☺ ✏✏✏✏
1 Programming and Problem Solving — Software Engineering (Read Chap. 2)
Programming and Problem Solving — Software Engineering (Read Chap. 2) 1.
1 Shawlands Academy Higher Computing Software Development Unit.
WEB ENGINEERING LECTURE 4 BY Kiramat Rahman. outline  In this Lecture you will learn about:  Term “Software” and its relationship with “Hardware” 
Comp 245 Data Structures Software Engineering. What is Software Engineering? Most students obtain the problem and immediately start coding the solution.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Stacks and Subroutines. Some example stacks Stacks and subroutine usage The stack is a special area of the random access memory in the overall memory.
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
7-1 Embedded Systems Algorithms and Software Design Lecture Notes 7.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 2.
9/20/6Lecture 3 - Instruction Set - Al1 Program Design.
CSE 219 Computer Science III Program Design Principles.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
SE: CHAPTER 7 Writing The Program
1 CSC 222: Computer Programming II Spring 2004 See online syllabus at: Course goals:
Fundamental Programming: Fundamental Programming K.Chinnasarn, Ph.D.
I Power Higher Computing Software Development The Software Development Process.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Chapter 10 Software Engineering. Understand the software life cycle. Describe the development process models. Understand the concept of modularity in.
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
The Software Development Process
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Design and Planning Or: What’s the next thing we should do for our project?
Or how to work smarter when building solutions.  2:30 – 3:30 Mondays – focus on problem solving (with some terminology thrown in upon occasion)  All.
Software Engineering Principles Practical Advice and Steps for Managing Your Project.
Advanced Assembly Language Programming
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
© 2010 Kettering University, All rights reserved..
Subroutines and Stacks. Stack The stack is a special area in memory used by the CPU to store register information or general data information during program.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
C++ for Engineers and Scientists, Second Edition 1 Problem Solution and Software Development Software development procedure: method for solving problems.
Principles of Programming. Achieving an Object-Oriented Design  Abstraction and Information Hiding  Object-Oriented Design  Functional Decomposition.
Introduction to Computing Systems and Programming Programming.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
1 Subroutines Advanced Programming. 2 Top-Down approach to problem solving Algorithm step by step description of how to solve a problem Divide and Conquer.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Stacks and Subroutines May 23. Stacks and subroutine usage The stack is a special area of the random access memory in the overall memory system The stack.
5-1 EE 319K Introduction to Microcontrollers Lecture 5: Conditionals, Loops, Modular Programming, Sub- routines, Parameter passing.
Lecture 2 Introduction to Programming
Unit# 9: Computer Program Development
Unit 6 Assignment 2 Chris Boardley.
Chapter 1 Introduction(1.1)
Chapter 9 TRAP Routines and Subroutines
Lecture 7 Algorithm Design & Implementation. All problems can be solved by employing any one of the following building blocks or their combinations 1.
CMSC 345 Programming.
Software Development Chapter 1.
Software Re-engineering and Reverse Engineering
Presentation transcript:

Software engineering, program management

The problem  Software is expensive to design! – Industry estimates put software development labor costs at 1.5 hours per machine instruction – Software developers are expensive labor – Most "real" programs contain thousands, if not millions of lines of code  The quality of much software and most documentation is poor

The problem  Even after extensive testing, software frequently has bugs – Testing can prove the presence of bugs, but testing can (almost) never prove the absence of bugs! – Testing and debugging software can take as much or more time than the original planning and writing  Most new software is completed later than forecast (2x or 3x longer is common)  Programming can be tedious, boring work

The problem  The design process – Software development, as any engineering effort, should be based around a logical design methodology whether for a lab assignment or as part of a large SW design team

The problem Need Concept Decomposition Specification Design Test / Validation Production Deployment Maintenance Disposa

Programmer's "goals" what's important?  Write the shortest program – Uses less memory, so hardware requirements are less – Often trading expensive human effort for inexpensive hardware costs – Encourages programming "tricks"

Programmer's "goals" what's important?  Write the fastest program – Get the program's execution done as quickly as possible – Not always an important goal in embedded systems – More payoff from developing and implementing an efficient algorithm – Use profiling as a guide to optimizing the already good algorithm

Programmer's "goals" what's important?  Write an easily understood program – The programmer and others must be able to understand the function of the instructions in the program – Complex programs are hard to modify and maintain – Good documentation – KISS principle

Programmer's "goals" what's important?  Write an easily modified program – Be able to change it to cope with changing environments – Requires planning and effort during the design phase – Effort is extremely cost effective compared to redesign effort – Focus on long-term success

Programmer's "goals" what's important?  Meet the schedule – Avoid the vaporware syndrome – Organize and plan for changes – Failure can mean loss of market share

Program design  The design process lends itself to an iterative problem decomposition in a divide-and-conquer approach  Decompose overall task into smaller subtasks that can be written and tested independently

Program design

 Avoid spaghetti code and designs – Each module should have single entry / exit points

Program design  Structured programming uses 3 basic control structures

Documentation  Good documentation is mandatory for good code This provides information needed by humans to understand the operation of the program and enable efficient maintenance and modification  For a given code segment / block / function, well thought out, detailed comments in the “header” can help reduce the need for line-by-line comments within the code itself

Documentation  Programs can be over or under documented  Examples: – Wrong: LDAA #$56 ; load ACCA with $56 – Right: LDAA #$56 ; initialization word for ; DDRC -- bits 1,2,4,6 ; are outputs

Documentation  Each code segment / block / function should include comments that … – Identify the routine’s name and function – Who wrote it and when – Describe the algorithm being implemented – Explain the parameters being passed to and from the routine – List other routines that call this routine or are called by this routine CONTD

Documentation – Describe register and memory requirements -- which locations are altered? – Give the modification history – Do not overwhelm the reader (particularly in-line comments)  Software written for the labs and design projects is expected to follow these guidelines! – For a good example, see the code included with the sample lab report on the WI web page

Documentation  Main routine should be mostly calls to subroutines – If something takes more than a few instructions, don’t put it directly in the main routine – make it a subroutine – Main routine will usually be an infinite loop – Example: ;******************************** ; Thermometer: This program reads an ; analog value from a temperature sensor ; every 0.5 seconds, and displays the ; temperature on an LCD display. ;********************************

Documentation ORG $B600 Thermometer: lds #$1FF ; initialize stack pointer jsr InitSystem ;initialize the system Loop: jsr GetAnalogValue ; get A/D value from ; temp sensor jsr ConvertTemp ; determine the ; temperature jsr DisplayTemp ; display it on LCD jsr Delay0P5 ; delay for 0.5 seconds bra Loop ; repeat

Documentation  Include a header with each subroutine: ;******************************** ; Convert_Temp: This routine converts ; an analog value (assumed to be an 8-bit ; binary fraction between 0 and 1) to a ; Fahrenheit temperature using the formula ; temp = (value * 180) + 32 ; Input: ACCA = 8-bit analog value ; Output : ACCA = temperature ; Registers modified: CCR ;********************************

Documentation Convert_Temp: pshb ; save ACCB ldab #180 ; calculate temp mul ; = (value * 180) + 32 adca #32 ; ACCA = temp pulb ; restore ACCB rts ; return

Summary  Programs should be well-designed and well- documented  Use a modular design – Each subroutine should perform a single function – Subroutine interfaces should be clearly defined  Focus on making programs easy to understand and easy to maintain – Bonus: They’re often easier to debug CONTD

Summary – Avoid programming “tricks” unless they are truly needed for performance or memory requirements – If you need to use “tricks” -- document them!  Time spent on design (before coding) is usually a good investment