Originally posted by Mark Herschberg:
Well, let's say performance is an issue. In my example you choose an array over a vector for performance reasons. Now performance is a requirement and there are specific test for it, but those tests will not delve into this level.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
I think that he would remember very fast once he sits down with the partner to browse through the code to explain it.
Originally posted by Ilja Preuss:
Well, I don't know your paradigm very well, so it may be true.
Originally posted by Ilja Preuss:
I don't think so - you will have a hard time to get me writing inline documentation, but I willingly write tests over tests. That is because I personally gain so much from the tests - they make my development live much easier *at the time I write them*. (http://c2.com/cgi/wiki?TestInfected)
Originally posted by Mark Herschberg:
I think that he would remember very fast once he sits down with the partner to browse through the code to explain it.
My experience (for both is myself and for others) suggests otherwise.
As of yet, I'm not convinced about XP.
Exactly! You've found benefits to tests; I've found benefits to documentation. My point is, just as a developer, upon realizing the value of tests, can change his behavior to always write them and keep them up-to-date, so, too, can a developer keep comments accurate and up-to-date.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
Why wouldn't I write a test that delves into this level instead of writing the comment?
Originally posted by Ilja Preuss:
What would happen if I had neither the test nor the comment?
Originally posted by Ilja Preuss:
I see. Are you curious enough to try a practice, say test-driven development, on a small test project?
Reid - SCJP2 (April 2002)
Originally posted by Mark Herschberg:
And test what? [...] What test would you write?
Someone comes along later and chances the code, not understanding the underlying motivations for why it was implamented as it was. If the constraint hasn't changed (but others have, which is why the code is being modified), then in meeting one new constraint, we break meeting an old again. Again, the old one is soft, it's performance, so it's not inherently clear how much effect this code have on it, just by looking at the code.
I see. Are you curious enough to try a practice, say test-driven development, on a small test project?
Yes.
I still think 4 months after writing some code, even with tests, you're likely to forget some of the subtlies of it.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
So, either the change would in fact be valid, or it would break the constraint, which would break at least one test. Am I missing something?
Originally posted by Mark Herschberg:
I'll be in AZ Friday through Monday, so I may be a little silent in this thread for the next few days.
Are you familiar with soft requirements, i.e. "-ilities?" (Plug: I spend about 10 pages in my book discussing them ;-)
Unit testing is local. As such, it cannot adequately express the overall motivation for the necessary code. (If I am short selling unit tests, please correct me.)
PS Ilja, do you have example of code, which, is undocumented, but sufficently unit tested, such that I, as an outsider, can understand it simply looking at the code and tests?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Originally posted by Reid M. Pinchback:
So, I agree that you would want automated tests for your acceptance, but in situations like the one I described those test materials and the execution of them are very disconnected from the activity of the developers. It wouldn't hurt at all for a developer to have supplemental information that explained some of the whys and wherefores of how the design was approached in order to achieve the desired performance levels across the entire integrated environment.
I think it would be good to have a growing body of small unit tests that kept an eye on localized performance issues, but the physical resources required to give the developer a realistic test of performance costs a huge amount - more than enough for you and your family to retire on.
I will say that in following this thread I'm becoming more interested in the idea of TDD; I can see pushing it a lot farther than I'd considered previously.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
OTOH, one of the outputs of such a test should be a specific performance requirement for the software side of the system. I think it would be very worthwhile to capture such a requirement in less costly automated system tests (where the more costly components might get mocked up, for example). Do you disagree?
Reid - SCJP2 (April 2002)
Originally posted by Reid M. Pinchback:
Nice in theory, doesn't always work in practice. I was on a large distributed systems project that tried to do exactly that, and the system ended up over a year late, largely because of performance problems.
I suspect you are working under the assumption that the performance of a complete system is something like a simple sum of the individual components, and largely independent of the hardware environment (making appropriate adjustments for CPU or network bandwidth).
Something like a minor (to a developer) tweak in a messaging protocol can entirely tank the global performance (I've seen it happen, luckily I wasn't the tweaker).
Sometimes you can't predict bottleneck and harmonic effects readily without having a duplicate environment. You do create such environments, but in the brokerage world they aren't cheap, and hence they become a highly constrained resource (you have to share access to them). They do help you to identify the more stable and instable parts related to performance.
Then you end up with code hacks that have nothing to do with functionality or unit tests for performance. You end up with comments in the code that say "JVM for JDK 1.3 is broken, changed to work around bug".
Another thing that makes the simulation approach difficult is that you may be simulating things for which you have inadequate information. You consider yourself lucky if you have decent API documentation, but you will have little or no information about performance behaviour for various kinds of transactions or loading situations.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Reid - SCJP2 (April 2002)
Originally posted by Reid M. Pinchback:
You were claiming that you could write tests for these things, and in particular you've been espousing TDD design, which requires that you know how to write the test before you write the code. My point was that sometimes you can't economically write such tests, paricularly when you don't have detailed information apriori to allow complex test rigging to be written.
It is not "agile" to spend millions of dollars writing test rigs for complex asynchronous environments when you could just execute the tests in the real but duplicated hardware environment.
Unless it is your intention to withhold current information from future developers, there is nothing wrong with adding some comments to the code to explain things for which it wasn't feasible to write such test rigs. I do not see how it is "agile" to be so unwilling to use normal human written communications to provide information to developers.
Why spend months writing complex test rigs for the equivalent of a few lines or paragraphs of comments?
I'd invite you to find out from your accounting department the average hourly cost for employees.
I don't see TDD being a universal panacea
particularly in situations where the cost of providing the tests swamps the cost of writing and documenting code and doing normal QA of the system. That to me is not being agile.
Additionally, while I agree that documentation that is not in sync with the code can be misrepresentative, the very same thing is true of tests. The whole point, as I understand it, of TDD is that developers can routinely execute those tests to ensure the correctness of there work. THAT is a gross misrepresentation when the tests are executed in a development environment that does not reflect the realities of the deployment environment. I hate to think of the months of time I've lost to bullet-headed developers who have insisted, incorrectly, that code was correct because it tested ok on their workstation.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Seriously? That's what you're going with? I prefer this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|