10

I've seen the term "fixture" used in a number of different contexts, and I suspect I don't quite understand what is meant by the term, because I see it used to mean things that I didn't think it meant. At a high level, can someone provide a clear, concise definition of the term?

4
  • 1
    It depends on the context. For instance, in Fitnesse or other BDD framework it is "glue" (intermediary software layer) that connects test scripts with the system under tests. E.g. translates test commands to system API and responses from system API back.
    – dzieciou
    Commented May 13, 2015 at 12:56
  • @dzieciou Sounds like an answer to me Commented May 13, 2015 at 13:08
  • I've added this as an answe, then. Thanks for your feedback.
    – dzieciou
    Commented May 13, 2015 at 13:13
  • 1
    If you want to say exactly where you saw the term, someone here can probably tell what fixture means in those contexts.
    – user246
    Commented May 13, 2015 at 19:46

3 Answers 3

3

It depends on the context.

For instance, in Fitnesse or other BDD frameworks it is the "glue" (an intermediary software layer) that connects test scripts with the system under test (SUT). E.g. translates test commands to SUT API and responses from SUT API back to the test script.

My observation is this is also a reason why BDD often fails. Non-technical testers and business analysts complain there is no fixture to test new feature of the SUT and developers say it is not their problem to write them.

2
  • So in BDD terminology, a PageObject (from Selenium terminology) is a type of fixture? Commented May 13, 2015 at 13:29
  • In my opinion yes. Although I used this term usually in the context where test scripts were written with some non-programming language, like with Fitnesse, you have test script written in Fitnesse format, Fixture in Java and SUT in Java.
    – dzieciou
    Commented May 13, 2015 at 13:32
5

I think the Wikipedia definition of fixture is pretty clear:

A test fixture is a fixed state of the software under test used as a baseline for running tests; also known as the test context. It may also refer to the actions performed in order to bring the system into such a state.

And

In generic xUnit, a test fixture is all the things that must be in place in order to run a test and expect a particular outcome.

Seems its a way to make sure a system is in a certain state.

1
  • 2
    Looks like etymology of the word "fixture" stems from fixing a system under test into a certain state.
    – dzieciou
    Commented May 13, 2015 at 18:22
1

I use NUnit which has a bunch of material around the word "Fixture" they have something called TestFixture which is declared at the beginning of your code and is defined as:

"This is the attribute that marks a class that contains tests and, optionally, setup or teardown methods."

2
  • 1
    I'm beginning to understand why I'm confused... Commented May 13, 2015 at 14:26
  • 1
    In my opinion there are a thousand definitions for this term....simply because it is a very vague word used in testing. I do apologize that I cannot be of more assistance. I use this definition for the test scripts I use in selenium.
    – DEnumber50
    Commented May 13, 2015 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.