Search for tag: "precondition"

SOIL Seminar: An Indexed Type System for Fast and Safe WebAssembly

Title: An Indexed Type System for Fast and Safe WebAssembly Speaker: Adam Geller—University of British Columbia Summary: Often in low-level languages (i.e., assembly languages), potentially…

From  Ross Tate 22 plays

Lesson 25.4 The raise Statement

Up until now, the only way that we knew how to create an error is with an assert statement. But these always create errors with the type AssertionError. In this video we show how to create errors…

From  Hannah Lee 66 plays

Lesson 23.5 Mixed-Type Operators

Operator overloading allows us to redefine the meaning of + or * on objects of our class. But sometimes we want to mix together types like a fraction and integer. In this video we show that it is…

From  Hannah Lee 70 plays

Lesson 21.4 Invariant Enforcement

We know how to enforce preconditions, but how do we force invariants for our attributes? As we see in this video, we do it much the same as for preconditions. But that is because we are going to…

From  Hannah Lee 97 plays

Lesson 21.3 Interface Implementation

Once you have the interface to a class, it is time to start writing code. As we see in this video, the idea is much the same as writing functions. However, attributes – and specifically…

From  Hannah Lee 86 plays

Lesson 20.5 Method Definitions

In addition to attributes, objects also have methods. In this video, we show how to add a method definition to a class. For the most part, it is as simple as indenting a function definition inside of…

From  Hannah Lee 107 plays

Lesson 17.5 Divide and Conquer Design

Now that we understand divide-and-conquer, it is type to implement it in Python. In this video we show you a three-step sequence for writing a function definition using this technique.

From  Hannah Lee 116 plays

Lesson 14.4 Try-Except and Testing

We have a new control structure, so it is time once again to talk about testing. In this video we revisit the concept of code coverage and show testing a try-except is very similar to testing a…

From  Hannah Lee 59 plays

Lesson 13.6 Assert Helpers

Sometimes we absolutely need to enforce all of our preconditions, and we cannot live with the compromises of the previous video. In this video we show how to use top-down design to give us more…

From  Hannah Lee 66 plays

Lesson 13.5 Assert Trade-Offs

Preconditions can get really complicated, and sometimes it is unclear how to enforce all of the preconditions. In this video we talk about why it is okay to break up a precondition and…

From  Hannah Lee 52 plays

Lesson 13.4 Assert Messages

We now know how to do assert statements to create errors. But the error messages are a little cryptic. In this video we talk about how we can do a better job.

From  Hannah Lee 60 plays

Lesson 13.3 Assert Statements

Determining responsibility can get really tedious. In this video, we show how we can responsibility explicit by creating errors on purpose. We introduce the assert statement, which will allow us to…

From  Hannah Lee 75 plays

Lesson 13.2 Error Responsibility

When we introduced specifications, we talked about responsibility; if there is a problem with a function, it is either the fault of the definer or the caller. In this video, we show how we read an…

From  Hannah Lee 59 plays

Zoom Sep. 29. Algorithm Design

In this session we do a deep dive in how we might design a series of functions to acomplish a single task.This class will be highly interactive. We will start with a specification – one more…

From  Hannah Lee 28 plays

Lesson 10.6 Top-Down Design

Top-down design is a widely–used design technique. Your instructor used it to design the first assignment, and you will use it yourself in later assignments. In this video we take a closer look…

From  Hannah Lee 84 plays

Zoom Sep. 22. Specifications and Testing

Both specifications and testing are critical for the first assignment. But many students struggle with them because they are so “fuzzy”.To help you improve your skills here, we have are…

From  Hannah Lee 28 plays