We all are onboarded with the fact that "The more we test a software the more quality emerged". Proper testing is one of the key attributes of high-quality software.
Test driven development (TDD) in product development.pdf
1. TDD in Product Development
Beroza Paul
Sr. software engineer
2. Truth about Software Product Development
â Industry average experience is about 1-25 bugs per 1000 lines of code for
delivered software.
â 7-12 bugs per 1,000 lines of code find their way to the customers
â Fixing a bug takes 30 times longer than writing a line of code
â 75% of a developerâs time is spent on debugging (1500 hours a year!)
Source: Code Complete by Steve McConnell
3. Production Bug is Expensive!
â Fixing a production bug may cost 100x more than fixing a bug at
design time.
â Fixing a production bug may cost 15x more than fixing a bug at
implementation time.
Source: The Economics of Software Quality
6. Facts of Production Bug
â Most production bugs caused by simple programming mistakes
â 58% of them are trivial and can be addressed with test coverage
â Tiny mistakes will have huge impact on production
11. TTD Results in Fewer Bugs?
â A case study of engineering teams at Microsoft and IBM showed that
the defect density decreased between 40% and 90% relative to similar
projects that did not use the TDD practice.
Source: Quality improvements
12. TDD Produces Better Quality?
â A study carried out among developers with 10+ years of professional
experience (on average), to investigate their perceptions when
employing TTD. Many of them agreed that âTDD allows greater quality
and maintainabilityâ
Source: TDD analysis
13. TDD Promotes Simpler Design?
â The Department of Computer Science at North Carolina State
University, ran an experiment with two groups of programmers: one
used TDD and the other the linear approach.
â It turned out that â92% of developers believed that TDD yields higher
quality code, 79% thought that TDD promotes simpler design.
Source: TDD investigation
15. Developing GUI With TDD
â Trying to test the exact placement of UI components is pointless. First
because layout is subjective and should be "tested" by humans
16. TDD experience in team
â An enthusiastic team and at least one experienced developer who
knows how to write good tests and also knows a few things about
good architecture, otherwise think twice before going down the TDD
road.
17. TDD slows down initial process
â If youâre pressed for time and need to quickly launch your product or
solution, the TDD approach may not be your best choice
18. Test Code Requires Maintenance
â All lines of code require maintenance, which means cost. The cost is
easiest to acknowledge when a change to existing functionality is
made.
19. TDD approach is difficult
â In TDD we need mocks/stubs etc. When we start using mocks, after a
while, we will want to start using Dependency Injection (DI) and a
Inversion of Control (IoC) container. To do that you need to use
interfaces for everything. At the end we end up writing lot more code.