有人可以帮我解释Fit Testing吗?

时间:2020-11-29 01:31:46

So this is something that has been at the back of my mind for a while. I've seen mentions of it, I've read the fitness web page and I still don't quite grok it. It seems like Fitnesse is yet another testing framework like NUnit or MbUnit or any of the others because you define inputs and outputs that you want to see but it seems to be aimed at testing the application as a whole rather than as units.

所以这一直是我脑海中浮现的一段时间。我已经看到了它的提及,我已经阅读了健身网页,我仍然不太了解它。似乎Fitnesse是另一个测试框架,如NUnit或MbUnit或任何其他测试框架,因为您定义了您想要查看的输入和输出,但它似乎旨在测试整个应用程序而不是单元。

If that is so, how does it run? Do you have to design your application with hooks for fit testing? Where on the spectrum of testing does it actually fall? And can someone give me a good example of where and how fit tests could be used and what are some advantages/disadvantages?

如果是这样,它是如何运行的?您是否必须使用挂钩设计您的应用程序以进行适合性测试?它的测试范围究竟在哪里下降?有人能给我一个很好的例子,说明在何处以及如何使用合适的测试以及有哪些优点/缺点?

5 个解决方案

#1


The difference between NUnit/MbUnit and FitNesse is that NUnit/MbUnit are intended to be used for unit tests, while FitNesse is for acceptance tests.

NUnit / MbUnit和FitNesse之间的区别在于NUnit / MbUnit旨在用于单元测试,而FitNesse用于验收测试。

Unit tests test a single, small unit of code, such as a method, to ensure that it executes as the programmer intended. For example, you might use a unit test to ensure that a factorial-computing method returns the correct results for a set of numbers, including some edge cases.

单元测试测试单个小的代码单元,例如方法,以确保它按程序员的意图执行。例如,您可以使用单元测试来确保阶乘计算方法为一组数字返回正确的结果,包括一些边缘情况。

Acceptance tests are intended to test whether a high-level design requirement is met. As an example, if you were writing a Pac-Man clone, and one of the requirements was "A new level begins when the last dot of the previous level is eaten," an acceptance test would test to see whether that requirement as a whole is satisfied by the code--not the specific pieces of code that consume a dot, check ending conditions, and load new levels (although that code would be exercised in the process of running the acceptance test). Acceptance tests typically are written without regard to the specific implementation of the requirement.

验收测试旨在测试是否满足高级设计要求。例如,如果您正在编写Pac-Man克隆,并且其中一个要求是“当上一级别的最后一个点被吃掉时,新级别开始”,则验收测试将测试该要求是否作为一个整体代码满足 - 不是消耗点的特定代码片段,检查结束条件和加载新级别(尽管该代码将在运行验收测试的过程中执行)。验收测试通常是在不考虑要求的具体实施的情况下编写的。

A lot of QA departments execute long lists of acceptance tests by hand, which can be very time consuming. Fit and FitNesse are tools that assist in automating acceptance tests, which can save a lot of time.

许多质量保证部门手工执行长验收测试列表,这可能非常耗时。 Fit和FitNesse是帮助自动化验收测试的工具,可以节省大量时间。

There's a lot of good information on acceptance tests at Ward Cunningham's wiki.

关于Ward Cunningham维基的验收测试有很多很好的信息。

#2


The last company I worked with used FitNesse with some degree of success. Its not meant to be used in the same way as NUnit, in which the degree of testing is very granular. FitNesse is used more for "acceptance testing", involving less granular, "large scale" tests. To compare the two, lets say we were writing an app for processing checks at a bank:

我工作的最后一家公司使用FitNesse取得了一定程度的成功。它并不意味着以与NUnit相同的方式使用,其中测试的程度非常精细。 FitNesse更多地用于“验收测试”,涉及不太精细的“大规模”测试。为了比较这两者,我们假设我们正在编写一个用于处理银行支票的应用程序:

  • If we're writing unit tests with NUnit, we'd test each individual method of our Check objects, Transaction objects, TransactionProcessor factories, test each method of our Data Access Layer, etc. You're tests are very close to the source code.

    如果我们用NUnit编写单元测试,我们将测试Check对象,Transaction对象,TransactionProcessor工厂的每个单独方法,测试我们的数据访问层的每个方法等。你的测试非常接近源代码。

  • If we're writing acceptance tests, we might set up a days worth of transactions, prompt the app to process the transaction, and make sure that the code produces the correct invoice statements and reports. You're at a much higher level than unit tests, usually at a vantage point where you can test all the applications business rules at once.

    如果我们正在编写验收测试,我们可能会设置一天的交易,提示应用程序处理交易,并确保代码生成正确的发票声明和报告。您处于比单元测试更高的级别,通常是在一个有利位置,您可以立即测试所有应用程序业务规则。

Unit tests tell programmers whether the code contains any defects, and acceptance tests tell business analysts that the applications meets user expectations.

单元测试告诉程序员代码是否包含任何缺陷,验收测试告诉业务分析师应用程序满足用户期望。

FitNesse test cases are designed to be written by people without technical knowledge. You still need programmers to write the DLLs to expose the innards of the application to FitNesse, but otherwise the use cases are supposed to be written by non-technical people who don't know anything about the source code (i.e. business analysts and QA).

FitNesse测试用例旨在由没有技术知识的人编写。您仍然需要程序员编写DLL以向FitNesse公开应用程序的内部,但是否则用例应该由非技术人员编写,他们对源代码一无所知(即业务分析师和QA) 。

My company used FitNesse to test one of our "core" applications, which happened to be written over the course of 20 years using a dead COBOL-like language. The core app did not have unit tests, and it was nearly impossible to create a unit testing framework in the original language. Forturnately, the language had COM bindings which exposed a few public methods to .NET and Java, allowing us to write automated test cases for this application for the first time in 20 years. It wasn't pretty, but the business people liked it.

我的公司使用FitNesse来测试我们的一个“核心”应用程序,这些应用程序恰好是在20年的时间里使用类似COBOL的语言编写的。核心应用程序没有单元测试,几乎不可能用原始语言创建单元测试框架。此外,该语言具有COM绑定,这些绑定将一些公共方法暴露给.NET和Java,这使我们能够在20年内第一次为该应用程序编写自动化测试用例。它不漂亮,但商界人士喜欢它。

#3


FitNesse is basically a wiki which stores all the test cases. Most probably for acceptance testing. In Test first development the test cases should be written at requirement gathering stage only i.e., the customer will also be included in writing tests which tends to write the tests regarding acceptance testing...

FitNesse基本上是一个存储所有测试用例的wiki。最有可能用于验收测试。在测试第一次开发中,测试用例应仅在需求收集阶段编写,即客户也将被包括在编写测试中,这些测试往往会编写有关验收测试的测试...

So the advantage is there is no separate acceptance testing is needed if the application meets all the user requirements.

因此,如果应用程序满足所有用户要求,则不需要单独的验收测试。

The disadvantage is when ever there is a change in the requirements the test cases also to be changed but of course it is not a big deal.

缺点是当需求发生变化时,测试用例也要改变,但当然这并不是什么大问题。

Also fitnesse will be suitable for small and medium projects. In case of large projects it could be clumsy because Fitnesse cannot export PDF files it only exports spread sheets like excel or worddoc. So it is a disadvantage that it can't be used for large projects.

fitnesse也适用于中小型项目。在大型项目的情况下,它可能是笨拙的,因为Fitnesse无法导出PDF文件,它只导出excel或worddoc等扩展表。因此它不能用于大型项目是一个缺点。

#4


From my point of view: it hardly depends on the hooking to the app to be tested. If that doesn't developes a good API, it's almost useless. And don't try it for GUI testing.

从我的角度来看:它几乎不依赖于要测试的应用程序的挂钩。如果这没有开发出一个好的API,它几乎是无用的。不要尝试进行GUI测试。

#5


Its can be used to run your regression test suites. It can be used to check the database release after release. It can be used to test stored procs. It can be used to compare different environments.

它可用于运行回归测试套件。它可用于在发布后检查数据库版本。它可用于测试存储过程。它可用于比较不同的环境。

#1


The difference between NUnit/MbUnit and FitNesse is that NUnit/MbUnit are intended to be used for unit tests, while FitNesse is for acceptance tests.

NUnit / MbUnit和FitNesse之间的区别在于NUnit / MbUnit旨在用于单元测试,而FitNesse用于验收测试。

Unit tests test a single, small unit of code, such as a method, to ensure that it executes as the programmer intended. For example, you might use a unit test to ensure that a factorial-computing method returns the correct results for a set of numbers, including some edge cases.

单元测试测试单个小的代码单元,例如方法,以确保它按程序员的意图执行。例如,您可以使用单元测试来确保阶乘计算方法为一组数字返回正确的结果,包括一些边缘情况。

Acceptance tests are intended to test whether a high-level design requirement is met. As an example, if you were writing a Pac-Man clone, and one of the requirements was "A new level begins when the last dot of the previous level is eaten," an acceptance test would test to see whether that requirement as a whole is satisfied by the code--not the specific pieces of code that consume a dot, check ending conditions, and load new levels (although that code would be exercised in the process of running the acceptance test). Acceptance tests typically are written without regard to the specific implementation of the requirement.

验收测试旨在测试是否满足高级设计要求。例如,如果您正在编写Pac-Man克隆,并且其中一个要求是“当上一级别的最后一个点被吃掉时,新级别开始”,则验收测试将测试该要求是否作为一个整体代码满足 - 不是消耗点的特定代码片段,检查结束条件和加载新级别(尽管该代码将在运行验收测试的过程中执行)。验收测试通常是在不考虑要求的具体实施的情况下编写的。

A lot of QA departments execute long lists of acceptance tests by hand, which can be very time consuming. Fit and FitNesse are tools that assist in automating acceptance tests, which can save a lot of time.

许多质量保证部门手工执行长验收测试列表,这可能非常耗时。 Fit和FitNesse是帮助自动化验收测试的工具,可以节省大量时间。

There's a lot of good information on acceptance tests at Ward Cunningham's wiki.

关于Ward Cunningham维基的验收测试有很多很好的信息。

#2


The last company I worked with used FitNesse with some degree of success. Its not meant to be used in the same way as NUnit, in which the degree of testing is very granular. FitNesse is used more for "acceptance testing", involving less granular, "large scale" tests. To compare the two, lets say we were writing an app for processing checks at a bank:

我工作的最后一家公司使用FitNesse取得了一定程度的成功。它并不意味着以与NUnit相同的方式使用,其中测试的程度非常精细。 FitNesse更多地用于“验收测试”,涉及不太精细的“大规模”测试。为了比较这两者,我们假设我们正在编写一个用于处理银行支票的应用程序:

  • If we're writing unit tests with NUnit, we'd test each individual method of our Check objects, Transaction objects, TransactionProcessor factories, test each method of our Data Access Layer, etc. You're tests are very close to the source code.

    如果我们用NUnit编写单元测试,我们将测试Check对象,Transaction对象,TransactionProcessor工厂的每个单独方法,测试我们的数据访问层的每个方法等。你的测试非常接近源代码。

  • If we're writing acceptance tests, we might set up a days worth of transactions, prompt the app to process the transaction, and make sure that the code produces the correct invoice statements and reports. You're at a much higher level than unit tests, usually at a vantage point where you can test all the applications business rules at once.

    如果我们正在编写验收测试,我们可能会设置一天的交易,提示应用程序处理交易,并确保代码生成正确的发票声明和报告。您处于比单元测试更高的级别,通常是在一个有利位置,您可以立即测试所有应用程序业务规则。

Unit tests tell programmers whether the code contains any defects, and acceptance tests tell business analysts that the applications meets user expectations.

单元测试告诉程序员代码是否包含任何缺陷,验收测试告诉业务分析师应用程序满足用户期望。

FitNesse test cases are designed to be written by people without technical knowledge. You still need programmers to write the DLLs to expose the innards of the application to FitNesse, but otherwise the use cases are supposed to be written by non-technical people who don't know anything about the source code (i.e. business analysts and QA).

FitNesse测试用例旨在由没有技术知识的人编写。您仍然需要程序员编写DLL以向FitNesse公开应用程序的内部,但是否则用例应该由非技术人员编写,他们对源代码一无所知(即业务分析师和QA) 。

My company used FitNesse to test one of our "core" applications, which happened to be written over the course of 20 years using a dead COBOL-like language. The core app did not have unit tests, and it was nearly impossible to create a unit testing framework in the original language. Forturnately, the language had COM bindings which exposed a few public methods to .NET and Java, allowing us to write automated test cases for this application for the first time in 20 years. It wasn't pretty, but the business people liked it.

我的公司使用FitNesse来测试我们的一个“核心”应用程序,这些应用程序恰好是在20年的时间里使用类似COBOL的语言编写的。核心应用程序没有单元测试,几乎不可能用原始语言创建单元测试框架。此外,该语言具有COM绑定,这些绑定将一些公共方法暴露给.NET和Java,这使我们能够在20年内第一次为该应用程序编写自动化测试用例。它不漂亮,但商界人士喜欢它。

#3


FitNesse is basically a wiki which stores all the test cases. Most probably for acceptance testing. In Test first development the test cases should be written at requirement gathering stage only i.e., the customer will also be included in writing tests which tends to write the tests regarding acceptance testing...

FitNesse基本上是一个存储所有测试用例的wiki。最有可能用于验收测试。在测试第一次开发中,测试用例应仅在需求收集阶段编写,即客户也将被包括在编写测试中,这些测试往往会编写有关验收测试的测试...

So the advantage is there is no separate acceptance testing is needed if the application meets all the user requirements.

因此,如果应用程序满足所有用户要求,则不需要单独的验收测试。

The disadvantage is when ever there is a change in the requirements the test cases also to be changed but of course it is not a big deal.

缺点是当需求发生变化时,测试用例也要改变,但当然这并不是什么大问题。

Also fitnesse will be suitable for small and medium projects. In case of large projects it could be clumsy because Fitnesse cannot export PDF files it only exports spread sheets like excel or worddoc. So it is a disadvantage that it can't be used for large projects.

fitnesse也适用于中小型项目。在大型项目的情况下,它可能是笨拙的,因为Fitnesse无法导出PDF文件,它只导出excel或worddoc等扩展表。因此它不能用于大型项目是一个缺点。

#4


From my point of view: it hardly depends on the hooking to the app to be tested. If that doesn't developes a good API, it's almost useless. And don't try it for GUI testing.

从我的角度来看:它几乎不依赖于要测试的应用程序的挂钩。如果这没有开发出一个好的API,它几乎是无用的。不要尝试进行GUI测试。

#5


Its can be used to run your regression test suites. It can be used to check the database release after release. It can be used to test stored procs. It can be used to compare different environments.

它可用于运行回归测试套件。它可用于在发布后检查数据库版本。它可用于测试存储过程。它可用于比较不同的环境。