Hi!
On 05/31/2014 11:45 PM, Niegodziwy Beru wrote:
> Hello.
>
> *TLDR:*
> I work for company that make lot of software projects, some of them are
> only for internal use, some of them are only in maintenance mode, most of
> them are rather big. Sometimes management gets an idea that we need add
> very important feature to maintained application, because our client really
> want it. Because maintenance team is very small, and most of developers
> from this particular project already move to work on something else,
> management decide that company need to make special force team. They
> "borrow" few developers from other projects for 3-6 months, to help
> maintenance team. Projects mostly have unit tests and integration tests,
> but a lot of them rots, code sometimes looks better, but there is a lot of
> hidden domain knowledge in abbreviations. There is also specification, but
> you can't verify what you read, with "old" developers, they don't work here
> anymore. I trying to follow uncle Bobs advice in project that I already
> work, or in new code that I create and this work great, but ...
>
> *Problem:*
> How to deal with big code that you don't know, you have limited period of
> time, no domain knowledge, no one that could help you, no idea how
> architecture of this software really looks like? Something like you want to
> work on big open source project (linux kernel, Firefox, Chromium, ...)
> without internet. You have real documentation = source code, and monkey
> with software skills.
At shops I worked with, there were similar rather large applications
like the ones you described, Niegodziwy. Very often even without tests!
> *My current approach (reverse engineering), but with low efficient:*
>
> - When I look to the code, and I want to understand it I'm trying not to
> think about refactoring it.
> - Sometime I'm trying to draw what I already know, state machines,
> design, but at the end I have mess. You always need to add additional
> arrows or rectangles.
> - I wrote script to "decipher" integration tests logs. Sometimes I just
> want to get messages flow, without looking what content they carry, and it
> take me to log to analyze tests (hundreds of nested functions).
> - I read about specific feature in documentation, and then I look for it
> in code. All decoded abbreviations I put in spreadsheet. Sometimes code is
> refactored/more generic, because there is dozen of similar features and
> these are very difficult moments. Trying understand one feature
> without understand all of them at once.
> - I discuss with people, a lot. Sometimes they have useful tips.
>
Very often, as you stated, is it not feasible to refactor such systems
initially, because you first have to struggle with understanding internals.
I do like the approach of writing tests to get a basic understanding of
whats going on, even if there are already tests.
For example, I try to setup a separate acceptance test application which
boots up the application and is able to stimulate and inspect its
barriers (e.g. with Windowlicker or Capybara). Depending on the type of
application, similar aspects like the database or the filesystem can be
observed while executing your stories.
By setting up such a harness, I am able to formulate domain-related
questions in code and let them hit the entire application. These tracing
bullets can give me a basic idea, which concepts the authors had in mind
while specifying and implementing the application.
Additionally, I feel a lot more comfortable in making actual changes
with such an approach. Regression test for free, basically :)
> Maybe someone know some books/articles about such reverse engineering
> problems? Uncle Bob, what do you think about this for you next lesson?
>
Have you read "Working Effectively with Legacy Code" by Michael
Feathers? I think you can find some great value regarding a similar
topic in this book.
Cheers, Jakob
--
Jakob Holderbaum, B.Sc
- Systems Engineer -
phon 0176 637 297 71
mail
h...@jakob.io
page
http://jakob.io