Often I had to hear that someone had listened to a lecture or read an article about unit tests, sort of understood it all; I decided to try it myself - and nothing happened.
Why is this so?
Apparently, the reason is that unit tests are usually demonstrated with simple examples. And in life the code is more complicated. In real projects, code uses databases, web services, code written by other teams, etc.
')
This live video demonstrates how to write unit tests for code with external dependencies.
www.devclub.eu/2011/06/06/asolntsev-real-life-unit-testsSlides can be found
here .
Ps. For those who do not know: in Estonia elections are held electronically, that is, people can vote via the Internet. In the presentation, the author shows the use of unit tests on his application to display the election results. Additional humor here is that during the last election a similar official application fell for several hours, which caused heated discussions in the society, and the contractor company was fined a large amount. In the presentation, the application works great with the same load.