编程中的夹具是什么? [英] What are fixtures in programming?
本文介绍了编程中的夹具是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经多次(在编程方面)听说过这个术语,但是找不到任何解释.有好的文章或解释吗?
I have heard of this term many times (in the context of programming) but couldn't find any explanation of what it meant. Any good articles or explanations?
推荐答案
我认为您指的是测试装置:
测试治具的目的是确保有一个众所周知的 在固定的环境中运行测试,以便获得结果 可重复的.有人将其称为测试上下文.
The purpose of a test fixture is to ensure that there is a well known and fixed environment in which tests are run so that results are repeatable. Some people call this the test context.
固定装置的示例:
- 使用一组已知的特定数据加载数据库
- 擦除硬盘并安装已知的全新操作系统安装
- 复制一组已知的特定文件
- 准备输入数据并设置/创建伪造或模拟对象
- 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
(来源:维基百科,请参见上面的链接)
(source: wikipedia, see link above)
这里还有一些.
这篇关于编程中的夹具是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文