Architecture Test

January 11, 2018 – 01:10 pm

Testing Rails Service Oriented Architecture

Over the last few years I’ve had the opportunity to work on several Service Oriented Architecture (SOA) applications. I learned that writing integration tests for such applications is difficult, but important. The challenge lies in the fact that most SOA applications use testing approaches that are well suited for monolithic applications, but these approaches are not always suited for testing SOA applications. It is important because without integration tests it is far too easy for subtle bugs to creep into your code base.

What is SOA?

Service Oriented Architecture might be best understood by first understanding monolithic applications. Your typical long-lived Rails application tends to be a monolithic application. According to Martin Fowler, monolith applications:

…are often built in three main parts: a client-side user interface (consisting of HTML pages and javascript running in a browser on the user’s machine), a database (consisting of many tables inserted into a common, and usually relational, database management system), and a server-side application. The server-side application will handle HTTP requests, execute domain logic, retrieve and update data from the database, and select and populate HTML views to be sent to the browser. This server-side application is a monolith - a single logical executable. Any changes to the system involve building and deploying a new version of the server-side application.

While there might not be a universally accepted definition of SOA, applications that adhere to this approach exhibit some common characteristics. SOA is a style of architecting applications where the underlying structure supports communication between a collection of loosely coupled services over well-defined interfaces.

An example might help clarify:

In this example, there are two applications that comprise the SOA, the home application and the client application. home has a database and exposes a RESTful interface. The client does not have a database and communicates with home via HTTP. For example, if the client wants a list of all the users, it has to issue a HTTP request to the /users resource of the home application, home queries its database for all the users, and home responds to the client with a JSON respresentation of all the users.

It's Interesting...

The Architect Registration Examination (ARE) is the professional licensure examination adopted by all 50 states, the District of Columbia, and three U.S. territories (Guam, Puerto Rico, and the U.S. Virgin Islands) to assess candidates for their knowledge, skills, and ability to provide the various services required in the practice of...

The National Architectural Accrediting Board (NAAB) is the sole authority for accredited US professional degree programs for architecture in the United States, developing standards and procedures to verify that each accredited program meets standards for the appropriate education of architects. These standards were developed with professional...

Twitter Activity

RT @afilina: You know you're dealing with bad architecture when you have to mock half the codebase just to test one method.
Fri, 26 June 2015 06:33 AM

@JayzTwoCents If I had to take a swing at it, I would guess AMD was using a alpha driver in those test that were tuned for the architecture
Thu, 25 June 2015 05:16 PM

RT @jasedeacon: Booom! First successful end to end test of the game services architecture! #FUCKYEAH #FISTPUMP
Thu, 25 June 2015 12:51 PM