SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Developers Border Line:
     Unit Testing

  Muhammad Usman Shafqat
       SQA Engineer
      Confiz Solutions
What do you guys think about Unit Testing?
What Is Unit Testing?

 Testing
        done by developers during and after
 code construction.

 Could   be of type:

  1- White Box
  2- Black Box
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 it's correctness.
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
Take a Better Approach
Value of Unit Testing
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?
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?
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 never
shows up again?
The Why, The What, The How

You have to show that

   The product works as expected
   But also its individual parts, like
        services
       components
       classes
       methods
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)
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
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
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.
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
Web UI issue - screen 1




Issue: Menu’s are Not displayed in single line and Text is displayed out of
Banner.
Mockup Screen is at Next Slide…
Mockup - screen 1
Web UI issue - screen 2




Issue: Text missing from highlighted area.
Mockup Screen is at Next Slide…
Mockup - screen 2
Web UI issue – screen 3




Issue: Twitter icon and Footer links are Not displayed.
Mockup Screen is at Next Slide…
Mockup - screen 3
Cross Browser Issue:
TinyMCE Editor is Not displayed correctly in IE, working fine in others.
Mobile App UI issue 1



Issue:

First Alphabet is Not
capital in “Cancel”
button text.
Mobile App UI issue 2



Issue:

Text alignment is Not
correct with screen.
Mobile App UI issue 3



Issue:

Buttons are Not
Centrally aligned with
Screen.
Enhancement Unit Testing Issue




Enhancement:        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…
Job Board Screen before Change
Unit Testing Checklists
   (Mobile App & Website)
Unit Testing Checklist - Mobile Application
         (I-Phone/I-Pod Devices, Android Device, Windows Phone, Blackberry, Symbian OS)




Generic Testing:                                                                               Yes   No   N/A
Does 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
Unit Testing Checklist - Website


Generic Testing:                                                                               Yes   No   N/A
Does 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
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

Weitere ähnliche Inhalte

Was ist angesagt?

Test Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalTest Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh Dahal
QA or the Highway
 
Bug best practice
Bug best practiceBug best practice
Bug best practice
gaoliang641
 
Testing Frameworks And Methodologies
Testing Frameworks And MethodologiesTesting Frameworks And Methodologies
Testing Frameworks And Methodologies
Steven Cahill
 
Inrotduction of Testing
Inrotduction of TestingInrotduction of Testing
Inrotduction of Testing
Palash Ghosh
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
SivaprasanthRentala1975
 
测试向前一步
测试向前一步测试向前一步
测试向前一步
drewz lin
 
Software Mobile Website Quality assurance framework design
Software Mobile Website Quality assurance framework designSoftware Mobile Website Quality assurance framework design
Software Mobile Website Quality assurance framework design
Bonnie Yau
 

Was ist angesagt? (20)

UI Automation Quirks
UI Automation QuirksUI Automation Quirks
UI Automation Quirks
 
Test Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh DahalTest Automation Architecture That Works by Bhupesh Dahal
Test Automation Architecture That Works by Bhupesh Dahal
 
Reaching for Your Quality Stretch Goals: Testing at Realtor.com
Reaching for Your Quality Stretch Goals: Testing at Realtor.comReaching for Your Quality Stretch Goals: Testing at Realtor.com
Reaching for Your Quality Stretch Goals: Testing at Realtor.com
 
Bug best practice
Bug best practiceBug best practice
Bug best practice
 
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
Testing Hourglass at Jira Frontend - by Alexey Shpakov, Sr. Developer @ Atlas...
 
Test for Success: 5 Steps to Usability Testing Success
Test for Success: 5 Steps to Usability Testing SuccessTest for Success: 5 Steps to Usability Testing Success
Test for Success: 5 Steps to Usability Testing Success
 
Testing Frameworks And Methodologies
Testing Frameworks And MethodologiesTesting Frameworks And Methodologies
Testing Frameworks And Methodologies
 
Accessibility Support Baseline: Balancing User Needs Against Test Effort
Accessibility Support Baseline: Balancing User Needs Against Test EffortAccessibility Support Baseline: Balancing User Needs Against Test Effort
Accessibility Support Baseline: Balancing User Needs Against Test Effort
 
Inrotduction of Testing
Inrotduction of TestingInrotduction of Testing
Inrotduction of Testing
 
The 7 minute accessibility assessment and app rating system
The 7 minute accessibility assessment and app rating systemThe 7 minute accessibility assessment and app rating system
The 7 minute accessibility assessment and app rating system
 
Bridging the communication gap
Bridging the communication gapBridging the communication gap
Bridging the communication gap
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
 
10 Benefits of Automated Testing
10 Benefits of Automated Testing10 Benefits of Automated Testing
10 Benefits of Automated Testing
 
Bringing Quality Design Systems to Life with Storybook & Applitools
Bringing Quality Design Systems to Life with Storybook & ApplitoolsBringing Quality Design Systems to Life with Storybook & Applitools
Bringing Quality Design Systems to Life with Storybook & Applitools
 
测试向前一步
测试向前一步测试向前一步
测试向前一步
 
Usability for all budgets
Usability for all budgetsUsability for all budgets
Usability for all budgets
 
Software Mobile Website Quality assurance framework design
Software Mobile Website Quality assurance framework designSoftware Mobile Website Quality assurance framework design
Software Mobile Website Quality assurance framework design
 
Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and Practices
 
Become Software Tester or Developer
Become Software Tester or DeveloperBecome Software Tester or Developer
Become Software Tester or Developer
 
Software Characterization & Performance Testing - Beat Your Software with a S...
Software Characterization & Performance Testing - Beat Your Software with a S...Software Characterization & Performance Testing - Beat Your Software with a S...
Software Characterization & Performance Testing - Beat Your Software with a S...
 

Andere mochten auch

TDD, unit testing and java script testing frameworks workshop
TDD, unit testing and java script testing frameworks workshopTDD, unit testing and java script testing frameworks workshop
TDD, unit testing and java script testing frameworks workshop
Sikandar Ahmed
 

Andere mochten auch (16)

Testing Javascript with Jasmine
Testing Javascript with JasmineTesting Javascript with Jasmine
Testing Javascript with Jasmine
 
JavaScript Unit Testing
JavaScript Unit TestingJavaScript Unit Testing
JavaScript Unit Testing
 
Client side unit tests - using jasmine & karma
Client side unit tests - using jasmine & karmaClient side unit tests - using jasmine & karma
Client side unit tests - using jasmine & karma
 
TDD, unit testing and java script testing frameworks workshop
TDD, unit testing and java script testing frameworks workshopTDD, unit testing and java script testing frameworks workshop
TDD, unit testing and java script testing frameworks workshop
 
Angular testing
Angular testingAngular testing
Angular testing
 
Unit testing JavaScript: Jasmine & karma intro
Unit testing JavaScript: Jasmine & karma introUnit testing JavaScript: Jasmine & karma intro
Unit testing JavaScript: Jasmine & karma intro
 
Unit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJSUnit Testing and Coverage for AngularJS
Unit Testing and Coverage for AngularJS
 
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma JavaScript Test-Driven Development with Jasmine 2.0 and Karma
JavaScript Test-Driven Development with Jasmine 2.0 and Karma
 
Intro to testing Javascript with jasmine
Intro to testing Javascript with jasmineIntro to testing Javascript with jasmine
Intro to testing Javascript with jasmine
 
Unit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and KarmaUnit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and Karma
 
JavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and KarmaJavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and Karma
 
Javascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and GulpJavascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and Gulp
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introductionAngularjs - Unit testing introduction
Angularjs - Unit testing introduction
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Istanbul presentation
Istanbul presentationIstanbul presentation
Istanbul presentation
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 

Ähnlich wie Developers Border Line: Unit Testing

Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
Rathna Priya
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
Rathna Priya
 
Testing Presentation
Testing PresentationTesting Presentation
Testing Presentation
sureshpkumar
 
STAREAST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STAREAST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STAREAST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STAREAST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
Anna Russo
 
Software Testing - A sneak preview By Srikanth
Software Testing - A sneak preview By SrikanthSoftware Testing - A sneak preview By Srikanth
Software Testing - A sneak preview By Srikanth
Srikanth Krishnamoorthy
 
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
Anna Russo
 
Different Methodologies For Testing Web Application Testing
Different Methodologies For Testing Web Application TestingDifferent Methodologies For Testing Web Application Testing
Different Methodologies For Testing Web Application Testing
Rachel Davis
 
Agile Engineering
Agile EngineeringAgile Engineering
Agile Engineering
John Lewis
 
Improving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester TrainingImproving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester Training
Anna Russo
 

Ähnlich wie Developers Border Line: Unit Testing (20)

Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
 
Manual testing visonia
Manual testing   visoniaManual testing   visonia
Manual testing visonia
 
Testing Presentation
Testing PresentationTesting Presentation
Testing Presentation
 
STAREAST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STAREAST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STAREAST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STAREAST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
 
Software Testing - A sneak preview By Srikanth
Software Testing - A sneak preview By SrikanthSoftware Testing - A sneak preview By Srikanth
Software Testing - A sneak preview By Srikanth
 
Automated tests
Automated testsAutomated tests
Automated tests
 
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2011 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
 
Different Methodologies For Testing Web Application Testing
Different Methodologies For Testing Web Application TestingDifferent Methodologies For Testing Web Application Testing
Different Methodologies For Testing Web Application Testing
 
Agile Engineering
Agile EngineeringAgile Engineering
Agile Engineering
 
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest IrelandMarkus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
Markus Clermont - Surviving in an Agile Environment - Google - SoftTest Ireland
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Istqb intro with question answer for exam preparation
Istqb intro with question answer for exam preparationIstqb intro with question answer for exam preparation
Istqb intro with question answer for exam preparation
 
Software test life cycle
Software test life cycleSoftware test life cycle
Software test life cycle
 
Improving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester TrainingImproving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester Training
 
Manual testing interview questions
Manual testing interview questionsManual testing interview questions
Manual testing interview questions
 
DevOps - Continuous Integration, Continuous Delivery - let's talk
DevOps - Continuous Integration, Continuous Delivery - let's talkDevOps - Continuous Integration, Continuous Delivery - let's talk
DevOps - Continuous Integration, Continuous Delivery - let's talk
 
Designing Self-maintaining UI Tests for Web Applications
Designing Self-maintaining UI Tests for Web ApplicationsDesigning Self-maintaining UI Tests for Web Applications
Designing Self-maintaining UI Tests for Web Applications
 
Future of QA
Future of QAFuture of QA
Future of QA
 
Futureofqa
FutureofqaFutureofqa
Futureofqa
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Developers Border Line: Unit Testing

  • 1. Developers Border Line: Unit Testing Muhammad Usman Shafqat SQA Engineer Confiz Solutions
  • 2. What do you guys think about Unit Testing?
  • 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. 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 it's correctness.
  • 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. Take a Better Approach
  • 7. Value of Unit Testing
  • 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. 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. 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 never shows up again?
  • 11. The Why, The What, The How You have to show that  The product works as expected  But also its individual parts, like  services  components  classes  methods
  • 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. 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. 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. 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. 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. Web UI issue - screen 1 Issue: Menu’s are Not displayed in single line and Text is displayed out of Banner. Mockup Screen is at Next Slide…
  • 19. Web UI issue - screen 2 Issue: Text missing from highlighted area. Mockup Screen is at Next Slide…
  • 21. Web UI issue – screen 3 Issue: Twitter icon and Footer links are Not displayed. Mockup Screen is at Next Slide…
  • 23. Cross Browser Issue: TinyMCE Editor is Not displayed correctly in IE, working fine in others.
  • 24. Mobile App UI issue 1 Issue: First Alphabet is Not capital in “Cancel” button text.
  • 25. Mobile App UI issue 2 Issue: Text alignment is Not correct with screen.
  • 26. Mobile App UI issue 3 Issue: Buttons are Not Centrally aligned with Screen.
  • 27. Enhancement Unit Testing Issue Enhancement: 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. Job Board Screen before Change
  • 29. Unit Testing Checklists (Mobile App & Website)
  • 30. Unit Testing Checklist - Mobile Application (I-Phone/I-Pod Devices, Android Device, Windows Phone, Blackberry, Symbian OS) Generic Testing: Yes No N/A Does 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. Unit Testing Checklist - Website Generic Testing: Yes No N/A Does 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. 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