You are not fed, if you dont ask. <img src="wink.gif" border="0"> <p>SCJP 1.4, i2CP, IBM s390 CP
Originally posted by Rama Krishna Yalamanchili:
As i look at the index, it suggests concepts like checking boundary conditions, forcing error conditions, performance testing ect... which are typically done by testers. I am critical about the factor that you suggest that the programmer focuses more on writing and implementing tests than actual "programming logic".
Dave Thomas <br />Author of "<a href="http://www.amazon.com/exec/obidos/ASIN/020161622X/ref=ase_electricporkchop/002-7467239-7061602" target="_blank" rel="nofollow">The Pragmatic Programmer: From Journeyman to Master</a>
Originally posted by Dave Thomas:
If instead you leave it to testers to try these things, then if they find problems you're potentially talking about redesigning your already written code to fix the issues. And this is far more expensive.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Dave Thomas:
...
As to the problem with your boss not liking the number of lines of test code: a couple of suggestions. First, ask him to let a team experiment with doing proper unit testing, and then to look not at lines of code but instead at overall productivity. I'm betting the tested code will be delivered earlier and with less bugs than the same code developered without testing.
...
Dave
Glenn Murray
Author of Yo Soy Una Vaca De Hoy
/\ndy Hunt<br /> <a href="http://www.PragmaticProgrammer.com" target="_blank" rel="nofollow">www.PragmaticProgrammer.com</a>
Originally posted by Andy Hunt:
The classes and modules without unit tests (or with very few unit tests) were the huge, giant headaches. Those with more unit tests jsut weren't a problem.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Yes, typing 200 lines of code takes more time than typing 100 lines of code. However, the vast majority of development time is not spent typing the code but fixing the defects that the developer introduced while typing those lines of code.Originally posted by Ko Ko Naing:
I guess classes and modules with more unit tests will take more time than those with less unit tests...
This is exactly what every single unit testing author has promoted since the beginning of time; there is a point of diminishing returns in unit testing as well.Originally posted by Ko Ko Naing:
What if we can just neglect some un-important classes and modules to be with less unit tests and emphasize more unit tests on important classes and modules...
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
You are not fed, if you dont ask. <img src="wink.gif" border="0"> <p>SCJP 1.4, i2CP, IBM s390 CP
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Rama Krishna Yalamanchili:
Why should we test th code every 5th line... if i am sure of my programming logic...
Testing has evolved over a paradigm, where what we have engineered is to be faultless. (I hope everyone agrees).
Ex: Civil engineering
If I am building something physical then i would not test every brick. If i know that i have my concrete mixture as prescribed by my building blue print specs then i test the building for its overall parameters.
Ex: Mechanical engineering
If I am assembling a car with x(Horse)Ranch(Power) then i would not test every nut and bolt and tyre as for every car i build. I would quality test a sample car with various mechanical parameters.
Coming to the software paradigm:::
I have my prebuilt OO building blocks. They are tested (I am sure SUN tests its classes before putting it in the Java API).
Ex: I built a security package with RSA. I needed random numbers with (Big Integers)at that time. I would write a piece of code that produces the keys. I would trust Java math.random. And if my extended eucliedien algorthim programming logic is correct which would be around 450 lines. Then i expect the keys to be produced.
What i would test in this scenario if i go by unit testing?
What as programmer i have tested around 6 years ago was that atleast for 100 samples of the keys produced were not identical before i handed it to testing. I did write a piece of testing code which would run the program for n number of times and compare all the results. I had to do a little syntax debugging for typos. And my code still runs with a Major Bank(Big Bucks) I did achieve a piece of code without using unit testing.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Rgds<p>--Siva Jagadeesan<br /><a href="http://java2simple.blog-city.com" target="_blank" rel="nofollow">http://java2simple.blog-city.com</a><br />Sun Certified Java2 Programmer<br />Sun Certified Web Component Developer<br />BEA Certified Weblogic Server 7 Enterprise Developer
Kishore
SCJP, blog
Rgds<p>--Siva Jagadeesan<br /><a href="http://java2simple.blog-city.com" target="_blank" rel="nofollow">http://java2simple.blog-city.com</a><br />Sun Certified Java2 Programmer<br />Sun Certified Web Component Developer<br />BEA Certified Weblogic Server 7 Enterprise Developer
You are not fed, if you dont ask. <img src="wink.gif" border="0"> <p>SCJP 1.4, i2CP, IBM s390 CP
Originally posted by Rama Krishna Yalamanchili:
My point of view (Active vs Passive Testing) is in a sense has a very subtle conflict. As a programmer everyone must test his code(Agreed). No one has commented yet on the logical part yet. Being a programmer for me is to be strong at programming logic and programming syntax.
If i know a language in and out as well have an implicit testing instinct i would bring it out in the code i write. Explicit testing for every few lines of code means we are not matured enough to write code(Or for that matter not a qualified programmer).
"Quote" Test a programmer first before he tests his code "Unquote"
Books: Pragmatic Unit Testing in Java, Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
Originally posted by Rama Krishna Yalamanchili:
Explicit testing for every few lines of code means we are not matured enough to write code(Or for that matter not a qualified programmer).
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Glenn Murray:
Do you know of any published data for this? I'd really like to see
some hard data to support the claim that JUnit tested code is
developed faster.
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|