CSE 331: Topics
The course is organized into 10 topics. We plan to cover one topic per week.
1. Specifications & Testing
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 look at how specifications for methods are written in Java.
-
Lecture Topic 1 slides (PDF)
- Summary of testing requirements
- Section 1 slides and Section 1 worksheet (HTML) (Section 1 worksheet PDF) and Section 1 solutions (HTML) (Section 1 solutions PDF)
2. Testing & Immutable Reasoning
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.
To gain even more confidence in correctness, we turn to reasoning. First, we will reason about code that does not change the values on any local variables (so-called "functional" code).
- Lecture slides
- Section 2 slides and Section 2 worksheet (HTML) (Section 2 worksheet PDF) and Section 2 solutions (HTML) (Section 2 solutions PDF)
-
Homework 1 Written and Homework 1 Coding
Change log:
- Updated zip to include Florist2.java and Florist2Tests.java for second implementation
- Task 4 conditional inside loop changed to match spec. Updated part b tests.
3. Reasoning about Local Variable Mutation: Floyd Logic
Now we will learn how to reason about code that changes the values of local variables using a technique called Floyd logic. Different properties will be true at different points in the program, based on the current values of the variables. We will learn how to propagate knowledge about what is true at different program points across assignment statements, conditionals (if statements), and loops.
- Lecture slides (combined with topic 2 slides; see above)
- Section 3 slides and Section 3 worksheet PDF
- Homework 2 Written
4. Mutation and Data Abstraction
- Lecture slides