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


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

Re: Eclipse question

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Eclipse question
Date 2017-10-27 15:10 -0400
Organization A noiseless patient Spider
Message-ID <ot00bd$q4b$1@dont-email.me> (permalink)
References (2 earlier) <a539e9c2-d3cf-4bf9-8a77-c78605ec1b3b@googlegroups.com> <osvgqo$1usm$1@gioia.aioe.org> <osvq1b$t1b$2@dont-email.me> <osvsmf$nd9$1@gioia.aioe.org> <2120adec-27d9-4a73-ba65-501806e891f5@googlegroups.com>

Show all headers | View raw


On 10/27/2017 2:23 PM, Eric Douglas wrote:
> On Friday, October 27, 2017 at 2:08:26 PM UTC-4, Arne Vajhøj wrote:
>> It is a huge task to write really complete tests.
>>
>> But my take on that is that non-complete tests are better than no
>> tests.
>>
> 
> Input-output is easy enough when my input is 2 and 6, my method is mutiply() and my result is 12.
> How do you write a complete test when my input is end user, my method is "drag mouse from GUI control A to control B", and my result is "does the end model show what the user expects".

     "I don't know."  Others have mentioned testing frameworks for
GUI's, but I'm unfamiliar with them and can't help you.

     However, you can at least write unit tests for the model: It
doesn't (or shouldn't) matter whether theModel.setWobbleRate(3.2)
is called from an ActionListener or from somewhere else -- like a
unit test, for example.  The unit test can then turn around and
check that the result of theModel.getWiggleSpan() is consistent
with the new wobble rate, or can check that the bad wobble rate
provokes an exception, or can check that changing the wobble rate
sends suitable events to the listeners the test itself registers.

     One benefit of separating the view and the model is that most
of the "business logic" resides in the latter, where it's easier to
test.  If the GUI consists mostly of sending data to the model and
getting notifications back from it, the GUI can be simpler and
(perhaps) less in need of this sort of testing.

-- 
esosman@comcast-dot-net.invalid
Eleven hundred eighty-one days to go.

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


Thread

Eclipse question Eric Douglas <e.d.programmer@gmail.com> - 2017-10-27 05:32 -0700
  Re: Eclipse question Joerg Meier <joergmmeier@arcor.de> - 2017-10-27 15:29 +0200
    Re: Eclipse question Eric Douglas <e.d.programmer@gmail.com> - 2017-10-27 06:41 -0700
      Re: Eclipse question Arne Vajhøj <arne@vajhoej.dk> - 2017-10-27 10:45 -0400
        Re: Eclipse question Martin Gregorie <martin@address-in-sig.invalid> - 2017-10-27 17:22 +0000
          Re: Eclipse question Arne Vajhøj <arne@vajhoej.dk> - 2017-10-27 14:08 -0400
            Re: Eclipse question Eric Douglas <e.d.programmer@gmail.com> - 2017-10-27 11:23 -0700
              Re: Eclipse question Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-10-27 15:10 -0400
              Re: Eclipse question Arne Vajhøj <arne@vajhoej.dk> - 2017-10-27 19:05 -0400
              Re: Eclipse question Martin Gregorie <martin@address-in-sig.invalid> - 2017-10-27 23:44 +0000

csiph-web