Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11170

Re: Best Way to Pass Info Between Objects?

From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.programmer
Subject Re: Best Way to Pass Info Between Objects?
Date 2012-01-10 06:43 -0800
Organization albasani.net
Message-ID <jehir9$vk$1@news.albasani.net> (permalink)
References (2 earlier) <Xns9FD4882D25253jpnasty@94.75.214.39> <54qdnTd-nYZBj5fSnZ2dnUVZ_q2dnZ2d@earthlink.com> <jed608$j13$2@localhost.localdomain> <qMudnaJsDvKGsJfSnZ2dnUVZ_s-dnZ2d@earthlink.com> <%ozOq.43065$aW6.17493@newsfe09.iad>

Show all headers | View raw


Arved Sandstrom wrote:
> I will also point out, neutrally, that what has been advocated here for
> unit tests in support of software component design is test driven
> development (TDD), or *close to it*. Lew and Martin both describe a
> process very close to it; I don't have enough information to say whether
> they are _requiring_ that all of the first tests fail (which is
> necessary in classic TDD), or simply assuming that many/most will.

When you write that up-front test and keep it simple, you don't have to run 
the test to know it'll fail initially.

I, too, write implementation before the unit test.  Or did.  I've learned that 
unit tests save effort and eliminate bugs, the more so earlier you write them, 
up to concurrently with implementation.

Covering your code with unit tests, you are freed of doubt whether you're free 
of unit-level bugs.  (Ducking tomatoes.  Hey, don't get mad at me if you wrote 
insufficient unit tests.  Fix them.)

I'm working on assimilating this lesson properly myself.  New habits displace 
ingrained patterns only by dint of diligence.  My transformation is helped by 
how little overhead a test-propelled approach introduces, and how much faster 
and better development goes.

> In any case the OP could read up on TDD to get more background on what's
> being described here. A salient point is that these are unit tests that
> support software component design; they are not unit tests for defect
> detection [1].
>
...
> 1. And how much of one's time one should devote to writing unit tests
> for _testing_, as opposed to higher-level tests, is a different discussion.

Would you expound on this distinction, please?  I've heard a lot of 
distinctions drawn around tests and unit tests in particular, but never this.


Notes:
1. Annotations.      Annotations.
2. EasyMock - beyond testing, a requirements scripter.  Yes, it's easy.
3. 'assert'.  It's pure Zen.
4. Dependency Injection.
5. Package-private methods.  (No, not every method.  Really?)


-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Best Way to Pass Info Between Objects? Novice <novice@example..com> - 2012-01-08 16:41 +0000
  Re: Best Way to Pass Info Between Objects? Patricia Shanahan <pats@acm.org> - 2012-01-08 09:08 -0800
    Re: Best Way to Pass Info Between Objects? Novice <novice@example..com> - 2012-01-08 18:22 +0000
      Re: Best Way to Pass Info Between Objects? markspace <-@.> - 2012-01-08 10:45 -0800
      Re: Best Way to Pass Info Between Objects? Lew <noone@lewscanon.com> - 2012-01-08 11:49 -0800
      Re: Best Way to Pass Info Between Objects? Patricia Shanahan <pats@acm.org> - 2012-01-08 14:04 -0800
        Re: Best Way to Pass Info Between Objects? Martin Gregorie <martin@address-in-sig.invalid> - 2012-01-08 22:40 +0000
          Re: Best Way to Pass Info Between Objects? Patricia Shanahan <pats@acm.org> - 2012-01-08 15:56 -0800
            Re: Best Way to Pass Info Between Objects? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-01-09 06:34 -0400
              Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-09 12:39 -0500
                Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-09 12:42 -0500
                Re: Best Way to Pass Info Between Objects? Lew <lewbloch@gmail.com> - 2012-01-09 13:43 -0800
                Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-09 17:26 -0500
                Re: Best Way to Pass Info Between Objects? Lew <noone@lewscanon.com> - 2012-01-10 06:47 -0800
                Re: Best Way to Pass Info Between Objects? Patricia Shanahan <pats@acm.org> - 2012-01-09 14:26 -0800
                Re: Best Way to Pass Info Between Objects? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-01-09 19:06 -0400
                Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-09 18:46 -0500
                Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-09 19:52 -0500
                Re: Best Way to Pass Info Between Objects? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-01-10 06:43 -0400
              Re: Best Way to Pass Info Between Objects? Martin Gregorie <martin@address-in-sig.invalid> - 2012-01-10 02:11 +0000
              Re: Best Way to Pass Info Between Objects? Gene Wirchenko <genew@ocis.net> - 2012-01-09 20:17 -0800
              Re: Best Way to Pass Info Between Objects? Lew <noone@lewscanon.com> - 2012-01-10 06:43 -0800
                Re: Best Way to Pass Info Between Objects? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-01-10 19:13 -0400
      Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-09 14:30 -0500
        Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-09 17:28 -0500
          Re: Best Way to Pass Info Between Objects? Martin Gregorie <martin@address-in-sig.invalid> - 2012-01-10 02:24 +0000
            Re: Best Way to Pass Info Between Objects? Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-01-10 06:35 -0400
              Re: Best Way to Pass Info Between Objects? Martin Gregorie <martin@address-in-sig.invalid> - 2012-01-10 22:48 +0000
  Re: Best Way to Pass Info Between Objects? v_borchert@despammed.com (Volker Borchert) - 2012-01-08 17:17 +0000
  Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-08 13:43 -0500
    Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-08 19:01 -0500
  Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-08 14:10 -0500
    Re: Best Way to Pass Info Between Objects? Jeff Higgins <jeff@invalid.invalid> - 2012-01-08 14:41 -0500
  Re: Best Way to Pass Info Between Objects? Roedy Green <see_website@mindprod.com.invalid> - 2012-01-09 04:13 -0800

csiph-web