This document discusses principles for architecting JavaScript applications to be testable. It recommends: 1. Using interfaces rather than implementations to define behavior and allow for loose coupling and swapping of implementations. 2. Applying design patterns like decorator and abstract factory to handle cross-cutting concerns like logging and profiling separately from the core functionality.
![Testable JavaScript: Application Architecture](https://cdn-ak-scissors.b.st-hatena.com/image/square/89ad8613eb9e1465236b3b84ba2d246bdfcbc149/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Ftestablejsmodern-130424121331-phpapp02-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)