软件测试时的洁净室

发布于 2024-08-12 16:14:19 字数 141 浏览 10 评论 0原文

我想准确检查我的代码在使用我没有代码的其他库时如何运行。虽然我可以在线执行此操作(即使用 SysInternals 的 FileMon、RegMon 和 TCPView),但我想知道是否有一个好的离线方法可以让我在虚拟机中运行我的代码,关闭虚拟机并比较整个虚拟机镜像?

I want to examine exactly how my code operates when using other libraries to which I do not have the code for. Whilst I can do this online (i.e. with FileMon, RegMon and TCPView from SysInternals), I was wondering if there was a good offline method that would allow me to run up my code in a virtual machine, shutdown the virtual machine and diff the entire VM image?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萌吟 2024-08-19 16:14:19

由于对系统的持久修改要么在注册表中的文件系统中,所以您可以有一个小程序来列出硬盘驱动器上的所有文件并转储注册表。
那么你也可以在程序运行之后,做一个简单的文件diff。
如果您使用的是virtualbox,我认为您可以离线安装磁盘映像(即虚拟机不运行)。然而,从脱机文件转储注册表可能会更困难。
请参阅 google 上的“安装 vdi”。

Since persistent modifications to the system is either in the filesystem on in the registry, you could have a little program that list all the files on the hard drive and also dump the registry.
Then you can also do it after program operation and do a simple file diff.
If you are using virtualbox, I think that you can do the mounting of the disk image offline (i.e. virtual machine not running). However dumping the registry from offline files may be harder.
See "Mount vdi" on google.

寒江雪… 2024-08-19 16:14:19

所有集成测试肯定会使用您没有源代码、框架库、数据库驱动程序、数据库、通信库的代码。其中一些甚至可能不在您的代码所在的同一台机器上。我不清楚你到底希望实现什么目标。你向排队系统打了一些电话,它会做各种各样的秘密松鼠事情。之前和之后都有所不同,现在你能说什么?您知道应该用什么数据格式来代表您的请求吗?

我认为测试是根据我正在使用的库和系统的已发布行为来定义的。数据库示例:我执行一些应该创建订单的业务操作。我知道我定义的订单,它们是否出现在数据库中?在定义测试时,我可以根据数据库中的记录指定明确的预期结果。然后我什至可以自动化测试 - 将数据库中的摘录与预期结果进行比较。

All integration testing surely will use code for which you don't have the source, your framework libraries, database drivers, databases, comms libraries. Some of which may not even be on the same machine your code is. I'm not clear exactly what you would hope to achieve. You make some calls to a queueing system, it does all manner of secret squirrel stuff. You diff before and after, now what can you say? Do you know what data formats there ought to be represent your request?

I see tests as being defined in terms of the published behaviours of the libraries and systems I'm working with. Example for a database: I execute some business actions which are supposed to create Orders. I know the orders I defined, do they appear in the database? In defining my tests I can specify explict expected outcomes in terms of records in a database. I can then even automate the tests - compare an extract from the database with expected results.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文