Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Developers Border Line: Unit Testing

1,288 views

Published on

Developers Border Line: Unit Testing

Published in: Technology, Education
  • Be the first to comment

Developers Border Line: Unit Testing

  1. 1. Developers Border Line: Unit Testing Muhammad Usman Shafqat SQA Engineer Confiz Solutions
  2. 2. What do you guys think about Unit Testing?
  3. 3. What Is Unit Testing? Testing done by developers during and after code construction. Could be of type: 1- White Box 2- Black Box
  4. 4. More Explanation: Unit testing is a development procedure where programmers create tests as they develop software. The tests are simple short tests that test functionality of a particular unit or module of their code, such as a “class” or “function”. Using open source libraries like cunit, cppunit and nunit (for C, C++ and C#) these tests can be automatically run and any problems found quickly. As the tests are developed in parallel with the source code, when the particular unit is completed, a successful unit test demonstrates its correctness.
  5. 5. Why Unit Test? Reveals bugs that may escape “black box” testing Simplifies Integration Facilitates Change Documentation Encourages good design, such as separation of interface from implementation
  6. 6. Take a Better Approach
  7. 7. Value of Unit Testing
  8. 8. The Why, The What, The How It has to do with Quality! Your software has to meet customer requirements  functional and non-functional requirements How do you ensure that your software does what it should?
  9. 9. The Why, The What, The How It has to do with Safety! You often have to change your existing code because of new requirements, improvements, and bug fixes How do you ensure, that your changed software still does what it did before?
  10. 10. The Why, The What, The How It has to do with Sustainability! You still have to fix bugs How do you ensure, that a fixed bug nevershows up again?
  11. 11. The Why, The What, The HowYou have to show that The product works as expected But also its individual parts, like  services  components  classes  methods
  12. 12. The Why, The What, The How You can do this manually  Writing test specifications and protocols Or (much better) automated  Let the system do it for you (at least part of it)
  13. 13. Best Practices:Have a Process and Stick to It! Have a process  Any process is better than none  Make sure it is not “shelfware” ALL processes say you should unit test  (they’re just not that specific about how) Developers should feel the process is helping, not hindering them Managers should support the team and the process
  14. 14. Best Practices:Test Early and Test Often Consider writing the tests first (Test-Driven Development) Start testing as soon as you start writing the code (if not before) Make sure the tests are run frequently The earlier you know about a problem the earlier you can fix it
  15. 15. Best Practices:Refactor, Refactor, Refactor Avoid complexity  Break large classes into smaller ones  Break large methods into smaller ones Simplifying the code makes it easier to understand.
  16. 16. Best Practices:Use “Extreme Feedback” Try to fix bugs as soon as they are identified If not possible, make a plan for when to fix “Don’t live with Broken Windows” If you can’t measure you can’t manage it If you can’t manage it, you can’t improve it
  17. 17. Web UI issue - screen 1Issue: Menu’s are Not displayed in single line and Text is displayed out ofBanner.Mockup Screen is at Next Slide…
  18. 18. Mockup - screen 1
  19. 19. Web UI issue - screen 2Issue: Text missing from highlighted area.Mockup Screen is at Next Slide…
  20. 20. Mockup - screen 2
  21. 21. Web UI issue – screen 3Issue: Twitter icon and Footer links are Not displayed.Mockup Screen is at Next Slide…
  22. 22. Mockup - screen 3
  23. 23. Cross Browser Issue:TinyMCE Editor is Not displayed correctly in IE, working fine in others.
  24. 24. Mobile App UI issue 1Issue:First Alphabet is Notcapital in “Cancel”button text.
  25. 25. Mobile App UI issue 2Issue:Text alignment is Notcorrect with screen.
  26. 26. Mobile App UI issue 3Issue:Buttons are NotCentrally aligned withScreen.
  27. 27. Enhancement Unit Testing IssueEnhancement: Display company introduction video at Job Board.Issue: Video is displayed but other sections that were visible before this change are Not visible now.See the Job Board screen before this change on Next Slide…
  28. 28. Job Board Screen before Change
  29. 29. Unit Testing Checklists (Mobile App & Website)
  30. 30. Unit Testing Checklist - Mobile Application (I-Phone/I-Pod Devices, Android Device, Windows Phone, Blackberry, Symbian OS)Generic Testing: Yes No N/ADoes the page layout consistent from page to page according to the mockups/PSDs?Functional Testing:Does App Installation & Un-installation working correctly?GUI & Usability Testing:Navigation to Screens working fine?Page Scrolling working fine?Compliance/Compatibility Testing:Verify the Behavior of Mobile App in Low resources (Memory/Space)?Web Services/Backend Testing:Connection with DB is made successfully through web service?Data successfully Posted through web services?See the full checklist available at below Engineering Wiki link:https://sites.google.com/a/confiz.com/software-engineering/guides/unit-test-check-list?pli=1
  31. 31. Unit Testing Checklist - WebsiteGeneric Testing: Yes No N/ADoes the page layout consistent from page to page according to the mockups/PSDs?Functional Testing:Check that all the links under Main Menu’s are working properly?Check that all the Header or Footer links are working properly?GUI & Usability Testing:Does all text properly aligned?Does all graphics properly aligned?Compliance/Compatibility Testing:Does all supported browsers been tested?Does the HTML version being used compatible with appropriate browser versions?Web Services/Backend Testing:Connection with DB is made successfully through web service?See the full checklist available at below Engineering Wiki link:https://sites.google.com/a/confiz.com/software-engineering/guides/unit-test-check-list?pli=1
  32. 32. References: http://rollerjm.free.fr/pro/junit/3.htm http://en.wikipedia.org/wiki/Unit_testing http://www.developertesting.com/ http://cplus.about.com/od/glossar1/g/unittesting.htm http://www.scribd.com/doc/84614135/05-unittesting http://ebookbrowse.com/unit-testing-nz-jug-presentation-pdf-d274895477

×