25
UCSD CSE 15L Java Debugging and the Scientific Method Week 1 September 28, 2011

UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

UCSD CSE 15L

Java Debugging andthe Scientific Method

Week 1September 28, 2011

Page 2: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Why does this course exist?1. To improve your skills programming in Java.2. To get practice working with code written by other people.3. As a lead-in to courses on software engineering.4. As an introduction to what it is like being an engineer:

teamwork, fables.5. To teach the scientific method.6. To replace a physics lab course.

Page 3: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

What will you do in 15L?

Main answer: Locate and fix mistakes in Java programs.

Other answers:• Do technical writing.• Work in a team of two.• Learn and apply the scientific method.• Absorb guidelines about debugging in general.

Page 4: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Debugging by David J. Agans

“... simple, foolproof principles guaranteed to help find any bug quickly. This book makes those shelves of application-specific debuggingbooks (on C++, Perl, Java, etc.) obsolete. It changes the way readers think about debugging, making those pesky problems suddenly much easier to find and fix.”

Page 5: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After
Page 7: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Breakdown of grades

10% quizzes; lowest one score removed30% final exam60% labs (3/8 notes, 5/8 reports); lowest notes score and lowest report score removed

Total 40% individual, 60% joint.

Page 8: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Some notes

1. Quizzes will last seven minutes. 2. Quizzes will be similar to the final exam.

Important: It is likely that scores will be more spread out on the final exam than on the labs.

The first quiz is next week at 3pm, October 5. Be on time.

Page 9: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Lectures and labs

• Every Wednesday, please be on time at 3pm here, WLH 2005.

• After the quiz and lecture, walk to the CSE building basement.

• Use the lab rooms B230, B240, B250 and B260. Do not use other labs. Feel free to ask non-15L students politely to leave.

• TAs and tutors will be available until 5:30pm at least.

Page 10: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Working in pairs

• Pick another student to be your partner.

• In every lab, you must have a different partner.

• Use two chairs in front of one computer.

• You will both get the same scores for the lab.

Page 11: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Deadlines

1. Quiz at 3pm every Wednesday.2. Before 7pm same day: Email your joint lab notes.3. Before noon Saturday: Email your joint report.

Lateness penalty: 25% of maximum per day (or part of day) late.

Example: For a report sent any time on Sunday, 50% penalty.

Page 12: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

How to submit notes and reports

Email notes and reports before their deadlines.

Use plain ASCII text: no attachments, no PDFs, no Word documents, etc.

See the handout for directions on formatting.

Page 13: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

How to submit notes and reports

We have a special Gmail address. Pay attention and use the right address, before the deadlines.

Graded notes and reports will be emailed back to you. Send a carbon copy (cc) to yourselves so we can do this.

Page 14: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Academic honestyCheating is unfair to other students. We will punish it.

Cheating includes plagiarism. Plagiarism means copying anyone else’s work without clear acknowledgment.

You may not use notes or reports from other teams, or from previous quarters or years.

The lab assignments are different this quarter, even if they look similar.

Page 15: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Class web site

Your responsibility: check the class web site regularly at http://cseweb.ucsd.edu/~elkan/15L

Find Java code for the first lab at http://cseweb.ucsd.edu/~elkan/15L/Alphabetize.java

Do not use copy-and-paste to get the code. Use the Linux commandwget http://cseweb.ucsd.edu/~elkan/15L/Alphabetize.java

Page 16: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Message board

Feel free to email any of the course staff with questions.

But, if your question is not personal, use the message board at  http://www.quicktopic.com/46/H/SEB8Mu7M2w7F

Page 17: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Linux and Eclipse

The first few labs will use the Linux command line.• Every software engineer needs to be comfortable with this.

Later labs will use the Eclipse IDE (interactive development environment).• IDEs increase productivity.

Page 18: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

How to compile Java

Use the command javac Alphabetize.java

Error messages are symptoms of syntax defects.

If not, a file named Alphabetize.class is created.

Page 19: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

How to run a Java program

Use the command java Alphabetize [args]The notation [args] means optional arguments.

Always be sure that you are running the latest version of your program!

What does the notation [input [output]] mean?

Page 20: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

What to do in the first lab

Task: Find and fix four bugs in Alphabetize.java

Write step by step notes about what you do, at the same time you are doing it. Submit these notes immediately when you are finished.

Page 21: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

The report for the first labOne interesting bug in Alphabetize.java is an “out of memory” issue. In your report, explain your thought process while finding and fixing this one bug.

Notes should be about all bugs, but the report should be about only this one bug.

The report must be written in good English, with complete sentences and paragraphs.

Scores are based on completeness and clarity, not on length.

Page 22: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

See on the website

• An example of good lab notes• An example of a good report• The guidelines that we will use for grading• The buggy code for today’s lab• The instructions for today’s lab (same as the handout)

Page 23: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Working in pairs

• Pick another student to be your partner. In every lab, you must have a different partner.

• Write notes at the same time you do debugging.• Email the notes with both your names today, before 7pm.

• Plan to finish your report jointly by Saturday noon.• You will both get the same scores for the lab.

Page 24: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Next week...

Next week I’ll talk about the scientific method: hypotheses, experiments, predictions, etc.

You will be able to compare the scientific method with your thought process from this week’s lab.

Page 25: UCSD CSE 15L Java Debugging and the Scientific Methodcseweb.ucsd.edu/~elkan/15L/Sep28.pdf · Lectures and labs • Every Wednesday, please be on time at 3pm here, WLH 2005. • After

Let’s go!

Please move to the labs now: B230, 240, 250 and 260.

Pick a partner and get started.