Skip to main content

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.

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).

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.

4. Mutation and Data Abstraction

5. Reasoning About Arrays

In this topic, we will look at how to reason about code with array indexing. As we will see, this creates potential bugs that cannot occur with lists. Array indexing gives us extra power but comes at a cost of more complex reasoning, requiring the use of prefixes, suffix, and “for any” facts to describe their states.

6. Web applications and AI-assisted programming

In this topic, we will learn the basics of full stack web development, as an example of a moderately complex type of programming. We will also explore what AI assistance can and cannot do for us in software development.

7. Type Polymorphism

In this topic, we will look at ways that we can write code that can be used for types without any changes. The first way is through the use of subtypes. The second way is through the use of type parameters, which are called “generics” in Java.