|
|
||||||||||||||||||||
| Home > Software Quality News > Unit testing critical for improving software quality | |
| Software Quality News: |
|
||
These days, almost everyone agrees that developers should play an active role in testing –- especially in writing and running unit tests on their own code. Unfortunately, there is still a huge chasm between knowing what should be done and actually doing it. Based on what I have seen and heard in the past several years, I believe that a lot of developers have been scared off from unit testing by some of the more extreme developer testing practices, like test-driven development. While I believe that test-driven development is a brilliant idea and can work wonders, for a developer who has never had to write tests, the idea of writing tests before writing the code might be too big a first step. Another problem is that when a software organization finally decides that developers should practice unit testing, in their enthusiasm they often go overboard and start with goals that are too ambitious or expect all developers to approach testing in the same way -- they are too ambitious and too dogmatic. This usually backfires. You need to give developers some time to get used to the idea and the freedom to approach unit testing in the way that works best for them -– at least at the beginning.
Why is such importance being given to unit testing? What needs to be done to ensure unit testing is successful? Think of code and test as one. In other words, don't approach testing as an afterthought. It's very difficult to test code that was not written with testability in mind. At the team and group level, the most important factor in ensuring success is to avoid too much dogma and too many rules -- especially at the beginning. Too much dogma kills motivation and creativity. Here's how I put it in The Way of Testivus: Don't get stuck on unit testing dogma Another, very important thing is that since testing is a combinatorial problem, you have to use some automation or you will be inefficient and will spend time doing things that are best done by a computer: Some tasks are best done by hand.
How have development methodologies such as Agile, Scrum and Extreme Programming (XP) affected programmers' roles in testing? In a perfect world, what would the software development life cycle look like so that companies create applications that are bug-free, meet user requirements, are completed on schedule, and are completed within budget? To give you an idea of what a typical software system would look like if it were physical equipment, imagine replacing software control loops (e.g. for loops) with wheels, conditional statements (e.g. if statements) with mechanical switches, and so on. Even if the size of each physical component was as small as the parts of a mechanical watch, most systems would be the size of houses and full of miniature interlocking gears, switches, levers, etc. There are a lot of moving parts in software, and keeping them all straight is a huge challenge. While bug-free code may be a long way off, there is still hope for very significant improvements. But we must start to think about testing and quality earlier in the cycle. We must also recognize and face the fact that software testing is a combinatorial problem and that in order to solve it, we need powerful specialized software and lots and lots of CPU power. Those two things, combined, are my mission in life and the reason why I co-founded Agitar Software: To get developers involved in testing and to make them successful by giving them the tools they need. Alberto Savoia is CTO and senior vice president of R&D at Agitar, which he co-founded in June 2002. Before Agitar, he worked at Google as the engineering executive in charge of the highly successful and profitable ads group. In October 1998, he co-founded and became CTO of Velogic Inc., a pioneer and leading innovator in Internet performance and scalability testing. Velogic was acquired in 2000 by Keynote Systems Inc., where Alberto continued to serve as chief technologist. Prior to Velogic, Alberto had an impressive 13-year career at Sun Microsystems. His last position at Sun was general manager of SunTest, a highly successful business unit he created and established as the technology and market leader in Java testing solutions. Before SunTest, he served Sun as director of the software technology research group for Sun Microsystems Laboratories, where his staff developed mission-critical and groundbreaking new technology in the areas of software development environments, programming languages and clustering.
'); // --> |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| About Us | Contact Us | For Advertisers | For Business Partners | Site Index | RSS |
| |
|
|||||||