A classic case of code that needs JUnit specific refactoring is most code using 3rd party APIs. You are either forced to mock interactions with 3rd party objects or set up a complex environment (which is a bit of admiting defeat as unit testing impllies your code should be tested in isolation) or break up your code along weird boundaries where you wrap 3rd party objects in your own classes just so that they are easier to mock. All of these approaches are short of ideal and there are projects to address this, among them MockObjects and JMock, but I believe none of them got it right. My idea for AOP aided unit testing should overcome these problems but I don't have the time to work on it now.
The code needs to be broken up into simpler units that are easier to test individually.
this is a cliche ofter repeated by the proponents of JUnit. Often times refactoring your code to make it compatible with JUnit results in the code structure more complex than if JUnit had been more transparent. This is bad refactoring as it flies in the face of simplicity as the overriding principle in software design.
I do have some ideas about how to dramatically overhaul the JUnit paradigm with Aspect Oriented unit testing, and have a proof of concept working but haven't had the time to turn it into an Open Source project. I will when my work duties get a little lighter, hopefully towards the end of the year.
My idea would be to tackle the mocking scenario by intercepting methods with AOP (AspectJ most likely) and subsituting mocked return values. This would at least make it possible to unit test legacy code without major refactoring and avoid some really questionable design decisions that junit sometimes forces you into.
The change that all unit test frameworks need is to address the issue of creating complex setups that your code typically relies upon to execute its tasks properly. Whether it be through mock objects or proper environment setup, at the moment it is the biggest PITA and many, many developers question whether the effort of maintaining those setup fixtures is worth the benefit of unit testing.
Fixtures is something that JUnit has been ignoring since its inception and thus it is much less appealing than it could be if the test fixture dillemma is ever solved.
Like "Seksmisja" (Eng. The sex-mission)? Incidentally it's one of the funniest commedies I've seen.
Basically, two males are hibernated and get thawed after World War III which actually turned out to be the escalated male-female confrontation. The females won and invented a way of reproducing without any male involvement.
Then those two blokes get defrosted and wake up in a world 100% ruled and controlled by women... Just watch it if you can get hold of it.
And I don't eat there often because it gave me a diarrhea a couple of times, but a virus? No, I'm far from ready for it. I'd rather quit eating out at McDonalds altogether.
Well, it requires a hydrogen car to be useful. And those can't be built without huge amounts of platinum. That's the reason why honda FCX costs over $1 million without any chance of dropping in price until a cheaper catalytic material is found.
That's pretty damn awful. Most of my schoolmates from Warsaw, Poland make more than that. Granted, all have more than six five experience by now, but still, that's Warsaw not Vancouver.
Yeah, but we'd be better off to start looking into Easter Island and why they got wiped off the face of the planet. We're following their footsteps so close ly it's not funny.
one man who works in the oil industry and spends 25% of every working day surfing porn sites and submitting reviews to porn aggregators for a fee.
Little wonder the fucking thing is trading close to $70/barrel on NYMEX. Just goes to show the disastrous effects porn has effected on the global economy!
Yongquist's book excerpt on shale is here:
http://dieoff.org/page132.htm
Even if Yongquist is wrong, and there is a minimal net energy gain in oil shale, I'm betting that the aquifaction system and the transportation and the refining process will eat severely into that modest energy gain (which your link claims) effectively making shale exploration an exercise in futility.
No it isnt. Chiefly because oil shale is a net energy loser. More energy must be used (typically by means of burning natural gas) than you recover from processing the shale into synthetic crude oil. And that does not even account for the much harder refining process.
You're better off converting some of the cars and trucks to compressed natural gas and reducing oil consumption this way than messing with the shale.
Yeah, lots of people would. For once you can use the nuclear station's output to power electric cars (or produce hydrogen from electricity if you believe in fuel cell vehicles).
Also, extracting oil this way uses staggering amounts of fresh water which is already a problem for the Canadian tar sands operation. There isn't enough fresh water in Canada to produce 20mbpd of oil ouput.
These things can be done on a small scale but they cannot scale to the levels of light sweet crude production and are extremely costly operations.
Oh, and good luck getting the American public to buy into your nuclear plant project.
But even so, I think you guys have your own share of spread-out living.
Where in the original post do I defend the Canadian suburban sprawl? And yes, suburban sprawl here is just as bad as south of the border.
You're not a European, but perhaps you've always been a city dweller and are looking at this from that particular frame of reference (i.e., romanticizing the idea of city life).
You romanticize suburban lifestyle as much as I romanticize urban living (which I don't really). Throughout my life I spent years in various environments, staring with pure rural on my granparents farm, through high density urban tower block living, to eventually move out to suburbia with my parents a few years before I moved out and started living on my own.
I know fairly well about European lifestyle because I spent eight years living there and I'm fairly familiar with how their cities operate. I can guarantee you that given a choice, at least half of American (or Canadian) suburbanites would pick a modern European city lifestyle over the caricature of rural living that is North American suburbia.
Do you notice how we Canadians (and you Americans) keep fooling ourselves about the wonders of suburbia? How subdivision names often represent that which they destroy ("Beaver Creek Valley", "Oak Hills", etc).
It is a caricature of rural living because it offers no advantages of rural lifestyle (healthy food, work in the open air, contact with nature) but bears all disadvantages (isolation from culture, kids trapped in the house, long distances to travel in order to trade, work and entertain etc). As such it's fair to say that suburbia is a giant misallocation of resources.
Do you notice how car commercials always show empty mountain roads and vehicles happily roaring through the wilderness? Now look at the traffic jam at your nearest interstate. See the dissonance between the commercial on TV and real life?
All of suburbian living is built on delusions like that.
Now, city living in a European styled city (if you want to experience it but are on a budget, take a trip to Quebec city for a taste of Europe that's a surprisingly realistic imitation) has downsides such as housing closer together. Yet, sacrificing your quarter acre yard in exchange for shorter commute (or no commute), beautiful architecture, nice neighbourhoods, functioning infrastructure, access to culture and independence for teenagers to socialize without asking mom for a "lift to the mall" is a small price to pay in the opinion of great many people.
Suburbia was invented to address the problem of having some nastiest most horrible looking, most disgustingly polluted cities in the world, and was hardly the pinnacle of human habitation. It was a temporary fix that got horribly out of control.
In the era of expensive oil this bizzarre societal setup will have to be fixed. There is no way around it whether the majority of us like it or not. I just hope we still have enough resources (financial as well as natural) to reshape our structures to survive the energy shortage shock that's coming in the next few years. And I hope that what emerges is a bit more worthwhile of preserving than a bunch of cheap slapped together McHouses with fried chicken huts in between them. Wouldn't you agree?
NO ONE likes being packed into sardine cans and paying outrageous housing costs due to the inability to expand outward. If there's a lot of land to be had, dammit, people want to spread out and get away from the noise, congestion, and crime of the urban areas.
You say that because your cities suck. Seriously, American cities sprang to life during the 19th century, the era of heavy industrialization. In effect they becamse massive industrial parks and not human habitats. There is not tradition of merchantry, trade, culture etc. in a typical North American city. This is why you despise city living so much and that's why the term "inner city" is to you synonymous with poverty.
When I grew up, my family was not wealthy (not poor either), but we lived in a 3000+ square foot home on three acres of heavily wooded land with a waterfall in the backyard.
All this in the era of cheap oil, probably well before US oil production peaked in 1971.
And this was the norm in this neighborhood! These were not terribly expensive houses either (think $250K).
Quarter of a million dollars is INSANELY expensive by any standard in the world, in any country. Only a US citizen during a real estate bubble can call that an inexpensive property. And I say this as a Canadian btw.
It was absolutely wonderful to live in such a peaceful, relaxing environment, close to nature. Sure it was a little ways to stores and work, but it was definitely worth it.
Well, suck it up. You lived in a bubble powered by incredibly cheap energy. Now that the bubble has burst, your utopia is over. In the past, people who lived in rural environments engaged in rural activities (ie farming). Now, that oil is about to get dramatically more expensive that model will soon become the only one acceptable. Farmers live on farms, city folks will live in cities. Subarbia was the most incredible misallocation of resources in the history of humankind.
Europeans aren't running out of land, they just never tried or wanted to build a drive-in utopia of mixing country living and urban lifestyle in a single package.
European cities are still considered very desirable places to live because they boast beautiful architecture, provide lots of amenities with walkable communities and they don't permit heavy polluting industries in the core of the cities. Now, there are nice cities and there are nasty cities in Europe just like everywhere else. Yet a European city on average, is a far more human friendly place than any North American city (note here that Mexico and Canada aren't excluded from my argument).
I despair what chaos expensive oil may cause in the coming years. Yet, I'm full of hope that it will eventually bring out the best in people and allow us to rebuild our countries (mine as well as yours) in a more citizen friendly fashion where people want have to escape to suburbian narcosis in order to live decent lives. Down with oppressive cities full of concrete and intimidating "tower blocks" surrounded by belching factories and refineries and littered with fried chicken pits and 90% covered with garangutan parking lots. Is this really a type of environment that you as an American citizen feel proud of? I as a Canadian feel no pride in this (and remember our place is just a smaller, colder imitation of yours).
You're not correct. The EROEI (Energy Return On Energy Invested) for Texas crude is about 5:1. The EROEI for Arabian crude is typically 30:1. This is according to Matt Simmons in his book "Twilight in the Desert". He has references in the book's appendix to back up these numbers.
That said 80:1 is clearly and exaggeration for any kind of oil.
However, the EROEI for tar sands is about 1.5:1 but US shale yields EROEI less than 1.0:1! That means that regardless of the price of a barrel of oil, the shale will never be profitable because the input energy will always cost more than what anyone can make selling the output energy. We're better off consuming the input energy directly and leaving the shale alone. Less damage to the environment and more net energy in the world.
Listen, I live in Canada. It's not in my interest to poopoo the tar sands. But the truth is this: The tar sands Energy Returned on Energy Invested ratio is barealy 3/2. In other words you need to invest two barrels of oil equivalents (typically natural gas) to get back three. It's still a net gain but when you compare this to Saudi Arabia where EROEI is around 30/1 it gives you something to think about. The "break even" point for tar sands is highly predicated on the cost of natural gas. If the demand for natural gas surges, the cost of it will follow creating a damper on the scale of tar sands processing.
The other problem with the synthetic crude from tar sands is that most refineries are unable to process it. That's why I called it "shitty" crude.
...and their oil is shitty and expensive. Also they can't scale production of it to the level you are hoping for. Tar sands production requires gigantic natural gas inputs. There simply isn't enough natural gas around to produce enough barrels of oil to satisfy US apetite.
Boy, oh boy. Been reading too much Reganomics books lately?
Greenspan controls the supply of US dollars by setting interest rates. If you don't understand how interest rates affect money supply resit your economics 101.
The US buck is not pegged to oil on a fixed basis but the fact that demand for oil equates to the demand for US buck (an artificial link maintained by the US through its unbelievable military might) means that anyone who wants to have a working economy needs US greenbacks. Why? Because it isn't possible to have a working economy without ample supplies of oil. China is the prime example here. But the situation is even more skewed in America's favour because not only is the supply of US greenback controlled by Greenspan, how those bucks are spent is controlled by Washington. China discovered that the hard way when they tried to buy Unocal. Now they are looking like idiots stuffed with a bunch of worthless paper printed by Mr Greenspan that they can't buy anything of real value for. I don't think they'll be so keen to stock up on US treasury bonds from now on. And once they unload what they amassed so far things will get very intresting in the ole' US of A.
Finally, from your comment I can discern that I understand a hell of a lot more about marktets than you do, sir.
Heh. Incidentally, MY government did march into Baghdad along with yours like a lapdog. That doesn't make it right or honourable. I also don't believe they did it for noble reasons.
It is also highly questionable whether Iraq is better off in its current shape vs what was there before Bush sent his minions. As a matter of fact most indicators show a substantial decline in an average Iraqi's life quality. Child poverty and mortality are at their highest. Frequent shortages of energy are commonplace and I haven't even got to the incessant daily violence.
It won't surprise me one bit if Saddam is not only freed but asked back to sort this mess out once Americans leave with their tails between their legs. Thare'd be a bit of poetic justice to it.
Bush is there to ensure the security of US oil supplies and to make sure oil remains to be traded in US dollars. If one of those things changes the US economy is headed for a catastrophe that'll make the Great Depression look like the good ole' times.
Yeah, it was all about Iraqi Freedom, silly me! Or is it Weapons of Mass Destruction? Which one is it this month?
Believe your government's propaganda all you want but ask yourself this question. If Iraq had been sitting on massive reserves of figs or bananas would they have been invaded by the USA?
There are brutal regimes all over the world, African ones seemingly the most vicious of them, there are WMD in former Soviet republics that can be had for a few crates of vodka. Why doesn't your government interven there if the WMD threat is its true motivation?
A classic case of code that needs JUnit specific refactoring is most code using 3rd party APIs. You are either forced to mock interactions with 3rd party objects or set up a complex environment (which is a bit of admiting defeat as unit testing impllies your code should be tested in isolation) or break up your code along weird boundaries where you wrap 3rd party objects in your own classes just so that they are easier to mock. All of these approaches are short of ideal and there are projects to address this, among them MockObjects and JMock, but I believe none of them got it right. My idea for AOP aided unit testing should overcome these problems but I don't have the time to work on it now.
this is a cliche ofter repeated by the proponents of JUnit. Often times refactoring your code to make it compatible with JUnit results in the code structure more complex than if JUnit had been more transparent. This is bad refactoring as it flies in the face of simplicity as the overriding principle in software design.
I do have some ideas about how to dramatically overhaul the JUnit paradigm with Aspect Oriented unit testing, and have a proof of concept working but haven't had the time to turn it into an Open Source project. I will when my work duties get a little lighter, hopefully towards the end of the year.
My idea would be to tackle the mocking scenario by intercepting methods with AOP (AspectJ most likely) and subsituting mocked return values. This would at least make it possible to unit test legacy code without major refactoring and avoid some really questionable design decisions that junit sometimes forces you into.
Fixtures is something that JUnit has been ignoring since its inception and thus it is much less appealing than it could be if the test fixture dillemma is ever solved.
Basically, two males are hibernated and get thawed after World War III which actually turned out to be the escalated male-female confrontation. The females won and invented a way of reproducing without any male involvement.
Then those two blokes get defrosted and wake up in a world 100% ruled and controlled by women... Just watch it if you can get hold of it.
And I don't eat there often because it gave me a diarrhea a couple of times, but a virus? No, I'm far from ready for it. I'd rather quit eating out at McDonalds altogether.
Well, it requires a hydrogen car to be useful. And those can't be built without huge amounts of platinum. That's the reason why honda FCX costs over $1 million without any chance of dropping in price until a cheaper catalytic material is found.
That's pretty damn awful. Most of my schoolmates from Warsaw, Poland make more than that. Granted, all have more than six five experience by now, but still, that's Warsaw not Vancouver.
Must be working out of New Orleans then? I heard you guys had a different pay scale for coloreds over there.
http://www.globalpublicmedia.com/lectures/461/
Nope. We live on a small, isolated rocky planet with severely depleted natural resources. Can you totally see the parallels?
Yeah, but we'd be better off to start looking into Easter Island and why they got wiped off the face of the planet. We're following their footsteps so close ly it's not funny.
Little wonder the fucking thing is trading close to $70/barrel on NYMEX. Just goes to show the disastrous effects porn has effected on the global economy!
Yongquist's book excerpt on shale is here: http://dieoff.org/page132.htm Even if Yongquist is wrong, and there is a minimal net energy gain in oil shale, I'm betting that the aquifaction system and the transportation and the refining process will eat severely into that modest energy gain (which your link claims) effectively making shale exploration an exercise in futility.
You're better off converting some of the cars and trucks to compressed natural gas and reducing oil consumption this way than messing with the shale.
Also, extracting oil this way uses staggering amounts of fresh water which is already a problem for the Canadian tar sands operation. There isn't enough fresh water in Canada to produce 20mbpd of oil ouput.
These things can be done on a small scale but they cannot scale to the levels of light sweet crude production and are extremely costly operations.
Oh, and good luck getting the American public to buy into your nuclear plant project.
Where in the original post do I defend the Canadian suburban sprawl? And yes, suburban sprawl here is just as bad as south of the border.
You're not a European, but perhaps you've always been a city dweller and are looking at this from that particular frame of reference (i.e., romanticizing the idea of city life).
You romanticize suburban lifestyle as much as I romanticize urban living (which I don't really). Throughout my life I spent years in various environments, staring with pure rural on my granparents farm, through high density urban tower block living, to eventually move out to suburbia with my parents a few years before I moved out and started living on my own.
I know fairly well about European lifestyle because I spent eight years living there and I'm fairly familiar with how their cities operate. I can guarantee you that given a choice, at least half of American (or Canadian) suburbanites would pick a modern European city lifestyle over the caricature of rural living that is North American suburbia.
Do you notice how we Canadians (and you Americans) keep fooling ourselves about the wonders of suburbia? How subdivision names often represent that which they destroy ("Beaver Creek Valley", "Oak Hills", etc).
It is a caricature of rural living because it offers no advantages of rural lifestyle (healthy food, work in the open air, contact with nature) but bears all disadvantages (isolation from culture, kids trapped in the house, long distances to travel in order to trade, work and entertain etc). As such it's fair to say that suburbia is a giant misallocation of resources.
Do you notice how car commercials always show empty mountain roads and vehicles happily roaring through the wilderness? Now look at the traffic jam at your nearest interstate. See the dissonance between the commercial on TV and real life? All of suburbian living is built on delusions like that.
Now, city living in a European styled city (if you want to experience it but are on a budget, take a trip to Quebec city for a taste of Europe that's a surprisingly realistic imitation) has downsides such as housing closer together. Yet, sacrificing your quarter acre yard in exchange for shorter commute (or no commute), beautiful architecture, nice neighbourhoods, functioning infrastructure, access to culture and independence for teenagers to socialize without asking mom for a "lift to the mall" is a small price to pay in the opinion of great many people.
Suburbia was invented to address the problem of having some nastiest most horrible looking, most disgustingly polluted cities in the world, and was hardly the pinnacle of human habitation. It was a temporary fix that got horribly out of control.
In the era of expensive oil this bizzarre societal setup will have to be fixed. There is no way around it whether the majority of us like it or not. I just hope we still have enough resources (financial as well as natural) to reshape our structures to survive the energy shortage shock that's coming in the next few years. And I hope that what emerges is a bit more worthwhile of preserving than a bunch of cheap slapped together McHouses with fried chicken huts in between them. Wouldn't you agree?
You say that because your cities suck. Seriously, American cities sprang to life during the 19th century, the era of heavy industrialization. In effect they becamse massive industrial parks and not human habitats. There is not tradition of merchantry, trade, culture etc. in a typical North American city. This is why you despise city living so much and that's why the term "inner city" is to you synonymous with poverty.
When I grew up, my family was not wealthy (not poor either), but we lived in a 3000+ square foot home on three acres of heavily wooded land with a waterfall in the backyard.
All this in the era of cheap oil, probably well before US oil production peaked in 1971.
And this was the norm in this neighborhood! These were not terribly expensive houses either (think $250K).
Quarter of a million dollars is INSANELY expensive by any standard in the world, in any country. Only a US citizen during a real estate bubble can call that an inexpensive property. And I say this as a Canadian btw.
It was absolutely wonderful to live in such a peaceful, relaxing environment, close to nature. Sure it was a little ways to stores and work, but it was definitely worth it.
Well, suck it up. You lived in a bubble powered by incredibly cheap energy. Now that the bubble has burst, your utopia is over. In the past, people who lived in rural environments engaged in rural activities (ie farming). Now, that oil is about to get dramatically more expensive that model will soon become the only one acceptable. Farmers live on farms, city folks will live in cities. Subarbia was the most incredible misallocation of resources in the history of humankind.
Europeans aren't running out of land, they just never tried or wanted to build a drive-in utopia of mixing country living and urban lifestyle in a single package.
European cities are still considered very desirable places to live because they boast beautiful architecture, provide lots of amenities with walkable communities and they don't permit heavy polluting industries in the core of the cities. Now, there are nice cities and there are nasty cities in Europe just like everywhere else. Yet a European city on average, is a far more human friendly place than any North American city (note here that Mexico and Canada aren't excluded from my argument).
I despair what chaos expensive oil may cause in the coming years. Yet, I'm full of hope that it will eventually bring out the best in people and allow us to rebuild our countries (mine as well as yours) in a more citizen friendly fashion where people want have to escape to suburbian narcosis in order to live decent lives. Down with oppressive cities full of concrete and intimidating "tower blocks" surrounded by belching factories and refineries and littered with fried chicken pits and 90% covered with garangutan parking lots. Is this really a type of environment that you as an American citizen feel proud of? I as a Canadian feel no pride in this (and remember our place is just a smaller, colder imitation of yours).
That said 80:1 is clearly and exaggeration for any kind of oil.
However, the EROEI for tar sands is about 1.5:1 but US shale yields EROEI less than 1.0:1! That means that regardless of the price of a barrel of oil, the shale will never be profitable because the input energy will always cost more than what anyone can make selling the output energy. We're better off consuming the input energy directly and leaving the shale alone. Less damage to the environment and more net energy in the world.
The other problem with the synthetic crude from tar sands is that most refineries are unable to process it. That's why I called it "shitty" crude.
...and their oil is shitty and expensive. Also they can't scale production of it to the level you are hoping for. Tar sands production requires gigantic natural gas inputs. There simply isn't enough natural gas around to produce enough barrels of oil to satisfy US apetite.
Greenspan controls the supply of US dollars by setting interest rates. If you don't understand how interest rates affect money supply resit your economics 101.
The US buck is not pegged to oil on a fixed basis but the fact that demand for oil equates to the demand for US buck (an artificial link maintained by the US through its unbelievable military might) means that anyone who wants to have a working economy needs US greenbacks. Why? Because it isn't possible to have a working economy without ample supplies of oil. China is the prime example here. But the situation is even more skewed in America's favour because not only is the supply of US greenback controlled by Greenspan, how those bucks are spent is controlled by Washington. China discovered that the hard way when they tried to buy Unocal. Now they are looking like idiots stuffed with a bunch of worthless paper printed by Mr Greenspan that they can't buy anything of real value for. I don't think they'll be so keen to stock up on US treasury bonds from now on. And once they unload what they amassed so far things will get very intresting in the ole' US of A.
Finally, from your comment I can discern that I understand a hell of a lot more about marktets than you do, sir.
It is also highly questionable whether Iraq is better off in its current shape vs what was there before Bush sent his minions. As a matter of fact most indicators show a substantial decline in an average Iraqi's life quality. Child poverty and mortality are at their highest. Frequent shortages of energy are commonplace and I haven't even got to the incessant daily violence.
It won't surprise me one bit if Saddam is not only freed but asked back to sort this mess out once Americans leave with their tails between their legs. Thare'd be a bit of poetic justice to it.
Bush is there to ensure the security of US oil supplies and to make sure oil remains to be traded in US dollars. If one of those things changes the US economy is headed for a catastrophe that'll make the Great Depression look like the good ole' times.
Yeah, it was all about Iraqi Freedom, silly me! Or is it Weapons of Mass Destruction? Which one is it this month?
Believe your government's propaganda all you want but ask yourself this question. If Iraq had been sitting on massive reserves of figs or bananas would they have been invaded by the USA?
There are brutal regimes all over the world, African ones seemingly the most vicious of them, there are WMD in former Soviet republics that can be had for a few crates of vodka. Why doesn't your government interven there if the WMD threat is its true motivation?
I wish you were wrong but you're not.