¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: "The design signals are weak"


 

On 7/26/23 10:12 AM, J. B. Rainsberger wrote:
On Mon, Jul 24, 2023 at 7:25?PM George Dinwiddie <lists@... <mailto:lists@...>> wrote:
I found that much of my design pressure came from the REEN "cat" state.
After I made the test pass, I often noticed that the code that did so
didn't communicate well. Often it was coupled with something else, or
had two concepts intermingled in a what that wasn't cohesive. This is
what drove my refactoring.
I presume you notice the signal to consider refactoring coming from both the production code itself (most likely focused on the code you just added) and from the tests (most likely the tests you most-recently wrote). Is that how you experience it?
Yes, the code I just wrote may be using some value that "seems wrong" for the class to own, and I may need to extract it to some place where it better belongs. I might have just introduced that value as a parameter passed by the test, but that should have a longer lifespan than one method call. Or, I might have written code that just assumes the value, though clearly it could be different for different needs.

Either way, I think about where I would like this value to live. Perhaps it belongs to some application configuration object or data store. Perhaps it's part of a larger sequence of operations. I might extract it out now just to keep it separate, but eventually I'll also push it to the entity where it seems to belong.

- George

--
----------------------------------------------------------------------
* George Dinwiddie *
Software Development
Consultant and Coach
----------------------------------------------------------------------

Join [email protected] to automatically receive all group messages.