Presenter – Jeff McWherter(Web Ascender)
Why testing? Peer Pressure – The secret to success is knowing who to blame for your failures.
Tools
- Naming Convention – testing for behaviors, not actual functions
- TestDriven.NET
- NUnit – Green Test – test passes (Red, Green, Refactor)
- MBUnit
- Free/Open Source
- Uses RowTest to allow it to pass multiple Rows for testing Exceptions, etc.
- MSTest – tends to be slow
- Resharper – Helps with TDD
- VSTS – very expensive, simple to use
- Allows for finding text
- Regex results testing
- Fiddler – provides http/tcp/ip information
- GZip compression, performance improvement modeling
- Simulate modem speeds
- Firebug – provides bug checking
- Plugin – YSlow Plugin – grades app and shows performance (put JS at the bottom)
- Check viewstate
- Watin (inspired from Water framework) free functional web testing
- Create a browser object
- Navigate to website, click something
- Expect something
- IE and Firefox testing
- Test Recorder
- Selenium – Web Test Recorder
- Suite of tools including remote control, writes test code for multiple languages
- WCAT – Script based performance testing
- ANTS Profiler – Code profiling
Creating good tests
- Use your Right BICEP
- Right results
- Boundary using conditions CORRECT
- Inverse relationships check
- Cross-check results
- Error conditions can be forced to happen
- Performance characteristics within bounds
- CORRECT
- Conformance – does the code conform to an expected format?
- Ordering – is the set of values ordered or unordered as appropriate?
- Range – is the value within reasonable minimum and maximum values?
- Reference -
- Existence
- Cardinality
- Time
- Use Stopwatch to time class run
- Good tests are “A TRIP”
- Automatic
- Thorough
- Repeatable
- Independent
- Professional
Test Driven Development
- Concept is red, green, refactor
- Write test first, have it fail
- Write code to make it pass
- Refactor code as necessary
Behavior Driven Development
- For a given [something], do [something], should return [something]
Testing For Performance
- Performance Counters
- Memory pages/sec & available bytes
- Processor Time
- SQL Server Buffer Cache Hit Ratio
- SQL Server User Connections
- .NET CLR Exceptions thrown
- ASP Applications App_Requests_Total
Books for Test-Driven Development – Ken Beck