views:

162

answers:

4

Like anything else understanding the words makes it much easier to learn the language. Can anyone chime in with all the words used in unit testing with their definitions (ex. Mock, Fixture, etc. )

+2  A: 

Perhaps these articles will be more helpful:

Wikipedia:

In computer programming, unit testing is a software design and development method where the programmer gains confidence that individual units of source code are fit for use. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual program, function, procedure, etc., while in object-oriented programming, the smallest unit is a method, which may belong to a base/super class, abstract class or derived/child class.

Unit testing can be done by something as simple as stepping through code in a debugger; modern applications include the use of a test framework such as xUnit.

Ideally, each test case is independent from the others; Double objects like stubs, mock or fake objects[1] as well as test harnesses can be used to assist testing a module in isolation. Unit testing is typically done by software developers to ensure that the code other developers have written meets software requirements and behaves as the developer intended.

MSDN:

The primary goal of unit testing is to take the smallest piece of testable software in the application, isolate it from the remainder of the code, and determine whether it behaves exactly as you expect. Each unit is tested separately before integrating them into modules to test the interfaces between modules. Unit testing has proven its value in that a large percentage of defects are identified during its use.

Extreme Rules:

Unit tests enable collective code ownership. When you create unit tests you guard your functionality from being accidentally harmed. Requiring all code to pass all unit tests before it can be released ensures all functionality always works. Code ownership is not required if all classes are guarded by unit tests.

Andrew Hare
+1: Quote the documents.
S.Lott
thanks for the resources, still to abstract though.
A: 

I've also found a glossary of testing terms, but it doesn't define Mock or Fixture, but there's an option to add new ones. Once the question is answered to your satisfaction maybe that could become the canonical source.

MrTelly
so close, the glossary was more on unit testing theory.
+2  A: 

This looks like a great page: http://xunitpatterns.com/Glossary.html

It includes:

  • SUT
  • synchronous test
  • task
  • TDD
  • test automater
  • test case
  • test code
  • test condition
  • test context
  • test database
  • test debt
  • test driver
  • test driving
  • test error
  • test failure
  • test fixture
  • test fixture
  • test fixture
  • test maintainer
  • test package
  • test reader
  • test result
  • test run
  • test smell
  • test stripper
  • test success
  • test suite
  • test-driven bug fixing
  • test-driven development
  • test-first development
  • test-last development
  • test-specific equality
  • test

In relation to mocking etc this might be useful:

This table and its references might be more useful:

http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html

Jonathan Parker
even closer! To be more specific, when i look at third party unit tests, classes are postfixed with called mock, fixtures, etc. Those names are used for a reason just like we call object repositories, managers, proxies, etc. Is there a resource for those terms.
http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html - Thats the resource I was looking for thanks!
A: 

Mock,

n.

  1. A type of turtle, used primarily in soup.
  2. A code construct used in Unit Testing, named after #1. A mock looks like the real thing to the code being tested, however any attempts to interact with it result only in mournful songs.

v.

  1. To construct a mock for use in testing.