CMSC 345 Programming.

Slides:



Advertisements
Similar presentations
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.
Advertisements

PHP Reusing Code and Writing Functions.
Chapter 3: Modularization
SYSTEM PROGRAMMING & SYSTEM ADMINISTRATION
API Design CPSC 315 – Programming Studio Fall 2008 Follows Kernighan and Pike, The Practice of Programming and Joshua Bloch’s Library-Centric Software.
Coding Practices. What are Coding Practices ? Coding practices are a set of informal rules that the software development community has learned over time.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
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.
Chapter 2: Input, Processing, and Output
Software Testing. “Software and Cathedrals are much the same: First we build them, then we pray!!!” -Sam Redwine, Jr.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
Understanding the Mainline Logical Flow Through a Program (continued)
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.
Testing. What is Testing? Definition: exercising a program under controlled conditions and verifying the results Purpose is to detect program defects.
1 Shawlands Academy Higher Computing Software Development Unit.
Planning for the Solution
CMSC 345 Fall 2000 Unit Testing. The testing process.
EGR 2261 Unit 5 Control Structures II: Repetition  Read Malik, Chapter 5.  Homework #5 and Lab #5 due next week.  Quiz next week.
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
Testing Basics of Testing Presented by: Vijay.C.G – Glister Tech.
Design and Programming Chapter 7 Applied Software Project Management, Stellman & Greene See also:
1 The Software Development Process  Systems analysis  Systems design  Implementation  Testing  Documentation  Evaluation  Maintenance.
Chapter 06 (Part I) Functions and an Introduction to Recursion.
Documentation and Comments. What’s a comment? A comment is a simple form of documentation. Documentation is text that you the programmer write to explain.
Oct 15, 2007Sprenkle - CS1111 Objectives Creating your own functions.
SE: CHAPTER 7 Writing The Program
Testing. 2 Overview Testing and debugging are important activities in software development. Techniques and tools are introduced. Material borrowed here.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
Software Testing and Maintenance 1 Code Review  Introduction  How to Conduct Code Review  Practical Tips  Tool Support  Summary.
CMSC 345 Programming. Organization of Coding Process Select “core” to implement first, following an incremental development model Reconsider architectural.
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
The Other Face Or Why Document? By Chris Bradney Or Why Document? By Chris Bradney.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
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.
Programming & Debugging. Key Programming Issues Modularity Modifiability Ease of Use Fail-safe programming Style Debugging.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
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.
4 - Conditional Control Structures CHAPTER 4. Introduction A Program is usually not limited to a linear sequence of instructions. In real life, a programme.
OPERATING SYSTEMS (OS) By the end of this lesson you will be able to explain: 1. What an OS is 2. The relationship between the OS & application programs.
SOFTWARE TESTING LECTURE 9. OBSERVATIONS ABOUT TESTING “ Testing is the process of executing a program with the intention of finding errors. ” – Myers.
Advanced Higher Computing Science
Software Testing.
Software Metrics 1.
Software Testing.
Chapter 2: Input, Processing, and Output
Lecture 2 Introduction to Programming
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Unit Test: Functions, Procedures, Classes, and Methods as Units
Software testing strategies 2
Program Design Introduction to Computer Programming By:
Design and Programming
PROGRAMMING METHODOLOGY
Lecture 22 Inheritance Richard Gesick.
Chapter 7 Writing the Programs Shari L. Pfleeger Joann M. Atlee 4th Edition.
Introduction to Computer Programming
Tonga Institute of Higher Education IT 141: Information Systems
An Introduction to Debugging
PPT and video are due no later than March 1, 2019
Tonga Institute of Higher Education IT 141: Information Systems
Chapter 2: Input, Processing, and Output
Software Development Chapter 1.
Presentation transcript:

CMSC 345 Programming

Topics Work Breakdown Coding Standards Defensive Programming Structured Programming Documentation

Work Breakdown Be positive that all component (e.g., objects, functions) interfaces are crystal clear to all team members Based on these interfaces, divide the work into independent, manageable pieces among team members One team member in charge of configuration management and change control wrt interfaces; no changes w/o his/her approval One team member in charge of code checkin/checkout and file directory structure One team member in charge of integration planning, keeping abreast of any changes in interfaces and/or source code files (above)

Work Breakdown (con’t) One team member charge of tracking that everyone is doing what they’re supposed to do and is on schedule; should be in daily contact with all team members One team member in charge of “master copy” of SRS and keeps track of changes, informing others of changes One team member in charge of “master copy” of SDD and keeps track of changes, informing others of changes

Coding Standards Everybody’s got them - a very real-world thing They help you organize your thoughts and avoid mistakes They let you focus on the problem You must organize, format, and document your code to make it easy for others to understand

Coding Standards - Problems Without Them 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). 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).

Coding Standards - Problems w/o Them (con’t) It is often more difficult to reuse software someone else has written than to rewrite it your self because it is hard to figure out how it works. 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).

Your Coding Standards Establish team coding standards immediately and document them file header comments function and/or object commenting coding and commenting styles identifier naming conventions 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

Defensive Programming - General 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 (if tuning is necesssary)

Defensive Programming - 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 the prompt and accept blank input to defer to the default value When there is a choice among a small number of simple values, list all of them in prompt

Defensive Programming - User Outputs Clearly explain all user output along with the output value(s) Provide options for at least two levels of verbose and terse output modes (also applicable to prompts) Probably also testing/debug mode (for use by test drivers or scripts) If the user has to “wait”, give a 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)

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

Control Structures Keep them as top-down as possible - no “spaghetti code” Are a good clue as to when a comment is needed

Algorithms Keep them as generic as possible (for reuse within same program or with later program(s)) Fast code is overrated and has cost (it’s complex!) Takes more time to write Takes more time to test Takes more time for users to understand Takes more time to modify and debug Execution time is only a small part of the cost equation. Balance execution time with design quality and customer requirements DO NOT sacrifice CLARITY and CORRECTNESS for speed

Documentation Internal Documentation External Documentation

Internal Documentation Intended for a programmer-type reader File header comments Component (e.g., objects, functions) header comments Component body comments Local data documentation Meaningful variable names Formatting

External Documentation Intended for non-programmer-types (maybe those who never read code) Describe the problem addressed by the component; when invoked; why needed Describe the algorithms – rationale, formulas, boundaries, special conditions Describe the data – component level data flow