6 Testing and prompt engineering

This chapter covers

  • Understanding the importance of testing Copilot code
  • Using closed-box versus open-box testing
  • Addressing errors by Copilot by modifying prompts
  • Working through examples of testing Copilot-generated code

In chapter 3, we first started to see the importance of testing the code produced by Copilot. Testing is an essential skill for anyone writing software because it gives you confidence that the code is functioning properly. In this chapter, we’ll learn how to test our code thoroughly and how to help Copilot fix code that doesn’t work by modifying our prompts.

Testing is an essential skill that you’ll need to learn how to do well on your own, so that you’re able to check that the code ...

Get Learn AI-Assisted Python Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.