CSE 331: Software Design and Implementation
What qualities make a program good? How can we tell if a program is
good? How can we build good programs? We will consider these
questions as we explore concepts and techniques for the design and
construction of reliable and maintainable software systems in modern
high-level languages; program structure and design; program-correctness
approaches, including testing; and event-driven programming. To
practice the concepts from lecture, we will build substantial projects.
Jan 4, 1. Introduction (materials)
Jan 6, 2. Formal Reasoning (materials)
Jan 8, 3. Reasoning About Loops (materials)
Jan 11, 4. Specifications (materials)
Jan 13, 5. Abstract Data Types (materials)
Jan 15, 6. Representation Invariants (materials)
Jan 20, 7. Abstraction Functions (materials)
Jan 22, 8. Testing (materials)
Jan 25, 9. Style and Design (materials)
Jan 27, 10. Equals and Hashcode (materials)
Jan 29, 11. Assertions and Exceptions (materials)
Feb 1, 12. Subtyping (materials)
Feb 3, 13. Generics 1 (materials)
Feb 5, 14. Generics 2 (materials)
Feb 8, 15. Debugging (materials)
Feb 17, 16. Checker Framework (materials)
Feb 19, 17. Events, Listeners, Callbacks (materials)
Feb 22, 18. Java Graphics and GUIs (materials)
Feb 26, 19. Java GUI Events (materials)
Feb 29, 20. Design Patterns 1 (materials)
Mar 2, 21. Design Patterns 2 (materials)
Mar 4, 22. System Development (materials)
Mar 7, 23. Verifying System Architectures (materials
Mar 11, 24. Wrap Up (materials
Jan 7, 1. Hoare Logic and Git (materials)
Jan 14, 2. Project Setup and More Git (materials)
Jan 21, 3. ADTs and HW4 (materials)
Jan 28, 4. Graphs and Testing (materials)
Feb 3, 5. Interfaces and HW6 (materials)
Feb 11, 6. Midterm Review (materials)
Feb 18, 7. Dijkstra's Algorithm (materials)
Feb 25, 8. Model View Controller (materials)
Mar 3, 9. Design Patterns (materials)
Mar 10, 10. Final Review (materials)
We will be reading selections from The Pragmatic Programmer and
Effective Java throughout the quarter. You can find quizzes on
the reading in Catalyst.
PP numbers correspond to sections and EJ numbers
correspond to items. Very sorry for the confusion
on this issue earlier in the quarter!
Week 1 : Get books!
Week 2 : quiz due 2/3
1 The Cat Ate My Source Code
2 Software Entropy
5 Your Knowledge Portfolio
31 Programming by Coincidence
35 Evil Wizards
Week 3 : quiz due: 2/3
21 Design by Contract
44 It's All Writing
Week 4 : quiz due 2/10
4 Good-Enough Software
7 The Evils of Duplication
26 Decoupling and the Law of Demeter
34 Code That's Easy to Test
43 Ruthless Testing
Week 5 : quiz due 2/10
Week 6 : quiz due 2/17
22 Dead Programs Tell No Lies
23 Assertive Programming
24 When to Use Exceptions
Week 7 : quiz due 2/24
16 - 20
57 - 62
Week 8 : quiz due 3/2
29 It's Just a View
Submit homeworks 0, 1, and 2 via the
Submit programming assignments by pushing and tagging
your git repo as described in the assignment spec.
If you absolutely must,
you can use up to 4 late days during the quarter,
but at most 2 per assignment.
To get ready for future homeworks, please see the
Homework 0 :
due Friday, January 8 at 10am
Homework 1 :
due Wednesday, January 13 at 11pm
Homework 2 :
due Tuesday, January 19 at 10am
Homework 3 :
due Thursday, January 21 at 11pm
Homework 4 :
due Thursday, January 28 at 11pm
Homework 5 :
due Monday, February 8 at 11pm
Homework 6 :
due Thursday, February 18 at 11pm
Homework 7 :
due Friday, February 26 at 11pm
Homework 8 :
due Friday, March 4 at 11pm
Homework 9 :
due Friday, March 11 at 11pm
Goals: There is a level of programming maturity beyond
introductory programming that comes from building larger systems and
understanding how to specify them precisely, manage their complexity,
and verify that they work as expected. After completing this course
successfully students should be able to:
Successfully build medium-scale software projects in principled ways
Understand the role of specifications and abstractions and how to
verify that an implementation is correct, including effective testing
and verification strategies and use of formal reasoning
Analyze a software development problem and be able to design
effective program structures to solve it, including appropriate
modularity, separation of abstraction and implementation concerns,
use of standard design patterns to solve recurring design problems,
and use of standard libraries
Use modern programming languages effectively, including understanding
type systems, objects and classes, modularity, notions of identity
and equality, and proper use of exceptions and assertions
Use and learn new contemporary software tools, including integrated
development environments, test frameworks, debuggers, version
control, and documentation processing tools
To gain experience we will use Java and associated tools like Eclipse,
JUnit, JavaDoc, and git, but the goal is to understand the underlying
ideas and concepts that are widely applicable to software construction.
Prerequisite: The only formal prerequisite is CSE 143.
We will very much rely on a thorough understanding of the concepts from
CSE 143 as well as Java programming skills. We will go much further and
you will be challenged to approach software development much differently
than you have in CSE 143 or other courses.
Grading and Exams: Your overall grade will be determined
as follows (subject to change as necessary, but substantial changes to
the numbers below is unlikely):
- 55% - Homework assignments, approximately weekly
- 17% - Midterm exam
- 23% - Final exam
- 5% - Reading quizzes and other participation
There is approximately one assignment per week, but not on an exact
schedule (i.e., assignments may be due on different days). The
assignments are not weighted equally because
they are of different length and sophistication. The exact weighting is
to-be-determined and is not likely to be published in advance (we need to
see how the course goes). Later assignments are likely to be weighted
more heavily because they are more involved.
Late Policy: Deadlines will be given with each
assignment. These deadlines are strict. For the entire quarter, you may
have four "late days". You are strongly advised
to save them for emergencies. You may not use more than two for the same
assignment. They must be used in 24-hour (integer) chunks. This policy
may not be the same as in your other classes. You are responsible for
understanding it if you choose to submit late work.
Academic Integrity: Any attempt to misrepresent the work
you submit will be dealt with via the appropriate University mechanisms,
and your instructor will make every attempt to ensure the harshest
allowable penalty. The guidelines for this course and more information
about academic integrity are below. You are
responsible for knowing that information.
Texts: There are two required books for the course:
- The Pragmatic Programmer by Andrew Hunt and David Thomas, Addison-Wesley, 1999.
- Effective Java by Joshua Bloch, 2nd ed., Addison-Wesley, 2008.
These books contain a great deal of distilled wisdom about software
construction in general and Java best practices, technical details, and
style issues. Reading about software development is an important skill.
There will be assigned readings from these books during the quarter, and
you will be required to complete short online quizzes from time to time
about the readings.
Do not skip class or section to work on homework, not even late in the
quarter when you are more tired and busy. This will cost you time (not
to mention learning) in the long run. Class will start promptly, and
you will find the entire course easier and more educational if you
arrive punctually, well-rested, and ready to pay attention for 50
Do buy a Java programming book. In general, a large, well-written
reference book for any programming language you are using is a great
value, sure to save you time over frustrating web-searching and time on
sites like stackoverflow.com (though those are useful too -- it is not
"one or the other"). Web-searching is cheaper, but you are spending a
lot of money on your education and will likely get a high-paying job
when you finish. The cost of a book that helps you do better
in classes, internships, etc. is miniscule compared to the
benefits you get from doing better work in less time. And such a book
will be valuable long after you complete CSE331.
A common misconception about this course is that the lectures,
readings, and homeworks are disconnected. They are different since
there is no point repeating something in multiple ways, but they also
are connected. If you are approaching a homework and not using the
concepts in the rest of the course materials, you are making it
harder. When you are sawing something with a dull blade, it can
seem like you do not have time to sharpen the blade because you need to
finish sawing. In fact, you likely do not have time not to stop and
sharpen the blade.
Start homeworks early. They are more difficult than assignments in
earlier courses and you need time to make mistakes.
Enjoy this course and learn a lot. It is invaluable for making you a
better software developer. The more you master these ideas now, the
more effective you can be in jobs, other courses, and any other
Approximate Topics (subject to change): We expect to
cover the following, with an emphasis on specification and design. The
order these are listed is only very rough as we will revisit some topics
- Reasoning about programs: pre- and post-conditions, invariants, and correctness
- Abstract data types, specification, implementation, abstraction functions, representation invariants, notions of equality
- Java language issues: subclasses and subtypes, generics, exceptions, assertions, etc.
- Tools: Eclipse IDE, version control, git
- Code quality, style, comments, documentation, JavaDoc
- Testing, test coverage, black- and white-box testing, test-first development, regression testing, JUnit
- Debugging strategies and tools
- Design: modular design, coupling, cohesion; design patterns
- User interfaces, callbacks, separation of model from view/control
You are responsible for understanding every word in this document.
- Motivation: A course in which students do not accurately present what they know and the
work they have done is worse than having no course at all. Your instructor
and your fellow students expect
and deserve a basic respect for the integrity of this course and an environment
where we can all focus on learning. Therefore, this document establishes
a clear understanding of what we all will do with
the expectation that it will never be an issue.
- Bottom Line: If you are
ever unclear about how to represent what work you have done, (a) ask and
(b) describe clearly what you have done. If you do, the worst
that will happen is you will lose some
credit on an assignment. This is much better than the alternative.
If you are at all in doubt about whether your collaboration was appropriate,
include a description of your collaboration with your homework submission.
If the course staff receives homework submissions that are too similar to
have been created independently, or are derived from
other sources, we will pursue the maximum penalty allowed by
- Collaboration: You are encouraged to discuss the material in
this course, including homework problems.
We all learn better when we trade ideas with others, including course staff
and fellow students.
But you must produce your own homework
solutions and you must not look at other students'
solutions or other information that takes away the intellectual challenge
of the homework.
Unless specifically told otherwise, you are to complete
assignments individually. You may discuss
assignments in general terms with other students including a discussion of
how to approach a problem, but the code and other work you submit must be your own.
The intent is to allow you to get some help when you
are stuck, but this help should be limited and should never involve details
of how to write a solution. You may not have another person (current student,
student, tutor, friend, anyone) "walk you
through" how to solve an assignment.
Copying someone else's homework or receiving unfair help
completing your assignment is cheating (see below), as is copying the
homework from another source (the web, other classes, previous course
Cheating: Cheating is a very serious offense. If
you are caught cheating, you can expect a failing grade and initiation
of a cheating case in the University system. Cheating is an insult to
your colleagues, to the instructors, to the department and major
program, and most importantly, to you. If you feel that you are having
a problem with the material, or do not have time to finish an
assignment, or have any number of other reasons to cheat, then talk
with the instructor. Copying others' work is not the solution.
To avoid creating situations where copying can arise, never e-mail
or post your solution files. When using the class discussion board, do
not post code that is an attempt to solve a homework problem. If in
doubt about what might constitute cheating, send the instructor email
describing the situation.
- Fine Print: It's not effective for us to try to define a list of all impermissible activities.
That approach can tempt people to look for loopholes.
Consider: "the code you write must be your own."
This includes things like not using any substantive material or solutions from
similar assignments this term or previous terms at UW or elsewhere,
including anywhere on the Internet, transcribing solutions from any
other source, etc. Our policy is intended to convey the spirit of
the law, fully understanding that the letter of the law may not
cover everything that someone may think of.
- For additional information and a more detailed discussion, please refer
to the CSE
Academic Misconduct Policy page.
Material in this course based on work from
Michael Ernst, Hal Perkins, Dan Grossman,
David Notkin, numerous TAs, and past 331 students.