Learning to Enjoy Unit Testing

35
Or at least make them as useful as possible

Transcript of Learning to Enjoy Unit Testing

Or at least make them as useful as possible

- Pushes out timeline- Boring- When do you stop ?- I hate it- We have a QA department- Broken window theory - I hate it.- We have GUI Tests we don’t need unit tests- Perfectionism

GUI Tests

Integration Tests

Unit Tests

You commit code without tests. You are a cowboy.

Cowboy no test

- Promotes loose coupling between classes and sub systems

- Adds flexibility to code changes for future changes

- Can enable better code reuse

- Easier to unit test

Mocks act like a ping-pong paddle by

intercepting the function call and

immediately returning execution to the

calling function.

- Dependencies

- Speed

- Hard cases

- Incompleteness

Plan

ModifyImplement

Assess

hypothesize what needs to change

predict the outcome

you make the changes and

observe the results

Read the Code

http://www.ncrunch.net/

30 Day trial available at