1. Trang chủ
  2. » Công Nghệ Thông Tin

OOP 01

41 141 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 41
Dung lượng 509,5 KB

Nội dung

CHAPTER Software Quality Contents • Introduction • Why worry? • Software Quality NNL – Khoa Toán Tin ĐHKHTN Introduction • Computer science is not just programming and that, instead, programming is just a tool of a computer scientist • Unfortunately, students might not have been taught the advantages and disadvantages of the different ways to write programs to solve the same problem NNL – Khoa Toán Tin ĐHKHTN Introduction • For example, consider the problem of writing module that is supposed to maintain a collection of people and the dogs they own – Should the collection be a hash table or an array or some other kind of collection? – Should the collection contain Person objects or maybe Person-Dog pairs of objects? – Should a Dog object have an instance variable pointing to its owner? NNL – Khoa Toán Tin ĐHKHTN Introduction – Should owners have an instance variable that refers to a collection of the dogs they own? If so, what kind of collection should it be? What other data should the Person object store? – Should you keep the collection of people sorted for easier lookup? – If a person’s only dog dies, should that person be removed from the collection or left in as a person who owns no dogs? NNL – Khoa Tốn Tin ĐHKHTN Introduction • If two designs, one with few classes and methods and one with many, both solve a problem, does it matter which one you use? • Similarly, if all versions of a loop correctly a computation, does it matter which one you use? • If two algorithms both work correctly, does it matter that one is faster than the other NNL – Khoa Toán Tin ĐHKHTN Introduction • The answer is, “Yes, it really does matter.” • We will learn to know not just what works, but also what makes some software “ugly” and other software “elegant” or “beautiful.” • How to develop a sense of aesthetics for designs and code NNL – Khoa Tốn Tin ĐHKHTN Why Worry? • A programmer who quickly throws together some code without considering design criteria might justify his actions by saying that he knows what is going on in the code and so there is no need to worry about a misinterpretation • In the case of small “quick-and-dirty” programs written by one person and used only once, the programmer is correct NNL – Khoa Tốn Tin ĐHKHTN Why worry? • However, you also need to be aware that code that the programmer thought of as “throwaway” is often not thrown away In such cases, time devoted to make the design elegant would be time productively spent • Designing software that is intended for longterm, heavy use requires a considerable investment of time and energy NNL – Khoa Toán Tin ĐHKHTN Why worry? • For large systems, in which many programmers are involved, it is even more important to spend a significant amount of time on the analysis of the problem and the design of the solution • If the solution has not been well designed, a change by one programmer in one line of code could easily introduce bugs in the code written by other programmers NNL – Khoa Toán Tin ĐHKHTN 10 Software Quality • The software community shows two typical attitudes towards efficiency: – Some developers have an obsession with performance issues, leading them to devote a lot of efforts to presumed optimizations – But a general tendency also exists to downplay efficiency concerns, as evidenced by such industry lore as “make it right before you make it fast” and “next year’s computer model is going to be 50% faster anyway” NNL – Khoa Toán Tin ĐHKHTN 27 Software Quality Portability • Portability is the ease of transferring software products to various hardware and software environments • Portability addresses variations not just of the physical hardware but more generally of the hardware-software machine NNL – Khoa Toán Tin ĐHKHTN 28 Software Quality Ease of use • Ease of use is the ease with which people of various backgrounds and qualifications can learn to use software products and apply them to solve problems It also covers the ease of installation, operation and monitoring – User Interface Design principle: Do not pretend you know the user; you don’t NNL – Khoa Toán Tin ĐHKHTN 29 Software Quality Functionality • Functionality is the extent of possibilities provided by a system (how much functionality is enough) NNL – Khoa Toán Tin ĐHKHTN 30 Software Quality Timeliness • Timeliness is the ability of a software system to be released when or before its users want it NNL – Khoa Toán Tin ĐHKHTN 31 Software Quality • Other qualities – Verifiability is the ease of preparing acceptance procedures, especially test data, and procedures for detecting failures and tracing them to errors during the validation and operation phases – Integrity is the ability of software systems to protect their various components (programs, data) against unauthorized access and modification NNL – Khoa Toán Tin ĐHKHTN 32 Software Quality • Other qualities – Repairability is the ability to facilitate the repair of defects – Economy, the companion of timeliness, is the ability of a system to be completed on or below its assigned budget NNL – Khoa Toán Tin ĐHKHTN 33 Software Quality • Documentation: The need for documentation is a consequence of the other quality factors seen above • Three kinds of documentations: – External documentation – Internal documentation – Module interface documentation NNL – Khoa Toán Tin ĐHKHTN 34 Software Quality – The need for external documentation, is a consequence of the definition of ease of use – The need for internal documentation, is a consequence of the extendibility requirement – The need for module interface documentation, is a consequence of the reusability requirement extendibility NNL – Khoa Toán Tin ĐHKHTN 35 Software Quality Four stand out qualities: • Correctness and robustness: it is still too difficult to produce software without defects (bugs), and too hard to correct the defects once they are there • Extendibility and reusability: software should be easier to change; the software elements we produce should be more generally applicable NNL – Khoa Tốn Tin ĐHKHTN 36 Software Quality – Int Factors • Scalability—is the ability of a software to perform correctly and efficiently when the problems grow in size by several orders of magnitude • Readability—is the ease for another programmer to read and understand the design and code? • Simplicity—the design and/or the implementation is unnecessarily complex NNL – Khoa Toán Tin ĐHKHTN 37 SOFTWARE MAINTENANCE • Maintenance is what happens after a software product has been delivered • About 70% of the cost of software is devoted to maintenance • A software product does not wear out from repeated usage, and thus need not be “maintained” the way a car or a TV set does NNL – Khoa Toán Tin ĐHKHTN 38 SOFTWARE MAINTENANCE NNL – Khoa Toán Tin ĐHKHTN 39 Summary • The purpose of software engineering is to find ways of building quality software • Rather than a single factor, quality in software is best viewed as a tradeoff between a set of different goals • External factors, perceptible to users and clients, should be distinguished from internal factors, perceptible to designers and implementors • What matters is the external factors, but they can only be achieved through the internal factors NNL – Khoa Toán Tin ĐHKHTN 40 Summary • The most important factors are correctness and robustness, together with reliability, and the factors requiring more decentralized software architectures: reusability and extendibility, together known as modularity • Software maintenance, which consumes a large portion of software costs, is penalized by the difficulty of implementing changes in software products, and by the over-dependence of programs on the physical structure of the data they manipulate NNL – Khoa Toán Tin ĐHKHTN 41

Ngày đăng: 01/12/2017, 23:59

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN