Make It Simple: Architecting Your JavaScript Applications for Testability

Mark Ethan Trostler tests a lot of small pieces rather than giant hunks.

fluent_webcast_3

Mark Ethan Trostler (@zzoass) writes and tests code for a living, currently at Google. The veteran coder and author of Testable JavaScript recently delivered a comprehensive lesson on writing and maintaining testable code to some 400 folks from around the globe. In one hour Trostler detailed methods for swapping implementations, writing tests once, and working/testing in parallel.

You’ll probably want to watch his free webcast from beginning to end, when Trostler answers a handful of audience questions. (Registration required). Here are some of the key points from the recording:

  • What is testability?
  • It all boils down to writing and syncing interfaces, not implementation
  • All dependencies should be injected into your object’s constructor
  • Cross-cutting concerns or what about the crap I might need? Logging, auditing, security, caching, and more
  • Quick detour on the mixin method
  • Profile interface and implementation
  • Runtime/short-lived dependencies with an example of picking matches on a dating website
  • Mocking abstract factories
tags: , ,

Get the O’Reilly Data Newsletter

Stay informed. Receive weekly insight from industry insiders.

Get the O’Reilly Web Ops and Performance Newsletter

Weekly insight from industry insiders. Plus exclusive content and offers.

Get the O’Reilly Programming Newsletter

Weekly insight from industry insiders. Plus exclusive content and offers.

Get the O’Reilly Hardware Newsletter

Get weekly insight and knowledge on how to design, prototype, manufacture, and market great connected devices.

Get Four Short Links in Your Inbox

Sign up to receive Nat’s eclectic collection of curated links every weekday.

Get the O’Reilly Design Newsletter

Stay informed. Receive weekly insight from industry insiders.

Get the O’Reilly Web Platform Newsletter

Stay informed. Receive weekly insight from industry insiders—plus exclusive content and offers.