Hello Kay,
Generally, this looks correct for using EMF without the Eclipse
infrastructure. It is preferrable to write code like that in the form
of a unit test, though.
Yes. But does unit testing not rely on knowledge of the expected outcome from
the SUT to check the real one against?
It was just a starting point, a prototype, a 'feasability study' to find out if
I'm able to handle a reqif file without ProR. I didn't know what to expect.
You're certainly right with your reply. This was just a
recommendation, and has little to do with your "real" question.
But since you asked, let me elaborate: Because your code contained
four "tests" (albeit without asserts), it feels natural to wrap them
in unit tests. You have an implicit assert: Running the test must
not throw an Exception. Rewriting it as a unit tests makes
development a lot easier: You immediate see the results of the four
test cases, and if an Exception is thrown, the test is marked as
failed. You also see the stack trace directly in Eclipse, and run
just one test alone.
Put it into the test suite, please :-)
... And of course, that is another reason for confirming a bug with
a test: Once added to the test suite, this problem will never pop up
again without us noticing. Yes, I was planning on adding it.
Hope this helps!
Best,
- Michael
|