Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[译] [600] 第六章 程序测试与提示工程 #12

Open
cssmagic opened this issue Feb 29, 2024 · 0 comments
Open

[译] [600] 第六章 程序测试与提示工程 #12

cssmagic opened this issue Feb 29, 2024 · 0 comments

Comments

@cssmagic
Copy link
Owner

cssmagic commented Feb 29, 2024

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
  • Viewing examples of testing code produced by Copilot
  • 理解测试 Copilot 代码重要性
  • 使用黑盒测试与白盒测试
  • 通过修改提示词解决 Copilot 的错误
  • 查看测试 Copilot 生成代码的示例

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.

在第三章,我们初次体会到测试 Copilot 生成代码的重要性。对于编写软件的人而言,测试是一项必不可少的技能,它能够让开发者对代码的正确运行有足够的信心。在这一章中,我们将学习如何对代码进行彻底的测试,并且了解如何通过调整提示词来帮助 Copilot 修复不正确的代码。


本章目录

  • 6.1 Why it is crucial to test code
  • 6.2 Closed-box and open-box testing
    • 6.2.1 Closed-box testing
    • 6.2.2 How do we know which test cases to use?
    • 6.2.3 Open-box testing
  • 6.3 How to test your code
    • 6.3.1 Testing using the Python prompt
    • 6.3.2 Testing in your Python file (we won’t be doing it this way)
    • 6.3.3 doctest
  • 6.4 Revisiting the cycle of designing functions with Copilot
  • 6.5 Full testing example
    • 6.5.1 Finding the most students we can add to a row
    • 6.5.2 Improving the prompt to find a better solution
    • 6.5.3 Testing the new solution
  • 6.6 Another full testing example—Testing with files
    • 6.6.1 What tests should we run?
    • 6.6.2 Creating the function
    • 6.6.3 Testing the function
    • 6.6.4 Common challenges with doctest
  • 6.1 为什么测试代码至关重要
  • 6.2 黑盒测试与白盒测试
    • 6.2.1 黑盒测试
    • 6.2.2 我们如何选定合适的测试用例?
    • 6.2.3 白盒测试
  • 6.3 如何测试你的代码
    • 6.3.1 使用 Python 提示词进行测试
    • 6.3.2 在 Python 文件中测试(我们不会采用这种方式)
    • 6.3.3 基于 doctest 的测试
  • 6.4 重新考量有 Copilot 参与的函数设计流程
  • 6.5 完整的测试案例
    • 6.5.1 找出能加入一行的最多学生数量
    • 6.5.2 优化提示词以寻找更优的解决方案
    • 6.5.3 测试新方案
  • 6.6 另一个完整的测试案例——文件测试
    • 6.6.1 我们应运行哪些测试?
    • 6.6.2 函数创建
    • 6.6.3 函数测试
    • 6.6.4 doctest 面临的常见问题

本章正文略。如需阅读,请购买正版。


@cssmagic cssmagic changed the title [译] [600] 第六章 程序测试与提示词工程 [译] [600] 第六章 程序测试与提示工程 Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant