Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arumandesu/qa_notes_crud
https://github.com/arumandesu/qa_notes_crud
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/arumandesu/qa_notes_crud
- Owner: ARUMANDESU
- Created: 2023-09-11T04:30:32.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-02T05:44:08.000Z (about 1 year ago)
- Last Synced: 2023-10-03T06:41:15.822Z (about 1 year ago)
- Language: Kotlin
- Size: 437 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![img.png](img.png)
# Unit test
Unit tests help ensure that individual functions or methods of your code work as expected in isolation.
### Example:
```kotlin
// Assume a simple Calculator class
class Calculator {
fun add(a: Int, b: Int): Int {
return a + b
}
}// Unit Test
fun testAddition() {
val calculator = Calculator()
val result = calculator.add(3, 4)
assert(result == 7)
}```
![img_1.png](img_1.png)# Integration test
Integration tests verify that different components or modules of your system work together correctly.
Also you can use mock some objects to isolate them and prevent changes of them
### Example:
```kotlin
// Assume a CRUD service with methods for creating and retrieving data
class CrudService {
fun createRecord(data: String) {
// Implementation
}fun getRecord(id: Int): String {
// Implementation
}
}// Integration Test
fun testCrudOperations() {
val crudService = CrudService()
crudService.createRecord("Test Data")
val retrievedData = crudService.getRecord(1)
assert(retrievedData == "Test Data")
}```
![img_2.png](img_2.png)# Stress testing
Stress testing evaluates how well your system handles extreme conditions or workloads.
You can use [Apache JMeter](https://jmeter.apache.org/) or [Gatling](https://gatling.io/) and etc.# Smoke testing
Smoke testing checks the basic functionality of your application to ensure it runs without critical errors.
Smoke test runs before more extensive testing.
---
But I think that smoke test is not necessary for this crud app, no where to place.
Because smoke testing checks the basic functionality of your application to ensure it runs without critical errors.