プリンキピア

第9章ソフトウェア工学

9.3 Special Topics9.3 個別の重要な話題

Learning Objectives学習目標
By the end of this section, you will be able to:
この節を終えると、次のことができるようになる。
• Explain the importance of testing in software engineering
• ソフトウェア工学におけるテストの重要性を説明する
• Describe the types of tools used by software engineers
• ソフトウェアエンジニアが使うツールの種類を説明する
• Describe ways that software reuse is made possible
• ソフトウェアを再利用できるようにする方法を説明する
• Explain the role of ethics in software engineering
• ソフトウェア工学における倫理の役割を説明する
• Discuss the future of software engineering
• ソフトウェア工学の将来について論じる
The role of a software engineer is wide-ranging, and the factors that impact software engineers are many. There are a few areas, however, that are worth delving into deeper. These areas include software testing, refactoring, design patterns, software tools used in software development, software reuse, free and open-source software (FOSS), software engineering ethics, and legal aspects.
英語のヒント
ソフトウェアエンジニアの役割は多岐にわたり、影響を及ぼす要因も数多い。その中でも、より深く掘り下げる価値のある分野がいくつかある。ソフトウェアテスト、リファクタリング、デザインパターン、ソフトウェア開発に使うソフトウェアツール、ソフトウェアの再利用、自由かつオープンソースのソフトウェア(FOSS)、ソフトウェア工学の倫理、法的側面などである。

Testingテスト

The purpose of testing is to verify that the software being developed delivers on the requirements that were set for the project without any unintended errors or side effects. In simple terms, it is to make sure software does what it was expected to do. Through this process of confirming that the software meets expectations, any issues that are found can be resolved to ensure the integrity of the product
英語のヒント
テストの目的は、開発中のソフトウェアが意図しないエラーや副作用を起こすことなく、プロジェクトに設定した要求を満たすと確かめることにある。簡単に言えば、ソフトウェアが期待どおりのことを行うと確認することである。ソフトウェアが期待を満たすと確かめるこのプロセスを通して、見つかった問題を解決し、製品の健全性を確保できる。
Testing should happen within nearly every phase of a project, with each phase having a specific testing focus. One axiom of testing is to test early and test often. As can be seen in Figure 9.17, the earlier issues can be found when developing software, the less costly they are to fix or resolve. Issues are generally found as a result of testing.
英語のヒント
テストは、プロジェクトのほぼすべてのフェーズで行うべきであり、各フェーズで重点を置く対象は異なる。テストの基本原則の一つは、早期に、しかも頻繁にテストすることである。図9.17から分かるように、ソフトウェア開発中の問題は早く見つけるほど、修正や解決にかかる費用が少なくなる。問題は一般にテストの結果として見つかる。
Figure 9.17

attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license · CC BY 4.0 · Source出典

Figure 9.17 The cost of finding issues rises through the life of a software development project; for example, the later a bug is found, the more it costs to fix. (attribution: Copyright Rice University, OpenStax, under CC BY 4.0 license)
図9.17 問題の発見にかかる費用は、ソフトウェア開発プロジェクトの進行とともに上昇する。たとえば、バグを発見する時期が遅いほど、修正の費用が大きくなる。(帰属:Rice University、OpenStax著作権、CC BY 4.0ライセンス。)
Levels of Testingテストの水準
Software goes through various levels of testing to ensure quality:
品質を確保するために、ソフトウェアにはさまざまな水準のテストを行う。
• Unit testing: Individual software components (functions or methods) are tested in isolation to verify they work as intended.
英語のヒント
• 単体テスト:個々のソフトウェア部品(関数やメソッド)をほかから切り離してテストし、意図どおりに動作するかを確かめる。
• Integration testing: Focuses on interfaces between components, ensuring they work together seamlessly.
英語のヒント
• 結合テスト:部品間のインターフェースに重点を置き、部品同士が継ぎ目なく連携して動作することを確かめる。
• System testing: Tests the entire software system as a whole, verifying it meets overall requirements.
英語のヒント
• システムテスト:ソフトウェアシステム全体を一つのまとまりとしてテストし、全体に対する要求を満たすと確かめる。
In addition to the various levels of testing, there are other crucial testing approaches that are used to ensure that software delivers to expectations. These approaches include:
英語のヒント
さまざまな水準のテストに加え、ソフトウェアが期待に応えることを確かめるための、ほかの重要なテスト手法もある。次のようなものが挙げられる。
• Acceptance testing: verifies that the software meets the expectations and requirements defined by the client or end users
• 受け入れテスト:顧客やエンドユーザーが定めた期待と要求を、ソフトウェアが満たしているかを検証する。
• Usability testing: evaluates how easy and intuitive the software is for users to interact with
英語のヒント
• ユーザビリティテスト:ユーザーがどの程度簡単かつ直感的にソフトウェアを操作できるかを評価する。
• Stress testing: assesses how the software performs under heavy loads or unfavorable conditions
英語のヒント
• ストレステスト:高い負荷や不利な条件の下で、ソフトウェアがどのように動作するかを評価する。
• Performance testing: evaluates the speed, responsiveness, and scalability of the software under various conditions
英語のヒント
• 性能テスト:さまざまな条件下で、ソフトウェアの速度、応答性、スケーラビリティを評価する。
• Security testing: identifies and addresses security vulnerabilities to protect against unauthorized access or data breaches
英語のヒント
• セキュリティテスト:不正アクセスやデータ漏えいを防ぐために、セキュリティ上の脆弱性を特定し、対処する。
Some testing is done by software developers, including software engineers who write code, but a majority of testing is done by quality engineers whose primary focus is testing. End users can also participate in acceptance testing or user testing scenarios.
英語のヒント
テストの一部は、コードを書くソフトウェアエンジニアを含むソフトウェア開発者が行うが、大半はテストを主な仕事とする品質エンジニアが行う。エンドユーザーも、受け入れテストやユーザーテストのシナリオに参加できる。
CONCEPTS IN PRACTICE概念を実際に使う
How Does Microsoft Test Windows Before Release?Microsoftは公開前のWindowsをどのようにテストするのか
Microsoft uses millions of testers before deploying a new update of Windows. These testers are a part of the Windows Insider program and have access to the prerelease versions of Windows. Anyone can sign up for this program; they just need to agree to test the new version and provide Microsoft with feedback. Because testing is done on a prerelease version of the software, the testers know that the software may be unstable and will likely have issues. If you are curious about testing—or are interested in becoming a tester yourself—visit Microsoft Windows Insider (https://openstax.org/r/76WdwsInsider) or Apple’s Beta Software Program (https://openstax.org/r/76BetaSoftware) for more information.
英語のヒント
Microsoftは、Windowsの新しい更新を配布する前に、数百万人のテスターを活用している。こうしたテスターはWindows Insiderプログラムに参加し、Windowsの公開前のバージョンを利用できる。このプログラムには誰でも登録でき、新しいバージョンをテストしてMicrosoftにフィードバックを提供することに同意すればよい。テスト対象は公開前のソフトウェアであるため、テスターは、そのソフトウェアが不安定であり、問題を含んでいる可能性が高いと承知している。テストに関心がある場合、あるいは自分もテスターになりたい場合は、Microsoft Windows Insider(https://openstax.org/r/76WdwsInsider)またはAppleのBeta Software Program(https://openstax.org/r/76BetaSoftware)を訪れると、さらに詳しい情報が得られる。
Methodologies of Testingテストの方法論
There are three primary testing methodologies, and they are categorized by the knowledge the tester has (or needs to have) to conduct to the tests. The three methodologies are:
英語のヒント
主なテストの方法論は三つあり、テスターがテストの実施に際して持っている知識、あるいは持つ必要のある知識によって分類される。三つの方法論は次のとおりである。
• The manner of testing where the tester is aware of the code, so they can test that the internal structure of the item being tested works properly, is called white box testing. Other names for white box testing include glass box, clear box, and structural testing.
英語のヒント
• テスターがコードを把握しており、テスト対象の内部構造が正しく機能するかを試せるテストの方法を、ホワイトボックステストという。グラスボックステスト、クリアボックステスト、構造テストとも呼ばれる。
• Tests based on requirements and the functionality of what is being tested without the need to focus on the code itself is called black box testing. The tester does not need to have any knowledge of the code. Other names for black box testing include input-output testing, specification-based testing, and behavioral testing.
英語のヒント
• コード自体に着目する必要がなく、要求とテスト対象の機能に基づいて行うテストを、ブラックボックステストという。テスターはコードに関する知識をまったく持たなくてもよい。入出力テスト、仕様に基づくテスト、振る舞いテストとも呼ばれる。
• The hybrid of both white box and black box testing is called gray box testing. The person who designs the test has a partial knowledge of code structure and understands the intended design of the software.
英語のヒント
• ホワイトボックステストとブラックボックステストを組み合わせたものを、グレーボックステストという。テストを設計する人はコード構造について部分的な知識を持ち、ソフトウェアの意図された設計を理解している。
When testing at the testing system level, we distinguish between verification and validation. Testing that the software solution functions without errors is called verification. In organizations that have large development teams, verification is often done by a Quality Assurance (QA) team. Testing that the software solution conforms to the requirements and does what the user wants it to do is called validation. Both verification and validation require code execution and can happen in all levels of testing, with verification generally taking place before validation.
英語のヒント
システムの水準でテストするときには、検証と妥当性確認を区別する。ソフトウェアによる仕組みがエラーなく機能するとテストすることを、検証という。大規模な開発チームを持つ組織では、品質保証(QA)チームが検証を行うことが多い。ソフトウェアによる仕組みが要求に適合し、ユーザーがさせたいことを実行するとテストすることを、妥当性確認という。検証も妥当性確認もコードの実行を必要とし、どの水準のテストでも行うことができる。一般に、検証は妥当性確認の前に行われる。
Testing is also distinguished by purpose into functional and nonfunctional testing. With functional testing, the functionality is tested. With nonfunctional testing, qualities such as performance, scalability, and usability are tested.
テストは、目的によって機能テストと非機能テストにも分けられる。機能テストでは機能をテストする。非機能テストでは、性能、スケーラビリティ、使いやすさなどの品質をテストする。
The attributes of a good test are as follows:
よいテストには、次のような特徴がある。
• A good test has a high probability of finding an error or issue.
• エラーや問題を見つける可能性が高い。
• A good test is not redundant. (It does not test the same thing as another test.)
英語のヒント
• 重複がない。(ほかのテストと同じことをテストしない。)
• A good test should be neither too simple nor too complex.
• 単純すぎず、複雑すぎない。