07.01.2013 Views

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

U2TP JUnit<br />

System Under Test<br />

(SUT)<br />

not to be identified explicitly.<br />

Test component Cannot be mapped.<br />

Arbiter<br />

17 UML 2.0 Test<strong>in</strong>g Profile 503<br />

As a property of Test Suite of type TestResult.<br />

Test context A class <strong>in</strong>herit<strong>in</strong>g from the TestCase class.<br />

Test control<br />

Overload<strong>in</strong>g the runTest operation of the fixture.<br />

Test case Operation.<br />

Stimulus and observation<br />

Cannot be mapped.<br />

Coord<strong>in</strong>ation Any available synchronization mechanism.<br />

Verdict<br />

Predef<strong>in</strong>ed verdicts are pass, fail and error.<br />

No <strong>in</strong>conclusive verdict.<br />

Test configuration Cannot be mapped.<br />

Wildcards Cannot be mapped.<br />

Cod<strong>in</strong>g rules Cannot be mapped.<br />

Timezone Cannot be mapped.<br />

Timer Cannot be mapped.<br />

Fig. 17.3. U2TP to JUnit Mapp<strong>in</strong>g Rules<br />

cases to share common test data and to assure certa<strong>in</strong> pre- and postconditions<br />

for every test method. At the end of a test run, JUnit reports a pass, failure or<br />

error as its test result by means of assertions. The JUnit framework provides a<br />

textual and a graphical test runner.<br />

When putt<strong>in</strong>g the concepts <strong>in</strong>to practice, the follow<strong>in</strong>g steps have to be done 2 :<br />

(1) Derive a subclass from junit.framework.Testcase;<br />

(2) If fixture objects are needed, override the setUp() method;<br />

(3) Def<strong>in</strong>e a number of tests that return void and whose method name beg<strong>in</strong>s<br />

with test;<br />

(4) If resources of the fixture need to be released, override the tearDown()<br />

method;<br />

(5) If a related set of test cases need to be grouped, def<strong>in</strong>e a test suite.<br />

Mapp<strong>in</strong>g to JUnit JUnit served as one basis for the development of U2TP. Table<br />

17.3 provides the mapp<strong>in</strong>g rules from U2TP to JUnit. A lot of the U2TP concepts<br />

2 In Section 17.4.5, an example is shown.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!