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


Groups > comp.lang.java.programmer > #26966 > unrolled thread

Re: A little concept puzzle (involving refactoring)

Started byJoerg Meier <joergmmeier@arcor.de>
First post2013-12-17 17:35 +0100
Last post2013-12-17 17:35 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.java.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: A little concept puzzle (involving refactoring) Joerg Meier <joergmmeier@arcor.de> - 2013-12-17 17:35 +0100

#26966 — Re: A little concept puzzle (involving refactoring)

FromJoerg Meier <joergmmeier@arcor.de>
Date2013-12-17 17:35 +0100
SubjectRe: A little concept puzzle (involving refactoring)
Message-ID<m6qxtl8yy815.trlch3cqlct8.dlg@40tude.net>
On 17 Dec 2013 16:16:35 GMT, Stefan Ram wrote:

>   The behavior has changed - so that was not a refactor!

The behaviour has not changed: the behaviour is that it prints out a random
number. This behaviour is consistent over many calls and does not change
with the refactoring. By your definition, my Firefoxes behaviour is changed
all the time without even recompiling it! And following that logic, it is
impossible to ever refactor an NTP client!

Clearly, that definition makes no sense. The real issue here is that your
program is not written in a way that allows for proper unit testing, and as
a result, you can not confirm changes in behaviour because of your
inability to mock proper input.

The real solution is to use a supplied Random that can be initialized with
a fixed seed for mocking/testing, and then refactoring can be defined as
getting the exact same output (if you so wished).

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web