|
I can actually see what you mean in the case of (true) Agile, because in that case the hand-off from dev to QA should be so tight that it is as if the hand-off were simply the one person who played the role as dev would now put on her QA hat and do the tests. In that case you would be right and that is really how it should work and that is again directly tied to ownership.
But, i assure you, long ago when that dev said that to me, it was entirely because testing was beneath him. Great conversation here though.
|
|
|
|
|
We're set up here now with SonarQube hooked into the CI system so if test coverage on new code is below 80% the change is automatically rejected (and it does reject changes).
We still get people saying "I don't understand why I need to test", which I hear as "I don't understand why I need to write higher quality code and catch issues earlier when they can be fixed more rapidly and where it's cheaper to do so".
I find that if you can set up a system to show unit tests being run, coverage information and actions being taken when issues are found then there tends to be more corporate buy-in. We had a senior manager here who wanted screens up so he could see the information each time he walked by the different teams.
Eagles may soar, but weasels don't get sucked into jet engines
|
|
|
|
|
I must be so freakin' old. It would never occur to me to give someone something attributable to me without making sure it works.
I've wasted so much time. If there's a problem then someone would probably tell me if it were really important. So much time wasted.
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 |
|
|
|
|
|
W∴ Balboos wrote: It would never occur to me to give someone something attributable to me without making sure it works.
That's exactly how I feel about it. It was literally like listening to a crazy person when he said he hadn't even shot one element of data through the thing. Crazy!
And, you're not old, you have a fine attention to The Craft of Software Development.
(Also, I'm old too.)
|
|
|
|
|
If for nothing else, I find unit tests the quickest way to debug new features and check they actually work. Far quicker than manually clicking through UI controls until you get to your new feature / bug fix.
Although I have worked with devs who pass on to QA without even running through the code themselves . .
|
|
|
|
|
Absolutely! Great comment.
Griping about unit tests and/or just not doing them is akin to griping about Source Control.
If you don't understand how much value Source Control brings as a developer and you only see it as overhead, then you probably don't really understand a lot about real dev. Source Control is annoying at times, but it saves so much work. Same thing for unit tests.
|
|
|
|
|
I've only been in the trade for 4 years so perhaps that is before my time. I can't even imagine working without source control. That includes personal projects, but particularly for collaboration.
What is the alternative to source control when working as a team? Emailing code around? Store on network drive? Word of mouth? Passenger pigeon? Reminds me of the time I received a printed XML in the post..
|
|
|
|
|
Sometimes it's better that the original developer doesn't write the (automated) tests.
Sometimes all that means is that the developers misconception of the requirements gets written twice.
OTOH, a test script that runs through all the expected interactions is useful, and yes, the basic test data for those interactions.
That said, most place I've worked don't have dedicated testers - just user acceptance testers.
|
|
|
|
|
AndrewDavie wrote: just user acceptance testers.
That's a good way to look at this and it sparked a thought in me.
User Acceptance testers can decide whether the software meets the user requirements and bascially fulfills the outward contract. So the testing could determine that the software is 100% correct.
However, without unit tests the design underneath could be so terrible that as soon as the customer wants to add an "easy change" the design may be so brittle that everything falls apart. So unit tests and other tests can/may indicate where the design is broken or bad and those kinds of tests would never be found by acceptance testers.
Good comment. Made me think.
|
|
|
|
|
Sure, programmers should do some unit and module testing.
But too often, programmers test their software when used the way it is supposed to be used. It is not like the "five year old test": Place a five year old by the keyboard and tell him "You just do what you want to do, and you'll have another ice cream cone every time you make the program crash".
Real testing must be done by "misbehaved" testers. People who are paid by the number of bugs they find, not by the number of code lines they write. 30 years ago, before software testing was an established discipline, we used student summer interns: If they stayed with us for more than half a year, they learned the programmer's way of thinking, using the software the intended way, and the number of bugs detected gradually. Every summer we got a new group of students, unfamiliar with the software, and the detected bugs count rose sharply.
Nowadays, we have a separate testing team - full time, but then: They are educated in the discipline of testing. Their profession is to identify corner cases, defining stress testing, managing bugs databases (programmer solution: add a comment in the code: "To do: Fix this bug when time allows" ), and rating the severeness of the bugs, making sure that the all the serious bugs are really fixed before the product is released.
Besides: Their job is to bark at the programmers when bugs are found that should never have been made at all. Programmers don't like to be barked at. So they do proper unit and module tests just as much to quiet down the testers as to satisfy the customers
I think the t-shirt I am wearing today is somehow related to my own program/bug-writing experience - it says "Experience - the ability to recognize a mistake when you repeat it". That certainly describes my experience when my code goes to the testers.
|
|
|
|
|
Great comments. I agree. There are definitely different types of testers and testing. as a matter of fact, the book I mentioned also touches upon these and how they are all different and should be considered.
|
|
|
|
|
I also find that if you want to make testable code, stay as "functional" in your programming as much as possible.
Anecdote:
I recently had to rework a monolithic module. The final result was 4 independent modules (separation of concerns) that were pure functional (inputs, outputs, no side effects) which generated almost the same information, but it was a lot easier to test/debug/capture intermediate results/replay/prove/etc.
The functional/separated modules actually were a lot cleaner and faster (less iterations) since one data structure in the old monolithic was split into separate,focused structures in the new modules.
After the refactor was complete, then the new requirements were added with clearly observable/diff-able results in outputs of the affected modules.
|
|
|
|
|
Excellent commentary. My primary customer makes a lot of different industrial machines. One of the primary engineering tasks is testability - how do we know this thing actually works? Keeps the electrical and mechanical engineers busy.
No reason why the same principles could not be applied to the software.
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"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
|
|
|
|
|
Need a review when you're done.
In 35 years, I've not yet worked in a shop that actually had deliberate testing. Sure, as the developer, you do (at least it's what I hold myself to) have a resp. to see that the code does basically what it's supposed to do. We only joke about "it compiled and linked, should be good".
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"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
|
|
|
|
|
Me: can you provide instructions on how to test your code?
Current Co-worker: I can't think in that kind of mind set.
Me:
co-worker also refuses to answer most emails - they don't want to be pinned to a paper trail. It really sucks on so many levels.
|
|
|
|
|
umjaco69 wrote: Current Co-worker: I can't think in that kind of mind set.
Riiiiiiiiight. S/he can't think in that mindest. Whatevs!! Doesn't want to think, more like.
|
|
|
|
|
The next two words out of Dev's Boss' mouth should be: 1) "You're" and 2) should start with a "f" and end with an "ed".
|
|
|
|
|
Right on!!
|
|
|
|
|
Gives you a whole new perspective on driverless car software huh?
Speed: 60 kph
Terrain: mountain road on a bridge over a chasm
Altitude: 2000 meters above sea level
Forward Sensors: 5 workers on the road 10 meters ahead
Reverse Sensors: tractor trailer approaching at 65 kph 20 meters back
Plow into the workers (5 killed)?
Veer off the bridge? (1 killed: passenger)?
Things that make you go hmmmmmm.
Cheers,
Mike Fidler
"I intend to live forever - so far, so good." Steven Wright
"I almost had a psychic girlfriend but she left me before we met." Also Steven Wright
"I'm addicted to placebos. I could quit, but it wouldn't matter." Steven Wright yet again.
|
|
|
|
|
An interesting perspective.
|
|
|
|
|
It's about the environment. Having someone leave after 2 days is preferable.
When I was 19, my first full-time position was working with Insurance Calculations for Premiums.
Finding out that I COULD BE FINED for errors in my calculations CHANGED me for the better. I would add diagnostic output to the current code (based on a setting)... And it allowed me to see the internals of ANY Premium Calculation change.
The worse part was the ratings books were always being updated, and our #1 change was to the ratings system that adjusted "some" premiums.
So, I would make my changes, capture last nights run. Restore/rerun using my new calculation, and DIFF the 2 sets of data. Highlight, and MAKE MANAGEMENT sign off that the new calcs were good, and nothing else was affected...
From those days forward. Having some semblance of testable code (at least unit tests) was key. And my biggest goofs were thinking something was such an OBVIOUSLY SIMPLE solution that it did NOT need any "coverage" testing...
|
|
|
|
|
Thanks for adding to the conversation.
Kirk 10389821 wrote: my biggest goofs were thinking something was such an OBVIOUSLY SIMPLE solution that it did NOT need any "coverage" testing...
So true. I've found that often to be true also.
this whole dev-testing thing is really about the mentality you bring to the coding game.
And then, there are tools & methods that can help make it all are part of the process.
A good book that makes you contemplate the entire dev life cycle. I'm enjoying the book.
|
|
|
|
|
Over a 35-year career, I have worked in two shops where they did good unit tests. And these tests caught practically all bugs. Integrations were a breeze. Merging changes, no problems.
Both these shops had psychopathic managers that made life a horror. One was a startup that burned brightly for a year and went dark. The other was a zero-documentation, high tech debt nightmare.
My conclusion is that a conservation law may be at work limiting the amount of goodness in any workplace. I am still working on an experiment to reveal the exact nature of this fundamental law.
|
|
|
|
|
Great post. Very interesting.
And you may be right, no work place can probably be good for a long period of time as measured by numerous factors.
Too bad. Things degrade.
|
|
|
|
|
I don't tend to write test cases; I write industrial automation code and to try to write tests for every possible interaction with the I/O would be a nightmare, so I do simulations with virtual and physical (dummy) hardware in my office. it's easier to simulate real time issues and faults with switches, knobs and various sensors. This finds 99% of all issues before they go out to the field, then on-site startups tend to find the remaining 1% of the edge cases.
As the sole programmer and tester (and installer, and trainer) for a decent sized company I have to manage my time very carefully. And yes I have to go to each facility for startups; way too much traveling.
|
|
|
|