|
9 | 9 | * [Governance as a side effect](../patterns/governance-side-effect.md)
|
10 | 10 | * [Quality Metrics](../quality-checks.md)
|
11 | 11 |
|
12 |
| -## Details |
13 |
| -* Quality is the whole team's responsibility |
14 |
| - * Software testing is the responsibility of the whole team. |
15 |
| - * Education on testing and testing principles is important to drive the right cultural behaviours. |
| 12 | +## General Testing Priniciples |
| 13 | + |
| 14 | +* **Quality is the whole team's responsibility** |
| 15 | + * Education on testing and testing principles should be important to the whole team. |
16 | 16 | * Quality approaches should be driven as a team and implemented by everyone.
|
17 |
| -* Combining business knowledge with testing knowledge yields better quality outcomes |
| 17 | + |
| 18 | +* **Combining business knowledge with testing knowledge yields better quality outcomes** |
18 | 19 | * Include business knowledge and critical thinking as part of assurance
|
19 | 20 | * Intrinsic knowledge and mindset of the team is key to driving quality outcomes
|
20 |
| - * Use Behaviour Driven Development (BDD) as an approach to align testing across the whole team and customer |
21 |
| - * Consider BDD to encode acceptance criteria in business terms as automated tests where appropriate. |
22 |
| - * This can be an effective communication and collaboration tool where the product owner is involved in reviewing detailed acceptance criteria (expressed as BDD tests). |
23 |
| - * But if the PO is not involved in this way then well written unit and integration tests are often sufficient and avoid the extra layer of abstraction which BDD frameworks introduce. |
24 |
| -* Testing is prioritised based on risk |
| 21 | + |
| 22 | +* **Testing is prioritised based on risk** |
25 | 23 | * A testing risk profile is defined and understood by the whole team, including the customer
|
26 | 24 | * Risk appetite should be worked across the whole team, including customers and/or users
|
27 | 25 | * Solution Assurance risks and Clinical Safety hazards must also be considered when prioritising risks
|
28 |
| -* Use experiental / experimental / exploratory testing as well as formal methods |
29 |
| - * Gamify testing - try multiple techniques and learn as you go |
30 |
| - * Integrate chaos engineering / resilence testing into your pipelines e.g. using AWS Fault Injection Simulator (see [AWS FIS](../tools/aws-fis) for sample code) |
31 |
| -* Testing is assisted by automation with automated tests as a default (see [automate everything](../patterns/automate-everything.md)). |
| 26 | + |
| 27 | +* **Testing is context driven** |
| 28 | + * Context should be considered when deciding on test techninques and tools to use. |
| 29 | + |
| 30 | +* **Testing is assisted by automation** |
32 | 31 | * Appreciate that not everything can be automated
|
33 | 32 | * Identify good candidates for automation - particular focus on high risk and repeatable areas
|
34 |
| -* Look to continually improve testing |
| 33 | + * Automated tests should be used to provide confidence to all stakeholders. This includes test analysts themselves who should be familiar with what the tests are doing to allow them to make decisions on what they want to test. |
| 34 | + * Automated test packs should be maintained regularly to ensure they have suitable coverage, are efficient and providing correct results. |
| 35 | + * Consider using testing tools to enhance other test techniques. |
| 36 | + * Eg. using record and play tools to aid exploratory UI testing |
| 37 | + * Eg. using API testing tools to aid exploratory API testing |
| 38 | + |
| 39 | +* **Testing should be continually improved** |
| 40 | + |
| 41 | +* **Testing is continuous** |
35 | 42 | * Testing is a continuous activity, not a phase of delivery
|
| 43 | + * Testing can be performed in [all phases of a product's DevOps cycle](https://danashby.co.uk/2016/10/19/continuous-testing-in-devops/) |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | +## Test Automation Theory |
| 48 | +* Test should be added at the most appropriate level of the [test pyramid](https://martinfowler.com/articles/practical-test-pyramid.html) — in general, the lower the better and avoid testing the same thing in multiple levels. |
| 49 | +* Consider using the [agile testing quadrant](https://lisacrispin.com/2011/11/08/using-the-agile-testing-quadrants/) to help support a whole team approach around test planning and test automation. |
| 50 | + |
| 51 | + |
| 52 | +## Guidelines for different types of testing |
| 53 | +### Unit Testing Guidence |
36 | 54 | * Tests act as documentation of the system's behaviour and should be clear enough to do this effectively.
|
37 | 55 | * Tests are written alongside or before whatever they are testing.
|
38 |
| -* Tests are code (see [everything as code](../patterns/everything-as-code.md)). |
39 | 56 | * Tests and test suites must be executable from the command line via a single command.
|
40 | 57 | * Tests do not rely on other tests (i.e. each test can be executed in isolation, tests can be run concurrently and in any order).
|
41 | 58 | * Tests only check a single condition.
|
42 | 59 | * Tests are idempotent (i.e. give the same result when re-run against the same code).
|
43 | 60 | * Test data is automatically generated when needed.
|
44 |
| -* New functionality must be covered by passing automated tests (unless there is a legitimate reason not to). |
45 |
| -* Consider where best to add tests within the [test pyramid](https://martinfowler.com/articles/practical-test-pyramid.html) — in general, the lower the better. |
46 |
| -* Avoid testing the same thing at multiple levels of the test pyramid. |
47 |
| -* Consider using the [agile testing quadrant](https://lisacrispin.com/2011/11/08/using-the-agile-testing-quadrants/) to help support a whole team approach around test planning and test automation. |
48 |
| -* Use stubs to test the behaviour of components in isolation — focus tests of multiple services on validating the interactions between services e.g. using consumer-driven contract testing. |
49 | 61 | * Do not add tests of no value (e.g. tests of default getters/setters) just to increase the coverage level — 100% coverage is not a good use of time.
|
50 | 62 | * Tests must pass before code can be merged.
|
51 |
| -* Non-functional requirements should also be covered by automated tests (e.g. security, performance, accessibility). |
| 63 | +* Use stubs to test the behaviour of components in isolation — focus tests of multiple services on validating the interactions between services e.g. using consumer-driven contract testing. |
| 64 | +### API Testing Guidence |
| 65 | + |
| 66 | +### UI Testing Guidence |
| 67 | +### Browser/OS Testing Guidence |
52 | 68 | * Website user interfaces should be tested against an appropriate set of browsers and versions — in particular, no effort should be spent testing against unsupported browsers or unsupported versions of browsers. See supported browsers for [Staff](https://aalto.digital.nhs.uk/#/document/viewer/8c039de1-eec0-49cd-8af3-a97fed6a8bff?library=5464c07f-daf1-4eee-b9b6-22e6c4dfbbd0) and [Citizens](https://aalto.digital.nhs.uk/#/document/viewer/465e6d1b-f107-49eb-ad25-e72c0299d3a6?library=5464c07f-daf1-4eee-b9b6-22e6c4dfbbd0)
|
53 | 69 |
|
54 |
| -## Further reading |
55 | 70 |
|
| 71 | + |
| 72 | +## Other Tools To Consider |
| 73 | +* BDD tools to encode acceptance criteria in business terms as automated tests where appropriate. |
| 74 | +* Chaos engineering / resilence testing e.g. using AWS Fault Injection Simulator (see [AWS FIS](../tools/aws-fis) for sample code) |
| 75 | +* Performance tools to check load, volume, soak and stress limits |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | +## Further reading and resources |
56 | 80 | * [Test Driven Development: By Example](https://learning.oreilly.com/library/view/test-driven-development/0321146530/)
|
57 | 81 | * [xUnit Test Patterns: Refactoring Test Code](https://learning.oreilly.com/library/view/xunit-test-patterns/9780131495050/)
|
| 82 | +* [Setting a foundation for successfull test automation](https://testautomationu.applitools.com/setting-a-foundation-for-successful-test-automation/), a short course by Angie Jones, who also has a talk on test automation strategy [based on game design](https://applitools.com/event/level-up-playing-the-automation-game/) |
| 83 | +* [Test Automation University](https://testautomationu.applitools.com/) |
| 84 | +* [Ministry of Testing](https://www.ministryoftesting.com/) |
0 commit comments