testing chapter 10. types of testing test typeensures that unit testeach independent piece of code...
TRANSCRIPT
TestingChapter 10
Types of Testing
Test type Ensures that
Unit test Each independent piece of code works correctly.
Integration test All units work together without errors.
Regression test Newly added features do not introduce errors to other features that are already working.
Load test (also called stress test)
The product continues to work under extreme usage.
Platform test The product works on all of the target hardware and software platforms.
Unit Testing with NUnit
See http://www.byte-vision.com/NUnitAnd
VBArticle.aspx
NUnit
• Unit testing framework
• Market standard automated testing tool
• Imported from JUnit
• Free tool
• Written in C#
• See http://www.nunit.org
Demo: Using NUnit
1. Create a VB.NET solution 1. Code Classes
2. Test Class
2. Set up Test
3. Write basic test
4. Write exception test
5. Run test using NUnit GUI
Add a nUnit Test button to a toolbar (VS 2005)
1. Tools | External Tools
2. External Tools Dialog
3. Edit Custom Tools Dialog
nunit-guiOr
nunit-console
(Put a nUnit button on a toolbar)4. Tools | Customize
5. Commands | Tools | External Command 2
Drag and drop onto a toolbar
6 Voila!
The Account Class
RULES:
• Overdraft limit must be positive
• Amount withdrawn or deposited must be greater than zero
• Cannot withdraw over the overdraft limit
Demo
• Project: AccountVB– Class: Account.vb (review)
• Reference to nUnit.Framework• Using Nunit.framework• TestFixture Attribute• Setup/Teardown Attributes• Test attributes• Red, Green, Yellow indicators• Withdraw test• Exception Test