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
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…
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…
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