Lecturer: Dr. AJ Bieszczad Chapter 76-1 Software engineering standards Standards for you Standards for others Matching design with implementation.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 3 Writing Java Applications, Java Development Tools.
Advertisements

1. Define the concept of assertions. 1 Explain the use of assertions. 2 Create Java program using assertions. 3 Run Java program using assertions. 4 2.
Pfleeger and Atlee, Software Engineering: Theory and Practice CS499 Chapter 7 Writing the Programs Shari L. Pfleeger Joann M. Atlee 4 th Edition.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Fall 2013 Chapter 13 Exception.
 Both System.out and System.err are streams—a sequence of bytes.  System.out (the standard output stream) displays output  System.err (the standard.
SE-1020 Dr. Mark L. Hornick 1 More Exception Handling and Throwing Exceptions.
Chapter 12 By Tony Gaddis Modified by Elizabeth Adams Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
© The McGraw-Hill Companies, 2006 Chapter 15. © The McGraw-Hill Companies, 2006 Exceptions an exception is an event that occurs during the life of a program.
Understand Error Handling Software Development Fundamentals LESSON 1.4.
E XCEPTION H ANDLING Chapter 11 C S 442: A DVANCED J AVA P ROGRAMMING.
Object Oriented Design An object combines data and operations on that data (object is an instance of class) data: class variables operations: methods Three.
Java Programming, 3e Concepts and Techniques Chapter 4 Decision Making and Repetition with Reusable Objects.
EXCEPTIONS Def: An exception is a run-time error. Examples include: attempting to divide by zero, or manipulate invalid data.
© The McGraw-Hill Companies, 2006 Chapter 9 Software quality.
1 Introduction to Software Engineering Lecture 42 – Communication Skills.
Object-Oriented Enterprise Application Development Javadoc Last Updated: 06/30/2001.
Scott Grissom, copyright 2004Ch 3: Java Features Slide 1 Why Java? It is object-oriented provides many ready to use classes platform independent modern.
Java Review 2 – Errors, Exceptions, Debugging Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Exception Error handling. Exception 4 n An unusual occurrence during program execution that requires immediate handling n Errors are the most common type.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 7 Defining Your Own Classes Part 2.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 17 Exceptions and.
Exceptions. Many problems in code are handled when the code is compiled, but not all Some are impossible to catch before the program is run  Must run.
1 Documenting with Javadoc CS 3331 Fall 2009 How to Write Doc Comments for the Javadoc TM Tool available from java.sun.com.
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.
Computer Science 340 Software Design & Testing Design By Contract.
1 Web Based Programming Section 6 James King 12 August 2003.
1 Chapter 18 Exception Handling. 2 Motivations F Program runs into a runtime error –program terminates abnormally F How can you handle the runtime error.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 18 Exception Handling.
Assertions Program correctness. Assertions Java statement – enables you to assert an assumption about your program. – An assertion contains a Boolean.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Exception Handling.
UNIT 3 TEMPLATE AND EXCEPTION HANDLING. Introduction  Program errors are also referred to as program bugs.  A C program may have one or more of four.
BASE CLASSES AND INHERITANCE CHAPTER 4. Engineer Class.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
1 Documenting with Javadoc. 2 Motivation  Why document programs? To make it easy to understand, e.g., for reuse and maintenance  What to document? Interface:
SE: CHAPTER 7 Writing The Program
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 15 Exceptions and.
Documentation and Programming Style Appendix A © 2015 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Software Documentation Section 5.5 ALBING’s Section JIA’s Appendix B JIA’s.
JAVA COURSE LESSON2 BY OMPUTER ENGINEEING ASSOCIATION.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
CSC 212 – Data Structures Prof. Matthew Hertz WTC 207D /
Sheet 3 HANDLING EXCEPTIONS Advanced Programming using Java By Nora Alaqeel.
Java Programming, 2E Introductory Concepts and Techniques Chapter 4 Decision Making and Repetition with Reusable Objects.
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
Page 1 – Autumn 2009Steffen Vissing Andersen SDJ I1, Autumn 2009 Agenda: Java API Documentation Code Documenting (in javadoc format) Debugging.
Exceptions in C++. Exceptions  Exceptions provide a way to handle the errors generated by our programs by transferring control to functions called handlers.
Exceptions and Assertions Chapter 15 – CSCI 1302.
1 Documenting with Javadoc CS 3331 Section and Appendix B of [Jia03] How to Write Doc Comments for the Javadoc TM Tool available from
SWE 4743 Abstract Data Types Richard Gesick. SWE Abstract Data Types Object-oriented design is based on the theory of abstract data types Domain.
Programming & Debugging. Key Programming Issues Modularity Modifiability Ease of Use Fail-safe programming Style Debugging.
1 Chapter 15 Exceptions and Assertions. 2 Objectives F To know what is exception and what is exception handling (§15.2). F To distinguish exception types:
Liang,Introduction to Java Programming,revised by Dai-kaiyu 1 Chapter 15 Exceptions and Assertions Nothing is impossible.
Lecture10 Exception Handling Jaeki Song. Introduction Categories of errors –Compilation error The rules of language have not been followed –Runtime error.
Defensive Programming. Good programming practices that protect you from your own programming mistakes, as well as those of others – Assertions – Parameter.
And other languages…. must remember to check return value OR, must pass label/exception handler to every function Caller Function return status Caller.
Chapter 7- Defining Your Own Classes Part 2 : Objectives After you have read and studied this chapter, you should be able to –Describe how objects are.
Chapter 13 Exception Handling
Advanced Programing practices
More Sophisticated Behavior
Haidong Xue Summer 2011, at GSU
Introduction to javadoc
Chapter 12 Exception Handling and Text IO
Programming in Java Assertion.
Chapter 7 Writing the Programs Shari L. Pfleeger Joann M. Atlee 4th Edition.
Documentation and Style
Introduction to javadoc
PPT and video are due no later than March 1, 2019
Computer Science 340 Software Design & Testing
Presentation transcript:

Lecturer: Dr. AJ Bieszczad Chapter 76-1 Software engineering standards Standards for you Standards for others Matching design with implementation

Lecturer: Dr. AJ Bieszczad Chapter 76-2 Algorithms Efficiency may have hidden costs –cost to write the code faster –cost to test the code –cost to understand the code –cost to modify the code

Lecturer: Dr. AJ Bieszczad Chapter 76-3 General guidelines Localize input and output Include pseudocode Revise and rewrite, rather than patch Reuse

Lecturer: Dr. AJ Bieszczad Chapter 76-4 Exception handling try { // code to try } catch (Exception e) { // exception handler } finally { // code executed under any circumstances }

Lecturer: Dr. AJ Bieszczad Chapter 76-5 Assertions In Java code: assert n > 0;// first form assert n > 0 : “n is zero!” // second form int i = k / n; Compiling:  javac –source 1.4 Enabling and disabling assertions:  java command line parameters -ea[:...|: ] -enableassertions[:...|: ] -da[:...|: ] -disableassertions[:...|: ] -esa | -enablesystemassertions -dsa | -disablesystemassertions Error throws if condition not satisfied:  Exception in thread “main” java.lang.AssertionError: n is zero!

Lecturer: Dr. AJ Bieszczad Chapter 76-6 Documentation Internal documentation –header comment block –other program comments –meaningful variable names and statement labels –format to enhance understanding –document data External documentation –describe the problem –describe the algorithm –describe the data

Lecturer: Dr. AJ Bieszczad Chapter 76-7 Class Header /** * * Note that there are two stars starting the comment. This makes the comments * eligible for processing with JavaDoc. * * HTML can be used in here; e.g., * This program... explain whatever it does, under what assumptions, what is the input and what is * the output, etc. * * annually, * monthly, and * daily. * * * is a control statement for JavaDoc * You can generate documentation using JavaDoc * My Name * */ // Here you start your class...

Lecturer: Dr. AJ Bieszczad Chapter 76-8 Method header /** * * Note that there are two stars starting the comment. * This makes the comments eligible for processing * with JavaDoc. * * Describe what the method does. You can use HTML. * parameterName parameter explanantion hour provides an integer representation * of the hour to set * explain what is returned from the method * (only if this is a typed function!) */ // now start your method code...