|
Marc Clifton wrote: Ultimately, the goal of a unit test is to provide some confidence that you can build higher level functionality on low level units of code.
I disagree entirely. The purpose of a unit test is to prove that unit of code works, that it behaves as you want it to. That given a certain range of inputs you get the desired outputs. If you write tests that don't explore boundary testing and different scenarios then your tests *are* useless and you shouldn't do them. When you build functionality on top of that code then that introduces more logic etc so requires its own testing. Of course that code isn't going to automatically work just because the code it uses does. If that's what you think unit tests are for then it's no surprise you don't see their value.
Unit tests come into their own when refactoring code or amending code to encompass new functionality, especially when working in a team. Unit tests should add confidence that changes you are doing don't alter the previous logic in any way, and if it does alter that functionality you should be told of such by the failing tests which then enables you to have a discussion around how you come up with a solutoin that satisfies all parties.
|
|
|
|
|
F-ES Sitecore wrote: I disagree entirely.
There are times when I start off writing a sarcastic/humorous response and then discover that there are some half-truths come out of it, granted, based on faulty logic/reasoning.
F-ES Sitecore wrote: If you write tests that don't explore boundary testing and different scenarios then your tests are useless and you shouldn't do them.
Well, not necessarily. Sometimes I write a unit test because it's a convenient way of setting up a test fixture for testing that code works with normal parameters. I may or may not go back and do boundary testing later on - it all depends on whether I can guarantee that the inputs are always valid for various reasons, including that the caller is doing validation.
F-ES Sitecore wrote: Unit tests come into their own when refactoring code or amending code to encompass new functionality, especially when working in a team.
Yup, and the irony there is I did an introductory demo of unit testing for the team I landed in, as nobody even knew how to write unit tests, let alone use the tools Visual Studio provides.
Marc
|
|
|
|
|
I have often found that the best unit tests are, in reality, actually using the application that you are building to attempt to achieve its intended goal.
if (Object.DividedByZero == true) { Universe.Implode(); }
Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016
|
|
|
|
|
CodeWraith wrote: In no place and at no time a test has ever proven anything. Plans are useless in wartime, planning is not. The same goes for testing.
A unit-test is something that tests the assumptions about a bit of code in an isolated environment. Those assumptions (or requirements) come from the specs, which may alreay contain errors. Even if you can guarantee that every nail and plank is tested, does not mean that nothing can go wrong when putting the parts together.
I'd have to agree with you on some other subjects as well;
Someone else wrote: If you believe that people’s ethnicity, gender, or whatever is a good way to judge their skills or what they have to teach you, you’re limiting your own development as a software developer. It is not what we believe, but what we DO.
Humans (and animals) categorize things as they encounter them, because putting them into a "known box" is an evolutionary advantage. If you encounter a lion and it eats one of you, then it would only be logical to be fairly acceptable to be wary of any other lion.
Whine about it all you want, psychology nor biology will change just to satisfy the perfect safe-space universe. And your gender has nil impact on my code - and no, I will not include a list with 27 types of genders in my database. You are seriously limiting your own growth if you keep living in a world of make-believe.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: If you encounter a lion and it eats one of you, then it would only be logical to be fairly acceptable to be wary of any other lion. Or at least to make sure that you are faster as other ones
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
..you can call me prejudiced, but we will not go hunting together
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Plans are useless in wartime, planning is not. Erwin Rommel, if I'm not mistaken. So tests are useless in wartime, testing is not?
But ok, I sure have better things to do than testing or planning when I see the light brigade charging at me.
I need a perfect, to the point answer as I am not aware of this.
Please don't reply explaining what method overloading is
|
|
|
|
|
No plan survives contact with the enemy!
So, no test survives contact with........management?
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
plan --> enemy
test --> user
I need a perfect, to the point answer as I am not aware of this.
Please don't reply explaining what method overloading is
|
|
|
|
|
I find users to be much less adversarial, though that was my draft version :p
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Hey, even better: For the first time my signature appears.
I need a perfect, to the point answer as I am not aware of this.
Please don't reply explaining what method overloading is
|
|
|
|
|
Your plans may not be watertight, just as testing does not prove that there are no unknown errors in the application.
Still you will need some planning to prevent complete chaos. Not testing simply because it does not guarantee anything is the same accepting defeat.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Heh. That sounds like my rant.
And ironically, F-ES Sitecore wrote exactly the same reply.
Marc
|
|
|
|
|
You need a map and a shovel to find them...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
And the parents in law are a "reverse treasure"? You need a shovel to bury them?
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
A real pirate would know that both is true for treasures.
I need a perfect, to the point answer as I am not aware of this.
Please don't reply explaining what method overloading is
|
|
|
|
|
My ex-girlfiend was a treasure - she had a sunken chest!
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Good one!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
X marks the spot?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Somehow, you need to work into this:
"One Man's Trash Is Another Man's Treasure - Any Takers?"
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Seems Oak Island's the safest place to bury treasure; the brothers have spent millions, torn the place apart and found no more than a couple of pennies (which I guess they can now rub together), half a dozen rocks, and last season (or before) a stick they still wet dreaming over. Never mind the treasure, they've probably destroyed more in real estate value than any box of gold is worth.
Point is the holes are already dug out there, enough to bury a small village an entire extended family.
Sin tack
the any key okay
|
|
|
|
|
So as all the old timers here know, I have been here since the first couple of weeks of the sites existence. I was the first Michael Martin here by far, I know this as I was allowed to name my account Michael Martin.
So today my setting faarrrkkkk up and I have to make some changes. One of them was to pop-up user profiles, I'd rather suck a dog off than have that shite running.
So I go to My Settings (as they have moved that particular setting there) and find I can't save any changes as Michael Martin is already taken. Can't even remove the erroneous spaces that have been put between the <, b, i and >'s in there.
So f***et I'm now Michael Faarrrkkkking Martin.
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004
|
|
|
|
|
Nice to meet you. Better faarrrkkkking than no king at all.
I need a perfect, to the point answer as I am not aware of this.
Please don't reply explaining what method overloading is
|
|
|
|
|
I somehow have the sensation of a dejavu
Didn't you have this same problem one or two years ago?
I suppose this is something @chris-maunder can solve. I would recommend you to contact him, later when you are not so pissed off
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I still hope that this is the same thing that I'm suffering from. He is in a far better position than I am to keep complaining until it is fixed.
I need a perfect, to the point answer as I am not aware of this.
Please don't reply explaining what method overloading is
|
|
|
|