gpt4 book ai didi

fixtures - 编程中的fixture是什么?

转载 作者:行者123 更新时间:2023-12-03 04:19:02 25 4
gpt4 key购买 nike

我多次听说过这个术语(在编程的背景下),但找不到它的含义的任何解释。有什么好的文章或解释吗?

最佳答案

我认为您指的是 test fixtures :

The purpose of a test fixture is to ensure that there is a well knownand fixed environment in which tests are run so that results arerepeatable. Some people call this the test context.

Examples of fixtures:

  • Loading a database with a specific, known set of data
  • Erasing a hard disk and installing a known clean operating system installation
  • Copying a specific known set of files
  • Preparation of input data and set-up/creation of fake or mock objects

(来源:维基百科,请参阅上面的链接)

这里还有一些practical examples from the documentation of the 'Google Test' framework .

关于fixtures - 编程中的fixture是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12071344/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com