Questions tagged [unit-testing]
Use this tag for code whose main focus is high-performance testing of the actual functional code.
1,045 questions
3
votes
2
answers
238
views
Storing functions for easier testing and mock API data for testing
Project collects football data from external API.
...
3
votes
2
answers
137
views
Completeness of a `fgets()` test code
Please review my_fgets_test() for completeness to exercise the functionality of fgets()-like code.
Also suggestions for ...
7
votes
2
answers
577
views
Test that tests that the docker image can be created and it runs
I created a test that creates the docker image based on a Dockerfile, and test that the web app is running. I did it because sometimes during the development of this project, I broke the creation of ...
4
votes
1
answer
198
views
Checking for string isomorphism in Java
Intro
Two \$n\$-strings \$s = \langle s_1 \ldots s_n \rangle \$ and \$z = \langle z_z \ldots z_n \rangle\$ are considered isomorphic if and only if there exists a bijection \$f\$ such that for all \$...
5
votes
2
answers
121
views
Funny time with DNA: a \$k\$-mer index data structure in Java, Take II
(See the previous and initial iteration.)
Intro
This time, I decided to pack the genomic data such that 4 nucleotide bases are encoded into a single byte. In other words, ...
4
votes
1
answer
97
views
Catch2 Sections as Macros
I like from the C++ unit test framework Catch2 its sections -- much more than the xUnit test fixtures. Therefore I wrote me some macros which mimic the Catch2 sections.
This is the first macro heavy ...
4
votes
3
answers
221
views
Function to calculate energy where all parameters must be positive
I have a function which requires all parameters to be positive:
...
5
votes
1
answer
405
views
Trying Out DDD : How to enforce data integrity and immutability
I've been transitioning from type-safe programming languages like Dart and Java to Python, and I'm trying to enforce Domain-Driven Design (DDD) principles in a language that naturally leans towards ...
4
votes
1
answer
181
views
Creating Dedicated Database for database test cases (Tests that I need to check the data are written or read sucessfully) in phpunit
I am making a base test class that bootstraps database Test cases
...
2
votes
2
answers
192
views
C++20 Performance Test Code Generator
My previous question about a generic dictionary class for C++ raised some valid concerns. I have made some modifications based on the previous review, but it needs extensive testing and further ...
6
votes
1
answer
465
views
FORTRAN90 test suite for Project Euler
The intent of this test file is to go through each of my Project Euler solutions and see if they:
return the correct answer, and
do so in under 60 seconds (unless expected otherwise).
I am using ...
3
votes
1
answer
167
views
Testing framework with a single assertion macro
I usually use the Catch2 testing framework in my C++ projects. Unlike other frameworks, it has only one core assertion macro for all comparisons. Instead of writing ...
3
votes
1
answer
81
views
Swift: Mocking a REST API-request
I have read the last two days through several tutorials about how to mock a HTTP-request against a REST API.
Finally I made a prototype for applying, what I have understood from the tutorials.
Here's ...
1
vote
1
answer
131
views
Project for reading and printing IPs
It's a small project which consists of Ip class and functions for reading and printing IPs, unit tests for this code, and a driver app. The driver app is just ...
3
votes
0
answers
405
views
Fluent VBA: Two (Almost Three) Years Later
Part 1 - A fluent unit testing framework in VBA: A fluent unit testing framework in VBA
Part 2 - Fluent VBA: One Year Later: Fluent VBA: One Year Later
Two (almost three) years have now passed since I ...