CSE 331: Topics
1. Specifications and Procedural Abstraction
Even when we are asking AI to write code for us, since AI cannot read our minds, it is important to be able to write a clear specification, stating in precise terms what that code needs to do. In this topic, we will discuss whole-program software specifications and method specifications.
- Lecture 1: Sum.java
- Homework 0
-
Lecture 2: Handout on method specifications and Handout with
indexOfexamples -
Section 1 slides and
solution slides and
Section 1 worksheet and Section 1 solutions and
Handout with
removeValueexamples -
Homework 1. Change log:
- (6/27/26 5pm) Updated the starter code to describe the expected output format for Task 4. Please update to the most recent starter code or review the differences.
-
(6/29/26 9am) Fixed the expected output values. The values contained in the
expected output file were incorrectly computed by dropping 1 HW score
instead of 2 as specified in
categories.csv. This has now been fixed.
2. Testing & Interactive Programs
Testing gives us some confidence (though not complete confidence) that the implementation satisfies the specification by checking it on a well-designed set of test cases.
- Lecture 3: Handout on testing
- Lecture 4: Handout on more testing and code coverage
- Lecture 5: Calculator.java and Handout on error handling and interactive programs
- Section 2 slides and Section 2 solution slides and Section 2 worksheet and Section 2 solutions
3. Reasoning about Assertions
Reasoning is a technique programmers use to determine what is true at different points in the program. In this topic, we will study global (whole-program) and local (within one method) reasoning, and connect the two together.
- Lecture 6: Handout on reasoning