Engineering for experiments: the role of modularity

My last post outlined some initial thoughts about requirements for easy split testing of web sites.  In this post I assert that modular design is a critical component of any web system you wish to improve through testing.

Software developers are well educated about the value of modular design for reuse and testing of correctness.  This can also extend to testing value of components.  By defining a clean interface for a component, it becomes possible to easily substitute other implementations or algorithms.

When we consider our related content widget example from the last post, we may have a new snippet generation algorithm we wish to compare to our existing algorithm.  By deploying a service implementing a standard snippet generation interface, a test framework could direct a portion of all requests to the new algorithm, recording this new component’s impact on click-through-rate.

Components of a related content selection widget: article ranker and snippet generatorComplementary to modularity is the need to handle data flow between components.  Without the ability to handle data flow between components in a generic web architecture, to developer is left reimplementing these interactions routinely.  With data flow management, the web architecture can intercept the output of components, transform results, monitor component throughput, and manage split tests.

In some ways the importance of creating modular components and the need to handle data flow between these components a generic web architecture for testing is similar to an enterprise service bus.  An enterprise service bus is middleware which handles messaging between components of complex information architectures.  The bus handles data flow between components, frequently legacy or written in a variety of programming languages.  The routing, message handling, monitoring, and management support provided by many enterprise service buses may be attractive for the design and development a web architecture for testing.  On the other hand, the multi-system support and extra bells and whistles which may not be necessary for your web architecture could create extra overhead and computing resources not desirable in your context.  Most enterprise service buses use XML as the communication language, which as a hefty representation of data, the processing and transformation messages could greatly add to the latency of your website.  I personally have not evaluated any enterprise serial bus for use with web systems, so it is possible that my fears are misplaced.

To conclude, modularity is an important component of any software system, and its use in a web architecture can facilitate web testing.  Coupled with modularity is the need for the test-oriented web architecture to handle data flow in a lightweight way.  Enterprise serial buses provide some of this functionality, but may have more overhead than is desirable for use in a low-latency web system, where every millisecond counts.  Any existing middleware solution for handling data flow would need to be existed to provide additional support for testing.