|
Pualee wrote: BUT... is there still a value to testing those methods which call into the simple units, or is that left to the QA department's functional testing? The underlying question here is, will that affect my code coverage metric adversly?
And that is the $20,000 question. Here's my 2c:
OK, let's say you are ultra-super disciplined and your lowest level methods don't have any conditional logic, no looping, nothing but "here are the inputs, here's the output." So that's the Holy Grail of unit testing not necessarily doable or meaningful.
The second level is that we allow some basic conditional logic and some basic looping. OK, now the unit tests are a little more meaningful and still "controllable" in that we can usually provide all the test cases to test each branch and iteration / recursion, as long as the functions are small enough.
What then? Well, can you organize your higher order functions somehow? For example, those that simply perform a workflow. It's easy enough to write a unit test that the workflow does what it's expected to do. What about more complex conditions? Those are unit testable too -- again the idea is to keep the functions small so that there aren't too many branches that need to be called. And furthermore, and most importantly, branches should not contain any statements other than a call to function to do something on that branch. No nesting, no inner looping, nothing but if-call-else-call. Rinse-and-repeat as you go up the food chain, keeping functions with conditionals and looping small, realizing that you don't need to test the lower level calls, only the higher level results.
At some point, the cost of unit tests becomes too high, which is a good time to switch over to the "if it broke, write a unit test first to recreate the problem" mode. That way, it's really cost effective -- you're fixing only known bugs and adding to your test suite.
Pualee wrote: Unit testing seems to force you into a certain mindset when you start out the coding.
They do indeed!
Does that help?
Marc
|
|
|
|
|
Marc Clifton wrote: Does that help?
Yes indeed. Helps to clarify the fuzziness of when and how to test.
Thanks!
|
|
|
|
|
Just has a look at droptask that is a good site / tool I like it
oh and congrats on the new e-book
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Simon_Whale wrote: Just has a look at droptask that is a good site / tool I like it
Yeah, I like how they handle the visualizations of subtasks, etc. There's a few features I wish it had, like task dependencies, but overall it's quite fun.
Marc
|
|
|
|
|
Congratulations on the new e-book; hope to read it soon.
|
|
|
|
|
jesarg wrote: Congratulations on the new e-book; hope to read it soon.
Thanks! Well, I'll be posting when it becomes available.
Marc
|
|
|
|
|
|
Just had this sort of discussion with my 15 yo. Best to learn to keep your mouth under control.
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
I am not at all for violence, but in general, you'd better shut up if you are not prepared to live with the consequences of what you say.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
I do like the way the Mail have pixelated the Audi's number plate but linked to the YouTube photo in which it is not pixelated.
|
|
|
|
|
doh!
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
I had a car swerve in on me and attempt to hit me and I was cited (as a cyclist) I now have my go pro on universally. Unfortunately, most police don't like bicyclist either. Now that I am go pro'd and lawyered up I can finally cycle without fear.
|
|
|
|
|
I'm pretty sure the camera won't do anything to reduce the risk of someone in a car or truck running you over. After the fact it might help your estate sue the moron for everything he owns, but you'd still be pushing daisies.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Quote: you do not expect to see that kind of behaviour on the roads Never been in Rome.
Veni, vidi, vici.
|
|
|
|
|
I know I am going to look a fool here but what does 'p***k' stand for?
I know 'p**t' but all I can think of for 'p***k' is 'plank' which maybe for a Daily Mail reader is a bit down on the streets!
Someone educate me!
All round good guy.
|
|
|
|
|
Brendan Costigan wrote: what does 'p***k' stand for? It's what you can do with a needle or a pin.
/ravi
|
|
|
|
|
Thanks.
I was never any good at crosswords!
All round good guy.
|
|
|
|
|
I find the road markings to be confusing as hell. Are they bike lanes or bus lanes? At one point the road has clear car lanes, but at the intersection, the bike late becomes as wide as a car lane?
Also found it comical that the bicyclist is annoyed at a car in the bike lane, but appears to have road in the car lane.
|
|
|
|
|
I am Jack's complete lack of sympathy for cyclists.
|
|
|
|
|
I was driving into work one day and there was a bicyclist in my lane one day, because there was a marked bike trail that was parallel to the road a right off the curb. I figured he was attempting to cross the lanes to get to the other side. As I enjoy bicycling myself I wanted to be courteous. So before switching lanes to avoid either one of us swerving into each other I tapped the horn to let him know I was there and I passed without incident.
While waiting at the traffic stop down the road the bicyclist pulls up alongside my car raps the window hard and flips me the bird while screaming about his rights to ride on the streets and heaven knows what else and then proceeds through a red traffic light. Elephanting arse!
Seeing this video allowed me to project my fustration on that guy. I do not advocate violence by any means but sometimes when two angry people cross paths there is that guilty pleasure of seeing them pummel each other and vicariously satisfy the resentment that one feels for people like them.
It was broke, so I fixed it.
|
|
|
|
|
Maybe I'm missing something important here, but isn't f******* what a p**** is designed for? Where's the problem? I could easily imagine a worse insult
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Dear Email user
You have won the sum of {Three Million Pounds £3,000.000.00} Cash from windowLive Award Program and your email address was generated in the recently drawn of windowLive Award Program for First Quarter of the Year 2014. Payable through our Paying Agent in South Africa. This Unique Program is Organized Every year to create and improve a larger awareness record for all internet usage for worldwide.
Kindly note that Your Ref: MDB/929/2014 falls within our Afro booklet Regional Headquarters representative office in Johannesburg, South Africa as indicated in the play coupon. For security reasons, you are advised to keep your winning information confidential until your claim is processed to avoid double claim.
Your winning details Below
Reference Number: MDB/929/2014
Amount Won: £3000.000.00
Payment File Number of Deposit:PPC/ZA5622/2014
You are hereby advised to Contact our Paying Agent (Payment Processing Center) for Immediate release of your fund.
Contact Persons: Mrs.Linda Rose
Direct Line: +27-74-460-5818
E-mail: ppcenter@accountant.com
Full Names:
Sex:
City:
Country:
Direct Mobile:
Age:
Occupation
Email:
Alternative Email
Reference No:
File Number of Deposit PPC/ZA5622/2014
Congratulations'' once again from all our Staff and thank you for being part of our Promotions Program
Yours Truly,
Onbehalf of WindowLive Award Team
copyright©2014 window live Inc
---------------------------------
Obscurum per obscurius.
Ad astra per alas porci.
Quidquid latine dictum sit, altum videtur .
|
|
|
|
|
Dalek Dave wrote: For security reasons, you are advised to keep your winning information confidential until your claim is processed to avoid double claim.
You've blown it now!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
you lucky blighter, lend us a tenna
You cant outrun the world, but there is no harm in getting a head start
Real stupidity beats artificial intelligence every time.
|
|
|
|
|
Wrong forum.[^]
Now, seriously, it is enough to get the emails, if it were possible not to bring them in the Lounge also...
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|