Tag Info

New answers tagged

0

In the example you give in your question, you can't unit test/TDD your way into the situation of clicking the button twice to cause an error very easily. But what you can unit test is that in the code which is called when you click the button, if you get an exception from the persistence layer you handle it appropriately (by either mocking out the ...


0

Other people have answered with "Mock out your DB!" - but what's the point in mocking out your DB layer if you actually need to test how it interacts with your code? What you're looking for is integration tests and/or automated UI tests. You mentioned that the problem happens when: *If you click the save button twice* The only way to test for this is ...


2

Databases can be very easy to unit test - you need stored procedures and transactions. This what Microsoft says about Database unit testing. You can also run unit tests against a database, writing your tests in Java or C# by setting up a DB connection, beginning a transaction, write whatever data you want to use for the test to the DB, run the tests and ...


6

One option is to use an in-memory testing database such as H2; it tends to be about about 10x faster than a standard disk-using database, and with lower startup/teardown times. Whether it will help does largely depend on whether the JPA issues you are having are general enough that they will still fail on different database. Not much point running tests ...


0

IMHO it is not overkill, that is just the Javascript (or functional) form of the command pattern, used in conjunction with dependency injection. The classic OO equivalent for achieving the same, is to construct a command class, pass socket and config through the constructor, store them in some member variables, and add a member function like Draw(data) ...


1

Individuals and interactions over processes and tools Go back to the user and ask for more clarification, details, etc. I know this isn't always possible and can be annoying to both sides, but it's better than coding in the blind. It may help both sides understand what everybody really needs to know before coding. There are plenty of techniques to make ...


2

Use Cucumber CPP which gives you Cucumber support for C++.



Top 50 recent answers are included