Tag Info

New answers tagged

0

Definitely include that data with your tests and your main application code. It helps to have a really well organised test suite - so if you're testing pdf extraction (and you have that code nicely encapsulated) then you should be able to construct a path to your test data, based on the path to the app code - that's always worked for me. With git you can ...


3

My question is: what is the preferred approach in C++? Is there a preferred approach? Which approach should I normally take when implementing 'container' classes? In C++ you can keep objects by: value reference pointer smart pointer (std::unique_ptr, std::shared_ptr, YourPointerClass). (you didn't mention the last two). Each of these is valid for ...


8

Firstly, you probably shouldn't implement a container class. 95% of the time you should one included in the standard library. If you just want to learn, or are in the 5%, carry on. If you are defining a template, leave the decision up to your users. You users can use: Stack<Foo> if they want by value. Stack<Foo*> if they want by pointer. ...


0

Depends on if the container "owns" the object and they are a base class. If the container doesn't own the object then you should use pointers and be careful of the danglers (make sure no container holds a pointer to the object when it is destroyed). If the container owns the object and is not a base class then you should store by value. Otherwise ...


4

If it's static data, then yes put it in version control. Those files won't really change once they're checked in; they'll either get removed if that functionality's no longer needed, or new test files will be added alongside. Either way, you don't need to worry about poor binary diffs taking up space. If you're generating test data, eg. randomly, then you ...


70

Your version control system should contain everything it needs to build, compile, test, and package an application for distribution (e.g. MSI, RPM). I would also argue build configurations and other scripts should also be in version control. I should be able to check out a project and have a complete compile, build, and test environment. There are two ...


11

If the tests are useless without the setup files that you have prepared, then it makes sense to include the files in your VCS along with the test code. While the files used in the test aren't code, you can view them as a dependency that the code relies upon. So there is merit in keeping everything together. As a counterpoint, some VCSs don't handle ...


0

There are no standards for naming conventions by any major working group. The closest you might get would be standards within an organisation or for a particular product so you are effectively free to choose the names that you feel are best. Maybe pick the best of some already great implementations (e.g. ActiveRecord Validations / Flask WTF etc.). You ...



Top 50 recent answers are included