SYSC 2004 Lecture Notes - Lecture 9: Test Fixture, Junit, Bluej

66 views2 pages

Document Summary

Midterm will cover chapters 1-6, first 6 labs, first 2 assignments. Chapter 9, well-behaved objects, section 9. 4, test automation. For more info, go to the junit web site: http://www. junit. org. Regression testing framework written by kent beck and erich gamma. Inspired the xunit family of testing tools for several languages (e. g. , c, python, ) Can be used with any java development environment. Names of test cases must begin with test. Test case consists of: code to create objects used in the test (test fixture) code to invoke methods on objects code to compare expected results with actual results. Example: verify that the starting square of a new board object is square 1 public void testcreateboard() Square loc = board. startingsquare(); assertequals(1, loc. number()); assertequals() triggers a failure if its first argument (the expected result) isn"t equal to its second argument (the actual result) For test case to pass, board(), startingsquare(), and number() must be implemented. More tests needed (see boardtest in monopoly-v1, monopoly-v2)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents