CMSC 345 Programming. Organization of Coding Process Select “core” to implement first, following an incremental development model Reconsider architectural.

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

Configuration management
Software Testing. Quality is Hard to Pin Down Concise, clear definition is elusive Not easily quantifiable Many things to many people You'll know it when.
Pfleeger and Atlee, Software Engineering: Theory and Practice CS499 Chapter 7 Writing the Programs Shari L. Pfleeger Joann M. Atlee 4 th Edition.
SOFTWARE MAINTENANCE 24 March 2013 William W. McMillan.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 17 Slide 1 Rapid software development.
FIT FIT1002 Computer Programming Unit 19 Testing and Debugging.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 20 Slide 1 Critical systems development.
Documentation 1 Comprehending the present – Investing in the future.
API Design CPSC 315 – Programming Studio Fall 2008 Follows Kernighan and Pike, The Practice of Programming and Joshua Bloch’s Library-Centric Software.
Chapter 9 Describing Process Specifications and Structured Decisions
Object-Oriented Analysis and Design Lecture 10 Implementation (from Schach, “O-O and Classical Software Engineering”)
© The McGraw-Hill Companies, 2006 Chapter 9 Software quality.
Software engineering, program management. The problem  Software is expensive to design! – Industry estimates put software development labor costs at.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
CSI 101 Elements of Computing Spring 2009 Lecture #2 Development Life Cycle of a Computer Application Monday January 26th, 2009.
Program design example Task: Develop an algorithm expressed in pseudocode for a specified problem specified problem.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
Lecturer: Dr. AJ Bieszczad Chapter 76-1 Software engineering standards Standards for you Standards for others Matching design with implementation.
CODING Research Data Management. Research Data Management Coding When writing software or analytical code it is important that others and your future.
Project Execution & Termination Life Cycle Execution Presented by: Basker George.
CH07: Writing the Programs Does not teach you how to program, but point out some software engineering practices that you should should keep in mind as.
Language Evaluation Criteria
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
1 Shawlands Academy Higher Computing Software Development Unit.
ISO Tor Stålhane IDI / NTNU. What is ISO ISO 9001 was developed for the production industry but has a rather general structure ISO describes.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
Prologue: The Software Process. Main Phases of Software Process 1. Requirements Analysis (answers “WHAT?”) Specifying what the application must do 2.
1 Debugging and Testing Overview Defensive Programming The goal is to prevent failures Debugging The goal is to find cause of failures and fix it Testing.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
GCSE OCR 3 A451 Computing Professional standards
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Implementation 1. Software Implementation – transforming design into code Requirements Analysis Software Design Implementation Testing Deployment Evolution.
School of Computer Science & Information Technology G6DICP - Lecture 9 Software Development Techniques.
1 Some initial Design suggestions… Getting started… where to begin? Find out whether your design architecture will work… as soon as possible. If you need.
Software Development Cycle What is Software? Instructions (computer programs) that when executed provide desired function and performance Data structures.
SE: CHAPTER 7 Writing The Program
1 Intro to Java Week 12 (Slides courtesy of Charatan & Kans, chapter 8)
# ACS 168 Structured Programming Using the Computer Chapter 2 Spring 2002 Prepared by Shirley White.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
1 Ch. 1: Software Development (Read) 5 Phases of Software Life Cycle: Problem Analysis and Specification Design Implementation (Coding) Testing, Execution.
CMSC 345 Fall 2000 Requirements Overview. Work with customers to elicit requirements by asking questions, demonstrating similar systems, developing prototypes,
The Software Development Process
1 Quality Attributes of Requirements Documents Lecture # 25.
Chapter One An Introduction to Programming and Visual Basic.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Connecting with Computer Science2 Objectives Learn how software engineering is used to create applications Learn some of the different software engineering.
Intermediate 2 Computing Unit 2 - Software Development.
Objectives Understand Corrective, Perfective and Preventive maintenance Discuss the general concepts of software configuration management.
Functions  A Function is a self contained block of one or more statements or a sub program which is designed for a particular task is called functions.
計算機程式語言 Lecture 03-1 國立台灣大學生物機電系 林達德 3 3 Introduction to Classes and Objects.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
C OMPUTER P ROGRAMMING 1 Input and Variables. I/O S TATEMENTS : I NPUT & V ARIABLES Input is the term used to describe the transfer of information from.
Software Development Process CS 360 Lecture 3. Software Process The software process is a structured set of activities required to develop a software.
Chapter – 8 Software Tools.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Introduction to Algorithmic Processes CMPSC 201C Fall 2000.
Advanced Higher Computing Science
Methodologies/Life Cycle Models
Lecture 5 Good modeling Chengcheng Fei 2017 Fall
Chapter 18 Maintaining Information Systems
Lecture 2 Introduction to Programming
Design and Programming
PROGRAMMING METHODOLOGY
Chapter 7 Writing the Programs Shari L. Pfleeger Joann M. Atlee 4th Edition.
CSE 303 Concepts and Tools for Software Development
Introduction to Computer Programming
Chapter 11 Describing Process Specifications and Structured Decisions
CMSC 345 Programming.
Presentation transcript:

CMSC 345 Programming

Organization of Coding Process Select “core” to implement first, following an incremental development model Reconsider architectural views and eliminate anything not critical Reconsider object/operations models and eliminate all unnecessary for mandatory requirements and/or easy extension to desirable requirements Micromanage your team but distribute/delegate responsibility (everyone should be in charge of something)

Select “Core” Must be compileable, buildable, runable, demoable, deployable, usable and maintainable Start over, try not to base on prototype Brooks: plan to throw one away, you will anyway But encourage customers/users to experiment with the prototype(s) and provide rapid feedback Make sure all mandatory requirements will be satisfied and all desirable requirements are easy to add Possibly reprioritize functional and nonfunctional requirements in consultation with customer

Work Breakdown Baseline process/component/object/operation interfaces before coding One team member should be in charge of configuration management and change control wrt interfaces, no changes w/o his/her approval One team member should be in charge of code checkin/checkout and file directory structure One team member should be in charge of integration planning, assuming those interfaces and source code file directory structure One team member should be in charge of tracking that everyone is doing what they’re supposed to do on schedule, should be in daily contact with all team members

Coding Style Each team should jointly choose a coding/commenting style and enforce it Later code inspections will check for this as well as correctness Makes easier to debug/maintain, particularly by others – not the original author nor even original team members

Team Programming Issues Agree in advance on identifier naming, indentation, and commenting conventions Think in terms of how “diff” will react to code modifications if you diddle the formatting Maintain development history in prologue of each file - owner, date of creation, dates of all updates and brief description of each update Any changes made by “non-owner” anywhere in file preceded by comment indicating name - plus update history in prologue

“Defensive Programming” Check validity of all input parameters (e.g., within range, non-null) Check validity of all returned values (i.e., from called subroutines) Repeatedly check validity of all external and internal data structures or data files Segregate this code so can easily be commented out during performance tuning Build fault tolerance into complex data structures (e.g., back references in linked structures)

Validate All User Inputs Expect the unexpected - and be able to recover! Respond to bogus inputs with useful diagnostics when possible, and explain what would be valid input in each case When there is a default value, indicate in prompt and accept blank input to refer to default When there is a choice among a small number of simple values, list all of them in prompt

Label All User Outputs Clearly explain all user output along with the output Provide options for at least two levels of verbose and terse output modes (also applicable to prompts) Probably also testing mode (for use by testing drivers or scripts) If the user has to “wait”, give periodic visual cue that the program is busy working (rather than hung) When possible, trap fatal errors and give diagnostics (including how to recover and who to report bug to)

Program Standards Everybody’s got them Help you organize thoughts and avoid mistakes Lets you focus on the problem Must organize, format and document your code to make it easy for others to understand

The Problem In some companies that write computer software, about 10% of the hours spent of software development is spent writing and 90% is spent doing maintaining, debugging, and documenting the code. Computer programs are generally more difficult to read than to write (even one's own code is often difficult to read after it hasn't been looked at for a while).

Problems (2) Software that is not internally or externally documented tends to be thrown-away or rewritten after the person that has written it leaves the organization (it is often thrown- away even if it is documented). It is often more difficult to reuse software someone else has written then to rewrite it your self because it is hard to figure-out how it works.

Problems (3) In practice, debugging often takes the place of understanding how programs work (ie. if we all understood perfectly how our own code worked we would not need to debug it to find out why it is not doing what we think it should).

Why the problem? Programming languages are designed more for encouraging people to write code for a compiler to understand than for other people to understand Especially C

Donald Knuth “Why I Must Write Readable Programs” /LitProg/Philosophy.html

Structured Programming Regardless of programming language, each program component involves at least Control structures Algorithms Data Structures

Control Structure Example Write a C function that searches an 80-character string for the first occurrence of a period and returns the index where found, or –1 if not found

First attempt int FindPeriod (char *s) { int j = 0, found = 0; while (!found && j < 80) { found = (s[j] == ‘.’); j++; } return (found ? j : -1); }

Generalized Version int FindChar (char *s, char c) { int j = 0, found = 0; while (!found && s[j]) { found = (s[j] == c); j++; } return (found ? j : -1); }

Algorithms Fast code is overrated and has cost Cost to write the faster code – more complex and takes more time Cost of time to test complex code Cost of time for users to understand code Cost of time to modify the code Execution time is only a small part of cost equation. Balance execution time with design, quality and customer requirements DO NOT sacrifice CLARITY and CORRECTNESS for speed

Data Structures Tax example -- Keep Program Simple First $10000, tax is 10% Next $10000 above $10K, tax is 12% Next $10000 above $20K, tax is 15% Next $10000 above $30K, tax is 18% Any income above $40K, tax is 20% Use tax table for loop, not if-else

Documentation Constituency Problem Internal Documentation External Documentation

Internal Documentation Header Block Comments Other Program comments Meaningful Variable names Formatting to enhance understanding Typography and layout Documenting data Data dictionary

External Documentation Read by those who never read the code Describe the problem addressed by the component; when invoked; why needed Describe the algorithms – rationale, formulas, boundary, special conditions Describe the data – component level data flow