Software Engineering and Architecture
local graph
Chapter 3 — Software Engineering and Architecture
Section titled “Chapter 3 — Software Engineering and Architecture”AI-enabled software represents a significant leap in system complexity. Unlike traditional software that follows deterministic rules, AI-enabled software attempts to mimic human decision-making, reasoning, and goal-seeking through heuristic algorithmic means. In doing so, creating multidimensional complexity and, hence, a non-deterministic system. There are different types of challenges to address than traditional software engineering.
This complexity manifests in various ways, from the integration of specialized machine learning components to the need for robust data pipelines, from handling model uncertainty to ensuring appropriate human oversight. Consider the sobering statistic from Gartner that, through 2022, 85% of AI projects delivered erroneous outcomes due to bias in data, algorithms, or the teams responsible for managing them [1]. This highlights the critical importance of robust architecture in AI system development.
To comprehend the scale of complexity we’re discussing, consider that the Linux operating system had over 30.34 million lines of source code as of 2021 (www.kernel.org). Linux powers millions of computers, from mission-critical systems to hobby kits, and was built by thousands of engineers working in self-organized groups over several decades. That such a complex system functions reliably is a modern marvel, made possible through a stable and modular architecture that frames system development.
”Complexity is the business we are in, and complexity is what limits us.”
Frederick Brooks, The Mythical Man-Month
Architecture in software shares common elements with other engineering domains such as civil, aerospace, and medical, though each field implements different models, patterns, and decompositions. The core goal remains consistent: ensuring the correct system is built. For complex software, especially AI-enabled systems, a disciplined architectural approach is essential to simplify the problem space and scope technical solutions through abstraction and modeling.
In this chapter, we’ll explore how software becomes complex in AI systems, outline architecting processes and documentation that mitigate these complexities, and examine the role of architects in project management to ensure successful project completion.
Understanding software complexity in AI systems
Section titled “Understanding software complexity in AI systems”Several distinct but interdependent types of software complexity exist in AI-enabled systems. Architecture serves as a tool to manage this complexity through modeling, which helps the architecture team reason about the system and provides a foundation for detailed specifications and team communication.

Figure 3.1: Software development lifecycle for AI systems
As shown in Figure 3.1, the development process for AI systems follows a structured lifecycle that begins with conceptual development, then moves through requirements gathering and architecture development before proceeding to design and development. After development, the process continues with integration, unit testing, system testing, and finally deployment. This systematic approach helps manage the inherent complexities of AI systems by ensuring that architectural considerations are addressed early in the development process. An excellent resource for learning about systems methodology can be found in the INCOSE Systems Engineering Handbook [5]. The authors posit that this sort of cycle can be applied to different development methodologies, be it a waterfall development or Agile methodology.
Integration complexity
Section titled “Integration complexity”Software integration becomes particularly challenging when development teams must incorporate code bases they didn’t create or don’t control. This spans multiple layers of the software stack, from operating system kernels to application frameworks. These different software packages have varying dependencies on libraries, operating systems, versions, and programming languages.
For AI-enabled systems, it’s economically advantageous to leverage open source or commercial packages for core algorithms rather than building functionality from scratch. We see this in the widespread adoption of frameworks such as TensorFlow, PyTorch, and scikit-learn, which provide ready-made implementations of complex machine learning algorithms. Consequently, the rest of the software architecture often needs to adapt to accommodate these components.
Case study: healthcare AI integration
Section titled “Case study: healthcare AI integration”A healthcare provider implementing a diagnostic assistance system faced significant integration challenges when incorporating a pre-trained deep learning model for medical image analysis. The model, built with TensorFlow, required specific versions of supporting libraries that conflicted with the hospital’s existing Java-based infrastructure. The architecture team solved this by implementing a microservice architecture with containerized components, allowing the AI system to operate in an isolated environment while communicating with existing systems through well-defined APIs. This said, there also exists the complexity of API management. This includes working with updated or revised APIs. This then forces the version control and compatibility of APIs based on the evolution of models or the application itself.
Functional complexity
Section titled “Functional complexity”The need for autonomous decision-making or inference introduces significant functional complexity. The decision process must be executed correctly for the system to fulfill its objectives. This requires implementing robust checks through monitoring, alerts, and alarms, as human oversight isn’t always available to ensure decision correctness.
AI technologies also introduce requirements for model re-training and deployment when models become incorrect or outdated. Alert systems and break points must be implemented to allow human override when the system operates incorrectly. Additionally, extensive logging is necessary to enable checking, alerting, and diagnostic functionality.
Privacy concerns and management of large volumes of log data become particularly important in AI systems that involve sensitive data, such as those in healthcare, finance, or government applications. A well-architected system must include mechanisms for data anonymization, secure storage, and controlled access to logs.
Technical complexity
Section titled “Technical complexity”AI algorithms place tremendous demands on underlying hardware. The computational complexity of algorithms, data preprocessing needs, and performance margins add complexity to hardware deployment decisions. As an example, training a large language model such as GPT-3 required approximately 3.14 x 10 23 FLOPS of compute [2], highlighting the extreme computational demands of modern AI systems.
Timeliness requirements for query and data processing introduce additional challenges. In real-time applications such as autonomous vehicles or financial trading systems, AI components must deliver decisions within strict time constraints, requiring careful optimization of the entire processing pipeline.
Processing pipelines require careful consideration of volatile memory and data storage needs. For instance, a computer vision system processing high-resolution images might generate terabytes of intermediate data that must be efficiently managed. Additionally, cybersecurity requirements add another layer of complexity through monitoring, encryption, and logging needs.
Scalability becomes a critical concern as AI systems move from development to production. The architecture must account for increasing data volumes, user loads, and computational demands, often requiring distributed computing approaches and cloud-based infrastructure.
Verification complexity
Section titled “Verification complexity”Ensuring the correct implementation of algorithms and test cases presents unique challenges in AI systems. Unlike traditional software, where outputs are deterministic, AI systems produce probabilistic results that can vary based on training data, initialization parameters, and even random factors introduced during training.
For AI components, understanding and defining nominal or unexpected data inputs is essential to demonstrate system robustness. This involves testing with adversarial examples, edge cases, and out-of-distribution data to ensure the system behaves appropriately even when faced with unfamiliar inputs.
While unit testing is valuable, integration testing often reveals failures that unit tests miss. A subtler verification challenge involves ensuring all logic paths and potential execution paths are adequately tested, which becomes exponentially more difficult in AI systems with complex decision boundaries.
Example: verification in computer vision
Section titled “Example: verification in computer vision”Consider a pedestrian detection system for autonomous vehicles. Unit tests might verify that the model correctly identifies pedestrians in a test dataset with high accuracy. However, integration testing might reveal that the system fails when camera inputs are affected by adverse weather conditions or unusual lighting. Even more concerning, adversarial testing might show that specific patterns on clothing could cause the system to miss detecting pedestrians entirely. Robust verification must account for all these scenarios.
Human interface complexity
Section titled “Human interface complexity”The roles and interactions between users and AI functionality must be clearly understood. This defines how information, warnings, alerts, and alarms will be activated, presented, and acted upon within the overall system.
The concept of levels of automation, as developed by Parasuraman et al. [3], provides a framework for understanding the division of responsibilities between human users and automated systems. Even highly autonomous AI systems require human configuration, oversight, and intervention capabilities.
If conflicts arise between user commands and AI system recommendations, the system must have clear protocols for adjudication. Similarly, the approach for user involvement in AI learning frameworks for model updates or improvements must be well-defined.
Explainability is a critical aspect of human interface design in AI systems. Users need to understand why an AI system made a particular recommendation or decision, especially in high-stakes domains such as healthcare, finance, and legal applications. This requires thoughtful design of explanation mechanisms that bridge the gap between complex mathematical models and human understanding.
Architecting in practice
Section titled “Architecting in practice”Complex software systems are rarely built from scratch, and architects typically don’t have complete command of all relevant technologies or domain expertise. This necessitates an architecting function distributed across a small team that typically includes the key roles called out in Figure 3.2.

Figure 3.2: Example organization chart for AI project teams
As illustrated in Figure 3.2 ’s organizational structure, AI project teams typically have the Project Manager at the top, with three key roles reporting directly to them: the Chief Architect, Specialty Engineers such as data engineers, data scientists, user interface developers, full stack developers, DevOps engineers, security engineers, operations analysts, compliance analysts, and project control analysts. This structure ensures that architectural concerns are given proper weight in project decisions, with the Chief Architect playing a crucial role in translating business requirements into technical specifications. Some key roles are outlined here:
- Vision Holder: This role focuses on the end customer’s needs and communicates the vision through technical documentation, presentations, diagrams, and working-level meetings. For AI systems, this role must understand both business objectives and the capabilities and limitations of AI technologies.
- Technology Expert: This role provides a specific understanding of the major components needed in the software system, including database technologies, middleware, user interface design, computational requirements, networking, and storage needs. In AI systems, this expertise extends to machine learning frameworks, model deployment technologies, and data management systems.
- AI Engineer: This role understands the data science or analytics process to ensure AI components meet the architectural vision and operate within technology constraints while delivering value to the end customer. This includes knowledge of machine learning algorithms, data preparation techniques, and model evaluation metrics.
The domain knowledge and AI/ML engineering roles should be tightly coupled since the ultimate goal is for AI/ML technology to deliver unique value to end customers. These functions come together to document and communicate the system vision.
A general rule of thumb from the systems engineering community is that architecting types of efforts should consume approximately 12–15% of project resources [5]. While this might seem unproductive initially, this up-front work saves time and prevents major technical errors later in the project, particularly in AI systems where architectural decisions can have far-reaching implications for system performance, maintainability, and scalability.
Approaches for taming software complexity
Section titled “Approaches for taming software complexity”The most visible artifacts from the architecting process are interrelated documents that guide system development. These include concept of operations documents, use cases, activity diagrams, logical diagrams, non-functional requirements specifications, metrics definitions, and the identification of software development tactics and patterns.
Developing the architecture
Section titled “Developing the architecture”Even the smallest projects should develop a Concept of Operations (CONOPS) document that justifies the AI-enabled system and explains how users will interact with it. The CONOPS document should describe how users will utilize the AI aspects of the system, how AI will be presented to customers, and how customers can impact AI decisions or outputs.
This document will also identify the major actors involved with the system and how AI/ML components will interact with them, if at all. The CONOPS document should delineate other systems that the AI system will interface with and how it fits into the larger system of systems. A recommended standard is the IEEE standard 1362-1998, “IEEE Guide for Information Technology –– System Definition –– Concept of Operations (ConOps) document.”
Another set of key artifacts developed by the architect is the description of the system through diagrams from the Unified Modeling Language (UML) or System Modeling Language (SysML). Not all UML or SML diagrams need to be developed.
The most common diagrams include the following:
- UML use case diagrams: Identify actors, roles, and actions that create value
- SysML block definition diagrams: Capture the major logical components of the system
- SysML activity diagrams: Show general flow of control
- UML state transition diagrams: Capture system states and transitions
- SysML interface control documents: Define data exchanges between components
- IDEF0 diagrams: Show inputs, objectives, constraints, and outputs of AI/ML decisions
These diagrams must capture the full cycle of AI/ML functionality, capturing decision-making processes. These diagrams should capture major logic decisions, error-handling approaches, model maintenance, validation, and re-training processes. Additionally, diagrams should show human interactions and control of the overall system. They should highlight key data engineering aspects, including data cleansing, transformation, and quality checks.
The data exchange interface is particularly critical for AI systems, defining how data exchange will be executed, including quality checks, volume, rates, and formats. This interface management and service-level agreements for data exchanges are part of data engineering, ensuring the system can be scalable, resilient, and perform within computational constraints. In the following chapters, more details and examples of these diagrams are presented.
As described by Bass et al. [4], software architecture is driven by non-functional requirements levied on the system. Examples include reliability, scalability, and usability. For AI/ML systems, common non-functional requirements include the following:
- Reliability: How the system handles failures and maintains operation
- Explainability: How the system explains its decisions and recommendations
- Fairness: How the system ensures equitable treatment across user groups
- Privacy: How the system protects sensitive data
- Adaptability: How the system evolves as data patterns change
Understanding and defining these requirements for AI/ML components is essential for successful system development.
Integration and cohesion
Section titled “Integration and cohesion”Complex AI/ML software systems require team development, demanding robust integration approaches established before integration activities begin. The architecture team doesn’t need complete implementation details, but must guide the process effectively.
Four main integration activities are as follows:
- Design adequacy assessment: Determining whether the design meets functional and non-functional requirements
- Non-functional requirements evaluation: Assessing how well the system satisfies quality attributes
- Metrics measurement: Initial determination of key system performance indicators
- Interface verification: Ensuring interfaces are correctly implemented and used
The architect must understand how different system components and data engineering impact the overall system. Integration issues inevitably arise, and the architect must carefully evaluate the impact of requirement changes across the system.
For example, a seemingly simple change in a database query response time could cause an AI component to receive out-of-sync data, leading to incorrect decisions. The architect must identify and address such dependencies early in the development process.
Integration typically is the first time non-functional requirements are tested. Addressing architectural-level issues early in the development lifecycle is critical. Late-stage architectural changes can have significant cascading effects on the system. Integration also provides the first opportunity to measure key system metrics and test interfaces between components. There exist several mechanisms and processes that help address integration challenges. The use of DevOps continuous integration/continuous deployment (CI/CD) techniques allows for the testing of new code in an automated way. This automation has steps set up where pre-defined integration testing happens as new code is developed and merged into the configured pre-production system baseline. The use of DevOps also allows for change management to identify areas of the baseline that were changed and are causing integration errors. Another advantage of a DevOps process is the rollback of a baseline in the event of an issue or undesired behavior from a production release.
Project management
Section titled “Project management”The architect plays a crucial role in project management, though they shouldn’t be the project manager due to other responsibilities. The architect contributes to the five major project management activities defined by the Program Management Institute in the Program Management Book of Knowledge:
Project initiation
Section titled “Project initiation”The architect helps develop key documents, including objectives, statement of work, work breakdown structure, schedule, and other project management documents. They clarify work scope, define milestones, and identify necessary resources, including staff type, level of effort, and supporting materials. Depending on the size of the project or the engineering culture of the organization, a system engineering team may exist. If this team is present, they work closely with the architect, identifying key features and work planning—for example, in an Agile development methodology, they aid in the creation of epics and user stories.
The architect also provides input on project execution methodology, such as Agile or spiral approaches.

Figure 3.3: Kanban board for Agile AI development
For AI projects, an Agile methodology such as Kanban (shown in Figure 3.3) often works well, allowing for a continuous flow of tasks and software development as models are refined and improved through iteration. The Kanban board visualizes work in three columns: TO DO for tasks that haven’t been started, DOING for tasks currently in progress, and DONE for completed tasks. There are other methods of organizing a Kanban board, with more stages. The authors chose to highlight the most basic type of board. Tasks can occur over a single or several execution cycles. In Agile, this is called a “sprint.”
Example activities to meet the criteria of “Done” in a sprint are as follows:
- There has been a code review
- Unit testing has been conducted
- The new code has been run through the CI/CD pipelines
- Human acceptance testing
An important note is that a feature may require several tasks over a longer period to be considered “Done.” The use of documentation and guidance from the architect aids in tracking and validation that a multi-sprint task is considered “Done.”
This visual management tool helps teams track progress and identify bottlenecks in the development process, which is particularly valuable for AI projects where tasks may have varying levels of complexity and uncertainty.
Project planning
Section titled “Project planning”During planning, the architect identifies major milestones and technical evidence requirements for milestone completion. They help determine team composition, effort allocation, and financial planning. The architect establishes reporting requirements and configuration control strategies for the architecture team.
For AI systems, planning must account for the iterative nature of model development, the uncertainty in algorithmic performance, and the need for continuous data collection and quality assurance.

Figure 3.4: Critical path analysis for AI system development
This planning process often involves critical path analysis, as depicted in Figure 3.4, which shows how different activities and dependencies affect the overall project timeline. In this network diagram, nodes represent project milestones (numbered 10 through 80), while edges represent activities (labeled A through I) with their associated durations (t=1 mo to t=4 mo). The critical path analysis helps project managers and architects identify which activities must be completed on time to prevent project delays, as well as which activities have slack time that can be utilized if resources need to be reallocated.
Project execution
Section titled “Project execution”In execution, the architect oversees work items allocated to their team and supports other engineering teams by providing insights and clarifications. They help the project manager track overall project execution and ensure integration activities will produce a coherent system.
The architect serves as a key resource for resolving technical conflicts, clarifying requirements, and ensuring design decisions align with the overall vision. This role becomes particularly important in AI systems where trade-offs between model accuracy, computational efficiency, and explainability must be carefully balanced.
Monitoring and control
Section titled “Monitoring and control”For monitoring and control, the architect provides quality checks and reviews of engineering efforts, giving the project manager updates on schedule and resource utilization. The architect helps interpret technical progress and identify potential risks before they impact project outcomes.
In AI projects, monitoring extends to tracking model performance metrics, data quality, and drift detection to ensure the system continues to meet requirements as it operates in the real world.
Project closing
Section titled “Project closing”In the closing phase, the architect ensures testing and certification are complete, advocating for the customer during final system validation. They work with the project manager on system deployment and delivery, providing the key artifacts required by the contract and statement of work.
For AI systems, closing activities might include knowledge transfer of model maintenance procedures, handover of monitoring tools, and documentation of future improvement opportunities.
Case study: AI project management in action
Section titled “Case study: AI project management in action”A financial services company implementing a fraud detection system using machine learning faced significant project management challenges. The initial project plan, based on traditional waterfall software development approaches, failed to account for the iterative nature of model development and the complexity of integrating with existing transaction processing systems.
The architecture team restructured the project using an Agile methodology around three-week sprints, with each sprint focusing on improving specific aspects of model performance while gradually expanding integration points. A key point of Agile methodology advocates the development of features in an iterative manner to get quick and impactful feedback from stakeholders. Also, by getting working code delivered sooner, the system could be tested and validated in a quicker manner, reducing total development time. They implemented early integration testing using synthetic data, allowing parallel development of both model components and system interfaces. This approach enabled them to identify and address integration issues early, ultimately delivering a system that reduced fraud losses by 37% while meeting all compliance requirements.
The authors do not intend to advocate for just an Agile methodology. Advantages of waterfall mechanisms are: robust requirements elicitation is done, and project control is more closely tracked through schedule definition and oversight of resources. Also, usually, time is allocated for robust documentation. Disadvantages of Agile methods are: a major function or interface is not accounted for, and Agile methods can lose architectural coherence. This happens when too much parallel development enables the execution of conflicting major design decisions. That said, we think that Agile methods with architecting aspects as described in this text are more effective in developing complex AI systems.
Summary
Section titled “Summary”In this chapter, we discussed how algorithmic decision-making in AI systems introduces unique forms of software complexity. We identified several dimensions of this complexity—integration, functional, technical, verification, and human interfaces—and explained how architecting processes and documentation applied early in the development project can help manage these challenges.
AI-enabled systems are not merely traditional software with an AI component bolted on; they represent a fundamentally different class of system that requires thoughtful architecture to achieve their potential. The role of the architect in these systems extends beyond technical design to include project management, stakeholder communication, and ensuring that the final system delivers the intended value.
As we progress through this book, we’ll build on these foundational concepts to explore specific AI techniques, implementation examples, and detailed architecting processes and development artifacts. These tools will equip you to successfully navigate the complexities of AI system development and create robust, valuable solutions that effectively leverage AI capabilities.
It is the position of the authors that architecting is best learned by doing. As one conducts more architecting tasks and projects, one can hone their skills. The following are some exercises that are done on different types of systems and will aid in the development of architecting skills.
Exercises
Section titled “Exercises”- Identify several component and process architecture products for an AI/ML system.
- Research and identify how CONOPS and requirements documents are used and integrated.
- Identify the major components of a complex website—such as Amazon, Google Maps, Zillow, or other systems where many components need to be integrated.
References
Section titled “References”- Gartner, “Gartner Says Nearly Half of CIOs Are Planning to Deploy Artificial Intelligence,” February 2018.
- Brown, T., et al., “Language Models are Few-Shot Learners,” Advances in Neural Information Processing Systems, 2020.
- Parasuraman, R., Sheridan, T.B., and Wickens, C.D., “A model for types and levels of human interaction with automation,” IEEE Transactions on Systems, Man, and Cybernetics-Part A: Systems and Humans, vol. 30, no. 3, pp. 286-297, 2000.
- Bass, L., Clements, P., and Kazman, R., “Software Architecture in Practice,” Addison-Wesley, 2012.
- International Council on Systems Engineering, “INCOSE Systems Engineering Handbook: A Guide for System Life Cycle Processes and Activities,” 4th Edition, 2015.