The Artima Developer Community
Sponsored Link

Weblogs Forum
What are Your JUnit Pain Points, Really?

65 replies on 5 pages. Most recent reply: Nov 13, 2009 2:01 PM by Nemanja Trifunovic

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 65 replies on 5 pages [ « | 1 ... 2 3 4 5 ]
James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What are Your JUnit Pain Points, Really? Posted: Nov 12, 2009 12:19 PM
Reply to this message Reply
Advertisement
> > Can someone explain to me how rotten buggy code can
> pass
> > (comprehensive) functional acceptance tests?
>
> Code that works can still have bad internal structure.
> The "bugs" in that kind of code are not behavioral.
> . Rather they are the impedance that the bad structure
> imposes on change. I think everyone will agree that if it
> takes months to make what ought to be a simple change,
> then the code is defective, even if it passes all
> acceptance tests.

I don't disagree but unit tests suffer from the same problem. For example, if the unit tests don't cover all possible input values (which they almost surely don't), the code can be incorrect and still pass all unit tests.

What I've seen of actual analysis on the effectiveness of different approaches to checking for code correctness, unit testing came in at the bottom of the pack, if not dead last.

I don't think unit testing is bad. I think it makes a lot of sense for fundamental building blocks of a system. The problem is many of the assertions of the TDD community seem to have more to do with religious fervor than facts.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What are Your JUnit Pain Points, Really? Posted: Nov 12, 2009 12:30 PM
Reply to this message Reply
> Not to mention that combinatorial math pretty much
> guarantees no functional test will ever come close to code
> coverage that unit tests can do.

First, if your goal is to maximize code coverage, then unit tests are the way to go. Personally I think 'code coverage' as it normally is defined is pretty flimsy but that's a different discussion. My goal is to prove that a system works as a whole. Unit tests do not do this.

Secondly, in my experience, processing hundreds of thousands of real world transactions through the system has uncovered many things that I never would have thought to write a unit test for.

Lastly, most of the issues that I have to solve with systems do not arise from low-level coding issues. They have to do with missed requirements and incorrect assumptions. Unit tests are derived from known requirement and assumptions. My time is much better spent getting to the point where I can see how good my assumptions are than checking that my code matches my assumptions.

Ian Robertson

Posts: 68
Nickname: ianr
Registered: Apr, 2007

Re: What are Your JUnit Pain Points, Really? Posted: Nov 12, 2009 3:11 PM
Reply to this message Reply
> What I've seen of actual analysis on the effectiveness of
> different approaches to checking for code correctness,
> unit testing came in at the bottom of the pack, if not
> dead last.

Do you have a reference? I would be very interested in looking at that analysis.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: What are Your JUnit Pain Points, Really? Posted: Nov 12, 2009 6:13 PM
Reply to this message Reply
> > What I've seen of actual analysis on the effectiveness
> of
> > different approaches to checking for code correctness,
> > unit testing came in at the bottom of the pack, if not
> > dead last.
>
> Do you have a reference? I would be very interested in
> looking at that analysis.

If I recall correctly, this presentation talks about the reference:

http://www.infoq.com/presentations/francl-testing-overrated

Daniel Sobral

Posts: 80
Nickname: dcsobral
Registered: Aug, 2008

Re: What are Your JUnit Pain Points, Really? Posted: Nov 13, 2009 2:45 AM
Reply to this message Reply
> > > What I've seen of actual analysis on the
> effectiveness
> > of
> > > different approaches to checking for code
> correctness,
> > > unit testing came in at the bottom of the pack, if
> not
> > > dead last.
> >
> > Do you have a reference? I would be very interested in
> > looking at that analysis.
>
> If I recall correctly, this presentation talks about the
> reference:
>
> http://www.infoq.com/presentations/francl-testing-overrated

FWIW, DZone's refcard for agile and software quality put TDD and unit tests way up, and functional tests way down.

http://refcardz.dzone.com/refcardz/agile-adoption-improving

It might be worth considering another point as well. Someone mentioned that the most common problems he saw was missed requirements. Well, clearly, he wasn't using an Agile methodology. With Agile, the user select specific requirements to develop at each interaction, which makes it impossible for the developers to "forget" one of them, and the short interactions help the user notice that he forgot about some requirement. But I'm really going off-topic with this.

Nemanja Trifunovic

Posts: 172
Nickname: ntrif
Registered: Jun, 2004

Re: What are Your JUnit Pain Points, Really? Posted: Nov 13, 2009 2:01 PM
Reply to this message Reply
I can't believe we are still discussing unit tests and not Google's Go :)

Flat View: This topic has 65 replies on 5 pages [ « | 2  3  4  5 ]
Topic: We No Longer Need Power Previous Topic   Next Topic Topic: Is Scala really more complicated than Java?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use