软件构造的视图与质量指标
軟件構(gòu)造的實(shí)質(zhì):Transformation between different views(不同視圖之間的轉(zhuǎn)換)
Multi-dimensional software views
按階段分:build and run-time views
按動(dòng)態(tài)性分:moment and period views
按構(gòu)造對(duì)象的層次分:code and component views
Transformation between different views
Nothing -> Code
Code -> Component
Build-time -> Run-time
Moment -> Period
5個(gè)重要的質(zhì)量目標(biāo)
- Easy to understand
elegant and beautiful code (understandability) - Ready for change
maintainability and adaptability - Cheap for develop
design for/with reuse: reusability - Safe from bugs
robustness - Efficient to run
performance
軟件多視圖的宏觀視角
構(gòu)建時(shí)期(Build-time views)
AST可以認(rèn)為是代碼的另一種等價(jià)視圖,對(duì)AST進(jìn)行修改就相當(dāng)于對(duì)源代碼進(jìn)行修改,對(duì)源代碼進(jìn)行修改就相當(dāng)于對(duì)AST進(jìn)行修改。
Semantics-oriented program structure(語(yǔ)義導(dǎo)向的程序結(jié)構(gòu)):用源代碼對(duì)現(xiàn)實(shí)世界進(jìn)行刻畫,例如使用UML圖描述接口、類、屬性、方法及其關(guān)系。先用人類語(yǔ)言表達(dá)需求和設(shè)計(jì)思想,再轉(zhuǎn)化成代碼。
版本控制。
運(yùn)行時(shí)期(Run-time views)
Executable programs:純粹的機(jī)器語(yǔ)言
Cibrary:運(yùn)行時(shí)庫(kù),需要鏈接
Configuration and data files:配置文件,提供程序運(yùn)行必要的參數(shù)
Distributed programs:分布式程序,例如一臺(tái)服務(wù)器+若干臺(tái)客戶機(jī)
兩種可執(zhí)行文件:編譯成的機(jī)器碼(Native Machine Code);完全解釋運(yùn)行(Fully Interpretation);解釋型字節(jié)碼(Interpreted Byte Code)
動(dòng)態(tài)鏈接:庫(kù)文件不會(huì)在build階段被加入可執(zhí)行文件,只做出標(biāo)記,在程序運(yùn)行時(shí),庫(kù)被按照標(biāo)記裝入內(nèi)存。
Transformation between views
- Nothing => Code
Programming / Coding (ADT/OOP)
Review, static analysis/checking - Code => Component
Design (ADT/OOP;Reusability;Maintainability)
Build: compile, static link, package, install, etc - Build-time => Run-time
Install / deploy
Debug, unit testing (Robustness and Correctness) - Moment => Period
Verson control
Loading, dynamic linking, execution (dumping, profiling, logging)
Concurrent threads
Quality properties 質(zhì)量指標(biāo)
External quality factors: 外部質(zhì)量因素,影響用戶,如運(yùn)行速度、易用性,包括correctness, robustness, extendibility, reusability, compatibility, efficiency, portability, ease of use, functionality, timeliness
Internal quality factors: 內(nèi)部質(zhì)量因素,影響軟件本身和它的開(kāi)發(fā)者,如模塊化程度、代碼可讀性
對(duì)于發(fā)布后的軟件而言,only external factors matter
且外部質(zhì)量取決于內(nèi)部質(zhì)量,External quality results from internal quality.
External quality factors
- Correctness
Correctness is the ability of software products to perform their exact tasks, as defined by their specification.
Correctness is the prime quality.
設(shè)法保證正確性:Testing and debugging; Defensive programming such as typing and assertions(通過(guò)斷言在寫程序的時(shí)候就保證正確性而不是在調(diào)試時(shí)發(fā)現(xiàn)錯(cuò)誤); 通過(guò)形式化驗(yàn)證發(fā)現(xiàn)問(wèn)題 - Robustness
Robustness is the ability of software systems to react appropriately to abnormal conditions.
健壯性是對(duì)正確性的補(bǔ)充 - Extendibility
規(guī)模越大,擴(kuò)展起來(lái)越困難 - Reusability
一次開(kāi)發(fā),多次使用。找到軟件系統(tǒng)中共性的部分,將它們抽取出來(lái)。 - Compatibility(兼容性)
不同軟件系統(tǒng)之間互相集成是否容易。軟件系統(tǒng)都不是孤立存在的,需要和其他系統(tǒng)進(jìn)行交互。難點(diǎn):不同軟件有不同的設(shè)定,例如,不同操作系統(tǒng)中有著互相不兼容的文件格式。解決方法:標(biāo)準(zhǔn)化。 - Efficiency
包括時(shí)間效率和空間效率。
Efficiency does not matter unless the software is correct.
正確性是性能的前提。
過(guò)度的優(yōu)化可能導(dǎo)致軟件不再適應(yīng)變化和復(fù)用。 - Portability(可移植性)
軟件可方便的在不同的技術(shù)環(huán)境間移植。 - Ease of use(易用性)
容易學(xué)、安裝、操作、監(jiān)控 - Functionality(功能性)
Functionality is the extent of possibilities provided by a system.
每增加一點(diǎn)點(diǎn)小功能,都要確保其他質(zhì)量指標(biāo)不受到損失。 - Timeliness(及時(shí)性)
Timeliness is the ability of a software system to be released when or before its users want it.
軟件產(chǎn)品出現(xiàn)的太晚,可能會(huì)錯(cuò)過(guò)它的受眾群體。 - Others: Verifiability(可驗(yàn)證性), Integrity(完整性), Repairability(可修復(fù)性), Economy(經(jīng)濟(jì)性)
Internal quality factors
- Readability
- Understandability
- Clearness
- Size
Trade off between quality properties (折中)
如果對(duì)efficiency有極致的要求,那么這將手具體機(jī)器型號(hào)的約束,軟件的portability就會(huì)受影響。
經(jīng)濟(jì)性(economy)和reusability也有沖突。
timeliness和extendibility也有沖突。
正確性(Correctness) 絕不能與其他質(zhì)量指標(biāo)沖突。
Summary
描述軟件系統(tǒng)的三個(gè)維度:
按階段分:build-time & run-time views
按動(dòng)態(tài)性分:moment & period views
按層次分:code & component views
軟件構(gòu)造的本質(zhì)是視圖之間的轉(zhuǎn)化:
nothing => Code
Code => Component
Build-time => Run-time
Moment => Period
質(zhì)量指標(biāo):
external & internal quality factors
important external quality factors
tradeoff
五個(gè)質(zhì)量目標(biāo):
easy to understand
ready for change
cheap for develop
safe from bugs
efficient to run
總結(jié)
以上是生活随笔為你收集整理的软件构造的视图与质量指标的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Eclipse中Git的使用与Junit
- 下一篇: Testing and Test-Fir