Section 2: Developer tools and you. Alex Mariakakis (staff-wide)

Similar documents
Warmup. A programmer s wife tells him, Would you mind going to the store and picking up a loaf of bread? Also, if they have eggs, get a dozen.

SECTION 2: HW3 Setup.

SECTION 2: Loop Reasoning & HW3 Setup

SECTION 2: Loop Reasoning & HW3 Setup

SECTION 1: CODE REASONING + VERSION CONTROL + ECLIPSE

hw6, BFS, debugging CSE 331 Section 5 10/25/12 Slides by Kellen Donohue

SECTION 2: CODE REASONING + PROGRAMMING TOOLS. slides borrowed and adapted from Alex Mariakis and CSE 390a

SECTION 1: CODE REASONING + VERSION CONTROL

SECTION 1: CODE REASONING + VERSION CONTROL

TDDC88 Lab 4 Software Configuration Management

CS 261 Recitation 1 Compiling C on UNIX

LAB 0: LINUX COMMAND LINE AND SVN

CSE 332: Data Structures and Parallelism Winter 2019 Setting Up Your CSE 332 Environment

CSE 331 Software Design & Implementation

Intro to Linux & Command Line

Using the Zoo Workstations

Department of Computer Science College of Engineering Boise State University


Using Eclipse for Java. Using Eclipse for Java 1 / 1

Source control with Subversion A user perspective

2/9/2013 LAB OUTLINE INTRODUCTION TO VCS WHY VERSION CONTROL SYSTEM(VCS)? II SENG 371 SOFTWARE EVOLUTION VERSION CONTROL SYSTEMS

CSE 390 Lecture 9. Version control and Subversion (svn)

Module Road Map. 7. Version Control with Subversion Introduction Terminology

Chapter 3. Revision Control

Agenda. - Final Project Info. - All things Git. - Make sure to come to lab for Python next week

User Guide Version 2.0

CS108, Stanford Handout #37. Source Control CVS

213/513/613 Linux/Git Bootcamp. Cyrus, Eugene, Minji, Niko

Unit 13. Linux Operating System Debugging Programs

What is Subversion and what does it do?

Version control. what is version control? setting up Git simple command-line usage Git basics

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

CSE 374 Programming Concepts & Tools. Hal Perkins Winter 2012 Lecture 16 Version control and svn

Software Development I

Human-Computer Interaction Design

AMath 483/583 Lecture 2. Notes: Notes: Homework #1. Class Virtual Machine. Notes: Outline:

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

AMath 483/583 Lecture 2

How to version control like a pro: a roadmap to your reproducible & collaborative research

Software Tools Subversion

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

Intermediate Programming, Spring Misha Kazhdan

Revision Control. Software Engineering SS 2007

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

Code::Blocks Student Manual

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

CSCI 4152/6509 Natural Language Processing. Lab 1: FCS Computing Environment

NetBeans Tutorial. For Introduction to Java Programming By Y. Daniel Liang. This tutorial applies to NetBeans 6, 7, or a higher version.

Version control CSE 403

Lab 08. Command Line and Git

GETTING STARTED WITH ECLIPSE Caitrin Armstrong

Version Control Systems (VCS)

Using Git to Manage Source RTL

CS480. Compilers Eclipse, SVN, Makefile examples

Human-Computer Interaction Design

Storing and Managing Code with CVS

HOW TO USE CODE::BLOCKS IDE FOR COMPUTER PROGRAMMING LABORATORY SESSIONS

Parallel Programming Pre-Assignment. Setting up the Software Environment

Lab 1 1 Due Wed., 2 Sept. 2015

Code::Blocks Student Manual

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Subversion Repository Layout

Revision control. INF5750/ Lecture 2 (Part I)

Version Control System - Git. zswu

Using git to download and update BOUT++

Introduction to Unix - Lab Exercise 0

Using GitHub to Share with SparkFun a

Unit 10. Linux Operating System

Revision Control. An Introduction Using Git 1/15

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

Git Setup Help using GitKraken (CSE 154)

Laboratory Assignment #4 Debugging in Eclipse CDT 1

How to set up SQL Source Control The short guide for evaluators

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

Linux File System and Basic Commands

Version Control Systems

STA 303 / 1002 Using SAS on CQUEST

Essential Linux Shell Commands

What s NetBeans? Like Eclipse:

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

Pieter van den Hombergh. September 9, 2015

Task-Oriented Solutions to Over 175 Common Problems. Covers. Eclipse 3.0. Eclipse CookbookTM. Steve Holzner

Eugene, Niko, Matt, and Oliver

Submitting your Work using GIT

A Gentle Introduction to CMSC311 labs and CVS Or How I learned to use CVS in CMSC311. William Arbaugh September 2, 2004

CMSC 201 Spring 2017 Lab 01 Hello World

CVS. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 21

A Tutorial for ECE 175

9 and 11-Jan CSCI 4152/6509 Natural Language Processing Lab 1: FCS Computing Environment, SVN Tutorial. FCS Computing Environment, SVN Tutorial

Lab #2 Physics 91SI Spring 2013

Lecture 01 - Working with Linux Servers and Git

Programming Logic - Beginning

Apache Subversion Tutorial

CMSC 201 Spring 2018 Lab 01 Hello World

2 Initialize a git repository on your machine, add a README file, commit and push

Version Control with Git

You should see something like this, called the prompt :

ENCM 339 Fall 2017: Editing and Running Programs in the Lab

Index. Bitwise operations, 131. Cloud, 88, 101

Introduction to Computation and Problem Solving

Transcription:

Section 2: Developer tools and you Alex Mariakakis cse331-staff@cs.washington.edu (staff-wide)

What is an SSH client? Uses the secure shell protocol (SSH) to connect to a remote computer o Enables you to work on a lab machine from home o Similar to remote desktop Windows and Linux users: PuTTY and WinSCP o Windows and Linux users Mac users: Terminal application o Go to Applications/Utilities/Terminal o Type in ssh XY csenetid@attu.cs.washington.edu

What is UNIX? Command-line based operating system o Like Windows or Mac OS without the mouse Command pwd ls cd cp mv rm mkdir rmdir man What it does prints the name of the working directory lists the files in a directory (i.e., lists stuff) changes a directory copies a file or directory move/rename a file or directory removes a file make a new directory remove an empty directory pulls up the manual pages

DEMO #1 http://courses.cs.washington.edu/courses/cse331/1 4sp/tools/WorkingAtHome.html

What is source control? Also known as version control/revision control System for tracking changes to code o Software for developing software Essential for managing projects o See a history of changes o Revert back to an older version o Back up your work o Merge changes from multiple sources We ll be talking about Subversion, but there are alternatives Git, Mercurial, CVS Email, Dropbox, USB sticks

Source control organization A repository stores the master copy of the project o Someone creates the repo for a new project o Then nobody touches this copy directly o Lives on a server everyone can access Each person checks out her own working copy o Makes a local copy of the repo o You ll always work off of this copy o The version control system syncs the repo and working copy (with your help) Working copy Repository svn Working copy

commit Source control common actions Most common commands: Commit / checkin o integrate changes from your working copy into the repository Update o integrate changes into your working copy from the repository update Repository svn Working copy

add, delete Source control common actions (cont.) More common commands: Add, delete o add or delete a file in the repository o just putting a new file in your working copy does not add it to the repo! Revert o wipe out your local changes to a file Resolve, diff, merge o handle a conflict two users editing the same code revert Repository svn Working copy

How to use Subversion 1. Eclipse plugin: Subclipse 2. GUI interface: TortoiseSVN, NautilusSVN 3. Command line: PuTTY

This Quarter We distribute starter code by adding it to your repo You will code in Eclipse just as you would have in your previous classes You turn in your files by adding them to the repo and committing your changes You will validate your homework by SSHing onto attu and running an Ant build file

DEMO #2 http://www.cs.washington.edu/education/courses/ cse331/14sp/tools/versioncontrol.html

Theoretical Scenario You are working on a computer in the lab and feel like you are at a good stopping point. You hit Save on your computer and start driving to Canada, only to realize that you forgot to commit your changes to your repo. Do you have to turn around and drive back? No, SSH into the attu, change to your eclipse workspace directory, and then call svn commit

Eclipse shortcuts Shortcut Ctrl + D Alt + Shift + R Ctrl + Shift + O Ctrl + / Ctrl + Shift + F Purpose Delete an entire line Refactor (rename) Clean up imports Toggle comment Make my code look nice

System.out.println() works for debugging o It s quick o It s dirty o Everyone knows how to do it but there are drawbacks o What if I m printing something that s null? o What if I want to look at something that can t easily be printed (e.g., what does my binary search tree look like now)? Eclipse s debugger is powerful if you know how to use it

Double click in the gray area to the left of your code to set a breakpoint. A breakpoint is a line that the Java VM will stop at during normal execution of your program, and wait for action from you.

Click the Bug icon to run in Debug mode. Otherwise your program won t stop at your breakpoints.

Controlling your program while debugging is done with these buttons

Play, pause, stop work just like you d expect

Step Into Steps into the method at the current execution point if possible. If not possible then just proceeds to the next execution point. If there s multiple methods at the current execution point step into the first one to be executed.

Step Over Steps over any method calls at the current execution point. Theoretically program proceeds just to the next line. BUT, if you have any breakpoints set that would be hit in the method(s) you stepped over, execution will stop at those points instead.

Step Out Allows method to finish and brings you up to the point where that method was called. Useful if you accidentally step into Java internals (more on how to avoid this next). Just like with step over though you may hit a breakpoint in the remainder of the method, and then you ll stop at that point.

Enable/disable step filters There s a lot of code you don t want to enter when debugging, internals of Java, internals of JUnit, etc. You can skip these by configuring step filters. Checked items are skipped.

Stack Trace Shows what methods have been called to get you to current point where program is stopped. You can click on different method names to navigate to that spot in the code without losing your current spot.

Variables Window Shows all variables, including method parameters, local variables, and class variables, that are in scope at the current execution spot. Updates when you change positions in the stackframe. You can expand objects to see child member values. There s a simple value printed, but clicking on an item will fill the box below the list with a pretty format. Some values are in the form of ObjectName (id=x), this can be used to tell if two variables are reffering to the same object.

Variables that have changed since the last break point are highlighted in yellow. You can change variables right from this window by double clicking the row entry in the Value tab.

Variables that have changed since the last break point are highlighted in yellow. You can change variables right from this window by double clicking the row entry in the Value tab.

There s a powerful right-click menu. See all references to a given variable See all instances of the variable s class Add watch statements for that variables value (more later)

Show Logical Structure Expands out list items so it s as if each list item were a field (and continues down for any children list items)

Breakpoints Window Shows all existing breakpoints in the code, along with their conditions and a variety of options. Double clicking a breakpoint will take you to its spot in the code.

Enabled/Disabled Breakpoints Breakpoints can be temporarily disabled by clicking the checkbox next to the breakpoint. This means it won t stop program execution until reenabled. This is useful if you want to hold off testing one thing, but don t want to completely forget about that breakpoint.

Hit count Breakpoints can be set to occur less-frequently by supplying a hit count of n. When this is specified, only each n-th time that breakpoint is hit will code execution stop.

Conditional Breakpoints Breakpoints can have conditions. This means the breakpoint will only be triggered when a condition you supply is true. This is very useful for when your code only breaks on some inputs! Watch out though, it can make your code debug very slowly, especially if there s an error in your breakpoint.

Disable All Breakpoints You can disable all breakpoints temporarily. This is useful if you ve identified a bug in the middle of a run but want to let the rest of the run finish normally. Don t forget to re-enable breakpoints when you want to use them again.

Break on Java Exception Eclipse can break whenever a specific exception is thrown. This can be useful to trace an exception that is being translated by library code.

Expressions Window Eclipse Debugging Used to show the results of custom expressions you provide, and can change any time. Not shown by default but highly recommended.

Expressions Window Eclipse Debugging Used to show the results of custom expressions you provide, and can change any time. Resolves variables, allows method calls, even arbitrary statements 2+2 Beware method calls that mutate program state e.g. stk1.clear() or in.nextline() these take effect immediately

Expressions Window Eclipse Debugging These persist across projects, so clear out old ones as necessary.

The debugger is awesome, but not perfect o Not well-suited for time-dependent code o Recursion can get messy Technically, we talked about a breakpoint debugger o Allows you to stop execution and examine variables o Useful for stepping through and visualizing code o There are other approaches to debugging that don t involve a debugger

DEMO #3