Architecture, Implementation, and Testing Architecture and Implementation Prescriptive architecture...

6
Architecture, Implementation, and Testing Architecture and Implementation • Prescriptive architecture vs. descriptive architecture • Prescriptive architecture: designed architecture, to be implemented by code into an executable system • Descriptive architecture: reconstructed architecture from an implemented/coded system. • Architecture drift and erosion • Architecture drift: a software system’s prescriptive architecture and descriptive architecture are different, i.e. the implementation did not exactly follow the prescriptive/designed architecture by extension, more details, and/or modifications. • Architecture erosion: a software system’s implementation, hence its descriptive architecture, changed the original architecture design significantly, that is, the implementation changed some major design decisions made by the architecture design.

Transcript of Architecture, Implementation, and Testing Architecture and Implementation Prescriptive architecture...

Page 1: Architecture, Implementation, and Testing Architecture and Implementation Prescriptive architecture vs. descriptive architecture Prescriptive architecture:

Architecture, Implementation, and TestingArchitecture and Implementation• Prescriptive architecture vs. descriptive architecture

• Prescriptive architecture: designed architecture, to be implemented by code into an executable system

• Descriptive architecture: reconstructed architecture from an implemented/coded system.

• Architecture drift and erosion• Architecture drift: a software system’s prescriptive architecture and descriptive architecture are different, i.e. the implementation did not exactly follow the prescriptive/designed architecture by extension, more details, and/or modifications.

• Architecture erosion: a software system’s implementation, hence its descriptive architecture, changed the original architecture design significantly, that is, the implementation changed some major design decisions made by the architecture design.

Page 2: Architecture, Implementation, and Testing Architecture and Implementation Prescriptive architecture vs. descriptive architecture Prescriptive architecture:

Architecture, Implementation, and TestingArchitecture and Implementation

Techniques to help keep the implementation code and the architecture consistent• Embedding the design in the code

• A key task for implementers is to faithfully execute the prescriptions of the architecture.• Architecture-evident coding style:

• Throughout the code, implementers can document the architectural concept or guidance that they are reifying.

• Frameworks• A framework is a reusable set of (implemented) libraries or classes for a software system.• Frameworks that are large and sophisticated often encode architectural interaction mechanisms, by encoding how classes (and objects derived from them) communicate and synchronized with each other.• A framework that provides a complete set of functionality for implementing an application in a particular domain is called a platform.• Architectural patterns can be implemented as frameworks

• Code templates• Keeping code and architecture consistent

Page 3: Architecture, Implementation, and Testing Architecture and Implementation Prescriptive architecture vs. descriptive architecture Prescriptive architecture:

Architecture, Implementation, and TestingArchitecture and Implementation

Techniques to help keep the implementation code and the architecture consistent• Code templates

• A template provides a structure within which some architecture-specific functionality is achieved, in consistent fashion system-wide.

• Many code generators, such as forward engineering from UML to Java code, produce a template into which a developer inserts code.

• Model-driven-development: from UML (architectural) models to generate code templates.

• Code templates have implications for reliability as once the template is debugged, then entire classes of coding errors across the entire system disappear.

• Templates represent a true common ground where the architecture and the implementation come together in a consistent and useful fashion.

Page 4: Architecture, Implementation, and Testing Architecture and Implementation Prescriptive architecture vs. descriptive architecture Prescriptive architecture:

Architecture, Implementation, and TestingArchitecture and Implementation

Techniques to help keep the implementation code and the architecture consistent• Keeping code and architecture consistent

• Types of architecture drift • No constraints imposed on the coders to follow the architecture.• Use the published architecture to start out, but when technical or scheduling problems are encountered, the architecture is abandoned and coders scramble to field the system as best they can.• After the system has been fielded, changes to it are accomplished with code change only, but these changes affect the architecture.

• Solution: to change an existing system which affect the system’s architecture, change the architecture first.

• Alternatives for achieving code alignment with the architecture when changing code first:

• Sync at lift-cycle milestone • Sync at crisis• Sync at check-in

Page 5: Architecture, Implementation, and Testing Architecture and Implementation Prescriptive architecture vs. descriptive architecture Prescriptive architecture:

Architecture, Implementation, and TestingArchitecture and Testing• Architecture cannot help but play an important role in testing.

• Levels of testing and architecture’s role• Unit testing

• Architecture defines the units: they are architectural elements in one or more of the module views.• Architecture defines the responsibilities and requirements assigned to each unit.• Unit testing cannot begin their work without the architecture.

• Integration testing• Incremental integration tests should be planned based on the architecture• The interfaces between elements involved in integration testing are part of the architecture.• Integration testing is where runtime quality attribute requirements can be tested.

•Acceptance testing• Acceptance testing involves stressing the system’s quality attribute behaviors by running it at extremely heavy loads, which should be based on the system’s architecture

Page 6: Architecture, Implementation, and Testing Architecture and Implementation Prescriptive architecture vs. descriptive architecture Prescriptive architecture:

Architecture, Implementation, and TestingArchitecture and Testing• Black-box and white-box testing

• Black-box testing: the architecture document where the requirements for a piece of the system are described.• White-box testing: code testing, less architecture role.• Grey-box testing: to test against the architectural structures

• Risk-based testing• Concentrates effort on areas where risk is perceived to be the highest.• Architecture can inform risk-based testing by contributing categories of risks to be considered.• Architecturally significant requirements are natural candidates for risk-based test cases.