2. Agenda
• Why should be even care?
• Impact of Production Bug
• How to Reduce Bug
• TDD
• PLUGINs
• Few points need to be followed by QA
3. Why should I even care?
• Bugs happen all the time – and they will be found in pre-
production or in production.
• But the main difference between preventing and finding
the bug in a pre-production environment is the cost.
• According to IBM’s research, fixing a bug in production
can cost X5 times more than discovering it in pre-
production environments (during the design, local
development, or test phase).
4. Impact of Production Bug
A customer finds the
bug and alerts
customer service.
The bug is logged by
the production team.
The developer gets the description
of the bug, opens the spec, and
spends time reading it over.
The developer then will
spend time recreating the
bug.
The developer must then
reacquaint him/herself with
the code to debug it.
Next, the fix
must undergo
tests.
The fix is then
built and
deployed in
other
environments.
Finally, the fix
goes through
QA testing
(requiring QA
resources).
5. How to reduce bug?
• Design well. Keep it simple - Create the design before coding: try to divide difficult problems into smaller parts/steps/modules that we
can tackle one by one, thinking of objects with well-defined responsibilities.
• Create Testable Code - Make sure you see your test fail at least once. This is the key concept of test-driven development(TDD).
• KISS (Keep it simple and Straight-forward) - Complex code is destined to lead to bugs, and it is also much more challenging to test.
• DRY(Don’t Repeat Your Self) – Check some other forks may already written for you or check if it could be done by existing library. Create
Independent method or class.
• Use code analysis tools - It help to ensure and maintain the quality of our code.
• Don’t Use Comments as a Band-Aid - Keep your code comments as clear and concise as possible. Instead of it use semantic name
for method and variable...
6. Continue…
• Take Compiler Warnings Into Account - By keeping an eye on these warnings, you can ensure that potential problems are stopped
before they become critical issues.
• Take Your Time - If team works under intense pressure to release code by unrealistic deadlines, it are more likely to make mistakes.
Rushing for a release and cutting corners could create larger issues for the application in long time. So, take your time to ensure that best
practices are put in place
• Implement Coding Standards
• Refactoring - Refactoring aims to improve and redesign the structure of already existing code, without modifying its fundamental
behavior. Simple examples of refactoring include fixing improperly names variables or methods and reducing repeated code down to a
single method or function.
• Run functional tests - Typically, this is not done at the development level. Test cases are written based on the specification, and the
actual results are compared with the expected results. Using Selenium and Protractor for UI testing and Junit for API testing.
• Release gradually - Test new features on a small set of users before releasing to everyone.
7. TDD(Test Driven Development)
TDD will make us automatically think in smaller pieces of code (functions, components, services, directives, whatever we can
imagine), Will make us think about well scoped responsibilities, will make us to take design decisions otherwise we may be ignoring.
• The Steps : -
• Write a single unit test to verify that some criteria is met.
• Run the failing test (non compiling code counts as a failing test).
• Write just enough code so that the test passes.
• Refactor the code making sure that the test still passes.
• Start again, incrementally testing and developing your application
8. PLUGINs in VS Code for Angular
• Angular Language Service - This extension provides a rich editing experience for Angular templates.
• Bracket Pair Colorizer - This extension allows matching brackets to be identified with colors.
• Move TS - you can simply move files/folders around and this extension will automatically update your import statements.
• Tslint
• Code Spell Checker - Code Spell Checker is a spell checker that considers camelCase code.
9. PLUGINs in Eclipse/IntelliJ
• SonarLint - SonarLint is an IDE extension that helps you detect and fix quality issues as you write code in Java, JavaScript, PHP, Python
and HTML.
• Spring Tools (Spring Tool Suite (STS)) - This plugin makes it really easy to create Spring and Spring Boot projects in Eclipse. By
using the STS plugin, you can create Spring Boot projects quickly using easy to use start.spring.io integration.
• FindBugs - FindBugs is a defect detection tool for Java that uses static analysis to look for more than 200 bug patterns, such as null pointer
dereferences, infinite recursive loops, bad uses of the Java libraries and deadlocks.
• Rainbow Brackets
10. Few points need to be followed by QA to avoid bug leakage
• QA Manager/Lead's/BA’s should actively participate, discuss and bring out scenarios that happens in live environment.
• Make sure that test case should covers every modules of your software.
• Proper review of test cases from the lead and monitoring the test execution cycle.
• Change in hands means if in any build cycle Engineer A executing then in another cycle allot to another QA engineer.
• Perform ad hoc test on the product.
• Always strive to have comparable data to a production environment