How can we test an application that makes calles to some external system, for example needs to access a website or a web-base API? We can hit the external system for every test-run, but that will probably slow down our testing, might get us banned from the web site, but maybe most importantly (for the tester), the test will be unreliable. In addition, it will be impossible to test cases when the external web site returns some error condition.

Let's try a simple example in which we fetch a web page and count specific strings.