From the course: Accelerate DevOps and Software Development with AI: Modern Tools and Workflows for Enhanced Software Delivery

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Coding project: Create AI-assisted test cases in Python

Coding project: Create AI-assisted test cases in Python

- I've gone ahead and implemented the remaining three methods. If you want to compare your project to mine, I've saved the code in the exercise files for this course. We're going to move to testing these methods now. Let's sanity check the service with a few assertions. We'll use a prompt that says write a demo function for this book service that creates two books, gets the first book, lists all books, deletes one book, and verifies that it's gone. Use plain assert statements. I'm going to accept this suggestion. This looks pretty great. It's done exactly what I asked. Writing tests can be pretty tedious. So this is a great starting point. Next, let's have AI enumerate what we might miss. My prompt says for this pure-Python BookService, list edge cases to test. Include invalid inputs, boundary IDs, duplicate titles or authors, and very large lists. This is a lot longer than what I was expecting, but it's still a pretty…

Contents