Wednesday, February 25, 2009

Design for Testability - SOCK

SOCK Principles
  • Simplicity - make it only as complex as it needs to be, the more complex software is, the harder it is to test
  • Observability - tests must be able to observe the results of the software and its effect on the system as a whole
  • Control - the more controllable a component, the more deterministic and predictable the behaviour
  • Knowledge - the need to know what the expected results are
Techniques:
  • When designing always think "how am I going to test this"? TDD reinforces this
  • Test at all levels - test indiviudal components, test integration of components and test via the front-end (GUI)
  • Use Mocks to test the erorr conditions of individual components
Sources:
Improving the Testability of Software

No comments: