Your SlideShare is downloading. ×
Unit Testing Basics
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Unit Testing Basics

1,109
views

Published on

Slides form very basic introductory talk about unit testing.

Slides form very basic introductory talk about unit testing.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,109
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Unit Testing Basics Serhiy Oplakanets @ Mavenresearch, November 2010 Slides are not intended to make sense outside of the talk.Thursday, November 18, 2010
  • 2. A Discipline • Unit Testing is a discipline of Quality Assurance • Others Include: • Functional Testing • Integration Testing • Code Review • Continuous Integration • ...Thursday, November 18, 2010
  • 3. Unit Testing is • validating that individual units of application work properlyThursday, November 18, 2010
  • 4. Benefits • Finding bugs early • Less debugging • Changes to application are safer and easier • Examples of code usage • Documentation (to some extent) • Unit test is a tool to validate code design; in most cases code that is hard to test is badly designedThursday, November 18, 2010
  • 5. Good Unit Test • Test only one unit at a time • Do not depend on ordering of test run • Runs fast • Tests only one feature at a time • Easy to understand • Tests the public API of unit • Covers all usage casesThursday, November 18, 2010
  • 6. Test Suite • Multiple tests form Test Suite • Your most important tool to check impact of changes • Helps estimate changesThursday, November 18, 2010
  • 7. Good Unit Test Suite • Is simple to run • Runs fast (preferable in seconds) • Is always Green • Is non-interactiveThursday, November 18, 2010
  • 8. Limitations of Unit Testing • Not every bug can be found by unit tests • As were testing only one module -- integration issues are not covered • Multi-threaded issues cant be caught by one- threaded test • Hardware failures, 3rd party component issues, etc. All those can be covered only with a proper Functional Test SuiteThursday, November 18, 2010
  • 9. Practical SessionThursday, November 18, 2010
  • 10. Resources • http://en.wikipedia.org/wiki/Unit_testing :) • http://blog.stevensanderson.com/ 2009/08/24/writing-great-unit-tests-best- and-worst-practises/ • http://googletesting.blogspot.com/2008/11/ clean-code-talks-unit-testing.html • http://geosoft.no/development/Thursday, November 18, 2010
  • 11. Thank you.Thursday, November 18, 2010

×