Software Testability

2,175 views
1,971 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,175
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
44
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Software Testability

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

×