canmove, Confirmed users
2,041
edits
No edit summary |
|||
Line 69: | Line 69: | ||
* Generally, minimize logic in tests. Tests do one thing and should require branching. | * Generally, minimize logic in tests. Tests do one thing and should require branching. | ||
* However, there are exceptions. A much larger discussion on this can be found [https://github.com/geoelectric/ui_auto_best_practice/blob/master/uiabp.md here]. | * However, there are exceptions. A much larger discussion on this can be found [https://github.com/geoelectric/ui_auto_best_practice/blob/master/uiabp.md here]. | ||
= State = | |||
* The test harness should always start a test from a single known state. | |||
* Tests should not depend on other tests for their state. Every test should stand alone, and should be runnable in any order. | |||
* Tests should not try to keep application state, except to use as a comparison for verification later. | |||
Resetting the application to a known state is the single most important functionality in a test suite or harness. It must be absolutely correct, and it must run as fast as possible. If it is unreliable, the tests are unreliable. If it is slow, testers will start combining tests together to avoid overhead between tests and tests will become unmaintainable. | |||
When given a choice between putting efforts into tests and putting efforts into improving the reset/known-state handling of the harness, pick the harness every time. | |||
= Programming Best Practices = | = Programming Best Practices = |