markdown
ソフトウェア工学の基本md 2ebcef9
lecture/information/software-engineering/software-engineering-basics.lecture.n.md
Download PDF

ソフトウェア工学こうがく基本きほん

date2026-07-14document_iddoc_ec524c19bcca1707ba56c325ebfdbfdbdescription要求、設計、テスト、版管理、運用、保守の関係からソフトウェア工学の基礎を説明する。prerequisitesプログラミング基礎 / 計算機システムの基本 / データベースとSQLの基本type講義statusactiverelateddata/lecture/information/software-engineering/software-engineering-portal.lecture.n.md / data/lecture/information/database/sql-basics.lecture.n.md / data/lecture/information/communications/communications-engineering-portal.lecture.n.md
informationsoftware-engineeringundergraduatelecture
data/lecture/information/software-engineering/software-engineering-portal.lecture.n.md

1導入どうにゅう

この講義こうぎでは、要求ようきゅうから運用うんよう保守ほしゅまでのライフサイクルをつうじて、ソフトウェアの品質ひんしつ変更可能性へんこうかのうせい管理かんりする方法ほうほう説明せつめいする。

プログラムが計算結果けいさんけっかかえすことは、ソフトウェアの品質ひんしつ一部いちぶにすぎない。利用者りようしゃ要求ようきゅうとの一致いっち障害時しょうがいじ信頼性しんらいせい攻撃こうげきたいするセキュリティ、変更へんこうのしやすさなども評価ひょうかする必要ひつようがある。ソフトウェア工学こうがくは、これらを個別こべつ工夫くふうではなく、体系的たいけいてき開発かいはつ運用活動うんようかつどうとしてあつかう。

2要求ようきゅう受入条件うけいれじょうけん

要求ようきゅうRequirement は、システムが提供ていきょうすべき機能きのうまたはたすべき制約せいやくである。

  • 機能要求きのうようきゅうFunctional requirement は、システムが実行じっこうすべき処理しょり提供ていきょうすべき機能きのう規定きていする。
  • 非機能要求ひきのうようきゅうNon-functional requirement は、性能せいのう可用性かようせい、セキュリティ、使用性しようせいなど、機能きのう品質ひんしつ制約せいやく規定きていする。

要求ようきゅうを「高速こうそくである」のような曖昧あいまい表現ひょうげんだけで記述きじゅつすると、実装じっそう完了かんりょう判定はんていできない。受入条件うけいれじょうけんAcceptance criterion は、要求ようきゅうたされたと判断はんだんするための観測可能かんそくかのう条件じょうけんである。たとえば「同時どうじに1000けん要求ようきゅう処理しょりしたとき、95%の応答おうとうを200 ms以内いないかえす」と記述きじゅつすれば、性能せいのう測定そくていできる。

3設計せっけい変更へんこう局所化きょくしょか

設計せっけいDesign は、要求ようきゅう実現じつげんするために、システムの構成要素こうせいようそ責務せきむ、および構成要素間こうせいようそかん関係かんけいさだめる活動かつどうである。設計せっけい目的もくてきは、たんにファイルやクラスを分割ぶんかつすることではない。ひとつの変更理由へんこうりゆう多数たすう構成要素こうせいようそ波及はきゅうしないように、責務せきむ配置はいちする。

凝集度ぎょうしゅうどCohesion は、ひとつの構成要素こうせいようそぞくする責務せきむがどの程度ていどまとまっているかをあらわす。結合度けつごうどCoupling は、構成要素間こうせいようそかん依存いぞんつよさをあらわす。一般いっぱんに、関連かんれんする責務せきむたか凝集度ぎょうしゅうどでまとめ、構成要素間こうせいようそかん結合度けつごうど必要最小限ひつようさいしょうげんにすると、変更へんこう影響えいきょう局所化きょくしょかしやすい。ただし、分割ぶんかつ過度かどすすめると、インターフェースと通信つうしん複雑性ふくざつせい増加ぞうかする。

インターフェースInterface は、構成要素こうせいようそ外部がいぶ公開こうかいする操作そうさ情報じょうほう境界きょうかいである。入力にゅうりょく前提条件ぜんていじょうけん出力しゅつりょく保証ほしょう失敗時しっぱいじ応答おうとう明示めいじすると、内部実装ないぶじっそう変更へんこうしても利用側りようがわへの影響えいきょう抑制よくせいできる。

4テストと検証けんしょう水準すいじゅん

テストTest は、入力にゅうりょく実行条件じっこうじょうけん設定せっていし、観測結果かんそくけっか期待結果きたいけっか比較ひかくして欠陥けっかん検出けんしゅつする活動かつどうである。テストが成功せいこうしても、未実行みじっこう入力にゅうりょく状態じょうたい欠陥けっかんがないことまでは証明しょうめいできない。このため、要求ようきゅうとリスクにおうじて試験範囲しけんはんい設計せっけいする。

  • 単体たんたいテストUnit test は、関数かんすうやモジュールなどのちいさな単位たんい検証けんしょうする。
  • 結合けつごうテストIntegration test は、データベース、ネットワーク、モジュールなどの境界きょうかいかいした連携れんけい検証けんしょうする。
  • システムテストは、統合とうごうされたシステムがシステム要求ようきゅうたすかを検証けんしょうする。
  • 受入うけいれテストAcceptance test は、利用者りようしゃ発注者はっちゅうしゃ観点かんてんから受入条件うけいれじょうけん評価ひょうかする。

修正しゅうせいによって既存機能きそんきのうそこなわれることを回帰かいきRegressionという。自動化じどうかされた回帰かいきテストを変更へんこうごとに実行じっこうすると、既知きちいが維持いじされているかを継続的けいぞくてき確認かくにんできる。

5変更管理へんこうかんり運用うんよう保守ほしゅ

版管理はんかんりVersion control は、ソースコード、設定せってい、ドキュメントなどの変更履歴へんこうりれき識別可能しきべつかのうはんとして記録きろくする。継続的けいぞくてきインテグレーションContinuous integrationは、開発者かいはつしゃ変更へんこう共有きょうゆうされた主系列しゅけいれつ頻繁ひんぱん統合とうごうし、そのたびに自動じどうビルドとテストの結果けっか実践じっせんである。これにより、複数ふくすう変更へんこう不整合ふせいごう早期そうき検出けんしゅつできる。レビューは変更内容へんこうないよう検討けんとうする補完的ほかんてき活動かつどうである。

運用うんようOperation は、配備はいびしたシステムを利用可能りようかのう状態じょうたい維持いじする活動かつどうである。構成こうせい管理かんりし、稼働状態かどうじょうたい監視かんしし、障害しょうがいやセキュリティインシデントへ対応たいおうする。監視結果かんしけっかとインシデントの記録きろくは、あらたな要求ようきゅう保守ほしゅ優先順位ゆうせんじゅんい反映はんえいする。

保守ほしゅMaintenance は、運用開始後うんようかいしごにソフトウェアを修正しゅうせいし、環境かんきょう適応てきおうさせ、または品質ひんしつ改善かいぜんする活動かつどうである。障害しょうがい修正しゅうせいだけでなく、あたらしい要求ようきゅう依存技術いぞんぎじゅつ更新こうしん性能改善せいのうかいぜん、セキュリティの強化きょうかふくむ。

短期的たんきてき納期のうき優先ゆうせんして設計上せっけいじょう問題もんだいのこすと、将来しょうらい変更費用へんこうひよう増加ぞうかすることがある。この将来費用しょうらいひよう技術的負債ぎじゅつてきふさいTechnical debtとしてとらえる。技術的負債ぎじゅつてきふさい比喩ひゆであり、すべての未改善箇所みかいぜんかしょただちに解消かいしょうすべきことを意味いみしない。影響えいきょう費用ひよう評価ひょうかして返済へんさい優先順位ゆうせんじゅんいさだめる。

6品質特性ひんしつとくせいとトレードオフ

品質ひんしつには、機能適合性きのうてきごうせい信頼性しんらいせい性能効率性せいのうこうりつせい使用性しようせい、セキュリティ、保守性ほしゅせいなどの複数ふくすう特性とくせいがある。すべての特性とくせい無制限むせいげん最大化さいだいかすることはできない。たとえば、冗長化じょうちょうか可用性かようせいたかめる一方いっぽうで、構成こうせい運用うんよう複雑ふくざつにする。要求ようきゅう、リスク、費用ひよう明示めいじし、トレードオフを合意ごういすることが設計判断せっけいはんだんとなる。

7具体例ぐたいれい:データベースを利用りようする履修登録りしゅうとうろくシステム

履修登録りしゅうとうろくシステムでは、「学生がくせい科目かもく登録とうろくできる」が機能要求きのうようきゅうとなる。「定員ていいんえる登録とうろく許可きょかしない」「二重登録にじゅうとうろく防止ぼうしする」は、受入条件うけいれじょうけんとして検証けんしょうできる。設計せっけいでは、画面がめん登録規則とうろくきそく、SQL による永続化えいぞくかことなる責務せきむとして分離ぶんりする。

単体たんたいテストは登録規則とうろくきそくを、結合けつごうテストはアプリケーションとデータベースのトランザクションを、受入うけいれテストは利用者りようしゃ操作手順そうさてじゅん検証けんしょうする。要件変更ようけんへんこうによって抽選方式ちゅうせんほうしき導入どうにゅうするとき、責務せきむ分離ぶんり回帰かいきテストが変更へんこう影響範囲えいきょうはんい明確めいかくにする。

8要点ようてん

  • 要求ようきゅう受入条件うけいれじょうけんは、実装じっそうとテストの共通基準きょうつうきじゅんとなる。
  • 設計せっけい責務せきむとインターフェースをさだめ、変更へんこう影響えいきょう局所化きょくしょかする。
  • テストは欠陥けっかん検出けんしゅつするが、欠陥けっかん存在そんざいしないことの一般的いっぱんてき証明しょうめいではない。
  • 版管理はんかんり、レビュー、継続的けいぞくてきインテグレーションは、変更へんこう追跡ついせきし、統合時とうごうじ問題もんだい早期そうき検出けんしゅつする。
  • 品質特性間ひんしつとくせいかんのトレードオフは、要求ようきゅう、リスク、費用ひようもとづいて判断はんだんする。

9つぎすす講義こうぎ

ソフトウェアを複数ふくすう機器きき拠点きょてんにまたがるシステムとして構成こうせいするには、情報じょうほう信号しんごうとして伝送でんそうする仕組しくみも必要ひつようとなる。つぎのポータルでは、通信つうしんささえる信号しんごう雑音ざつおん変調へんちょうなどをあつかう。

data/lecture/information/communications/communications-engineering-portal.lecture.n.md

Software Engineering Fundamentals

data/lecture/information/software-engineering/software-engineering-portal.lecture.n.md

1Introduction

This lecture explains how to manage software quality and changeability throughout the lifecycle from requirements to operation and maintenance.

Producing a computed result is only one aspect of software quality. A system must also be evaluated for conformance to user requirements, reliability under failure, security against attacks, and ease of change. Software engineering treats these concerns through systematic development and operational activities rather than as isolated implementation techniques.

2Requirements and Acceptance Criteria

A requirementRequirement is a capability that a system must provide or a constraint that it must satisfy.

  • A functional requirementFunctional requirement specifies behavior or functionality that the system must provide.
  • A non-functional requirementNon-functional requirement specifies quality or constraints such as performance, availability, security, and usability.

An ambiguous statement such as “the system must be fast” does not determine when implementation is complete. An acceptance criterionAcceptance criterion is an observable condition for deciding whether a requirement has been satisfied. For example, “when processing 1,000 concurrent requests, return 95 percent of responses within 200 ms” makes performance measurable.

3Design and Localization of Change

DesignDesign is the activity of defining a system's components, their responsibilities, and their relationships in order to realize requirements. Its purpose is not merely to divide code into files or classes. Responsibilities should be arranged so that one reason for change does not propagate through many components.

CohesionCohesion describes how closely the responsibilities within one component belong together. CouplingCoupling describes the strength of dependencies between components. In general, grouping related responsibilities with high cohesion and limiting coupling helps localize change. Excessive decomposition, however, increases the complexity of interfaces and communication.

An interfaceInterface is the boundary of operations and information that a component exposes. Stating input preconditions, output guarantees, and failure behavior limits the effect on clients when an internal implementation changes.

4Testing and Levels of Verification

TestingTest is the activity of configuring inputs and execution conditions and comparing observed results with expected results to detect defects. A successful test does not prove that no defect exists for unexecuted inputs or states. Test coverage must therefore be designed according to requirements and risk.

  • A unit testUnit test verifies a small unit such as a function or module.
  • An integration testIntegration test verifies interaction across boundaries such as modules, databases, or networks.
  • A system test verifies the integrated system against system requirements.
  • An acceptance testAcceptance test evaluates acceptance criteria from the perspective of a user or customer.

A change that damages existing behavior causes a regressionRegression. Running automated regression tests after each change continuously checks whether established behavior remains intact.

5Change Management, Operation, and Maintenance

Version controlVersion control records the history of source code, configuration, and documentation as identifiable versions. Continuous integrationContinuous integration is the practice of frequently integrating changes into a shared mainline and obtaining automated build and test feedback for each integration. It detects inconsistencies among changes early. Review is a complementary activity that examines the content of a change.

OperationOperation is the activity of keeping a deployed system available for use. It includes managing configuration, monitoring operational state, and responding to failures and security incidents. Monitoring results and incident records inform new requirements and maintenance priorities.

MaintenanceMaintenance is the activity of correcting software, adapting it to its environment, or improving its quality after deployment. It includes not only defect correction but also new requirements, dependency updates, performance improvement, and security strengthening.

Prioritizing a short-term deadline can leave design problems that increase the cost of future change. This future cost can be described as technical debtTechnical debt. Technical debt is a metaphor; it does not imply that every imperfection must be removed immediately. Teams evaluate impact and cost to prioritize repayment.

6Quality Attributes and Trade-offs

Quality comprises multiple attributes, including functional suitability, reliability, performance efficiency, usability, security, and maintainability. These attributes cannot all be maximized without limit. Redundancy, for example, can improve availability while making configuration and operation more complex. A design decision makes the relevant requirements, risks, and costs explicit and establishes an agreed trade-off.

7Example: A Database-Backed Course Registration System

In a course registration system, “a student can register for a course” is a functional requirement. “Do not permit registration beyond capacity” and “prevent duplicate registration” can be verified as acceptance criteria. The design separates the user interface, registration rules, and SQL-based persistence as distinct responsibilities.

Unit tests verify registration rules, integration tests verify transactions between the application and database, and acceptance tests verify the user's workflow. When a requirement change introduces a lottery, separated responsibilities and regression tests clarify the affected scope.

8Key Points

  • Requirements and acceptance criteria provide a shared basis for implementation and testing.
  • Design defines responsibilities and interfaces to localize the effects of change.
  • Testing detects defects but does not generally prove their absence.
  • Version control, review, and continuous integration track change and detect integration problems early.
  • Trade-offs among quality attributes are decided according to requirements, risks, and costs.

9Next Lecture

Systems spanning multiple devices or sites also require mechanisms that transmit information as signals. The next portal addresses signals, noise, modulation, and other foundations of communication.

data/lecture/information/communications/communications-engineering-portal.lecture.n.md
raw .n.md をコピー
loc をコピー (filepath:line ~ line)
copy share link
copy encoded share link
path をコピー
copy share link
copy encoded share link
copy share link
copy encoded share link
タブを全て閉じる