Write unit tests for queries
Developers write unit tests for queries. With these tests, it can be determined if the application behaves in an intended manner.
- Author: Otto Nordling
- Date / Version: 30/05/2023
User roles
- Developer
Prerequisites / Conditions
- A working database connection
- A method to query the database through the application
Use Case Diagram
Description of use case
- Developer codes the app
- Developer writes unit tests
- Developer inserts queries
- Database receives queries through the application
- Query is returned to the developer through the application
- Developer confirms whether the result to the query was expected or not
Exceptions
- No known expectations
Result
- The developer will know if they need to modify their code to make the application work as intended
Use frequency
- After the code has been modified
Additional information**
- Each developer should write unit tests for their own code.
Sources
This wiki-document is based on the The public administration recommendations
Thanks to the original authors.