Test Driven Development
- Unit tests are about coverage
- Integrations tests are about component relations happy path test
- Acceptance/smoke/e2e tests are about journeys
Functional Tests
- Unit Test (Coverage)
- Fuzzing Test
- Property Test
- Table Test (parameterised test)
- Testing Styles
- Gherkin Style (Given, When, Then)
- Spec Style (Describe / It)
- Fun Suit (When, Test)
- Flat Suit (When, Should)
- Integration Test (With IO Mock, Stub, Fakes for happy path)
- Smoke Tests (Interface Tests) - This test work with docker and third party integrations. check to builded artifact before push to artifact.
- Consumer Driven Contact Tests (Pact)
- End to End Tests (System Tests) - Standalone. Simulate agains to real environment.
- User Journey Tests (Acceptance Test) - Works on real environment
Non-Functional Tests
- Documentation Tests
- Security Tests
- Vulnerability Checks
- Dependency Tests
- License Tests
- Performance Tests
- Load Testing
- Stress Testing
- Benchmark Tests
Unit Testing Libraries
- Test Library (JUnit, Hamcrest, etc)
- Matchers
- Test Doubles
- Stub
- Spy
- Mock
- Faker (Test Data Generator)
- Code Coverage
- Static Analysis
- Race Condition Detector
Test Tools
For Java
- JUnit
- Hamcrest
- Mockito
- AssertJ
- Awaitility
- WireMock
- Java Faker (https://github.com/DiUS/java-faker)
- JMeter
- ArchUnit (https://www.archunit.org/)
- Lombok
- Checkstyle
- Snyk
- Spotbugs
- Jacoco code coverage
- Sonarqub
For Golang
- Testify
- Ginkgo / Gomega
For Node
- Cypress
- Taiko
- Chai
- React Testing Library
Method & Principles
- TDD
- ATDD
- BDD
- F.I.R.S.T
- Fast: run (subset of) tests quickly (since you’ll be running them all the time)
- Independent: no tests depend on others, so can run any subset in any order
- Repeatable: run N times, get same result (to help isolate bugs and enable automation)
- Self-checking: test can automatically detect if passed (no human checking of output)
- Timely: written about the same time as code under test (with TDD, written first!)
Test Doubles (fake, stub, mock, spy)
- Stub - an object that provides predefined answers to method calls.
- Mock - an object on which you set expectations.
- Fake - an object with limited capabilities (for the purposes of testing), e.g. a fake web service.
- Spy - an object keep state (how many times call etc)
Test Double is the general term for stubs, mocks and fakes. But informally, you’ll often hear people simply call them mocks. Mocks are not stubs
Dictionary
SUT -> system under test / subject under test
Resource: http://xunitpatterns.com/