Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/denisbuserski/testing
https://github.com/denisbuserski/testing
Last synced: about 6 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/denisbuserski/testing
- Owner: DenisBuserski
- Created: 2024-07-18T20:46:45.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-11-10T15:19:33.000Z (8 days ago)
- Last Synced: 2024-11-10T16:26:57.747Z (8 days ago)
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Testing
### 7 Testing Principles
| Principle | Description |
|-----------------------------------|----------------------------------------------------------------------------------------|
| Testing is context dependent | |
| Exhaustive testing is impossible | Perfect testing does not exist |
| Defect clustering | |
| Early testing is always preferred | Test as early as possible |
| Pesticide paradox | When we repeat the same tests, they become ineffective over time |
| Testing shows presence of defects | - Testing can show us that there are problems
- CANNOT say that there are no bugs |
| Absence-of-errors fallacy | |### Unit testing
- Each test is `public void`
- `@Before`
- Gets executed before each test
- Prepares data for the test### 3 A Pattern
`Arrange` - Preconditions - The data should correspond to the situation we want to recreate.
`Act` - Test a single behavior.
`Assert` - Post conditions - Expected behavior.```
@Test
public void depositShouldAddMoney() {
BankAccount account = new BankAccount(); // Arrange
account.deposit(50); // Act
Assert.assertTrue(account.getBalance() == 50); // Assert
}
```
Exception testing
```
@Test(expected - IllegalArgumentException.class) // Assert
public void depositNegativeShouldNotaddMoney() {
BankAccount account = new BankAccount(); // Arrange
account.deposit(-50); // Act
}
```Manual testing
Automated test
Test suite
Integration test
TDD- [Software Testing Explained in 100 Seconds](https://www.youtube.com/watch?v=u6QfIXgjwGQ&t=56s)
- [What is Integration Testing? Software Testing Tutorial](https://www.youtube.com/watch?v=QYCaaNz8emY)
- [Unit and Integration testing COMPARED](https://www.youtube.com/watch?v=pf6Zhm-PDfQ)
- [Важността на качествения код в тестовете](https://www.youtube.com/watch?v=eUn5FOdkinc&list=WL&index=93&t=31s)
- [Unit testing in Java: Mockist vs classical style](https://www.youtube.com/watch?v=dOVz-VE06X4&list=WL&index=4&t=6s)