Continuous Testing

Subscribe to Continuous Testing: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get Continuous Testing: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Continuous Testing Authors: Plutora Blog, Mehdi Daoudi, Pat Romanski, Stackify Blog, Elizabeth White

Related Topics: Application Performance Management (APM), Continuous Testing, DevOps Journal

Blog Feed Post

Application Modularization in Testing | @CloudExpo @BlueBox #DevOps

One of the most important best practices in application development is testing

Why Application Modularization Matters: Testing
By Ruben Orduz

Preface
A few weeks ago my colleague PJ Hagerty wrote about driving your existing monolithic application toward a more modular design. This time around I'll dive a little bit deeper into its importance and the benefits of application modularization.

The Case
One of the most important best practices in application development is testing, and more specifically automated and continuous testing. When your application is a monolith with multiple functionalities and responsibilities, automated testing becomes massively unwieldy. To illustrate this issue let's use the following illustration of conceptual (and, admittedly trivial) photo gallery web application:

conceptual photo gallery web application example

Say you want to test Login functionality. After writing some basic testing setup and "plumbing" code, etc., you can start writing tests against the Login functionality. What if you want to test Post Photo functionality? On top of all the testing code for Login functionality now you also need special testing code for Post Photo functionality. How about testing Get Photo functionality? You need all of the above code plus the code to test Get Photo. At this point as you start getting testing failures, you'll be heading down-head first-into the proverbial rabbit hole. You won't know for sure where things are going awry: is the Login functionality failing or the Post Photo functionality or Get Photo functionality? And this is as trivial and straightforward as it gets. Now imagine a real application with more complex and intertwined functionality: a nightmare to maintain, test and develop.

Now, let's imagine the same application with a more modular approach:

conceptual photo gallery web application example with modular approach example

It's worth noting that in this example for the sake of simplicity, the Login module is also the front end your users interact with your application.

In the illustration above, we modularized the application in their own logical models and functionality driving toward what is known in the world of software development as single-responsibility principle. So, let's circle back to testing. Let's say you want to test Get Photo functionality. Now it's substantially easier: you can write tests against the Photo module and mock or stub out all other functionality (namely the Login module), same with Album module and any other modularized components. So now you can not only add automated testing more easily, but it becomes significantly simpler to figure out and fix when things fail-you have complete control over the context, so you'll know if it's a real failure or a false-positive and where those failures come from.

Closing thoughts
Testing is a critical part of your application. It's as critical as having a snazzy UI layer, super fast performance or some insanely clever functionality. Without proper testing you're, figuratively speaking, going off the deep end of technical debt and sooner or later you will have to pay. With a monolith, your testing will be limited, at best and nonexistent at worst. If you want your application to be easily maintainable, simple to work on and add or modify existing functionality with ease, you must drive toward modularization and thus testing.

Read the original blog entry...

More Stories By Blue Box Blog

Founded in 2003 by Jesse Proudman, Blue Box offers Blue Box Cloud—a managed Private Cloud as a Service (PCaaS) product available in both hosted and on-prem versions, powered by OpenStack.

Blue Box employees bring a wealth of diverse, in-depth operational experience to each customer installation of our unique hosted private cloud offering. Think of Blue Box team as your application’s lifeline.