Questions tagged [mocks]
In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. A programmer typically creates a mock object to test the behavior of some other object, in much the same way that a car designer uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts.
66
questions
4
votes
1
answer
167
views
Track and trace allocations
When testing or debugging allocator-aware objects, it can be useful to provide allocators that can provide insight into how they get called. The Tracing_alloc from ...
2
votes
0
answers
93
views
C++ Mock Library: Part 6
Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
C++ Mock Library: Part 6
Side Note:
I will say the processes of ...
1
vote
0
answers
56
views
C++ Mock Library: Part 5
Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
C++ Mock Library: Part 6
Overview
So brief overview:
Part3 was the ...
3
votes
1
answer
81
views
C++ Mock Library: Part 4
Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
C++ Mock Library: Part 6
Description:
In part 3 I described how I ...
2
votes
1
answer
61
views
C++ Mock Library: Part 3
Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
C++ Mock Library: Part 6
Define normal use case patterns:
The next ...
3
votes
1
answer
124
views
C++ Mock Library: Part 2
Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
C++ Mock Library: Part 6
Removing redundant MOCK_SYS usage
After ...
6
votes
1
answer
269
views
C++ Mock Library: Part 1
Parts
C++ Mock Library: Part 1
C++ Mock Library: Part 2
C++ Mock Library: Part 3
C++ Mock Library: Part 4
C++ Mock Library: Part 5
C++ Mock Library: Part 6
Note:
If you see an extra ...
3
votes
1
answer
134
views
End to End testing of user interaction in Rust
I am interested in any kind of possible improvement to this method of testing a Rust program with user interaction in an end-to-end manner (simulating user input and asserting a certain program output ...
0
votes
1
answer
131
views
Unit testing and alternative to mocking in Haskell
Let's say you have a simple pure function that applies a discount of 30% if the total price of a list of Items is over 30.00 (let's not delve into the fact that I'm ...
2
votes
1
answer
542
views
Basic Ticket booking code with Unit tests
I am going to run a session for a few other developers who are new to Junit, mocking, etc.
I have designed a very simple application with classes and tests to demonstrate how to do unit testing. ...
0
votes
1
answer
94
views
First time writing tests (Service Layer)
Service class:
...
3
votes
1
answer
133
views
Abstract wrapper for fundamental types
I have created this interface as part of my C++ learning path. This post inspired me a lot.
The idea is to use its concrete implementations to perform some actions before and after any change of the ...
1
vote
1
answer
85
views
How to make the initialization of the mocks more readable?
In an Arduino project, I'm using some code which is a slightly modified version of a public library. I made several modifications to it:
I performed some minor changes I needed to make the code work.
...
2
votes
0
answers
90
views
A terminal based atom feed reader written in golang
I'm a beginner trying to get a better understanding of golang so I decided to write an atom feeder that runs from the terminal.
I am using the gofeed library to parse the atom feeds and the tview ...
2
votes
1
answer
322
views
Mockingbird c++ mocking framework
I have developed Mockingbird a mocking framework for c++, it depends on function injection, here is the code from the repository:
...