New code base joys
-
My employer just purchased the intellectual property for a web server product from a partner firm, much to our developers' dismay.
PMD lights up like a Christmas tree with the code. One method is particularly fun, having 836 lines, a cyclomatic complexity of 226, and an NPath complexity of over 1 BILLION. (Which implies one billion distinct acyclic execution paths through that method.)
With such complexity, you might expect some elaborate tests.
Unfortunately, not so much: <br<pre> public void test1() { assert(1==1); }
</br<pre>
-
@Thuktun said:
public void test1() {
assert(1==1);
}Ah, the classic DoLawsOfPhysicsStillApply() test. It's fun on http://hasthelargehadroncolliderdestroyedtheworldyet.com/ (ah, good to see it still hasn't!), but this use seems inappropriate.
-
Why is "nope" hard coded in a noscript tag? Dumb.
-
-
@Lorne Kates said:
So... did it pass?
Amazingly, no. The setup method in that JUnit 3 test has environmental requirements I can't fulfill yet so any testcases on that class fail when I run them.
Many of the existing tests I can't run because they
- test things by firing off emails that need to be manually verified
- rewrite source code in the working copy
-
@Lorne Kates said:
@Thuktun said:
public void test1() {
assert(1==1);
}So... did it pass?
To be "that guy" for a moment, the test could fail if the CPU is overclocked. Although it has the same odds of failing as every other operation, so... it's still not useful.
Raymond Chen wrote an article about errors like this that end up in Windows' error database, and when they research them they find it's always overclocking that caused it.
-
-
@derula said:
http://hasthelargehadroncolliderdestroyedtheworldyet.com/
Where is their public webservice that we can use to check that in our own code?
-
@Power Troll said:
Why is "nope" hard coded in a noscript tag? Dumb.
Well as stated in the HTML comment on the site, you'll get a full refund if they fail to update it correctly.
-
@toth said:
@derula said:
http://hasthelargehadroncolliderdestroyedtheworldyet.com/
Where is their public webservice that we can use to check that in our own code?
Well, there's an Atom feed.
-
@derula said:
@toth said:
@derula said:
http://hasthelargehadroncolliderdestroyedtheworldyet.com/
Where is their public webservice that we can use to check that in our own code?
Well, there's an Atom feed.
Sorry, but I work on Enterprise apps. That's not Enterprisey enough.
Although I guess I could roll out my own custom Atom reader. That could be pretty enterprisey.