Skip to main content
August 28, 2009
Answered

Do theories need to be single tests?

  • August 28, 2009
  • 1 reply
  • 1324 views

Looking at the turnkey project theory tests, I see that no matter how many combinations are tried for a given theory there's only one result shown for the whole series of tests.

I'd been hoping to use theories to construct data-driven tests, but have one test per datapoint reported. For instance, I'd have a "theory" that my code should be able to import any given input file and not throw errors. Then I'd put the theory to the test over a large set of files and get individual test results for each file in the set.

Is this stretching the theory idea too far? Or should I be able to make a runner that would do this the way I want (creating unique test IDs for each data point, running through the entire data set if errors are encountered, etc.).

This topic has been closed for replies.
Correct answer mlabriola

Alan,

Short answer: Yes, that is stretching the idea somewhere it isn't supposed to go.

When you think of a theory, think mathematical theory.

Any combination of values that disprove a theory, means they theory itself is false, not that a particular set of values is a failure.

So, in FlexUnit/JUnit, a theory is about trying something that is supposed to be true over a potentially infinite set of data, and verifying that it always true for that data set. If there was any combination of numbers that made the pythagorean theorem false, then the entire theorem is disproved.

That said, what you are looking for is parameterized testing. That is something that we have infrastructure already built for inside of FlexUnit 4, but have not built it all the way to the test case level. This feature will likely make it in before we have a release version, but (before anyone asks) I don't have a timeline on that just yet.

Mike

1 reply

mlabriolaCorrect answer
Participating Frequently
August 28, 2009

Alan,

Short answer: Yes, that is stretching the idea somewhere it isn't supposed to go.

When you think of a theory, think mathematical theory.

Any combination of values that disprove a theory, means they theory itself is false, not that a particular set of values is a failure.

So, in FlexUnit/JUnit, a theory is about trying something that is supposed to be true over a potentially infinite set of data, and verifying that it always true for that data set. If there was any combination of numbers that made the pythagorean theorem false, then the entire theorem is disproved.

That said, what you are looking for is parameterized testing. That is something that we have infrastructure already built for inside of FlexUnit 4, but have not built it all the way to the test case level. This feature will likely make it in before we have a release version, but (before anyone asks) I don't have a timeline on that just yet.

Mike