Unit Test Against In-Memory vs Real Database for SwiftData Applications

I am writing unit tests for my SwiftData application. Currently, I am using in-memory database, which get reset after every test. What benefits will I gain if I start using real database? My main reason is that real database (SQLite) will be the environment user will experience. I can easily wipe out the records from the real database after each test is completed.

Unit testing a large project with few publicly accessible components [duplicate]

This question already has answers here: Unit testing internal components (4 answers) Closed 6 years ago. I’m asking about C#, but this probably applies to most other languages as well. Imagine I have a project with a lot of complex logic, split up into a lot of small components. Let’s say that, among other things,…

Documentation for unit tests

I have a small project written primarily in C++ which is documented with Doxygen and tested with a unit testing framework (Google Test in my case, but that doesn’t matter). I wrote several test cases for each method of each class to test the method’s behavior under various conditions, and I want to leave some comments for the test suites. The Doxygen documentation is designed for projet’s user, who very likely does not want to see the documents for projects implementation details and tests.

Best Practice: Unit test coverage vs. in-method sanity checks [duplicate]

This question already has an answer here: Code Coverage or Test Brevity? (1 answer) Closed last year. I have a code-coverage requirement of of a certain percentage, and face the following tradeoff: Should I sacrifice in-method sanity checks and error handling for ease of (unit-) testability? Lets consider two variants of a simple method addAndSquare.…