第9章ソフトウェア工学
LINK TO LEARNING学習リンク
The IEEE Computer Society has proposed IEEE-Std-42010:2022, Software, Systems and Enterprise—Architecture Description (https://openstax.org/r/76IEEEEStd) as a standard that describes the use of architecture viewpoints, architecture frameworks, and architecture description languages (ADLs) as a means of codifying the conventions and common practices for architectural description.
英語のヒント
IEEE Computer Societyは、アーキテクチャの記述に用いる慣行や一般的な実践を成文化する手段として、アーキテクチャの視点、枠組み、アーキテクチャ記述言語(ADL)の利用を定める規格、IEEE-Std-42010:2022「ソフトウェア、システムおよび企業―アーキテクチャ記述」(https://openstax.org/r/76IEEEEStd)を提案している。
Software Design
ソフトウェア設計
The abstraction and refinement of requirements into a specification that can be used to help create a software solution is referred to as software design. Software design is a software engineering task set that is part of the DLD software engineering action. The focus of the DLD software engineering action is to detail or extend the HLD work products. As part of the DLD software engineering action, every element of a system is provided with detailed specifications, and the logic of each component within each module of a solution is determined.
要求を抽象化し、ソフトウェアによる仕組みの作成に使える仕様へと詳細化することを、ソフトウェア設計という。これはDLDのアクションに含まれるタスクの集合である。DLDでは、HLDの成果物を詳しくし、展開することを重視する。システムのあらゆる要素へ詳細な仕様を与え、各モジュール内の各構成要素の論理を決める。
Software design generally requires problem-solving skills as well as the ability to conceptualize framing as well as define it into a working specification that can be used to create a software solution. In contrast to the HLD software engineering action, the LLD software design task set is concerned with all the implementation details. In Agile approaches, we typically postpone many design decisions until implementation time and only design up front the parts that are tricky or that need to be solved in an unusual way.
英語のヒント
ソフトウェア設計には一般に、問題解決力に加え、枠組みを概念として捉え、仕組みを作るのに使える実用的な仕様として定義する能力が必要である。HLDとは異なり、LLDの設計タスクは、実装のあらゆる詳細を扱う。アジャイルでは通常、多くの設計判断を実装時まで延期し、扱いが難しい部分や、通常とは異なる方法で解決する必要がある部分だけを事前に設計する。
The main concepts that drive software design are:
ソフトウェア設計を導く主な概念は、次のとおりである。
• Abstraction: high-level representation of components such as data (or data objects) and procedures (the sequence of instructions that usually have specific and limited function)
• 抽象化:データやデータオブジェクト、手続きといった構成要素を、高水準で表現すること。手続きとは、通常は特定の限定的な機能を持つ、一連の命令である。
• Architecture: overall structure or organization of software components, ways components interact, and structure of data used by components; component-based software engineering (CBSE) can be considered as a task set as part of the DLD software engineering action to assemble solutions based on the reuse of preexisting components
• アーキテクチャ:ソフトウェアの構成要素の全体構造や編成、相互作用の方法、利用するデータの構造。コンポーネントベースのソフトウェア工学(CBSE)は、既存の部品を再利用して仕組みを組み立てるための、DLDの一部となるタスクの集合と考えられる。
• Design patterns: a design structure that solves a well-defined design problem within a specific context; pattern-based design can be considered as a task set as part of the DLD software engineering action to assemble solutions using implementation patterns and frameworks
• 設計パターン:特定の状況で、明確に定義された設計上の問題を解くための構造。パターンベースの設計は、実装パターンや枠組みを使って仕組みを組み立てるための、DLDの一部となるタスクの集合と考えられる。
• Separation of concerns: a technique based on the idea that any complex problem can be more easily handled if it is subdivided into pieces
• 関心の分離:どのような複雑な問題でも、部分に分ければ扱いやすくなるという考えに基づく技法。
• Modularity: compartmentalization of data and function
英語のヒント
• モジュール性:データと機能を区画に分けること。
• Information hiding: controlled interfaces that define and enforce access to component procedural detail and any local data structure used by the component
• 情報隠蔽:部品の手続きの詳細や、その部品が使う局所的なデータ構造へのアクセスを定義・制限する、管理されたインターフェース。
• Functional independence: single-minded (high cohesion) components with aversion to excessive interaction with other components (low coupling)
英語のヒント
• 機能的独立性:一つの目的に集中した、凝集度の高い部品が、ほかの部品との過剰なやり取りを避け、結合度を低く保つこと。
• Stepwise refinement: incremental elaboration of detail for all abstractions
• 段階的詳細化:すべての抽象的な表現について、詳細を少しずつ具体化すること。
• Refactoring: a reorganization technique that simplifies the design without changing functionality
• リファクタリング:機能を変えずに設計を単純化する、再構成の技法。
• Design classes: provide design detail that will enable analysis classes to be implemented
• 設計クラス:分析クラスを実装できるようにする、設計の詳細を与えるもの。
The work products generated as part of the DLD software engineering action are used to construct the actual solution. There are many other task sets that could be considered as part of the DLD, including prototype, user experience and user interface design, and specific design task sets for web, mobile, social, and gaming solutions design.
DLDで生み出す成果物は、実際の仕組みの構築に使う。そのほかにも、試作品、ユーザーエクスペリエンス、ユーザーインターフェースの設計や、Web、モバイル、ソーシャル、ゲーム向けの仕組みに固有の設計など、DLDに含められるタスクの集合は数多くある。
THINK IT THROUGH考えてみよう
Asking the Right Questions適切な問いを立てる
In 1998, the Mars Climate Orbiter was launched toward Mars to study its climate. Unfortunately, the lander was never able to complete its task. The probe ended up being destroyed by the Martian atmosphere due to an error in the mathematical calculations. However, the issue was not with the calculations but the numbering system that was used for distance measurements. The software in the probe used the metric system but the team from Earth that sent the data to the probe sent their values in imperial numbers. The result was a destroyed probe.
英語のヒント
1998年、火星の気候を調べるため、マーズ・クライメート・オービターが火星へ向けて打ち上げられた。残念ながら、この着陸機は任務を果たせなかった。探査機は、数学的計算の誤りによって火星の大気で破壊される結果となった。しかし、問題は計算そのものではなく、距離の測定に使った数値の体系にあった。探査機のソフトウェアはメートル法を使っていたが、地球からデータを送るチームはヤード・ポンド法の数値を送っていた。その結果、探査機は失われた。
Was this a design error? What could have been done to avoid a mistake such as using the wrong measurement system?
これは設計の誤りだったのだろうか。異なる測定単位系を使ってしまうといった間違いを避けるために、何ができただろうか。
Construction Framework Activity構築の活動
As part of the construction phase or framework activity, the design documents that result from the DLD software engineering action of the elaboration framework activity are used to write corresponding source code in a programming language as well as create any supporting assets such as deployable container images, databases, and controls. This is where the coding magic happens! Developers work to build the software based on the design created earlier. This phase involves writing code, testing individual components, and fixing defects/bugs.
英語のヒント
構築のフェーズでは、推敲のフェーズにおけるDLDの成果である設計文書を使い、プログラミング言語で対応するソースコードを書く。また、配備可能なコンテナーイメージ、データベース、制御部品など、必要な補助的な資産も作成する。いよいよコードを書く段階である。開発者は、先に作成した設計に基づいてソフトウェアを組み立てる。このフェーズには、コードの作成、個々の部品のテスト、欠陥やバグの修正が含まれる。
Source code may also be automatically generated from design work products using round-trip engineering tools, although this type of functionality is still limited today. The development methodology model-driven engineering, which is compatible with Agile methods, stresses the importance of formal and executable specifications of object models and the ability to verify the correctness and completeness of the solution by executing the models. This is typically made possible when using round-trip design engineering tools and frameworks that allow for the specification of models using standard modeling notations and the creation of evolvable software from these models (e.g., jBPM5 ).
英語のヒント
ラウンドトリップエンジニアリングのツールを使い、設計成果物からソースコードを自動生成することもできる。ただし、この機能は現在でも限られている。アジャイルの手法とも両立する、モデル駆動工学という開発方法論は、オブジェクトモデルの形式的で実行可能な仕様と、モデルの実行によって解決策の正しさや完全性を検証できることを重視する。通常、jBPM5のように、標準の記法でモデルを指定し、そこから発展可能なソフトウェアを作れるラウンドトリップ設計のツールや枠組みを使うことで、これが可能になる。
The result of the construction phase is a complete running solution that is based on the design work products and meets the expectations set forth as part of the inception phase. It should be noted that coding is a mechanistic outgrowth of procedural design, and errors can be introduced as the DLD design work products are translated into a programming language. This is particularly true if the programming language does not directly support data and control structures represented in the design. Code walk-throughs are designed to avoid this.
英語のヒント
構築のフェーズの成果は、設計成果物に基づき、立ち上げの段階で定めた期待を満たす、完全に動作する仕組みである。コードを書くことは、手続きの設計から機械的に派生する作業であることを押さえておこう。DLDの成果物をプログラミング言語へ移し替える際に、誤りが入り込むことがある。特に、設計で表したデータ構造や制御構造を、使用する言語が直接支援しない場合に問題が生じやすい。コードのウォークスルーは、このような事態を避けるために行う。
5 https://www.jbpm.org/
5 https://www.jbpm.org/
The field of DevOps, a wide-ranging collection of development and operations practices, has introduced further processes and infrastructure to automate many of the software engineering actions that are part of the construction phase. When these methodologies have been applied together, Agile methodologies and DevOps’ automation have increased the speed, robustness, and scalability with which software can be constructed.
英語のヒント
開発と運用に関する幅広い実践の集合であるDevOpsは、構築フェーズの多くのアクションを自動化するため、工程や基盤をさらに導入してきた。アジャイルの方法論とDevOpsの自動化を一緒に適用すると、ソフトウェアを構築する速さ、堅牢性、スケーラビリティが向上する。
Software engineers use many tools to implement solutions. These include code editors such as Atom, Integrated Development Environments (IDEs) such as VSCode or Visual Studio, version control systems such as Git, debugging tools, testing tools, and more.
エンジニアは実装のために、多くのツールを使う。Atomなどのコードエディター、VSCodeやVisual Studioなどの統合開発環境(IDE)、Gitなどの版管理システム、デバッグツール、テストツールなどがある。