Tagged Questions
2
votes
4answers
124 views
Initializing derived classes in the same way
I have a class Base that has several children, say A, B, C. For testing purposes I'd like to mock those derived classes by deriving from them. So MockA derives from A, MockB derives from B and so on.
...
-2
votes
1answer
154 views
Do you unit-test your PODs? [closed]
do you create unit-tests for PODs (Plain Old Data Structure)? And why?
I'm interested in your opinions.
Regards
Tobias
0
votes
3answers
204 views
Is there an accepted name for a fake object injected via a preprocessor seam?
I am dealing with some old, sloppy C++ code in which there is a structure with a lot of data members and functions. I want to test a class that I have implemented which uses the struct, but this ...
2
votes
2answers
129 views
Should I split out synchronization from my class and what's it called?
When thinking about testability and modular code, I recently thought about whether I should split out the synchronization part of a class from the actual behavior part.
By example:
The app "needs" ...
3
votes
1answer
157 views
How to structure unit testing of huge libraries?
I am writing unit tests for a library written in Qt/C++.
The library is rather big, with lots of functionalities. I have a separate unitTest folder which I have my UnitTest.cpp in there. Having all ...
6
votes
1answer
130 views
Unit testing a text index
Consider a text index such as a suffix tree or a suffix array supporting Count queries (number of occurrences of a pattern) and Locate queries (the positions of all the occurrences of a pattern) over ...
12
votes
3answers
1k views
Unit testing C++: What to test?
TL;DR
Writing good, useful tests is hard, and has a high cost in C++. Can you experienced developers share your rationale on what and when to test?
Long story
I used to do test-driven development, ...
7
votes
3answers
369 views
Interfacing application code with unit tests
I am working on a project in which we have to implement and unit test
some new module.
I had a quite clear architecture in mind so I quickly wrote down the main
classes and methods and then we started ...
2
votes
2answers
278 views
Looking for good testing in multithreaded C or C++ open source projects
I have read a lot about the importance of unit testing, and testing in general. In particular I have read about TDD which, in theory, seems like a good way to ensure effective test coverage for a ...
18
votes
5answers
558 views
Does unit testing lead to premature generalization (specifically in the context of C++)?
Preliminary notes
I'll not go into the distinction of the different kinds of test there are, there are already a few questions on these sites regarding that.
I'll take what's there and that says: ...
15
votes
6answers
552 views
Does adding unit tests make sense for well-known legacy code?
I'm talking about unit tests in the TDD sense. (Not automated "integration", or what you like to call it tests.)
Legacy code as in: (C++) code without tests. (see: Michael Feathers' Working ...
4
votes
2answers
128 views
How to keep settings for C++ Unit Test modules in sync with the production code modules?
Note: I'm coming from a Windows / Visual-C++ background.
Note: I have already read Michael Feathers' Working Effectively with Legacy Code.
Note: Broad question, asking for narrow answers, i.e. while ...
26
votes
2answers
1k views
How should C++ Unit Test code be organized for maximum Unit Test efficiency?
This question is not about Unit Testing Frameworks.
This question is not about writing Unit Tests.
This question is about where to put the UT code written and how/when/where to compile and run it.
...
2
votes
2answers
231 views
Best practice for shared files within multiple unit test fixtures
I was wondering what the general best practice is for when you have multiple unit test fixtures testing different things that use the same file paths.
My test files are in a directory tree with ...
