Whenever a ruby program is run, the program is first lexed into tokens, then the tokens are assembled into an abstract syntax tree, and finally the AST is compiled into virtual machine instructions
This is the most common architecture pattern in most of the enterprise level applications. This is also known as the n-tier pattern, assuming n number of tiers
The recent “Is TDD Dead?” hangout between DHH, Martin Fowler and Kent Beck has made the level of dissatisfaction about too much mocking and stubbing when writing automated tests pretty clear