Testing Departments are for Losers
I understand that this is a very strong statement and I’m definitely not trying to insult anyone; so apologies in advance. I’m trying to challenge the belief that testing is mandatory and that there should be one testing resource for every two developers. Quality development is about quality assurance and zero defects not about having testing departments.
One testing resource for every two developers is not a good solution
Quality Assurance (QA) is about making a positive statement about product quality. QA is about positive assurance, which is stating, “We are certain that there are few, if any, defects in this product.” Airplanes are a product with quality assured, the manufacturers will stand by their quality and the statistics back them up. Contrast this with this article or this article which wonders what would happen if Microsoft made airplanes — would you fly in them?
he reality is that most testing departments simply discover defects and forward them back to the engineering department to fix. By the time the software product gets released we are basically saying, “We got rid of as many defects as we could find before management forced us to release this product, however, we really have no idea how many other defects are in the code”. This is not assuring quality; at best you get negative assurance out of this.
Everyone understand that buggy software kills sales (and start-ups
), however, testing is often an after thought in many organizations. When software products take longer than expected they are forwarded to the testing department. The testing department is often expected to test and bless code in less time than allocated.
To compound problems, many testing departments don’t even receive proper requirements against which to test the code and/or sufficient tools to work with. Large testing departments and/or large amounts of manual testing are not healthy or efficient.
Humphrey Watts was emphatic that calling defects “bugs” trivializes the issue and downplays the negative impact that defects cause on a development organization.
Calling defects “bugs” trivializes an important issue
Defects are not introduced into software by goblins and elves. Defects areinjectedinto the code by developers that:
- don’t understand the requirements or architecture
- misunderstand how to use their peer’s components
- misunderstand 3rd party libraries
- having a bad day because of home troubles or work environment
- are careless because someone else will test their code
Defects are injected by the team
No one is more aware of how code can break down than the developer who writes it. Any line of code that is written without concentration and planning becomes a potential defect. It is impossible for testers to understand every pathway through the code and make sure that every possible combination of variables is properly taken care of.
There are many techniques that can increase code quality and dramatically reduce the amount of testing that is necessary:
- test driven development (TDD)
- database driven testing
- design by contract (DbC)
- inspections
- pair programming
- minimizing cyclomatic complexity
- using static and dynamic code tools
- proper code planning techniques
Test Driven Development
Properly written tests require a developer not only to think about what a code section is supposed to do but also plan how the code will be structured. If you know that there are five pathways through the code then you will write five tests ahead of time. A common problem is that you have coded n paths through the code when there are n+1 conditions.
TDD is white box testing and can reach every pathway that the developer codes. TDD is proactive and can test pathways from end to end, it does not just have to be used for unit testing. When TDD is hooked up to a continuous integration engine then defects are located and fixed before they make it to testing.
Database Driven Testing
Using actual test data to test existing routines during development is an excellent way to make sure that there are fewer production problems. The test data needs to be a copy (or subset) of production data.
Database driven testing can also be hooked up to a continuous integration engine and prevent defects from getting to testing.
Design By Contract
The Eiffel programming language introduced design by contract (DbC). DbC is
orthogonal to TDD because its goal is to ensure that the contract defined by the preconditions and postconditions for each function call is not violated. DbC can be used in virtually any language for with their is an Aspect Oriented Programming (AOP) solution.
During development, the minute a developer violates the expected contract of any function (his or a peers) then the developer will get feedback to fix the problem before it gets to testing.
Inspections
Since the 1970s we have statistical evidence that one of the best ways to eliminate defects from code is through inspections. Inspections can be applied to the requirements, design, and code artifacts and projects that use inspections can eliminate 99% of the defects injected into the code. Self Inspections are not Optional and Software Professionals do Inspections.
Each hour of inspections will save you 4 hours of testing
Pair Programming
Pair programming can be selectively used to prevent and eliminate defects from code. When developers work in pairs they not only review code as quickly as possible but also learn productivity techniques from each other. Pair programming should only be done on complex sections of code.
Pair programming not only eliminates defects but allows developers to get enough feedback that they can prevent defects in the future.
Minimizing Cyclomatic Complexity
There is evidence that routines with high cyclomatic complexity will have more latent defects than other routines. This makes sense because the number of code pathways goes up dramatically as cyclomatic complexity increases and increases the chance that the developer does not handle all of them. In most cases, testing departments can not reproduce all of the pathways in routines of high cyclomatic complexity.
Use Dynamic and Static Code Checking
There are many code problems caused by a careless use of pointers and other powerful language constructs. Many of these problems can be detected by having the development team use dynamic and static code checking problems.
Proper Code Planning Techniques
There are developers that try to write code at the keyboard without planning, which is neither efficient nor effective. This is like having to do errands in 5 locations and driving to the locations randomly — you might get your errands done, but odds are it won’t be efficient.
Watts Humphrey talks directly to the idea of planning in the Personal Software Process. In addition techniques like diagramming with UML or using decision tables can go a long way to thinking through code structure before it is implemented.
Conclusion
Developers are the ones who inject defects into the code and therefore they
are the best line of defense to remove them. The developer has the best information on what needs to be tested in his code at the time that he writes it. The longer it takes for testing or a customer to discover a code defect the longer the developer will spend in a debugger chasing down the problem.
Developers need to be trained in preventing and eliminating defects. Developers who learn to get the code correct the first time will reduce and eliminate effort in testing.
The goal of development should be to catch defects early; this is the only way to assure quality. Hence quality assurance starts and finishes in the development department, not the testing department.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)






Comments
Rajesh Mathur replied on Tue, 2013/01/22 - 11:01am
Dear Mahal,
After reading half of your article I knew that you know nothing about the subject you are talking about. I would still not call it BS because that would be insulting the manure. I did not have to read the complete article because in order to check whether the curry is ready or not, you just have to taste (test) few drops of it! Please read my comments below:
"I understand that this is a very strong statement and I’m definitely not trying to insult anyone; so apologies in advance."
You do not need to apologize, I am sure you have no idea about testing. The statement is 'not' a very strong statement, as we testers have to deal with ignoramuses everyday and we do that with tact, as would be visible in my response to you (hopefully).
Yes, you are trying to insult your colleagues; and possibly because one of those smart testers has found defects in your code. Right? You can be honest with us, Mahal.
"I’m trying to challenge the belief that testing is mandatory and that there should be one testing resource for every two developers."
Where did you get that belief from? Do yo have any statistics to support that? I know you don't. If your belief is based on heuristics and biases, then you do need to recollect that data and base that on facts, not biases.
"Quality development is about quality assurance and zero defects not about having testing departments."
This statement actually does not make any sense as there is no such thing as zero defect.
"Quality Assurance (QA) is about making a positive statement about product quality. QA is about positive assurance, which is stating, “We are certain that there are few, if any, defects in this product.”
I have to repeat it many time and I have no hesitation in doing that. After all that's my job as a tester. QA and testing are not just about 'making' positive or negative statements. Would you accept the 'positive assurance' from the QA group if it says, "We are certain that there are few, if any, defects in the product. BTW, those few may all be high severity defects."
You have no idea of QA too, isn't it? I know I am wasting my time, but showing the mirror is my job. Now it is up to the OP to either break the mirror or accept the defect. Another choice is killing the messenger. Up to you!.
"Airplanes are a product with quality assured, the manufacturers will stand by their quality and the statistics back them up. Contrast this with this article or this article which wonders what would happen if Microsoft made airplanes — would you fly in them?"
Aha!! You got my attention here. I love those machines. I 'test' the software on them; and I 'QA' the hardware changes on some; and I 'test' the integration with avionics on them and sometimes I also review (static 'testing' like inspection) the manufacturer's work. There is a lot more I do as a 'tester' on the airplanes. But, as I said before, you have no idea what you are talking about and you will have no idea what I am talking about too.
Let me ask you a question. When, where & how did you get the quality assurance statement from an aircraft manufacturer to be assured of the quality of their product? Are you confusing aircraft manufacturers with airlines? And are you seriously referring us to those two articles? One written by a former manager at KPMG and other one by a nobody. Both have no background or understanding of airline industry. It is easy to say anything, right? But is hard to compare a $300 computer with a $300 million airplane. and it is NOT easy to compare both of those with a single life. Do you want me to spend similar effort on testing your notepad application because some nube somewhere could not access notepad on his laptop? Are you seriously serious? Hey Mahal, do you dope dude?
"he reality is that most testing departments simply discover defects and forward them back to the engineering department to fix. By the time the software product gets released we are basically saying, “We got rid of as many defects as we could find before management forced us to release this product, however, we really have no idea how many other defects are in the code”. This is not assuring quality; at best you get negative assurance out of this."
Nah, the reality is that you have no idea what testing is, how it should be performed and what testers actually do. You need to wake up, learn more about things you talk about even before you think of writing a single word. That's a different story if you get paid for writing non-sense. I won't question that then.
Now it is my turn to apologize. I read your article up to the point mentioned above. The reason being, it wasn't worth wasting any more time. You know, testing is a cognitive process and a tester has more creative things to do. If you wish to learn more about testing or airplanes, please do not contact me. I am known for losing my patience with a specific species. Please also think twice contacting James Bach because he also belongs to the same category and he is fiercer than I am.