© O. Nierstrasz— P2 —1 Exceptions All Exception classes look like this! Define your own exception class to distinguish your exceptions from any other kind.

Slides:



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

11-Jun-14 The assert statement. 2 About the assert statement The purpose of the assert statement is to give you a way to catch program errors early The.
Utilizing the GDB debugger to analyze programs Background and application.
Software Development Tools COMP220/COMP285 Seb Coope Ant and XML: Getting Started These slides are mainly based on “Java Development with Ant” - E. Hatcher.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
ANT: Another Nice Tool Ali Beyad October 1, 2003.
CVS Selim Çıracı Ahmet Kara Metin Tekkalmaz. CVS – Open Source Version Control System Outline What are Version Control Systems? And why do we need them?
Linux+ Guide to Linux Certification, Second Edition
CS 501 : An Introduction to SCM & GForge An Introduction to SCM & GForge Lin Guo
Configuration Management and RCS CPS470 Fall 1999.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Low level CASE: Source Code Management. Source Code Management  Also known as Configuration Management  Source Code Managers are tools that: –Archive.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Introduction to Classes and Objects CS-2303, C-Term Introduction to Classes and Objects CS-2303 System Programming Concepts (Slides include materials.
2000 Copyrights, Danielle S. Lahmani UNIX Tools G , Fall 2000 Danielle S. Lahmani Lecture 9.
CS465 - Unix C Programming (cc/make and configuration control)
Source Code Management Or Configuration Management: How I learned to Stop Worrying and Hate My Co-workers Less.
1 CMPT 275 Software Engineering Revision Control.
1 Classes and Objects. 2 Outlines Class Definitions and Objects Member Functions Data Members –Get and Set functions –Constructors.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
C++ / G4MICE Course Session 3 Introduction to Classes Pointers and References Makefiles Standard Template Library.
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
1 Topics for this Lecture Software maintenance in general Source control systems (intro to svn)
Introduction to Shell Script Programming
JUnit in Action SECOND EDITION PETAR TAHCHIEV FELIPE LEME VINCENT MASSOL GARY GREGORY ©2011 by Manning Publications Co. All rights reserved. Slides Prepared.
Apache Ant Java-Based Build Tool. Making your builds boring… Building projects should be easy and standardized. You should not be spending a substantial.
1 Lecture 19 Configuration Management Software Engineering.
1 Software Development Configuration management. \ 2 Software Configuration  Items that comprise all information produced as part of the software development.
Linux+ Guide to Linux Certification, Second Edition
CSC Programming I Lecture 8 September 9, 2002.
Introduction Use of makefiles to manage the build process Declarative, imperative and relational rules Environment variables, phony targets, automatic.
Ant Build Tools.  Creating a product from source may take several steps: Compile Link Copy files to various directories Remove intermediate files Generate.
ClearCase Basics XML presentation.
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Chapter Ten g++ and make1 System Programming Software Development: g++ and make.
CVS – concurrent versions system Network Management Workshop intERlab at AIT Thailand March 11-15, 2008.
CSE 219 Computer Science III CVS
Ant Presentation by: Bart Taylor. What is Ant? The simple definition: A Java-based build tool The Official Definition: “Apache Ant is a Java-based build.
RCS The Revision Control System. To Be Covered… An RCS overview The RCS command set Some useful things Where it can be used Alternatives to RCS.
Reformatted slides from the textbook, C++ How to Program, 6/e Pearson Education, Inc. All rights reserved Chapter 3. [Lecture 02] Introduction to.
More About Objects and Methods Chapter 5. Outline Programming with Methods Static Methods and Static Variables Designing Methods Overloading Constructors.
Introduction Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Makefiles. Multiple Source Files (1) u Obviously, large programs are not going to be contained within single files. u C provides several techniques to.
Chapter 3 Understanding Ant datatypes and properties.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Data Display Debugger (DDD)
Chapter 3 Part I. 3.1 Introduction Programs written in C ◦ All statements were located in function main Programs written in C++ ◦ Programs will consist.
M1G Introduction to Programming 2 5. Completing the program.
COP3502 Programming Fundamentals for CIS Majors 1 Instructor: Parisa Rashidi.
12 CVS Mauro Jaskelioff (originally by Gail Hopkins)
CS 350, slide set 11 M. Overstreet Old Dominion University Spring 2006.
Slide 1 Running NEMO at ECMWF Slide 1 NEMO under Perforce at ECMWF Kristian S. Mogensen Last revised:
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
How to configure, build and install Trilinos November 2, :30-9:30 a.m. Jim Willenbring.
TEAM FOUNDATION VERSION CONTROL AN OVERVIEW AND WALKTHROUGH By: Michael Mallar.
Brandon Packard. Why make? So far, you have probably worked on relatively small projects Coding projects can become huge My research consists of 1600.
Defensive Programming. Good programming practices that protect you from your own programming mistakes, as well as those of others – Assertions – Parameter.
UNIX Development: g++ and make CS 2204 Class meeting 8 Created by Doug Bowman, 2001 Modified by Mir Farooq Ali, 2002.
Defining Data Types in C++ Part 2: classes. Quick review of OOP Object: combination of: –data structures (describe object attributes) –functions (describe.
A First Book of C++ Chapter 12 Extending Your Classes.
Makefiles Manolis Koubarakis Data Structures and Programming Techniques 1.
Introduction to Configuration Management With RCS
Henning Schulzrinne Advanced Programming
ENERGY 211 / CME 211 Lecture 17 October 29, 2008.
Classes and Objects Systems Programming.
Introduction to Classes and Objects
Presentation transcript:

© O. Nierstrasz— P2 —1 Exceptions All Exception classes look like this! Define your own exception class to distinguish your exceptions from any other kind. public class AssertionException extends Exception { AssertionException() { super(); } AssertionException(String s) { super(s); } } The implementation consists of a default constructor, and a constructor that takes a simple message string as an argument. Both constructors call super() to ensure that the instance is properly initialized.

© O. Nierstrasz— P2 —2 Testing Assertions It is easy to add an assertion-checker to a class: private void assert(boolean assertion) throws AssertionException { if (!assertion) { throw new AssertionException("Assertion failed in LinkStack"); }  What should an object do if an assertion does not hold?  Throw an exception.

© O. Nierstrasz— P2 —3 Make Make is a Unix and Windows-based tool for managing dependencies between files. You can specify in a “Makefile”: Which files various targets depend on Rules to generate each target Macros used in the dependencies and rules Generic rules based on filename suffixes When files are modified, make will apply the minimum set of rules to bring the targets up-to-date.

© O. Nierstrasz— P2 —4 A Typical Makefile.SUFFIXES:.class.java.java.class :# generic rule javac $< CLASS = AbstractBoardGame.class AssertionException.class \ BoardGame.class GameDriver.class Gomoku.class Player.class \ Runner.class TestDriver.class TicTacToe.class all : TicTacToe.jar Test.jar# default target TicTacToe.jar : manifest-run $(CLASS)# target and dependents jar cmf manifest-run $(CLASS)# generation rule Test.jar : manifest-test $(CLASS) jar cmf manifest-test $(CLASS) clean : rm -f *.class *.jar

© O. Nierstrasz— P2 —5 Running make % make javac AbstractBoardGame.java javac GameDriver.java javac TestDriver.java jar cmf manifest-run TicTacToe.jar AbstractBoardGame.class AssertionException.class BoardGame.class GameDriver.class Gomoku.class Player.class Runner.class TestDriver.class TicTacToe.class jar cmf manifest-test Test.jar AbstractBoardGame.class AssertionException.class BoardGame.class GameDriver.class Gomoku.class Player.class Runner.class TestDriver.class TicTacToe.class % touch Runner.java % make Test.jar javac Runner.java jar cmf manifest-test Test.jar AbstractBoardGame.class AssertionException.class BoardGame.class GameDriver.class Gomoku.class Player.class Runner.class TestDriver.class TicTacToe.class

© O. Nierstrasz— P2 —6 RCS command overview ciCheck in revisions coCheck out revisions rcsSet up or change attributes of RCS files identExtract keyword values from an RCS file rlogDisplay a summary of revisions mergeMerge changes from two files into a third rcsdiffReport differences between revisions rcsmergeMerge changes from two RCS files into a third rcscleanRemove working files that have not been changed rcsfreezeLabel the files that make up a configuration

© O. Nierstrasz— P2 —7 Using RCS When file is checked in, an RCS file called file,v is created in the RCS directory: mkdir RCS# create subdirectory for RCS files ci file# put file under control of RCS Working copies must be checked out and checked in. co -l file# check out (and lock) file for editing ci file# check in a modified file co file# check out a read-only copy ci -u file# check in file; leave a read-only copy ci -l file# check in file; leave a locked copy rcsdiff file# report changes between versions

© O. Nierstrasz— P2 —8 Additional RCS Features Keyword substitution Various keyword variables are maintained by RCS: $Author$who checked in revision (username) $Date$date and time of check-in $Log$description of revision (prompted during check-in) Revision numbering: Usually each revision is numbered release.level Level is automatically incremented upon each check-in A new release is created explicitly: ci -r2.0 file

© O. Nierstrasz— P2 —9 Other tools Be familiar with the programming tools in your environment! memory inspection tools: like ZoneRanger help to detect other memory management problems, such as “memory leaks” zip and jar: store and compress files and directories into a single “zip file” awk, sed and perl: process text files according to editing scripts/programs

© O. Nierstrasz— P2 —10 What you should know!  How do make and Ant support system building?  What functionality does a version control system support?  When should you use a debugger?  What are breakpoints? Where should you set them?  What should you do after you have fixed a bug?  When should you use a profiler?  What is an IDE?

© O. Nierstrasz— P2 —11 Can you answer these questions?  When should you use Ant rather than make?  When should you use CVS rather than RCS?  How often should you checkpoint a version of your system?  When should you specify a version of your project as a new “release”?  How can you tell when there is a bug in the compiler (rather than in your program)?  How can you tell if you have tested every part of your system?