SlideShare une entreprise Scribd logo
1  sur  16
Bordas Shop
Unit Tests
27th October 2013
Objective
Automated test
Test for core methods only
Integrated with Jenkins
Build success only if all test success
Total 496 test cases for 6 core methods
Testing Framework – NUnit
Version 2.6
Written entirely in C#
Many advantages of .NET.
E.g. custom attributes and reflection.
Jenkins NUnit Plugin for build automation
NUnit = xUnit of .NET languages
Free
Change of plan
Visual
Studio
Unit
Testing
Framework
NUnit
Naming
Roy osherov
Author of “Art of unit testing”
blog “Naming standards for unit tests”
[UnitOfWork_StateUnderTest_ExpectedBehavior]
GetProducts_Availability_NotNullExpected
GetProducts_CheckPriceLessThanOrEqualZero_CountZeroExp
ected
GetStreet_CheckDuplicateId_InputPostCode1113_CountZeroEx
pected
A A A
Arrange: setup everything needed.
Act: Invoke the code under test.
Assert: Specify the pass criteria for the
test, which fails it if not met.
In 2003 William C. Wake blogged about
using Arrange Act Assert pattern in unit
tests.
A A A
Arrange, Act, Assert
Sample test case 1
Check by different combination
Sample test case 2
Don’t miss boundary values
Sample test case 3
Make sure exception is thrown where is should
NUnit
Jenkins
Goals
Glitch free methods
Tested methods
Fully functional methods
Tension free modification
A form of documentation.
Confidence
Demonstration
Q & A
Thank you

Contenu connexe

Tendances

UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPT
suhasreddy1
 

Tendances (20)

An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration Testing
 
Automation testing
Automation testingAutomation testing
Automation testing
 
UNIT TESTING
UNIT TESTINGUNIT TESTING
UNIT TESTING
 
Test Automation
Test AutomationTest Automation
Test Automation
 
Unit Testing (C#)
Unit Testing (C#)Unit Testing (C#)
Unit Testing (C#)
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
 
UNIT TESTING PPT
UNIT TESTING PPTUNIT TESTING PPT
UNIT TESTING PPT
 
Unit testing
Unit testingUnit testing
Unit testing
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Unit test
Unit testUnit test
Unit test
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
An Introduction to Unit Test Using NUnit
An Introduction to Unit Test Using NUnitAn Introduction to Unit Test Using NUnit
An Introduction to Unit Test Using NUnit
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testing
 
What is JUnit? | Edureka
What is JUnit? | EdurekaWhat is JUnit? | Edureka
What is JUnit? | Edureka
 
Junit
JunitJunit
Junit
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
 
Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?Unit Test Lab - Why Write Unit Tests?
Unit Test Lab - Why Write Unit Tests?
 

Similaire à Unit Test Presentation

Unit Testing Fundamentals
Unit Testing FundamentalsUnit Testing Fundamentals
Unit Testing Fundamentals
Richard Paul
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and Challenges
TriTAUG
 

Similaire à Unit Test Presentation (20)

Unit testing
Unit testing Unit testing
Unit testing
 
Unit Testing in .NET Core 7.0 with XUnit.pptx
Unit Testing in .NET Core 7.0 with XUnit.pptxUnit Testing in .NET Core 7.0 with XUnit.pptx
Unit Testing in .NET Core 7.0 with XUnit.pptx
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Model For Applying Unit Test
Model For Applying Unit TestModel For Applying Unit Test
Model For Applying Unit Test
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
 
unit test in node js - test cases in node
unit test in node js - test cases in nodeunit test in node js - test cases in node
unit test in node js - test cases in node
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012
 
Automated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesAutomated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and Challenges
 
Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013
 
Unit testing
Unit testingUnit testing
Unit testing
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Unit Testing Fundamentals
Unit Testing FundamentalsUnit Testing Fundamentals
Unit Testing Fundamentals
 
Unit testing in Unity
Unit testing in UnityUnit testing in Unity
Unit testing in Unity
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and Challenges
 
Unit testing
Unit testingUnit testing
Unit testing
 
Unit testing framework
Unit testing frameworkUnit testing framework
Unit testing framework
 
Unit tests and TDD
Unit tests and TDDUnit tests and TDD
Unit tests and TDD
 
Testing tools in visual studio
Testing tools in visual studioTesting tools in visual studio
Testing tools in visual studio
 

Unit Test Presentation