Designing Software for Testability


Published on

Introduction to designing software in a way that they can be tested easily.

Published in: Technology, Business
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Designing Software for Testability

  1. 1. Design For Testability A forgotten design pattern Rohit Nayak Talentica Software
  2. 3. <ul><li>The Anti-Pattern </li></ul><ul><li>If it works, </li></ul><ul><li>its the developer, </li></ul><ul><li>if not it's QA </li></ul>
  3. 4. <ul><li>Design for Testability – The aspects of the product design process whose goal is to ensure that the testability of the end product is competently and sufficiently developed. </li></ul><ul><li>Design for Diagnosability – the aspects  of the Diagnostic Engineering process that focus on improving the product design, with the intent of optimizing the extent to which faults within the end product can be confidently, unambiguously and efficiently identified . </li></ul>
  4. 5. <ul><li>“ Testability is a design issue and needs to be addressed with the design of the rest of the system. Projects that defer testing to the later stages of a project will find their programmers unwilling to consider testability changes by the time testers actually roll onto the project and start making suggestions. Testability takes cooperation, appreciation and a team commitment to reliability.” </li></ul>
  5. 6. Testability and Automation <ul><li>Testability is a critical aspect of successful test automation efforts: </li></ul><ul><li>Automation requires testability. Whether testing via an API or a GUI, some accommodations to testability are necessary for successful automation. If you’re going to have to do it, why not plan for it up front? </li></ul><ul><li>Successful automation requires a focus on testability. Again, regardless of approach, the greater the emphasis on testability within the development team, the more likely automated testing will successful. </li></ul><ul><li>Test automation always affects test veracity to some degree. Automating tests always makes them somewhat different from actual customer usage. Wise testers will understand these deviations and develop compensating testing strategies, rather than act as though it can be eliminated. </li></ul>
  6. 7. Good Automated Tests are <ul><li>Repeatable </li></ul><ul><li>Easy to Write </li></ul><ul><li>Easy to Understand </li></ul><ul><li>Fast </li></ul>
  7. 8. Coding For Testability <ul><li>Expose application data </li></ul><ul><li>Choose automation-friendly third-party controls </li></ul><ul><li>Uniquely name application pages and objects </li></ul><ul><li>Add “hidden” controls </li></ul><ul><li>Modify custom controls </li></ul><ul><li>Externalize functions in a Public API </li></ul>
  8. 9. Coding For Testability - 2 <ul><li>Use proper naming conventions </li></ul><ul><li>Use only standard widgets </li></ul><ul><li>Expose “hidden” controls </li></ul><ul><li>Use unique page names </li></ul><ul><li>Composition in manageable components </li></ul><ul><li>Production environment can be simulated in test environment </li></ul>
  9. 10. Design criteria <ul><li>Layering (e.g., user interface, application kernel, database access) </li></ul><ul><li>Modularization: strong cohesion, lose coupling localization of function localization of test </li></ul><ul><li>Limited special cases high test coverage with few tests </li></ul><ul><li>Errors are raised where they occur (not later) </li></ul><ul><li>System can be parameterized (e.g., Date) by the test environment </li></ul><ul><li>Easy debugging (localizing errors) </li></ul>
  10. 11. The Value Proposition <ul><li>Developers write code, but the real mission is to ship software </li></ul><ul><li>Since detecting and fixing errors is such a major part of the development effort, it's worth our time as developers to invest in feedback mechanisms to find errors more quickly </li></ul>