CSE 331 Midterm Exam
5/9/14
Sample Solution
Question 1. (10 points) (Forward reasoning) Using forward reasoning, write an assertion
in each blank space indicating what is known about the program state at that point, given
the precondition and the previous
Ways to get your code right
Verification/quality assurance
Purpose is to uncover problems and increase confidence
Combination of reasoning and testing
Debugging
Find out why a program is not functioning as intended
Defensive programming
Programming wi
Outline
This lecture:
1. What is an Abstract Data Type (ADT)?
2. How to specify an ADT?
3. Design methodology for ADTs
CSE 331
Software Design & Implementation
Very related next lectures:
Representation invariants
Abstraction functions
Two distinct, com
Reasoning about code
Determine what facts are true as a program executes
Under what assumptions
CSE 331
Software Design & Implementation
Examples:
If x starts positive, then y is 0 when the loop finishes
Contents of the array arr refers to are sorted
Reasoning about loops
So far, two things made all our examples much easier:
CSE 331
Software Design & Implementation
1. When running the code, each statement executed 0 or 1 times
2. (Therefore,) trivially the code always terminates
Neither of these hold
2 Goals of Software System Building
Dan Grossman
Fall 2014
Lecture 4 - Specifications
Building the system right
Does the program meet the specification?
Determining this is usually called verification
CSE 331
Software Design & Implementation
Building th
Welcome!
We have 10 weeks to move well beyond novice programmer:
Larger programs
Small programs are easy: code it up
Complexity changes everything: design an artifact
Analogy: using hammers and saws vs. making cabinets (but
not yet building houses)
Pri
A data abstraction is defined by a
specification
A collection of procedural abstractions
Not a collection of procedures
CSE 331
Software Design & Implementation
Together, these procedural abstractions provide some set of values
All the ways of directly u
SECTION 1:
OUTLINE
VERSION CONTROL +
ECLIPSE
Version control
IDEs Eclipse
Debugging
[email protected]
slides borrowed and adapted from Alex Mariakis and CSE 390a
WHAT IS VERSION
CONTROL?
VERSION CONTROL
ORGANIZATION
Also known as source contr
Agenda
Section 5:
HW6 and Interfaces
Version control and tools review
BFS
Interfaces
Parsing Marvel Data
Slides adapted from Alex Mariakakis,
with material from Krysta Yousoufian, Mike Ernst, Kellen Donohue
331 Version control
Where is my code?
(/proj
Agenda
Section 9:
Design Patterns
What are design patterns?
Creational patterns review
Structural patterns preview
Slides adapted from Alex Mariakakis, with material
from David Mailhot, Hal Perkins, Mike Ernst
What Is A Design Pattern
Creational Patter
Agenda
Section 3:
HW4, ADTs, and more
HW4: fun with math review!
Abstract data types (ADTs)
Method specifications
Slides with material from Alex Mariakakis, Krysta
Yousoufian, Mike Ernst, Kellen Donohue
Polynomial Addition
(5x4 + 4x3 - x2 + 5)
+
Polyno
Agenda
Section 4:
Graphs and Testing
Graphs
Java assertions
Internal vs. external testing
Representation invariants in real code
Slides adapted from Alex Mariakakis, with
material from Krysta Yousoufian, Mike
Ernst, and Kellen Donohue
Graphs
Graphs
A
SECTION 2:
CODE REASONING +
PROGRAMMING
TOOLS
OUTLINE
Reasoning about code
Developer tools
Eclipse and Java versions
ssh
Version control
[email protected]
slides borrowed and adapted from Alex Mariakis and CSE 390a
REASONING ABOUT
CODE
FORWAR
CSE 331 Final Exam 6/10/14
Name _
There are 13 questions worth a total of 100 points. Please budget your time so you get to
all of the questions. Keep your answers brief and to the point.
The exam is closed book, closed notes, closed electronics, closed t
CSE 331 Final Exam 12/9/13
Name _
There are 10 questions worth a total of 100 points. Please budget your time so you get to
all of the questions. Keep your answers brief and to the point.
The exam is closed book, closed notes, closed electronics, closed t
CSE 331 Midterm Exam Sample Solution 11/5/12
Question 1. (16 points) (assertions) Using backwards reasoning, find the weakest
precondition for each sequence of statements and postcondition below. Insert appropriate
assertions in each blank line. You shoul
CSE 331 Midterm Exam Sample Solution 2/20/13
Question 1. (16 points) (assertions) Using backwards reasoning, find the weakest
precondition for each sequence of statements and postcondition below. Insert appropriate
assertions in each blank line. You shoul
CSE 331 Final Exam 3/18/13
Name _
There are 11 questions worth a total of 100 points. Please budget your time so you get to
all of the questions. Keep your answers brief and to the point.
The exam is closed book, closed notes, closed electronics, closed t
Name:
CSE331 Fall 2014, Final Examination
December 9, 2014
Please do not turn the page until 2:30.
Rules:
The exam is closed-book, closed-note, etc.
Please stop promptly at 4:20.
There are 156 (not 100) points, distributed unevenly among 11 questions (
Name:
CSE331 Fall 2014, Final Examination
December 9, 2014
Please do not turn the page until 2:30.
Rules:
The exam is closed-book, closed-note, etc.
Please stop promptly at 4:20.
There are 156 (not 100) points, distributed unevenly among 11 questions (
University of Washington
CSE 331 Software Design & Implementation
Spring 2013
Midterm exam
Wednesday, April 24, 2013
Name:
Section:
CSE Net ID (username):
UW Net ID (username):
This exam is closed book, closed notes. You have 50 minutes to complete it. It
CSE 331 Final Exam Sample Solution 12/9/13
Question 1. (22 points) Class specification. One of last summers interns was working
on a generic version of a graph that used an adjacency matrix representation. Theres
some existing code, but its not specified
CSE 331 Midterm Exam Sample Solution 11/18/13
Question 1. (10 points) (assertions) Using backwards reasoning, find the weakest
precondition for each sequence of statements and postcondition below. Insert appropriate
assertions in each blank line. You shou
CSE 331 Midterm Exam
11/18/13
Name _
There are 13 questions worth a total of 100 points. Please budget your time so you get to
all of the questions. Keep your answers brief and to the point.
The exam is closed book, closed notes, closed electronics, close
CSE 331 Midterm Exam
5/9/14
Name _
There are 7 questions worth a total of 100 points. Please budget your time so you get to
all of the questions. Keep your answers brief and to the point.
The exam is closed book, closed notes, closed electronics, closed m
Name:
CSE331 Winter 2014, Final Examination
March 17, 2014
Please do not turn the page until 8:30.
Rules:
The exam is closed-book, closed-note, etc.
Please stop promptly at 10:20.
There are 116 points total, distributed unevenly among 11 questions (man