Rob Smyth

Thursday, 5 July 2007

User Acceptance Test Pattern

Automated User Acceptance Tests (UATs) compliment unit tests but are different. Today Nigel proposed a pattern for UATs. The benefit of the pattern is to give clear responsibilities of roles of classes within the UAT code. This is a great benefit.

I expect that he will post the full pattern but the roles were of Context, Tests, Jigs, and Testers. Where:

Context is the context of what is being tests and is implemented as base classes. A context provides actions suitable for the context of the test. e.g. If the UAT is on a UI page displaying a weather forecast then perhaps the base context class will offer methods to read temperature predicted from the page.

Tests are the tests that drive user actions and make assertions. e.g. Open page, get forcaset temperature, assert that forecast temperature displayed is XX.

Jigs are wrappers for user controls, typically UI pages. They encapsulate access to the controls (in a UAT manner) using the testers. e.g. A test jig for the forecast page may have a property to get a tester for the forecast temperature control.

Testers are underlying framework classes for testing UI controls. e.g. NUnitForms.

No comments: