Skip to content
ImagineWorld

Technical Agility with Patterns and Techniques

node_idnode-book_becoming-an-agile-software-architect_chapter-07-technical-agility-with-patterns-and-techniques
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
chapter_num7
chapter_titleTechnical Agility with Patterns and Techniques
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Chapter 7 — Technical Agility with Patterns and Techniques

Section titled “Chapter 7 — Technical Agility with Patterns and Techniques”

It is possible to fly without motors, but not without knowledge and skill.

-Wilbur Wright, American inventor and aviator

The previous chapter focused on process excellence in delivering value with the shortest sustainable lead time without compromising quality. This chapter will explore the technical excellence needed to successfully deliver quality solutions without losing sustainability and lead time.

In the fast-moving world of technologies delivering high-quality solutions, architects must be at the forefront of technology advancements by curiously learning and continuously applying niche technologies. Adopting the right technologies and techniques for the right use cases enhances technical agility, quality, and customer satisfaction. Organizations have to maximize technical agility by investing in cultivating individual craftsmanship. Achieving technical agility is primarily done by adopting patterns and techniques as well as nurturing a DevOps culture. Evolutionary architecture to respond rapidly to customer requirements, modularizing applications to reduce coupling, and adopting modern technologies are necessary enablers for technical agility. While greenfield systems are easy to manage, many organizations continue to deal with legacy systems due to their long tail of tech debts. Re-platforming those systems to an acceptable technical level with incremental modernization is essential to continue deriving value. Teams deliver better-quality solutions when they follow good coding practices with a strong focus on testability and full stack telemetry.

Architects have the inherent responsibility to enable technical agility that brings stated benefits in delivering high-quality solutions faster. Therefore, we must learn the art of promoting technical agility by consistently applying patterns and techniques. This chapter sets the overall context of technical excellence and then zooms into the aspect of technical agility with architecture patterns and techniques. We will discuss many areas that architects have to focus on in order to achieve technical agility. We will also discuss legacy modernization techniques for graceful upgrades.

In this chapter, we’re going to cover the following main topics:

  • Amplifying agility with technical excellence
  • Building technical agility with patterns and techniques
  • Architecting for change
  • Developing good code with engineering excellence
  • Understanding enterprise integration
  • Developing for testability
  • Treating infrastructure like software with the cloud
  • Monitoring everything with full stack telemetry

This chapter focuses on the Technical Agility focal point of The Agile Architect’s Lens:

Figure 7.1 – Technical Agility – Focal point

Amplifying agility with technical excellence

Section titled “Amplifying agility with technical excellence”

Technical excellence is a term widely used beyond software engineering to refer to the rigorous and outstanding qualities and capabilities of individuals and organizations in a particular field of expertise.

In the paper Technical Excellence: A Requirement for Good Engineering, Paul S Gill and William W. Vaughan explain technical excellence at NASA as technical thoroughness and rigor applied to software engineering. This paper also observes that technical excellence has a personal accounting aspect as well as an organizational responsibility. Technical excellence refers to the state of an organization where people have the culture of favorably adopting technologies by going beyond their call of duty to deliver anti-fragile, reliable, and durable solutions at optimal cost. As proposed by Jim Highsmith, one of the manifesto signatories, technical excellence is measured as the ability to deliver solutions for the customer’s current needs and its adaptability for future needs.

One of the manifesto principles of agile software development is that continuous attention to technical excellence and good design enhances agility. 10 years after publishing the manifesto, the signatories met again, at the Snowbird 2011 event, to reflect on its adoption status. One of the key messages that came out of the gathering was the call for technical excellence. The group signatories observed that the agile community must demand technical excellence by doing the following:

  • Promoting individual change and leading organizational change
  • Organizing knowledge and improving education
  • Maximizing value creation across the entire process

This is clear evidence demonstrating the pertinence of technical excellence in agile software development.

Large-Scale Scrum (LeSS) observes that the maturity of technical excellence restricts an organization’s degree of agility. The key characteristics of a learning organization competing and thriving to attain agility, with technical excellence as a critical enabler, include building an adaptive culture, software craftsmanship, technical mastery, and continuous learning of technology advancements. As an example, Snow in the Desert implemented an internal academy to foster continued learning by partnering with other enterprises and universities. Rewards, recognition, and leader boards are implemented to keep the motivation of employees high.

Well-engineered products flawlessly adapt to changes with minimal impact on serviceability, speed of delivery, and cost. Often, maintenance costs are regarded as a way to measure technical excellence. Obsession over the best quality, with a strong inclination toward minimizing operational overheads, is a positive sign of technical excellence.

The influence of technical excellence in the software life cycle is illustrated in the following diagram:

Figure 7.2 – Impact of technical excellence on software delivery

As shown in the preceding diagram, the development cost may be marginally high when organizations focus on technical excellence. In the long run, maintenance costs offset the initial development cost.

Architects play an incredibly significant role in enabling and promoting technical excellence through adopting the right technologies and techniques by providing technical thought leadership and responding to complex problems with simple, sustainable solutions. Agile architects need to critically and continually reflect and improve their technical knowledge in order to remain relevant.

As shown in the following diagram, technical excellence has two aspects:

Figure 7.3 – Components of technical excellence

Software craftsmanship is associated with individuals, whereas technical agility is at an organization and team level. This is explained further in the following sections.

Intrinsically motivated individuals are significant assets to any organization for delivering well-engineered software products. Focusing on the quality of the solution is a habit for such individuals more than their duty. Regardless of processes, instilling craftsmanship can dramatically improve delivery success, quality, and maintainability of the software when individuals assume a sense of ownership.

The most formal documentation on software craftsmanship is the manifesto for software craftsmanship defined in 2009. It states that practicing and educating on the craft of professional software development steadily adds value to business change by delivering well-crafted working software. Such practitioners foster a community of professionals with a productive customer partnership beyond collaboration.

Adding value by delivering a well-crafted software solution is one of the key highlights of this manifesto. Software craftsmanship requires personal commitment for self-improvement, a curiosity to learn, and striving for better quality. As a master programmer, software craftsmanship is core to an architect’s role. Software craftsmanship is the state of an individual with a growth mindset when they do the following:

  • Relentlessly stretch their comfort zone by continuously striving to acquire new skills
  • Fearlessly adopt good technical practices
  • Systematically apply learning with passion, rigor, and thoroughness
  • Selflessly share learning for the betterment of the people around

Beyond merely getting their job done, these aspiring and disciplined individuals care about the code they write and invest time in avoiding code depreciation. They use simple designs and clean and concise code, and they automate mundane tasks. They take pride in delivering bug-free code and always challenge the status quo for their own betterment. They invent innovative ways to perform the same job differently for their satisfaction and deliver better, faster, and cheaper solutions.

Software craftsmanship is possible for individuals to achieve only with immense encouragement and support from the organization. Organizations need to invest in individuals’ technical skills by continuously amplifying learning and consistently applying reflective improvements.

Organizations cannot accomplish agility by just adopting agile development and delivery practices. It requires the efficacious use of technologies as a cardinal tool to enable agility. For example, agile software development using in-house infrastructure management with a lead time of months for procurement and the provisioning of new servers induces flow barriers.

Teams excel in technical agility when contextually adopting modern technologies such as the cloud, microservices, and automation for accelerating the flow of delivery continuously and sustainably. High-performing teams enable agility by imprinting principles such as clean code, proven engineering practices, appropriate use of technical patterns, and adherence to object-oriented concepts and design techniques.

Focusing on technical agility helps organizations to harness current technologies and embrace new technologies quickly and easily. Technical agility helps avoid excessive reworking, improves productivity, and ensures a faster time to market, higher quality, better longevity, reduced operations cost, and improved organizational agility.

There are three segments in technical agility, as shown in the following diagram:

Figure 7.4 – Components of technical agility

The three segments are explained as follows:

  • Patterns and techniques help deliver high-quality evolvable solutions.
  • DevOps and automation support the continuous faster flow of values.
  • Built-in quality supports high-performing, scalable, and sustainable solutions.

Scaled Agile Framework (SAFe) describes technical agility as one of the seven competencies. It consists of critical skills and competencies required for high-performing teams to develop and deliver high-quality solutions to customers.

So far, we have examined technical excellence, which consists of software craftsmanship and technical agility. We have also seen the importance and characteristics of technical agility. The following section introduces some of the principles of technical agility.

Building technical agility with patterns and techniques

Section titled “Building technical agility with patterns and techniques”

Embracing new technologies for adding new features or incrementally enhancing live systems without disruptions necessitate an evolutionary architecture. Carefully choosing the right patterns and techniques enhances software evolution and, hence, technical agility.

Neal Ford from ThoughtWorks defines evolutionary architecture as an architecture that supports guided, incremental changes across multiple dimensions. Evolvability needs to be considered as a first-class citizen when targeting technical agility. A sound, evolvable architecture demonstrates patterns and techniques such as simplicity, well-formed structures, and modular, repetitive components.

Many real-world architectural marvels, such as the Taj Mahal and Tower Bridge, reflect these characteristics. These large architectural monuments were built using the principle of self-replicating geometry and symmetry of architectural elements, as illustrated in the following diagram:

Figure 7.5 – Tower Bridge – the symmetry of architectural elements

As you can observe in the diagram, simple, standalone, and replicated components integrate with the overall structure in symmetric order. Architecture evolves by extending these repeated structures in multiple directions. In software engineering, simple, smaller parts of the system stand on their own and integrate to form larger systems. Repeating the same structural patterns differently to build larger systems is the way to build stable systems faster.

Accomplishing technical agility with evolutionary architecture patterns and techniques can be summarized as five core principles, as shown in the following diagram:

Figure 7.6 – Principles of technical agility

The principles of technical agility enable developers to accept changes without fear of failure. These five principles are explained further in the following sections.

Architecting for change is an art. It requires a change-aware mindset irrespective of working with greenfield or legacy systems. This section explains the different patterns and techniques for enabling architecting for change.

The Keep It Simple, Stupid (KISS) principle is one of the oldest principles for relating good design and engineering. This principle originated from an American aircraft engineer, Kelly Johnson, referring to the simplicity in designing military aircraft to be repaired with a limited set of tools in a war zone. This principle highlights that systems with simple designs work better than their complicated alternatives. Simplicity must be one of the key goals when architecting for change to support software evolution.

Simplicity is also reflected in Occam’s Razor, or the Law of Parsimony, as a principle related to problem solving. This principle states that if there are multiple hypotheses for a solution, choose the one that has the fewest assumptions. Fewer assumptions brings better clarity and simplicity.

The following points highlight the consequences of complex design:

  • Complex designs due to overengineering result in increased costs of change, evolvability, and maintainability.
  • Complex designs due to feature creep lead to extra efforts in building features beyond what is needed for the solution.
  • Complex designs due to a lack of refactoring lead to software bloats, which consume more resources and slow the system down.
  • Complex designs with more moving parts, such as components, dependencies, configurations, technologies, and layers, lead to reduced productivity and an increased number of faults.

Adopting the clean architecture principles defined by Robert C. Martin helps to develop the most straightforward but effective form of layered architecture. Good engineering practices and an individual’s maturity are essential for keeping the design as simple as possible.

Simplicity alone cannot deliver the necessary levels of technical agility. Isolation by design is one of the most critical design aspects to enable technical agility. The next section explains the different patterns and practices of isolation by design.

Isolation by design is one of the critical principles of architecting for change. Isolation by design is defined as follows: for software to be evolvable, tightly dependent components have to stay together, exhibiting high degrees of cohesion, whereas components that are likely to change need to be decoupled with loose integration patterns and techniques.

Several patterns and techniques related to isolation by design are explained in the following sections.

The traditional way of organizing architecture is by slicing an application horizontally with technology layers as the boundary. Product-based development is one of the standard practices in agile software development. Architecture needs vertical slicing along the boundaries of the product instead of horizontal slicing with technology as the currency. Doing so helps in significantly minimizing the blast radius of any system changes.

The following diagram captures both the horizontal slicing and vertical slicing approaches:

Figure 7.7 – Horizontal and vertical slice architectures

M in the diagram stands for functional modules. As shown in the preceding diagram, vertical slicing is a miniature version of the whole system that helps accelerate feedback cycles with minimal investments. Technologies and layers are abstracted within the vertical slices to provide empowerment and autonomy for product-specific teams with full stack developers. The components within a vertical slice are high on cohesion, whereas across slices they are loosely connected. These vertical slices are progressively enhanced with vertical user stories without disrupting other slices.

Vertical slices not only reduce the blast radius, but also aid in substitutability and maintainability. They also help you to stay customer-focused, accelerate innovations, understand and organize teams better, achieve faster build cycles and structured integrations, improve testability, automate deployments, facilitate segmented delivery and release pipelines, and achieve better performance, and they are less laborious to operate.

Domain-Driven Design (DDD) is an effective approach to vertically slice larger systems across functional and product boundaries. DDD is a development approach proposed by Eric Evans to help build evolvable systems by organizing complex logic and data models with bounded contexts. A bounded context is a mechanism for establishing functional boundaries between various parts of the system.

The following diagram gives an illustration of domain objects and bounded contexts:

Figure 7.8 – DDD using bounded contexts

When introducing Snow in the Desert in Chapter 2, Agile Architecture – The Foundation of Agile Delivery, we saw four departments – Front Office, Back Office, Field Operations, and Vehicle and Asset Management. These are often treated as bounded contexts as they share domain objects, the same business language, and relationships. The domain decomposition usually starts with these higher-level bounded contexts, which are decomposable into more granular sub-domains.

The Field Operations domain can be further decomposed into the Fulfillment sub-domain, the Scheduling sub-domain, and the Planning sub-domain. The Fulfillment sub-domain can be further decomposed into the Tracking sub-domain and others. Similarly, the Front Office domain can be decomposed into more granular domains, such as the Booking sub-domain.

Figure 7.8 shows two bounded contexts from Snow in the Desert – Field Operations and Front Office, focusing on the Tracking and Booking sub-domains. As shown in the diagram, the Customer domain object is repeated in both bounded contexts, but may represent different meanings.

DDD uses domain objects, object-oriented principles, and business language to model complex problems. Unrelated domain objects and business language indicate that they belong to a different bounded context. Domain objects within a group are highly cohesive, whereas the objects across domain boundaries are loosely coupled. Typically, bounded contexts are owned by a line of business and aligned to a development team.

These models reflect the interactions and behaviors of the business in the real world. The model evolves by adding new relationships and objects as new scenarios are introduced. Since models use business language, stakeholders from business can easily validate and share feedback based on their experience ahead of the development.

A good domain model developed using object-oriented patterns and principles reduces breaking changes, improves modularity, and produces better-quality clean code.

Implementing vertical slices and DDD using microservices

Section titled “Implementing vertical slices and DDD using microservices”

Even though microservices are a relatively new concept, Dr. E. E. David, at the NATO Software Engineering Conference back in 1968, observed that the building of large systems needs to start small by developing and deploying a small subsystem and then building on that. He also observed that systems need to be designed in modules that can be implemented, tested, and evolved independently.

Microservices is a realization of Dr. E. E. David’s vision. It is an architecture style that primarily helps in implementing vertical slices and bounded contexts. The microservice approach decomposes large applications into a series of smaller autonomous services minimally integrated with loosely coupled designs. The life cycle states from inception to operations of these services are relatively independent of each other.

The following diagram shows the concept of microservices as a combination of DDD and vertical slicing:

Figure 7.9 – Microservices architecture

As shown in the diagram, application components, infrastructure, development teams, and business can all be isolated from other services by providing greater degrees of autonomy.

Some of the key benefits of microservices in the context of agile software development are as follows:

  • Organizing teams around service boundaries to reduce co-ordination efforts, improve autonomy, and better engage with business.
  • Separating deployment pipelines and infrastructure for each service, thereby helping teams to determine the frequency of deployment and releases independently.
  • Automating build, test, infrastructure provisioning, and deployment is then easier to achieve compared to large monolithic systems.
  • By enabling polyglot technologies, teams are empowered to choose the right technologies for the right purpose to deliver maximum value at optimal cost.
  • Enabling innovations with a faster test learn cycle, as the impact of the failure is restricted to a smaller set of features.
  • Reduced cost of operations is achieved with selective autoscaling and service-based availability.

In the context of Snow in the Desert, two microservices were represented in the container diagram explained for AVTS in Chapter 5, Agile Solution Architects – Designing Continuously Evolving Systems. Extending that further, the following diagram shows the component view of Tracking Microservice:

Figure 7.10 – Component diagram for a tracking service

As captured in the diagram, Tracking Microservice uses a clean and straightforward structure based on Java and the Spring Framework. The self-contained solution is deployed as a containerized Spring Boot application, and managed by a separate team with isolated continuous integration and deployment pipelines.

Isolation by design techniques are straightforward to apply in greenfield development scenarios. However, they are incredibly complex and pragmatic to use with legacy monolithic applications. The next section will explain some of the patterns that are useful when dealing with legacy applications.

In a large enterprise with a long tail of legacy, architects have to deal with live legacy systems, which are hard to change, test, deploy, monitor, and scale. Most of these systems are incompatible with and non-responsive to modern techniques and technologies, such as containers, the cloud, infrastructure as code, and continuous delivery pipelines.

Legacy systems require considerable investment for large-scale modernizations. Many times, the business value of such large-scale improvements is outweighed by the cost of upgrades. Therefore, such approaches are considered infeasible. Instead, small incremental changes that move systems to the next immediate desired state is a better proposition. A few patterns are handy for achieving graceful changes to legacy applications.

The strangler pattern is used when new changes are built outside the core legacy system or incrementally by moving functionalities from the core system to outside. Services built outside the legacy system follow modern architecture and engineering practices. The legacy system makes its way to retirement once all features are migrated to the new architecture.

The following diagram captures different phases of the strangler pattern:

Figure 7.11 – Strangler pattern for legacy modernization

As shown in the diagram, the façade between the UI and backend helps avoid disruptions to customers. The strangler pattern helps in reducing the migration risk and interruption to customer services. However, this incremental migration is a bit trickier for frontend applications as users may experience a sub-optimal user experience during the migration period.

Stalling migration halfway is one of the common challenges associated with the strangler pattern, which leads to a migration flux. Migration flux is a complicated situation with old and new systems working in conjunction for a more extended period without further migration. Full commitments from the sponsors and an aggressive migration plan are essential for avoiding migration flux.

The anti-corruption layer is another pattern that is useful for legacy migration. In this case, the old systems continue to have the old way of working, and the new system serves new functionalities.

The following diagram captures the anti-corruption layer pattern:

Figure 7.12 – Anti-corruption pattern

As shown in the diagram, downstream systems that rely on the old system may take time to migrate completely so as to be compatible with the new system. The anti-corruption layer acts as a message translating bridge between the old and new systems. With this approach, the new system is not polluted with legacy semantics and avoids significant investment in the old system to make it compatible with new semantics. Similar to the strangler pattern, the anti-corruption layer is only a transitionary stage. It is essential to change downstream systems to comply with new semantics to avoid unnecessary complexity and maintenance overheads.

So far, several tactics helpful for architecting for change to support technical agility have been explored. The next section will examine the engineering excellence aspects of technical agility.

Developing good code with engineering excellence

Section titled “Developing good code with engineering excellence”

The rich and adequately modeled domain of DDD is an excellent starting point and a strong foundation for building evolvable systems. Architects identify opportunities, and foster, demonstrate, and continuously reinforce good technical practices. The technical quality of a team is directly connected to the technical competency of the leader.

The development of high-quality code demands that engineers adopt several engineering disciplines. The subsequent sections cover these essential practices, starting with principles, techniques, and patterns, which are the foundation.

Applying coding principles, techniques, and patterns

Section titled “Applying coding principles, techniques, and patterns”

The development of mission-critical resilient systems with longer estimated service periods needs to focus on, and invest in, good-quality code. This section explores design techniques and patterns for building such long-lasting systems.

Software design patterns and practices are fundamentally based on several enabling techniques of object-oriented programming. These enabling techniques include abstraction, encapsulation, information hiding, modularization, separation of concerns, coupling and cohesion, and the separation of the interface from implementation. Meticulously practicing enabling techniques helps to develop robust foundational design and code.

The Gang of Four (GoF) design patterns provide solutions to recurring problems in the most elegant and optimal way, with well-structured and proven code. In addition to the GoF patterns, principles such as SOLID and Don’t Repeat Yourself (DRY) are also very useful in developing resilient systems. The Design Principles and Design Patterns paper by Robert C. Martin documents several design principles and patterns for developing good-quality code.

Enterprise-grade patterns have to solve more complex and challenging problems beyond what the GoF and other foundation patterns address. Enterprise patterns are solutions to repeatable complex application design problems, such as Model View Controller (MVC) for web application development, and Front Controller. These principles are related to the layering of application components, structuring domain logic and web applications, connecting to databases, handling sessions, and so on. Other higher-level design patterns, such as event sourcing, Command Query Responsibility Segregation (CQRS), and circuit breakers, are also useful for solving enterprise application architecture problems. Microsoft Cloud Design Patterns (https://docs.microsoft.com/en-us/azure/architecture/patterns/) is a good repository of application-level patterns that are quite useful for building modern cloud-based applications.

With Snow in the Desert, architecture and design patterns are developed and maintained in a Git repository as patterns as code for easy consumption.

Good coding practices come with experience and craftsmanship. Great programmers define and continually follow enterprise coding guidelines, including naming and structuring standards, to produce consistent and maintainable code. While an average developer just handles the exception when they encounter an issue, a good programmer fixes the exception’s root cause, even if it takes more time.

Too many control statements reduce readability and code performance, where a master programmer uses object-oriented constructs in place of control statements. Cyclomatic complexity is a general measure of the code’s complexity by measuring the number of independent control flow paths in the source code. A lower value for cyclomatic complexity indicates well-structured code. Clean code, as proposed by Robert C. Martin, advocates writing code in a simple, structured, orderly, and elegant fashion with the right levels of abstraction and good readability.

Snow in the Desert continuously enhances coding and design guidelines and applies them automatically by integrating with development IDEs and continuous integration tools. Knowledge of coding practices and patterns is spread throughout learning sessions and code fests.

Sustainable delivery of software in agile development requires continuous improvement of systems that require continuous refactoring. Refactoring is not optional; it is a must and has to be part of all team members’ day jobs. Cumulative change by many developers over time invariably increases design and code complexity. Refactoring requires a different mindset in which developers need to anticipate code changes to accommodate new requirements, no matter how well the code is written initially.

Refactoring, by definition, is changing the structure of the code without altering the behavior of the solution. To ensure that behavior is intact, an automated regression test pack is essential. Refactoring is not only applicable across all layers, such as the UI and database, but also applicable at architecture, design, and code levels.

As mentioned in Chapter 6, Delivering Value with New Ways of Working, small but repeated refactoring is preferred in order to reduce complexity, tech debts, and code smells. Refactoring improves performance, reduces resource utilization, enhances readability, and promotes reusability.

Twelve-factor principles, made popular by Heroku, now part of Salesforce, is a methodology describing the characteristics expected from modern cloud-ready applications.

Developers building modern, cloud-native, scalable, and distributed applications have to adhere to several fundamental coding practices in addition to the good coding practices. These are a set of principles relating to coding, configuration, dependencies, and deployment. They help in decoupling application code from the cloud environment so as to insulate against infrastructure volatility. For example, internal and service URLs have to be separated strictly from code into, preferably, an externalized configuration file. By doing so, developers ensure that code does not change between deployment environments.

Now, let’s understand what is meant by enterprise integration.

Modern software development following agile practices needs to consider integration as a first-class citizen. Short-sightedness in integration may quickly turn into a flow impediment. The early and continuous testing of integrations is a good practice in agile software development to avoid this.

Designing and implementing robust integrations requires many considerations, including the following:

  • The right level of coupling by choosing integration types and protocols, such as synchronous versus asynchronous and HTTP versus TCP/IP
  • Non-functional requirements, such as fault tolerance, performance, data transfer size, cost of transmission, and scalability
  • Appropriate data exchange and transformation mechanisms
  • Implementing appropriate security controls

Designing reactive event-driven services can significantly minimize dependencies between subsystems of organically evolving systems. Organizing teams around bounded contexts restricts inter-team communications through a loosely coupled API-first approach. Using enterprise integration patterns such as publish-subscribe, message routing, message transformation, and message consumption solves the most common integration patterns.

The following example is from Snow in the Desert to demonstrate how trains and systems communicate with loosely coupled event-driven interfaces:

Figure 7.13 – Teams and systems communicate with event-driven interfaces

In the case of Snow in the Desert, the Booking System, which is part of the Customer Train, and the Fulfilment System, which is part of the Fulfilment Train, interact through events over a message bus. Upon completion of order creation, the Booking System publishes Order events to a topic to which the Fulfillment System is subscribed. In this case, teams agree on a contract for events exchanged between them. This way, both these systems and, hence, teams can work with minimal dependencies.

In summary, developing clean code requires the diligent application of design principles, patterns, and guidelines, together with continuous refactoring. The next section covers the testability aspect of technical agility.

Agile software development focuses on rapid tests and learns cycles implemented with repeatable and automated testing. Therefore, designing systems for testability is critical. A fully automated regression test pack helps developers fearlessly make changes to code since automated testing can discover faults as early as possible in the delivery cycle before interrupting customers’ services.

Testability refers to the ability to test application code, preferably in an automated form. Testability and automatability enable faster feedback cycle time, reduce rejections, and minimize the number of faults in production. Let’s see how this works with the TDD approach.

Test-Driven Development (TDD) is a software development approach that advocates writing test cases before code. The code is written against pre-created test cases, which represent scenarios of customers’ needs. The red-green-refactor approach is typically used in TDD as follows:

  1. First, write a test case that is failing because the code is not yet ready.
  2. Then, write the most straightforward possible code to make the test pass.
  3. Lastly, add functionality and refactor the code to make it more structured, efficient, and better.

TDD helps in avoiding overengineering by forcing you to write only the required code to meet test cases. It also helps in clearly meeting customer expectations and introducing new features since the test pack can detect faults. In most cases, developers apply TDD alongside Behavior-Driven Development (BDD), which is an extension of the TDD concept.

Using contract-first design and a fake implementation of a test double enables parallel development for producers and consumers. It ensures that producers are developing just enough code to meet the contract and empowers producers to make behavioral changes by just testing against consumer contracts.

Architecting for testability and automation together with TDD helps guarantee the quality of delivery. The next section examines the infrastructure aspect of technical agility.

Treating infrastructure like software with the cloud

Section titled “Treating infrastructure like software with the cloud”

Enterprises cannot achieve business agility without adopting a cloud for application deployments. Agile software development, microservices (or loosely coupled architecture), DevOps, and the cloud are critical forces that help organizations realize business agility.

The traditional way of managing infrastructure is no longer feasible when the focus is on rapidly delivering value. There are several disadvantages associated with using traditional infrastructure models in agile software development:

  • The traditional approach of labor-intensive and less responsive infrastructure management is considered a flow impediment in agile software development, impacting lead times, developer productivity, operational excellence, and knowledge acquisition challenges.
  • In the traditional approach, architects and developers spend a fair share of their energy and time focusing on architecting, deploying, and maintaining infrastructures and software platforms instead of focusing on building business solutions.

There are several benefits in actively adopting the cloud instead of the traditional data center approach. Some of the key benefits are as follows:

  • The cloud provides an easy-to-manage, software-friendly environment for enterprises instead of buying, owning, and maintaining hardware components and technical platforms.
  • The cloud offers modern enterprise-grade services that are battle-tested for high scalability, availability, resiliency, fault tolerance, and performance at an optimal cost.
  • Enterprises adopting the cloud realize improvements in terms of agility, productivity, and cost of operations.
  • Embracing the cloud enables architecture evolution by supporting the incremental expansion of infrastructure and platform services without requiring capacity predictions.
  • The cloud also allows teams to have frequent releases with a high degree of automation and unparalleled security and compliance levels.
  • Cloud environments support the rapid development, testing, and launching of business applications by rapidly provisioning infrastructure and platform services with lower investments and upfront contractual commitments.
  • Platform services such as database as a service, messaging as a service, containers, serverless computing, APIs, CI/CD pipelines, and application telemetry help bootstrap modern application development faster without spending a significant amount of time on plumbing needs.

Since cloud services are API-based, the adoption of the cloud gives teams more autonomy by reducing dependencies on central infrastructure teams. Development teams effortlessly provision, configure, and operate infrastructure as code by maintaining it in a version control repository just like any other code.

The last principle to be taken care of when building evolutionary architecture is full stack monitoring. The next section will cover the monitoring aspect of technical agility.

Monitoring everything with full stack telemetry

Section titled “Monitoring everything with full stack telemetry”

Proactively collecting data to determine possible faults helps to significantly improve Mean Time To Recovery (MTTR) and, therefore, minimize disruption to customer services. Telemetry is a rapid automated feedback mechanism for collecting data for measurement purposes from various data sources. Full stack instrumentation and telemetry are the cornerstones of effective monitoring. They connect infrastructure, networks, applications, and customer interactions to provide end-to-end visibility of operations.

Outcome-based monitoring, product-centric monitoring, and observability are best practices for monitoring modern systems that enable technical agility. The following sections cover these topics in detail, starting with outcome-based monitoring.

Outcome-based monitoring with progressive enhancement

Section titled “Outcome-based monitoring with progressive enhancement”

Several metrics across applications, infrastructures, networks, platforms, interfaces, and security are required to maximize the system’s serviceability with monitoring. The data collection includes logs, metrics, user activities, security, pipelines, and distributed systems tracing. While traditional monitoring is limited to monitoring the data collected, modern monitoring systems need to show the value of monitoring by rolling up as Key Performance Indicators (KPIs) at various levels, including business, IT service management, products, and infrastructure, as shown in the following diagram:

Figure 7.14 – Different levels of monitoring

KPIs and outcome-centric monitoring help in quantitatively determining the impact of an incident. For example, revenue loss due to an online e-commerce website being down for 30 minutes is a business KPI.

Well-established processes to progressively enhance monitoring capabilities help minimize interruptions to services and, therefore, improve customer satisfaction and reduced revenue loss. With such processes, every root cause analysis leads to not only fixing issues, but also enhancing monitoring to proactively detect and prevent similar incidents from occurring in the future.

In the traditional approach, monitoring is fragmented. Current stack-based monitoring practices focus on isolated technical components and layers such as a database, server, and network. In a product-centric environment, development teams must be autonomous as much as possible.

A comparison of traditional monitoring and product-centric monitoring is captured in the following diagram:

Figure 7.15 – Product-centric monitoring

While traditional monitoring requires effort to aggregate and create insights, product-centric monitoring does this by design. The approach must shift from horizontal to vertical full stack monitoring by offering end-to-end diagnostic information for development teams to minimize dependencies on others. Such product-centric teams use contextualized visual displays for instant access to metrics and logs collected for diagnosis.

Modern systems must be like a transparent watch – the inner mechanisms are visible from the outside. Observability in software systems is a concept that helps to bring this transparency.

Observability helps to understand the inner state of a system, collecting signals that originated from its internal components. Observability starts with signals as opposed to the monitoring requirements and metrics.

The following diagram captures a typical process of monitoring observable systems:

Figure 7.16 – Observability-based architecture

As shown in the diagram, the key patterns for signal collection for observability are metrics, tracing, and event logs. Aggregation, storing, and visualization are additional capabilities for full stack telemetry. Insights and alerts are generated based on the analysis of aggregated data. AI Ops – Artificial Intelligence for IT Operations – is an upcoming trend to identify and process patterns to create insights and automated actions. Structuring logs properly, adding instrumentation at multiple levels, emitting signals as events, and adopting distributed tracing are good design patterns for full stack telemetry.

Technical excellence brings rigor in quality development, which substantially improves organizational agility. Technical agility and software craftsmanship are underpinning forces enabling technical excellence. While technical agility implies good practices for architecture, development, testing, and deployments with built-in quality and automation, software craftsmanship is about an individual’s ability to exhibit mastery in technology.

Learning organizations elevate technical agility by indefatigably adopting good design and coding practices and strenuously implementing DevOps and automation techniques. Technical agility fosters architecture evolution when architecture principles, design coding, testing, and operations are thoughtfully applied. Architecting for change is primarily attained by vertically slicing solutions, adopting DDD for decomposition, and implementing microservices-style architecture. Anti-corruption and strangler patterns are inevitably important for legacy migration. Clean design and leveraging clean coding techniques, principles, and patterns significantly promote quality and sustainability. Investing in writing test cases with TDD and developing automated regression packs helps developers fearlessly make code changes. Studiously adopting the cloud, platform services, and infrastructure as code is indispensable for developing modern applications. Full stack telemetry and observability across various environments enable the early detection of faults and minimize disruption to customer services.

This chapter focused on patterns and techniques – aspects of technical agility. The next chapter continues to focus on technical agility, deep diving into DevOps and automation aspects.