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?
-
1It 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.– dzieciouCommented May 13, 2015 at 12:56
-
@dzieciou Sounds like an answer to me– YamikuronueCommented May 13, 2015 at 13:08
-
I've added this as an answe, then. Thanks for your feedback.– dzieciouCommented May 13, 2015 at 13:13
-
1If you want to say exactly where you saw the term, someone here can probably tell what fixture means in those contexts.– user246Commented May 13, 2015 at 19:46
3 Answers
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.
-
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.– dzieciouCommented May 13, 2015 at 13:32
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.
-
2Looks like etymology of the word "fixture" stems from fixing a system under test into a certain state.– dzieciouCommented May 13, 2015 at 18:22
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."
-
1
-
1In 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. Commented May 13, 2015 at 14:28