From 'Continuous delivery and continuous deployment': https://youtu.be/bTGj4PeRPjs
- Source Control Management
- CI - Continuous Integration
- Integration tests
- Unit tests
- System Integration Tests (SIT)
- Operational Acceptance Tests (OAT)
- Security Tests (Pen)
- Compliance Tests
- Deploy
- Delivery
Azure Pipelines see: https://github.com/boeschenstein/AzureDevOps/blob/main/README.md
From: https://www.guru99.com/software-testing-seven-principles.html
- Principle 1 Testing shows presence of defects
- Principle 2 Exhaustive testing is impossible
- Principle 3 Early Testing
- Principle 4 Defect Clustering
- Principle 5 Pesticide Paradox
- Principle 6 Testing is context dependent
- Principle 7 Absence of errors - fallacy
what | why | how |
---|---|---|
unit | functional | autmated |
integration | acceptance | semi-automated |
component | smoke | manual |
service | exploratory | |
UI |
Book: Succeeding with agile
costs | Type | number of tests |
---|---|---|
++++ | Manual tests | + |
+++ | UI tests | ++ |
++ | Service tests | +++ |
+ | Unit tests | ++++ |
- Verify functionality
- Language of business
- Criteria of completeness
- Full tests are problematic
How
- Eliminate UI
- Use In-Memory DB
- Mock Infrastructure
- Mock Cross-Cutting concernes
What
- Focus on essential
- Minimize coded UI-Test
- Smoke tests instead
- Minimize manual tests
- Exploratory tests instead
https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-dotnet-test
Speak the same Language: https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practices#lets-speak-the-same-language
https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practices
- FluentAssertions
- Moq
- AutoMoqer/AutoMoqCore
- Bogus, AutoBogus
- AutoBogus / AutoFaker
- AutoFixture
- Moq, AutoMoq
- Bogus, AutoBogus, AutoFaker
- https://github.com/nickdodd79/AutoBogus
- Links and documentation: https://github.com/bchavez/Bogus
- Other libraries: 2 different
Faker.net
:- fakes data: addresses (UK, US), boolean, companies, countries, currencies, ...
- A) https://github.com/oriches/faker-cs (based on ruby faker)
- B) https://github.com/jonwingfield/Faker.Net (based on ruby ffaker, sugar)
- AutoFixture: https://github.com/AutoFixture/AutoFixture
- Assertions
- Fork of FluentAssertions: https://github.com/AwesomeAssertions/AwesomeAssertions
- Shouldly: https://docs.shouldly.org/
- FluentAssertions (not free anymore): https://fluentassertions.com/
- Cheat Sheet Moq, xUnit, AutoFixture: https://www.jankowskimichal.pl/wp-content/uploads/downloads/2016/01/Cheatsheet_Moq_xUnit_AutoFixture.pdf
- FakeLogger, TimeProvider https://devblogs.microsoft.com/dotnet/fake-it-til-you-make-it-to-production/
- https://stackoverflow.com/questions/3459287/whats-the-difference-between-a-mock-stub
Dummy
objects are passed around but never actually used. Usually they are just used to fill parameter lists.Fake
objects actually have working implementations, but usually take some shortcut which makes them not suitable for production (an in memory database is a good example).Stubs
- provide canned answers to calls made during the test, usually not responding at all to anything outside what's programmed in for the test.
- Stubs may also record information about calls, such as an email gateway stub that remembers the messages it 'sent', or maybe only how many messages it 'sent'.
Mocks
are what we are talking about here: objects pre-programmed with expectations which form a specification of the calls they are expected to receive.- Snapshot testing
- do not write asserts - use files instead
- overview https://timdeschryver.dev/bits/snapshot-testing-in-c-with-verify
- https://github.com/VerifyTests/Verify
- Snapshot testing: do not write asserts - use files instead
- Stryker Mutator
- This tool temporarily mutates (aka changes) your code (example: replaces + with -, true with false, ...) and if your unit test won't fail, it blames your test as unsufficent.
- https://stryker-mutator.io/
- All Mutations: https://stryker-mutator.io/docs/stryker-net/mutations/
- Blog with example: https://engincanv.github.io/c%23/.net/stryker/2024/02/10/mutation-testing-in-c-sharp-with-stryker.html
- More Information on DDD testing: https://github.com/boeschenstein/clean-architecture/blob/main/README.md
- SpecFlow (todo)
- Load Testing Tool https://k6.io/
- Unit testing https://docs.microsoft.com/en-us/dotnet/core/testing/
- Integration Testing https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests
- EF Core Testing: https://docs.microsoft.com/en-us/ef/core/testing/