Docsity

Design Principles & Architecture: Testability, Defensive Design, & Software, Slides of Banking and Finance

Partial preview of the text

Download Design Principles & Architecture: Testability, Defensive Design, & Software and more Slides Banking and Finance in PDF only on Docsity!

Design Principle 10: Design for Testability

Take steps to make testing easier

  • Design a program to automatically test the software —Discussed more in Chapter 10 —Ensure that all the functionality of the code can by driven by an external program, bypassing a graphical user interface
  • In Java, you can create a main() method in each class in order to exercise the other methods

Design Principle 11: Design defensively

Never trust how others will try to use a component you are designing

  • Handle all cases where other code might attempt to use your component inappropriately
  • Check that all of the inputs to your component are valid: the preconditions —Unfortunately, over-zealous defensive design can result in unnecessarily repetitive checking

9.3 Techniques for making good design

decisions

Using priorities and objectives to decide among alternatives

  • Step 1: List and describe the alternatives for the design decision.
  • Step 2: List the advantages and disadvantages of each alternative with respect to your objectives and priorities.
  • Step 3: Determine whether any of the alternatives prevents you from meeting one or more of the objectives.
  • Step 4: Choose the alternative that helps you to best meet your objectives.
  • Step 5: Adjust priorities for subsequent decision making.

Example priorities and objectives

Imagine a system has the following objectives, starting with top priority:

  • Security : Encryption must not be breakable within 100 hours of computing time on a 400Mhz Intel processor, using known cryptanalysis techniques.
  • Maintainability. No specific objective.
  • CPU efficiency. Must respond to the user within one second when running on a 400MHz Intel processor.
  • Network bandwidth efficiency : Must not require transmission of more than 8KB of data per transaction.
  • Memory efficiency. Must not consume over 20MB of RAM.
  • Portability. Must be able to run on Windows 98, NT 4 and ME as well as Linux

Using cost-benefit analysis to choose

among alternatives

  • To estimate the costs , add up: —The incremental cost of doing the software engineering work, including ongoing maintenance —The incremental costs of any development technology required —The incremental costs that end-users and product support personnel will experience
  • To estimate the benefits , add up: —The incremental software engineering time saved —The incremental benefits measured in terms of either increased sales or else financial benefit to users

9.5 Software Architecture

Software architecture is process of designing the global organization of a software system, including:

  • Dividing software into subsystems.
  • Deciding how these will interact.
  • Determining their interfaces. —The architecture is the core of the design, so all software engineers need to understand it. —The architecture will often constrain the overall efficiency, reusability and maintainability of the system.

Contents of a good architectural model

A system’s architecture will often be expressed in terms of several different views

  • The logical breakdown into subsystems
  • The interfaces among the subsystems
  • The dynamics of the interaction among components at run time
  • The data that will be shared among the subsystems
  • The components that will exist at run time, and the machines or devices on which they will be located

Design stable architecture

To ensure the maintainability and reliability of a system, an architectural model must be designed to be stable****.

  • Being stable means that the new features can be easily added with only small changes to the architecture

Developing an architectural model

  • Refine the architecture —Identify the main ways in which the components will interact and the interfaces between them —Decide how each piece of data and functionality will be distributed among the various components —Determine if you can re-use an existing framework, if you can build a framework
  • Consider each use case and adjust the architecture to make it realizable
  • Mature the architecture

Describing an architecture using UML

  • All UML diagrams can be useful to describe aspects of the architectural model
  • Four UML diagrams are particularly suitable for architecture modelling: —Package diagrams —Subsystem diagrams —Component diagrams —Deployment diagrams