... native ... Now that I think about this, speaking of Java 1.5, why not see how the java.util.concurrent folks unit test their code? On the concurrency...
17671
eclipse eclipse1
eclipse.junit
Aug 28, 2006 7:44 pm
Hi, Where can i find the junit examples, so that i can go through them and learn about how to write tests for void method, and etc. Tom ...
17672
Lasse Koskela
lassekoskela
Aug 28, 2006 7:46 pm
Hi Cedric, Chris, Simon, ... ...or use the mock connection for verifying that your code interacts with the 3rd party API (JDBC driver) as expected and write a...
17673
Elliotte Harold
elharo@...
Aug 28, 2006 7:48 pm
... What sort of problems do you see? I admit I don;t think much about the testability of client code either, but I'm not sure how that practically impacts...
17674
Elliotte Harold
elharo@...
Aug 28, 2006 7:53 pm
... You do know what you're talking about, and you are practitioners, as am I. However you're making the classic mistake of assuming that everyone else is just...
17675
Andrew McDonagh
andy_ipaccess
Aug 28, 2006 9:49 pm
I rely upon Acceptance tests to test this kind of 3rd party integration issues. I find it make my unit tests smaller, easier to write, faster to run, adding a...
17676
Cédric Beust
cbeust
Aug 28, 2006 9:58 pm
... It will probably make your unit tests smaller, but when the bug happens, it will take you longer to isolate it because only your acceptance tests will ...
17677
Andrew McDonagh
andy_ipaccess
Aug 28, 2006 10:16 pm
I haven't found this to be the case during the last 4 years. Especially since using Fit/Fitnesse. Each Fitnesse test runs a 'setup39; fixture for connecting to...
17678
Cédric Beust
cbeust
Aug 28, 2006 10:21 pm
... Then I understand even less: if you already have a working DB connection when your unit tests run, why not test close() directly on it? Are you running...
17679
Andrew McDonagh
andy_ipaccess
Aug 28, 2006 11:30 pm
No, our unit tests dont have a working db connection. None of our unit tests use dbs,files,network,ui We mock them all. Our acceptance tests drives these very...
17680
Simon Chappell
spchappell
Aug 29, 2006 1:21 am
... Trust me, it doesn't take very long to find and debug a connection error in production jdbc drivers. Been there, done that and have several t-shirts. I...
17681
huaishih_wen
Aug 29, 2006 10:17 am
How does junit determine the order of execution for test methods? How does junit determine the order of execution for test cases added to a test suite? Does...
17682
Michael Feathers
mfeathers256
Aug 29, 2006 12:27 pm
... Sure, I once worked on a system for instrument automation. The library supplied by the vendor presented an API that contained only non-virtual functions....
17683
Michael Feathers
mfeathers256
Aug 29, 2006 12:32 pm
... I think you're mixing pedagogical techniques with working techniques. Average programmers can think in terms of interfaces.. it's a matter of acclimation....
17684
didoss@...
ddoss_2006
Aug 29, 2006 12:42 pm
Not sure if this is what you are talking about, but it reminds me of something that I was thinking about this morning,...I39;m using an API, and I want to test...
17685
Michael Feathers
mfeathers256
Aug 29, 2006 12:49 pm
No, that helps a lot. In an ideal world, all libraries would distributed test cases also. And, yes, it would go far in dealing with the issue I'm talking...
17686
Elliotte Harold
elharo@...
Aug 29, 2006 12:50 pm
... You're going to have to elaborate on that case. I don't doubt you had a problem, but I don't understand what it was. How do non-virtual functions imply...
17687
Michael Feathers
mfeathers256
Aug 29, 2006 1:04 pm
... Yes, C++. We couldn't introduce mocks for testing. ... Nope. We wrapped it. Yes, we had system tests, but in order to test our logic independently, we...
17688
Michael Feathers
mfeathers256
Aug 29, 2006 1:44 pm
... It's not like that, though. Really, if you make your UTs look like ATs, i.e., they run all of these external subsystems, you've just pushed the issue of...
17689
Cédric Beust
cbeust
Aug 29, 2006 2:15 pm
... We're talking about a JDBC connection here, though. Are you saying you would write a battery of unit tests that all work on a fake JDBC connection? This...
17690
Elliotte Harold
elharo@...
Aug 29, 2006 3:00 pm
... So you tested without mocks. I can accept that. I vastly prefer mock-free testing to mocked testing. -- Elliotte Rusty Harold elharo@... ...
17691
Elliotte Harold
elharo@...
Aug 29, 2006 3:08 pm
... I don't want the tests to be independent of the libraries they depend on. I want them to depend on exactly what the code depends on: no more; no less. That...
17692
Michael Feathers
mfeathers256
Aug 29, 2006 3:10 pm
... No actually, we couldn't write automated tests. There was no path back to check results, just instrument actions. Michael Feathers www.objectmentor.com...
17693
Elliotte Harold
elharo@...
Aug 29, 2006 3:27 pm
... I suspect in that case the library is dysfunctional irrespective of testing. There should be some form of return value, error code, or callback that...
17694
Simon Chappell
spchappell
Aug 29, 2006 3:38 pm
... There is no declared order. In fact the order is definitively stated to be undefined. This encourages tests to be written in such a way as to be...
17695
Cédric Beust
cbeust
Aug 29, 2006 4:18 pm
... I would. When you're an API writer, it behooves you to make your library general enough that it can be used for cases you didn't envision, or you'll make...
17696
Andrew McDonagh
andy_ipaccess
Aug 29, 2006 5:25 pm
My team have just created two daemon applications within 6 weeks. Both do similar things, poll for data in a db 'interface39; view, transform it in some way and...
17697
Elliotte Harold
elharo@...
Aug 29, 2006 6:22 pm
... I'm sorry, but I flat out disagree. You should put in what is currently needed, no more. Do not try to support use cases you do not envision and do not...
... Exactly, which is exactly why you should be humble when you ship your code and open it up. Assume that people will use it in ways you didn't think of, and...
17699
Elliotte Harold
elharo@...
Aug 29, 2006 7:44 pm
... No, exactly the opposite. Until you know what you need to open and why you need to open it, keep it closed. That is humility. Do not assume you can guess...