expected thrown excepAons • Mocks – Observable expectaAons through the use of mocks • Errors – Watch for a specific error • AsserAons – Comparison of actual and expected condiAons – Most common used
does. – Use doc tags to define input and expected output – Generate Test Skeletons once completed • Behavior Driven – Create the tests and define the Class and methods – Generate your classes from the tests once complete
test-‐case that duplicates the complaint • Write a test-‐case that should break but doesn’t • Write a test-‐case that should not break • When all test-‐case pass the bug is fixed • All bug related tests should idenAfy the Acket
get from them? – Ability to control the returns – Test the number of Ames a method is used – Test how a mock is used. – Eliminate dependency on outside methods and data sources. – While tesAng the return of an outside source is necessary at Ames by definiAon a ‘unit test’ is a test on a ‘Unit of Work’ and fall outside the scope of this discussion.
• New development. • Troublesome pieces of code. • Code you make changes to: • Make a test to validate its current operaAon • Make a test for expected change performance • Make your changes, test and repeat All it works.