简体   繁体   English

您可以在不创建测试代码的情况下执行单元/集成测试

[英]Can you perform unit / integration tests without creating test codes?

In our project, test procedures and expected test results (test specifications) are created in a document. 在我们的项目中,在文档中创建测试过程和预期的测试结果(测试规范)。 Then, we perform testing on a built product / release. 然后,我们对构建的产品/版本执行测试。 Here, no test codes nor test tools are involved. 这里不涉及测试代码和测试工具。

Is this acceptable for unit / integration testing? 这对于单元/集成测试是否可接受?

What you are doing is "manual testing". 你在做什么是“手动测试”。

Manual testing per definition is not, and can never be unit testing. 根据定义进行手动测试不是,也绝不能进行单元测试。

Manual testing can be used for integration testing, and in fact should be used to some degree, because automated tests cannot spot all forms of unexpected error conditions. 手动测试用于集成测试,实际上应该在某种程度上使用,因为自动测试无法发现所有形式的意外错误情况。 Especially bugs having to do with layout and things not "looking right" (which happen to be rather common in web apps). 特别是与布局有关的错误和不“看起来正确”的事情(这在网络应用中恰好相当普遍)。

However, if you have no automated tests at all, it means that your application is insufficiently tested, period. 但是,如果您根本没有自动化测试,则意味着您的应用程序未经过充分测试。 Because it's completely infeasible to manually test every detailed aspect of an application for every release - no organization would be willing or able to pay for the effort that would require. 因为为每个版本手动测试应用程序的每个详细方面是完全不可行的 - 没有任何组织愿意或能够为所需的工作付费。

Is this acceptable for unit / integration testing? 这对于单元/集成测试是否可接受?

No. what you describe is neither unit nor integration testing, it is taking the build for a walk around the block to get a cup of coffee. 不,你所描述的既不是单元测试,也不是集成测试,它是在街区附近散步以获得一杯咖啡。

Unit testing is - as I understand it - the testing of individual units of code. 单元测试 - 据我所知 - 测试各个代码单元。 Relatively low level and usually developed at the same time as the code itself. 相对较低的水平,通常与代码本身同时开发。

To do that you need to be working in code as well and ultimately the code that performs these tests is testing tool even if for some reason you aren't using a framework. 要做到这一点,你需要在代码中工作,并且最终执行这些测试的代码是测试工具,即使由于某种原因你没有使用框架。

So no, if you aren't using testing tools or testing code, you aren't doing unit testing. 所以不,如果你没有使用测试工具或测试代码,你就不会进行单元测试。

Theoretically you could be doing integration testing manually, but it's still unreliable because people tend to be inconsistent and expensive because people are slower than machines. 从理论上讲,你可以手动进行集成测试,但它仍然不可靠,因为人们往往不稳定和昂贵,因为人们比机器慢。

Ultimately the more testing you can automate, the faster and more accurate your tests will be and the more you will free your QA personel to test things that can only be tested manually. 最终,您可以自动化的测试越多,测试的速度就越快,越准确,您就可以越多地释放QA人员来测试只能手动测试的内容。

Unit and Integration testing are two very different things, and what constitutes "acceptable" depends entirely on your organisation. 单元和集成测试是两个截然不同的东西,构成“可接受”的内容完全取决于您的组织。 It may very well be acceptable to test the system, rather than each unit separately. 测试系统可能是可以接受的,而不是单独测试每个单元。

Personally, I'm not a fan of automated unit testing, since the vast majority of issues I encounter are the sort of things that only ever come to light in the context of a system test. 就个人而言,我不是自动化单元测试的粉丝,因为我遇到的绝大多数问题都是在系统测试环境中才会发现的事情。

I tend to develop incrementally, so that as what I'm working on grows, it becomes its own test harness, and foundations are proved to be solid before building anything on them. 我倾向于逐步发展,因此随着我正在努力增长,它变成了自己的测试工具,并且在构建任何基础之前,基础被证明是可靠的。

I'd love to be able to automate system testing. 我希望能够自动化系统测试。 It reveals all the things I would never have thought of in a million years of writing unit tests. 它揭示了在一百万年的单元测试中我从未想过的所有事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM