Skip to main content

Why Agile and Test Driven Development (Part 3)

(Originally published by me on www.servicevirtualization.com)

Complexity yields defects
In part 2, we examined why SCRUM and TDD exhibit problems when measured from the perspective of the number of defects that they both yield. Before we can begin to understand why Service Virtualization helps address both of these reasons, it's worth elaborating on statements made in part 2.

You'll recall the equation to the right, presented last time. c represents the degree of complexity, which has a direct correlation to the amount of code that must be written to meet the business requirements that yielded the complexity to begin with. Because t is fixed and c continues to trend upward (over several releases) then the number of defects will also increase over time. Therefore, t is the primary constraint around which everything else revolves.
Expected number of defects

In SCRUM, an increase in the complexity of an individual sprint or the total application expressed as a sum of the functionality in each sprint, as seen to the left (s is a single sprint, n is the total sprints required to implement the full set of business requirements, and cs is the code to be developed in any given sprint), results in a corresponding increase in the number of defects produced given a fixed time.

TDD is slightly different. Here, the time must be "divided" (figuratively, not mathematically) into the time required to implement the tests that initially fail and the time required to implement the code that satisfies the test conditions. As the complexity increases, the number of tests that must be written also increases since the number of execution paths also increases. But, as we see in the illustration to the right, if more time must be allocated to writing tests then that leaves less time to write the code to satisfy those tests.
Mutually exclusive goals in TDD

So what about Service Virtualization? You've undoubtedly read elsewhere that the four primary benefits of CA's solution are...
  1. Shifting quality left. Allowing developers the ability to test code earlier in the SDLC substantially compresses each release cycle.
  2. Reduce infrastructure costs. Providing an environment that behaves "just like the real McCoy" but runs on commodity hardware reduces the need to purchase expensive development and test environments.
  3. Enable performance readiness. Stability is one aspect of availability management, but scalability is as well. While many companies still struggle to understand and implement cloud bursting to handle peak usage periods, their applications must still handle increased load or else suffer outages due to events like "the Oprah effect."
  4. Manage test scenarios. Drastically reducing the need to acquire and consume production data (which has a long turnaround time for each request due to data scrubbing requirements for regulatory reasons) allows testing to be both more effective and efficient.
With SCRUM, shifting quality left is the benefit we are primarily concerned with here. When examined in more detail, we find that this is possible because the amount of complexity is reduced by removing the constraints on other components or even entire applications or infrastructure components that would normally prevent efficient validation of the code produced.

"But hold on!" you say. "If complexity is directly related to the amount of code produced, aren't you contradicting yourself by implying that Service Virtualization reduces the amount of code that needs to be written?" You are correct and clarification is necessary: c in the equations at the top refers to the complexity of the code that is the responsibility of each individual developer. It does not include the additional complexity that results from other aspects of the architecture that are out of the control of the developer.

So if developers have dependencies on other components in the application, authored by other developers, or downstream infrastructure components then their complexity increases further since they represent variability that they cannot control. Therefore, the overall complexity is reduced when the variability is removed by replacing live systems with virtualized services that behave like their live equivalents but do not change while they are writing code to interact with them.

With TDD, test scenario management is the benefit we are primarily concerned with here. Since developers have a fixed amount of time to write tests that fail as well as the code to address those failures, the probability of having enough variance in the data driving the test harnesses to completely cover every permutation (or at least a large percentage of them) of data that causes the test to fail is incredibly small. This pushes defect discovery to the quality organization in spite of the best efforts of TDD as a discipline to avoid this exact scenario.

Furthermore, the time to develop test harnesses themselves results in inefficiencies. Service Virtualization solution includes a full featured test script IDE with a Visio-like interface that makes test development much easier than it would be using other, data panel-based applications from other solution producers.

Questions or comments? Leave a comment below!

Popular posts from this blog

It's Easier to Fail at DevOps than it is to Succeed

Slippery when wet Since the term DevOps was coined in Belgium back in 2009, it is impossible to avoid the term whether in discussions with colleagues or in professional trade magazines.  And during the years while this movement has gained momentum, many things have been written to describe what elements of a DevOps strategy are required for it to be successful. Yet in spite of this, there is an interesting data point worth noting: not many organizations feel there is a need for DevOps.  In a Gartner report entitled DevOps Adoption Survey Results (published in September 2015),  40%  of respondents said they had no plans to implement DevOps and 31% of respondents said they hadn't implemented it but planned to start in the 12 months after the survey was conducted. That left only 29% who had implemented DevOps in a pilot project or in production systems, which isn't a lot. "Maybe it's because there truly isn't a need for DevOps," you say.  While t...

So What is this IPaaS Stuff, Anyway?

 In my last post , I discussed how no-code/low-code platforms fulfill rapid development of business applications - addressing the needs of the Citizen Developer (a Gartner term  first used around 2009).  I also commented on how this specific objective limits their ability to provide true integration capabilities, which require the flexibility to adapt to the myriad variations of infrastructure.  This is a concern because companies often have acquired legacy systems via M&A activity while simultaneously investing in new technology solutions, resulting in a mishmash of systems with multiple ways of accessing them. In this post, I'd like to examine how the needs of the latter group are met by describing some key capabilities that are "must-haves" for any company looking to execute on a digital transformation strategy.  In order to do this, let's define who the target user base is for such a technology platform. Disclaimer:   I work for MuleSoft (a division...

Application Development Done Right

In a previous article, entitled DevOps as the Ultimate Panacea? , I described how developing code without thinking about the current needs of the end user as well as the future needs once they've become accustomed to using your application ends up not only frustrating them but also can result in customer churn and ultimately lower revenues.  In this article, I'd like to describe something simple that I came across today that shows a definite degree of effort to do quite the opposite. Recently, we had a severe snowstorm, one with blizzard-like conditions, which is unheard of in central New Jersey.  Being responsible adults, my wife and I went to the grocery store to stock up on essentials (read:  chips, chocolate, etc.) in case we get stuck at home. As we were ringing up our order, the cashier mentioned to us that the store has a mobile application.  Since both of us are in technology oriented professions, we were skeptical about the need for a grocery store mob...