• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Unit testing presentation
 

Unit testing presentation

on

  • 3,506 views

 

Statistics

Views

Total Views
3,506
Views on SlideShare
3,498
Embed Views
8

Actions

Likes
0
Downloads
85
Comments
0

2 Embeds 8

http://www.slideshare.net 7
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Unit testing presentation Unit testing presentation Presentation Transcript

    • Unit Testing Test early and test often. by AbdAllah SaeeD
    • Yet Another CAT Stand-up session :)
    • Software Development Life Cycle Keywords: SDLC, Software Testing
    • Software Tester  Who is he?  Software Testing:  A part of build automation.  Manual.  More about testing and testers:  http://www.softwaretestinghelp.com/ Keywords: Software Tester, Unit Testing
    • Unit Test?  Test Cases?  Unit Testing is a method in which a programmer tests if individual units of source code are fit for use.  Unit Testing is the first level of Software Testing.
    • Why?  Find problems early in the development cycle.  A way to Optimality.  Can be used to validate that the code functionality still works after code changes.  Documentation.
    • When?  How do you know that a method needs a unit test?  Is the code too simple?  Can it be tested by inspection?  Any method that can break is a good candidate for having a unit test.
    • Danger!  you don't have to define unit tests for every single method you have. Although this leads to:  Incomplete coverage. But:  The careful programmer will know that their unit tests must cover every cluster of objects that form their application. Keywords: Integration Testing
    • Automated Testing Input Main class Testing Class Contains the Testing Contains the actual code that will code that need to be operate on the tested. output of the main class. Output True | False?
    • Automated Testing • There are two ways to test your code – The standard way: • Create a class that takes the input and output from the class we want to test after compiling it. Then compile this testing class. – Unit Testing: • Create a class that interacts with the classes and methods -including private ones- of the class we want to test and only compile the testing class.
    • The standard way • What's wrong with this method? – Too hard to implement in Huge applications. – The testing code is totally separated from the main code. – Compiling Twice! • Main class compilation • Test class compilation – Wasting precious time!
    • Unit Testing Frameworks • Unit testing frameworks help simplify the process of unit testing. • You can write unit tests without using any framework. – Slower. – And more error-prone. Keywords: Software Framework
    • Unit Testing Frameworks • Examples: – JUnit (Java) – NUnit (.NET) – Doctest (Python) • For the complete list of unit testing frameworks: – http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks Keywords: JUnit, NUnit, Doctest
    • JUnit • A simple, open source framework to write and run repeatable tests. • Homepage: http://junit.org • Now, lets test!
    • Getting our hands dirty • Java – JUnit – Under Eclipse IDE • Python – Doctest – Under any terminal
    • Keywords • SDLC. • Java • Software Testing. • Eclipse • Test Case • JUnit • Unit Testing. • NUnit • Integration Testing. • Python • System Testing. • Doctest
    • Resources • http://en.wikipedia.org • http://bashmohandes.blogspot.com • http://www.softwaretestinghelp.com/ • http://www.vogella.de • http://junit.sourceforge.net • http://junit.org
    • Questions?
    • Thanks!