Re:Why not make the tester the compiler?
on
High Integrity Software
·
· Score: 2, Informative
> you only have to write the tests > to get both the test and the code that > passes the test!
This came up on the Extreme Programming list a while back. I think the Java IDE IDEA does something like this, in that you can write a test and it'll generate the source code for the method signatures that you're trying to test. Then you fill in the implementation. *Disclaimer - I haven't used that feature so I don't know how well it works*
One problem with this, though, is that code can pass a test but still be lousy. For example, say you've got a test case for a Stack:
public void testStack() {
Stack s = new Stack();
assert(s.empty());
s.push("hello");
assert(s.pop().equals("hello")); }
So the generator comes up with a Stack implementation - but the first thing it does is allocate a new array of size Integer.MAX_INT to hold the items. The tests pass... but memory usage is ridiculous.
You could go at it by writing a genetic algorithm to evolve code that better fit the requirements... but I'm not sure that'd get you much further.
> some other company can take the contribution > and incorporate it into their own > proprietary version of PostgreSQL > without contributing their changes back.
Let 'em. No harm is done to PostgreSQL, and a programmer who is more familiar with the code is liable to contribute bug fixes and features and such in the future. It's the story of OpenSSH's success.
> Ask about licensing on the lists and > the core contributors say, "No one > cares as long as you don't try > to screw us."
Hm, that's interesting! I haven't been mingling around the PG folks for too long, so I haven't picked up on that vibe yet. Pretty cool, thanks for the thoughtful post.
> It was used to meet contractual > requirements, not engineering requirements.
There be dragons.
> One neat trick is to generate a large > proportion of the annotation from the > output error messages
That's classic. It makes sense, though - kind of like running a code reformatter rather than running a "code format checker". Every night, the code gets reformatted to meet the style guide... no nagging emails, just silent enforcement.
Cue Hitchhiker's Guide on the Sirius Cybernetics Corporation:
In other words - and this is the rock solid principle on which the whole of the Corporation's Galaxy-wide success is founded - their fundamental design flaws are completely hidden by their superficial design flaws.
> you are going to see more serious enterprise > features being developed by interested 3rd > party corporations for PostgreSQL
In my mind this is due - at least in part - to PostgreSQL being under the BSD license. It seems to make contributors less leery than other licenses.
I know that I've had significant contributions to PMD from folks who said that if it were GPL'd they wouldn't be contributing - but since it's BSD, they did.
> while I'll use Oracle for its > scalability, performance, and corporate support.
There's probably a size/performance metric floating around here too. For database under a terabyte, PostgreSQL is probably fine.
The question then becomes - how much data will I be packing into this database? If it's only a few hundred GB or so... PostgreSQL may be sufficient. And the customer will save a lot of money... good times.
...Spring, and so forth can be found on the frequently offensive but never boring BileBlog. An excerpt:
J3EE is moron bait I've been trying to ignore this nonsense, but frankly, it's just so ridiculous and such a nice big fat juicy target that it's hard to pass up.
...when I was in the Coast Guard in the middle '90s the computers onboard my ship ran CTOS - Convergent Technology Operating System. On 286s and (if you were lucky) 386s. Very slow, very crashy.
> Visual J++ is already way past "dead meat" stage
It's a nice fast Java IDE, though. As long as you stay away from the RNI/JDirect "lots of comments that get magically transformed into native method invocations" stuff, it's pretty cool.
And what the article said about game programming is right on... trying writing even a simple Brickout clone without knowing basic trigonometry and you'll run into problems.
> to get both the test and the code that
> passes the test!
This came up on the Extreme Programming list a while back. I think the Java IDE IDEA does something like this, in that you can write a test and it'll generate the source code for the method signatures that you're trying to test. Then you fill in the implementation. *Disclaimer - I haven't used that feature so I don't know how well it works*
One problem with this, though, is that code can pass a test but still be lousy. For example, say you've got a test case for a Stack:So the generator comes up with a Stack implementation - but the first thing it does is allocate a new array of size Integer.MAX_INT to hold the items. The tests pass... but memory usage is ridiculous.
You could go at it by writing a genetic algorithm to evolve code that better fit the requirements... but I'm not sure that'd get you much further.
Fun stuff!
> some other company can take the contribution
> and incorporate it into their own
> proprietary version of PostgreSQL
> without contributing their changes back.
Let 'em. No harm is done to PostgreSQL, and a programmer who is more familiar with the code is liable to contribute bug fixes and features and such in the future. It's the story of OpenSSH's success.
> Ask about licensing on the lists and
> the core contributors say, "No one
> cares as long as you don't try
> to screw us."
Hm, that's interesting! I haven't been mingling around the PG folks for too long, so I haven't picked up on that vibe yet. Pretty cool, thanks for the thoughtful post.
> It was used to meet contractual
> requirements, not engineering requirements.
There be dragons.
> One neat trick is to generate a large
> proportion of the annotation from the
> output error messages
That's classic. It makes sense, though - kind of like running a code reformatter rather than running a "code format checker". Every night, the code gets reformatted to meet the style guide... no nagging emails, just silent enforcement.
> you are going to see more serious enterprise
> features being developed by interested 3rd
> party corporations for PostgreSQL
In my mind this is due - at least in part - to PostgreSQL being under the BSD license. It seems to make contributors less leery than other licenses.
I know that I've had significant contributions to PMD from folks who said that if it were GPL'd they wouldn't be contributing - but since it's BSD, they did.
> while I'll use Oracle for its
> scalability, performance, and corporate support.
There's probably a size/performance metric floating around here too. For database under a terabyte, PostgreSQL is probably fine.
The question then becomes - how much data will I be packing into this database? If it's only a few hundred GB or so... PostgreSQL may be sufficient. And the customer will save a lot of money... good times.
> georgie's boys can do whatever the
> hell they want and just say "It's a
> secret - you can't stop me".
Then why are the papers full of the prisoner abuse news?
> Mr. Bush and his Nazi party
I must have missed the news about the government rounding up Jewish people.
> awfully silent around SCO lately
Perhaps the plummeting stock has something to do with it...
...i.e., this.
Hopefully they've set up throttling...
...when I was in the Coast Guard in the middle '90s the computers onboard my ship ran CTOS - Convergent Technology Operating System. On 286s and (if you were lucky) 386s. Very slow, very crashy.
> governments
> the government
Touche!
> "The report warns governments
> against relying on open-source software
Since the government is busy sponsoring open source software, I think this warning falls (happily) on deaf ears.
> report them as income to the IRS.
> Then you don't have to worry.
Well said. Like they say - if you tell the truth, you don't have to remember what you said.
Very nice! No need to copy/paste the URL, though.
> Visual J++ is already way past "dead meat" stage
It's a nice fast Java IDE, though. As long as you stay away from the RNI/JDirect "lots of comments that get magically transformed into native method invocations" stuff, it's pretty cool.
...has case studies on Linux Terminal Server Project deployments in schools.
Not business case studies, but still might yield some useful results...
Oddly, we just had a post to the open source distributed agent system Cougaar about using Cougaar on a Zaurus.
The only response was a mention of Cougaar Micro Edition... not sure where it will go from there. Depends on how much horsepower the Zaurus has...
...demand more math than others. Artificial intelligence techniques, for example.
And what the article said about game programming is right on... trying writing even a simple Brickout clone without knowing basic trigonometry and you'll run into problems.
> the as-if rule
Yup. I think I was mostly responding to the original poster's claim that a System.gc() call would _force_ garbage collection, which it doesn't.
I'd like to see exactly what System.gc() does, but, alas, it delegates to a native method in java.lang.Runtime...