Software Testability 软件可测试性 Request From Quality
No Agenda
Impression Testability is defined as the degree to which a system facilitates the establishment of test criteria and the performance of tests to determine whether those criteria have been met. (from IEEE 90) DFT (Design For Test, Wikipedia),  http://en.wikipedia.org/wiki/Design_For_Test For software, testability is not only testable, but easy-to-test.
Definition 简单的说,软件的可测试性就是一个计算机程序能够被测试的容易程度。 一般来说可测试性很好的软件必然是一个强内聚、弱耦合、接口明确、意图明晰的软件,而不具可测试性的软件往往具有过强的耦合和混乱的逻辑。
Includes: Operability  Visibility Resolvability Simplicity Intelligibility Control Stability
Operability Excellent UX (don’t make me think) Smooth Interaction Less Error
Visibility Accessible Code (comments, changes) Design (changes) State Standard Output (include error) Detailed Log Only one output for each input
Resolvability Independent Modules Reduce coupling between modules /layers Avoid UI inter-invocation
Simplicity  Function Structure Code
Intelligibility Design Dependency Changes Document Guidance
Control  Standard Controls (recognizable by 3rd party) Customized UI Elements Naming standard Recognizable (name, type) Uniqueness Controllable (input, get, click) Good practice: Forms Widgets
Control (cont.) Testing purpose Interface (method, url) Hook
Stability Unfrequent changes Controllable changes Little impact on existing test Easy recovery
Unit Test TDD(Test Driven Development) Less Arguments Short Method Simple Logic Clear Log Reduce Expensive Instantiation Weak Coupling
Weak Coupling
Causes for the lack of testability Dev concern functionality for customer not tester Tester never aware demand functionality /hooks help test Management support Consequence: Software quality hurts, and test cost increase.
为了测试它,我们需要了解它 了解越多的信息,我们将测得更巧妙 我们越是能控制它,测试越能被自动化和优化
The End

Software Testability