Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set your subtitle preferences in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please refer to our video player troubleshooting guide for assistance.

TDD Overview & What You'll Learn

This is the first video of the course and provides you an overview about the course as well as the objectives of this course. Furthermore, the stack data structure is explained.

Resources

00:00 Hello! This is Chyld of Real Python. In this video, I’m going to be teaching you about test driven development. The objectives for this video are we’re going to be building a basic stack data structure, you’re going to be doing this using test driven development techniques, I’m going to show you how to structure the file layout,

00:20 you’re going to be learning about pytest, you’re going to be learning about fixtures and how to use them, and finally, you’re going to be learning about test coverage.

00:30 So, it might be useful to learn a little bit about the stack data structure before we start implementing it. Python, as you know, has multiple data structures built-in, like a list, a set, a tuple, a dictionary. This is another data structure, and we could just implement it from scratch.

00:47 So, you could imagine this thing is empty, and if you wanted to put something into this data structure, you would perform a push operation. And so if you were to push one element, the first element, it would go here. If you were to push another element, it would go here. The third element—here. And then finally, if you do one final push, this fourth one—it would go here on top.

01:07 So that’s why it’s called stack, is because you’re stacking these things one on top of the other. Now, pop does just the opposite—it pulls things off of the stack. So if you did a pop operation, what happens is whatever got pushed last is what gets popped off.

01:22 Okay? So, you can imagine being in a cafeteria and having some trays. The trays, when they’re put down, are what’s called pushed onto the stack, and if you wanted to pull a tray off and use it, then that would be an example of popping the tray off.

01:36 We’re going to be implementing this stack data structure in Python using test driven development.

Become a Member to join the conversation.