I like Uncle Bob Martin. We're nearly finished his book Clean Code in our work study group and I only disagree with ~5% of what he says. ;)
However he's flipped out over Flipping the Bit. Referencing an article by Tim Fischer, UB has decided that because Fischer calls into question the value of doing Unit Tests 100% of the time, Fischer doesn't value testing (I think he does, he just has bad design which makes his testing life harder).
Unit Tests don't obviously equal TDD, because the T of course stands for Tests, but as we know, there are many levels of testing. Unit, integration, end to end, etc. I'm all for TDD, quite strongly in fact that I've occasionally bordered on being a zealot. Here I totally agree with UB's points about testing (TDD to be specific) as bringing higher quality, "cheaper" code into existence. Fischer has it totally wrong that "[unit] tests are little-used for the development of enterprise applications." In my organisation we write Unit Tests all the time (as part of TDD), and they provide a high degree of feedback and value to the project. His point about the cost (purely monetary) of writing Unit Tests is true from a mathematical perspective, however it's a cost worth paying.
Point (1) of UB's list is totally justified in being there. Reading Fischer's post on can easily think that he hasn't grasped the point of TDD because his examples talk about writing the tests after the implementation. UB is right to smack Fisher on the nose about this one.
Sadly in both these posts there's kernels of truth woven in there, and I think UB missed the nugget in Fischer's post which leads to UB's second (erroneous) point:
Unit tests don’t find all bugs because many bugs are integration bugs, not bugs in the unit-tested components.
Why is he wrong? Because Unit Tests != TDD. The jump there was astonishing to my mind. Superman couldn't have jumped that gap better! We do have to justify the existence of test code - but to ourselves not to higher ups or the Unit Test Compliance Squads. What value are these tests adding? How are they proving the correctness of my program and creating/improving my design/architecture?
If you're writing an Adapter (from the Growing Object Oriented Software Guided By Tests book) then Unit Tests add little value to ensuring that the Adapter works correctly because the Adapter is so tightly coupled to the Adaptee that you'd have to essentially replicate the Adaptee in fakes and stubs. Here any bugs that happen in the Adapter will probably not show up in Unit Tests, because those bugs are signs that the developer probably misunderstood the behaviour of the Adaptee for a particular scenario, and therefore would have coded the fake/stub to be incorrect. You've got a broken stub, an incorrect test, but a green light.
An example is an DAO. It is designed to abstract away access to the DB and is tightly coupled to the underlying DB technology (JPA, JDBC, etc). You don't want to Unit Test that. Integration tests add far more value/feedback with less code to maintain. Add in an inmemory DB and you've got easy, fastish tests that have found bugs in my code far too many times than I'd like. Unit Tests at the Adapter level have only in the end been deleted from my teams codebase because they take time (therefore money) to maintain, replicate the testing logic of the Integration Tests and give little feedback about what's going on down there. That's in line with Fischer's gripes. The costs of the tests outweigh the benefits.
Where Fischer goes seriously wrong is that he doesn't add in all forms of testing into his money calculations, and doesn't realise that if you don't do TDD properly (where Unit Tests do play an integral part) you'll spend more money.
His pretty picture is flawed in that SomeMethod() is business logic (a Port) that uses data from several sources. However a Port should never get the data directly; it should always go via an Adapter ("Tell don't ask", SOLID, etc all show how good design ends up with this result). Hence SomeMethod() can be Unit Tested to the Nth degree covering every scenario conceivable because the Adapters can be mocked (which we own and understand hopefully), while the Adapters are Integration Tested. Other wise the amount of code required to setup what is essentially a Unit Test (because we're focused on the SomeMethod() unit) for every scenario for SomeMethod() becomes prohibitive. Developers being developers will slack off and not write them. If they do, the bean counters will get upset because the cost of developing/maintaining the tests increases as the tests are brittle. If there is a bug where is it located? SomeMethod(), the third party "systems", the conduits inbetween? So you spend more time and money tracking down a problem.
This is where Fischer throws the baby out with the bathwater. He has bad design.
I'm surprised the Uncle Bob didn't pick up on this, and instead focused (rightly) on Fischer's points about cost side of not writing Unit Tests, which devolved (wrongly) into a rant about not writing tests at all.
TDD is the way to go (one should flip the bit for that), but Unit Tests are not always beneficial (eg: for Adapters) and can bring little ROI and instead the Integration Tests should be written first, with the Adapter being implemented to pass those tests. Having said that if you're throwing Unit Tests out all together you've got a seriously flawed design.
Showing posts with label Rant. Show all posts
Showing posts with label Rant. Show all posts
Thursday, January 12, 2012
Thursday, February 24, 2011
Technological justice
In The Age today, it's reported that the Federal court backed iiNet. Finally some sane and reasonable justice from the courts in technological matters.
Well done iiNet.
Well done iiNet.
Friday, January 21, 2011
How to beat the competition by being more agile
Over at Forbes there's a discussion about how Facebook beat MySpace. The simple solution I got out of that was Facebook is more agile, but that they also priotise customer input. Enough users want something, Facebook gives it to them (and one would assume as fast as possible). That's responding to change, obviously a key Agile principle.
Makes me think about how doing business might continue to change over the years. The suits and the bean counters may want to do one thing (lots of Powerpoint presos with forecasts), and the techs on the ground might only be thinking three months ahead - getting the latest feature out the door. There's something to be said for long term vision but do short term sprints take precedence? After all the company has to make money to keep the suits in a job.
One thing Facebook does need to do is focus on quality. To much of it breaks (and often non deterministically). The fact that I can't invite friends to an event now for three days means something's going dreadfully wrong. Since you listen to customers Facebook, can you please fix your defective parts as well as push out the latest and greatest features?
Makes me think about how doing business might continue to change over the years. The suits and the bean counters may want to do one thing (lots of Powerpoint presos with forecasts), and the techs on the ground might only be thinking three months ahead - getting the latest feature out the door. There's something to be said for long term vision but do short term sprints take precedence? After all the company has to make money to keep the suits in a job.
One thing Facebook does need to do is focus on quality. To much of it breaks (and often non deterministically). The fact that I can't invite friends to an event now for three days means something's going dreadfully wrong. Since you listen to customers Facebook, can you please fix your defective parts as well as push out the latest and greatest features?
Friday, July 23, 2010
100% Nonsense
Meanwhile in totalitarian land the government has gone completely bonkers.
If Labor wants to boost it's chances of getting reelected it should dump the filter. If they can orchestrate a coup in a night, why can't they dump the stupid thing?!
If Labor wants to boost it's chances of getting reelected it should dump the filter. If they can orchestrate a coup in a night, why can't they dump the stupid thing?!
Thursday, June 24, 2010
I for one would like to welcome our new overlord
If you haven't heard, Australia has just replaced our Prime Minister, with a lady. Well done to Julia Gillard for becoming the first women PM in the country's history. Hopefully she has a better technology policy than her predecessor. Nothing would make me - a voter in the next election, happier than for Conroy to be fired and the whole censorship thing dropped.
UPDATE: Kate Lundy looks awesome for Conroy's role Thanks to @brucejcooper
UPDATE: Conroy stays on. Shame that.
UPDATE: Kate Lundy looks awesome for Conroy's role Thanks to @brucejcooper
UPDATE: Conroy stays on. Shame that.
Tuesday, June 22, 2010
Continuing saga of Google's WiFi collection
Another article on the investigation of Google's WiFi adventures. There are two paragraphs that brought me great joy.
The Privacy Commissioner, Karen Curtis, has embarrassed Communications Minister Stephen Conroy by playing down the seriousness of Google's Wi-Fi spying bungle.
...
Curtis rejected Senator Conroy's claims that banking transactions were captured, while also noting that Google did not collect personal information transmitted over encrypted Wi-Fi networks.
“Australian banks use secure internet connections and my Office is not aware of any instances where banking information has been collected,” she said.
Curtis (or someone on her staff) obviously got what Conroy didn't/doesn't.
The data may have been collected (who says you can't write encrypted data to a hard drive), but Curtis understands that it wouldn't be of much use to Google.
Good on her. Keep up the good work Curtis!
The Privacy Commissioner, Karen Curtis, has embarrassed Communications Minister Stephen Conroy by playing down the seriousness of Google's Wi-Fi spying bungle.
...
Curtis rejected Senator Conroy's claims that banking transactions were captured, while also noting that Google did not collect personal information transmitted over encrypted Wi-Fi networks.
“Australian banks use secure internet connections and my Office is not aware of any instances where banking information has been collected,” she said.
Curtis (or someone on her staff) obviously got what Conroy didn't/doesn't.
The data may have been collected (who says you can't write encrypted data to a hard drive), but Curtis understands that it wouldn't be of much use to Google.
Good on her. Keep up the good work Curtis!
Tuesday, June 8, 2010
More evidence that the Minister for Communications doesn't know how we communicate
I read an article in today's Age entitled Australia denies targeting Google over web filter. I find this comment by our glorious Communications Overlord to quite informative.
"It is possible that as Google drove past your home, if you didn't have the password protection and you were typing, you were doing your online banking, passing personal information in a transaction, as they drove past they could have captured that," Conroy said.
Informative that Conroy yet again has shown he doesn't get the internet. He's talking about the protection that your wireless router has. WPA or WEP or whatever else you're using. Which is fine to stop my neighbour downloading his pr0n off my network, but Mr Conroy that doesn't stop anybody else reading it when it goes down the pipe to the wider web.
"Oh no, my banking details - if only there was a scheme to prevent people reading my passwords". Enter the saviour of the piece - HTTPS. You see Mr Conroy when data of a sensitive nature is exchanged between two parties they encrypt it. Yes that's right, no bank in the world sends data in clear text. So even if Google harvests an exchange between you and your bank Senator - it's meaningless noise to them; they can't read it (at least without extensive effort/time/money). I dare you to find me the name of a bank that doesn't use HTTPS. I double dare you [insert line from Pulp Fiction] .....
On a philosophical note, if Google harvests data off a unsecured network then the person deserves to have Google exploit their location. People will only learn when they suffer.
Update: Check this out - /sigh
"It is possible that as Google drove past your home, if you didn't have the password protection and you were typing, you were doing your online banking, passing personal information in a transaction, as they drove past they could have captured that," Conroy said.
Informative that Conroy yet again has shown he doesn't get the internet. He's talking about the protection that your wireless router has. WPA or WEP or whatever else you're using. Which is fine to stop my neighbour downloading his pr0n off my network, but Mr Conroy that doesn't stop anybody else reading it when it goes down the pipe to the wider web.
"Oh no, my banking details - if only there was a scheme to prevent people reading my passwords". Enter the saviour of the piece - HTTPS. You see Mr Conroy when data of a sensitive nature is exchanged between two parties they encrypt it. Yes that's right, no bank in the world sends data in clear text. So even if Google harvests an exchange between you and your bank Senator - it's meaningless noise to them; they can't read it (at least without extensive effort/time/money). I dare you to find me the name of a bank that doesn't use HTTPS. I double dare you [insert line from Pulp Fiction] .....
On a philosophical note, if Google harvests data off a unsecured network then the person deserves to have Google exploit their location. People will only learn when they suffer.
Update: Check this out - /sigh
Monday, April 12, 2010
Of Myths and Mandatory Internet Censorship
A very informative article on the subject. Unlike Senator Conroy's uninformed propaganda.
Friday, February 26, 2010
On Customer Service
One thing that makes me stay with a company is customer service. I haven't done much on the HTPC front because I'm moving house. So stuff is packed, and I can't really get into it. When you move house you obviously have to deal with the relocation of utilities. Things like electricity, phone, internet, etc.
In my previous post I was really annoyed at the lack of internet infrastructure here in the land down under. I checked out some competitors and they were offering what I wanted, but not at the price I wanted to pay. This "price" also includes the hassle of transferring providers, and paperwork. So not only were they more expensive from a cost perspective, but there was the transfer.
So why aren't I willing to fork up the extra cash, and change providers? It boils down to two reasons:
I just wish all customer service operators listened to me (us) instead of pushing new products. I'm looking at you 3 Mobile.
In my previous post I was really annoyed at the lack of internet infrastructure here in the land down under. I checked out some competitors and they were offering what I wanted, but not at the price I wanted to pay. This "price" also includes the hassle of transferring providers, and paperwork. So not only were they more expensive from a cost perspective, but there was the transfer.
So why aren't I willing to fork up the extra cash, and change providers? It boils down to two reasons:
- Not enough incentive. The other providers do have the tech, but my provider is catching up. They might have the equipment in a couple of months. So changing providers (for the increase in price), coupled with the usual contractual obligations is not worth it in my opinion.
- Customer service. Whenever I ring up with a problem, or a query, I can talk to an intelligent individual who can talk the language. Working in IT, I get how the internet works. Being able to have an informed discussion with someone I can understand is what keeps me.
I just wish all customer service operators listened to me (us) instead of pushing new products. I'm looking at you 3 Mobile.
Friday, February 19, 2010
Thursday, February 18, 2010
No naked for you
Australia is such a backwards country technologically. If this chart is to be believed; in terms of Internet speed Australia is fifth from the right. Sooooooo slow.
As well as the lack of infrastructure, the current federal government is planning to introduce a National Broadband Network that is going to get shot in the thigh, or, some other major organ by the proposed mandatory filter that our nanny state wants to put over us. What the frell is the point of giving us 100Mbit/sec speeds if the filter becomes the bottleneck. Despite the rhetoric my local MP mailed me back when I wrote to him condemning this atrocity; all the experts I've read and spoke to seem to agree that it's going to be a gigantic farce and waste of tax payers money.
I don't want to reiterate all the objections to the idea, but technically speaking I use a combination of VPNs and SSH tunnels at work. If I know how to do this in a legal capacity for my job, what's to stop me doing it illegally. As I pointed out to a friend (who's an arts student) if you have SSL to protect online financial transactions (for example), what's to stop me using that technology and using it to encrypt and exchange material of an illegal or questionable nature. I'm ALL for stopping child porn, but this isn't going to work Mr Conroy.
And to top it all off - my primary rant for this article is that by moving house 20 kms I have to dumb down my Internet connection. I currently live in Fairfield, and am moving to Mitcham. At my current residence I use what's termed as Naked ASDL2. The best bit of being naked as it were is no line rental fee. I pay an extra $20 to my ISP (which also gains me an extra 15GB of quota) and save between $30 - $50 by not renting my line from Telstra. I love it. I don't call people much anyway these days. Even my mum's on MSN and Facebook. I don't need the phone.
But alas because we're such a backward country over here, 20 kms means dumbing down to ADSL, and a phone connection. I might dig out my old modem in case dial up is required. If you look at the linked map, I'm not exactly moving to the middle of nowhere. Melbourne is so behind the times in every aspect of it's infrastructure (don't get me started on public transport).
I hear New Zealand's nice this time of year.
As well as the lack of infrastructure, the current federal government is planning to introduce a National Broadband Network that is going to get shot in the thigh, or, some other major organ by the proposed mandatory filter that our nanny state wants to put over us. What the frell is the point of giving us 100Mbit/sec speeds if the filter becomes the bottleneck. Despite the rhetoric my local MP mailed me back when I wrote to him condemning this atrocity; all the experts I've read and spoke to seem to agree that it's going to be a gigantic farce and waste of tax payers money.
I don't want to reiterate all the objections to the idea, but technically speaking I use a combination of VPNs and SSH tunnels at work. If I know how to do this in a legal capacity for my job, what's to stop me doing it illegally. As I pointed out to a friend (who's an arts student) if you have SSL to protect online financial transactions (for example), what's to stop me using that technology and using it to encrypt and exchange material of an illegal or questionable nature. I'm ALL for stopping child porn, but this isn't going to work Mr Conroy.
And to top it all off - my primary rant for this article is that by moving house 20 kms I have to dumb down my Internet connection. I currently live in Fairfield, and am moving to Mitcham. At my current residence I use what's termed as Naked ASDL2. The best bit of being naked as it were is no line rental fee. I pay an extra $20 to my ISP (which also gains me an extra 15GB of quota) and save between $30 - $50 by not renting my line from Telstra. I love it. I don't call people much anyway these days. Even my mum's on MSN and Facebook. I don't need the phone.
But alas because we're such a backward country over here, 20 kms means dumbing down to ADSL, and a phone connection. I might dig out my old modem in case dial up is required. If you look at the linked map, I'm not exactly moving to the middle of nowhere. Melbourne is so behind the times in every aspect of it's infrastructure (don't get me started on public transport).
I hear New Zealand's nice this time of year.
Subscribe to:
Posts (Atom)