Skip to content

[译] [607] 本章小结 #19

New issue

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

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

Already on GitHub? # to your account

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

[译] [607] 本章小结 #19

cssmagic opened this issue Feb 29, 2024 · 0 comments

Comments

@cssmagic
Copy link
Owner

Summary

本章小结

  • Testing is a critical skill when writing software using Copilot.
  • Closed-box and open-box testing are different approaches to ensuring the code is correct. In closed-box testing, we come up with test cases based on what we know about the problem; in open-box testing, we additionally examine the code itself.
  • Doctest is a convenient way to test your code by adding test cases to the docstring description of a function.
  • Creating artificial files is an effective way to test code that uses files.
  • 在利用 Copilot 进行软件开发时,测试技能至关重要。
  • 黑盒测试与白盒测试代表了确保代码准确性的两种不同策略。黑盒测试依据我们对问题的认识来设计测试案例;而在白盒测试中,我们会进一步审视代码本身。
  • Doctest 提供了一种方便的方法,可以通过在函数的文档字符串说明中加入测试案例来对代码进行测试。
  • 创造虚拟文件是测试涉及文件操作代码的一个高效策略。
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant