Lecture09 Unit Testing 2020
Lecture09 Unit Testing 2020
START
Internal Use
Learning Goals
After the course, attendees will be able to:
Quiz
Internal Use
V-Model
Internal Use
Test Levels
Internal Use
Test Levels
✓ Reducing risk
✓ Verifying whether the functional and non-
functional behaviors of the component are as
designed
and specified
✓ Building confidence in the component’s quality
✓ Finding defects in the component
✓ Preventing defects from escaping to higher test
levels
Internal Use
Unit Test – Why?
$14,000
➢ Faster Debugging
85% % Defects
➢ Better Design Introduced in
Percentage of Bugs
this phase
➢ Reduce Future % Defects
Cost (Quality found in
in this phase
$1000
Effort & $ Cost to
Correction Cost) $25 $130 $250 repair defect
in this phase
Coding Unit Funct Field Post
Test Test Test Release
Internal Use
Unit Test – Inputs (Test Basis)
✓ Detailed design
✓ Code
✓ Data model
✓ Component specifications
Internal Use
Unit Test – Types/Technique
Internal Use
Unit Test – Implementation
Internal Use
Top-Down Unit Testing
➢Stubs: called by software component
Stub
Stub
B
Stub
Internal Use
Bottom-up Unit Testing
➢Driver: call software component
Test Test
Drivers Drivers
Level N Level N
Test
Drivers
Level N-1
Internal Use
Unit Test – Typical defects and failures
Internal Use
Unit Test – Tools
UT Tools for references:
Java: Junit (www.junit.org)
C/C++: cppUnit
(http://sourceforge.net/projects/cppunit/)
Python: pyUnit (http://pyunit.sourceforge.net/)
Perl: PerlUnit (http://perlunit.sourceforge.net/)
Visual Basic: vbUnit (http://www.vbunit.com/)
C#: csUnit (http://www.csunit.org/)
.NET: Nunit (http://www.nunit.org/)
Internal Use
Quiz!
There are 5 questions below.
Click NEXT button to start!
Internal Use
Quiz! Question 1 of 5 01: 08
A test type
An ISTQB certification
Submit
Internal Use
Quiz! Question 2 of 5 01: 08
Submit
Internal Use
Quiz! Question 3 of 5 01: 08
Faster Debugging
Submit
Internal Use
Quiz! Question 4 of 5 01: 08
Stub
Driver
Proxy
Submit
Internal Use
Quiz! Question 5 of 5 01: 08
Submit
Internal Use
Exit Course
THANK YOU
You have completed “Unit Testing" Lecture.
EXIT
Internal Use