|
I know it is possible to create a TestCase or TestSuite with the wizard within JUnit, but how does one sync the code after the class under the test has been modified, such as method signature modification or newly added methods. I would like my TestCases...
Started by Steven Rosato on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Suddenly the idea of having a Test class for eachIf you change method....
As has been mentioned before, refactorings and not writing tests, your point of view shifts.
Of a way to have the test class automatically updated.
|
|
If I create a test suite for a development project, should those classes be kept under version control with the rest of the project code?
Started by devonmallory on
, 15 posts
by 15 people.
Answer Snippets (Read the full thread at stackoverflow):
Test classes must stay up-to-date with....
For all of the other reasons if the interfaces change, necessitating that the tests change?
Absolutely.
Keep test data under source control unless it is massively large.
|
|
Hi,
We have an API which is used in a class via an exposed interface. The API is meant for UNIX family and assumes, that every UNIX has /bin/sh. Thus when running the junit test under win32 we get:
Cannot run program "/bin/sh"
Is it a catch-22 situation...
Started by D_K on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Why are you testing code meant for Unix under Win32?
If you cannot test under Unix (or rewrite the code to be platform-independent), some optionsYour question is unclear....
It's natural (and OK) for the unit test to fail.
|
Ask your Facebook Friends
|
After reading Martin Fowler's Mocks Aren't Stubs , I've discovered I've been practicing TDD in the "mockist" fashion.
But I'm wondering if even in mockist TDD if one can take mocking too far.
Here's an updated example in Python-style pseudo-code:
def ...
Started by Daryl Spitzer on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Formerly:
As a fellow interaction tester, consider....
The database connecting class can be faked when you unit test the class under test.
This class will be a dependency of the class under test.
|
|
I'm working on moving as much logic out of a custom control as possible so that it can be unit tested to reduce manual testing burden. I'm having trouble with situations where a method under test produces a complex result; writing a test case that calculates...
Started by OwenP on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
So ideally you would have seperate unit tests....
Just makeA "unit test" should really just be testing a single unit.
Not using the code under test to generate the test data (a very bad sin in unit testing).
|
|
Presume you have a class which passes all its current unit tests.
If you were to add or pull out some methods/introduce a new class and then use composition to incorporate the same functionality would the new class require testing?
I'm torn between whether...
Started by Finglas on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
That being....
But once you start making changes to either of those two classes.
If you need to add behavior to the class, that would be the time to introduce a test the same stuff is still under test.
Of the class.
|
|
I am working on writing unit tests properly, and I wonder is it bad technique to test the result of a method under test by calling another method to verify the result?
ie. in the below example I can only check that an StoreObject method call was successful...
Started by theringostarrs on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
(I'm not really sure what this class does except wrap a Dictionary in a slightly different API, but that's another topic...)
Don't think of a test case as testing a method; think of it as testing a unit of functionality....
|
|
Suppose I have several unit tests in a test class ([TestClass] in VSUnit in my case). I'm trying to test just one thing in each test (doesn't mean just one Assert though). Imagine there's one test (e.g. Test_MethodA() ) that tests a method used in other...
Started by trendl on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Such a feature is different, but that's the reason why unit test frameworks don't allow you to order that the fact that some of your tests depend on a different method call on the same class is a symptom of tight technique), you ....
|
|
Is there any way of replacing the logic within a private method when running a JUnit test?
A bit of background: we have some private methods which interact with bundles within an OSGi container. This is not available in the unit test therefore the methods...
Started by James Carr on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
A workaround may be some package as production class): public class BlaTest {
@Test void test_xx(){ //use stubbed impl of ....
An inject the mock into the class-under-test, instead of the original heloper.
|
|
I understand how equivalence testing works. How is it the same or different from boundary value testing?
Started by Phenom on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Therefore you group the test item into class where all items in each class are suppose class....
Equivalence Class Testing
EC Testing is when you have a number of test them all.
Errors on the boundaries.
|