+ All Categories
Home > Documents > Unit Test Presentation

Unit Test Presentation

Date post: 15-Apr-2017
Category:
Upload: sayedur-rahman
View: 164 times
Download: 0 times
Share this document with a friend
16
Bordas Shop Unit Tests 27th October 2013
Transcript
Page 1: Unit Test Presentation

Bordas Shop

Unit Tests27th October 2013

Page 2: Unit Test Presentation

Objective

Automated testTest for core methods onlyIntegrated with Jenkins

Build success only if all test success

Total 496 test cases for 6 core methods

Page 3: Unit Test Presentation

Testing Framework – NUnit

Version 2.6Written entirely in C#Many advantages of .NET.

E.g. custom attributes and reflection.

Jenkins NUnit Plugin for build automationNUnit = xUnit of .NET languagesFree

Page 4: Unit Test Presentation

Change of plan

VisualStudioUnit

TestingFramework

NUnit

Page 5: Unit Test Presentation

Naming

Roy osherovAuthor of “Art of unit testing”blog “Naming standards for unit tests”

[UnitOfWork_StateUnderTest_ExpectedBehavior]GetProducts_Availability_NotNullExpected

GetProducts_CheckPriceLessThanOrEqualZero_CountZeroExpected

GetStreet_CheckDuplicateId_InputPostCode1113_CountZeroExpected

Page 6: Unit Test Presentation

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.

Page 7: Unit Test Presentation

A A AArrange, Act, Assert

Page 8: Unit Test Presentation

Sample test case 1Check by different combination

Page 9: Unit Test Presentation

Sample test case 2Don’t miss boundary values

Page 10: Unit Test Presentation

Sample test case 3Make sure exception is thrown where is should

Page 11: Unit Test Presentation

NUnit

Page 12: Unit Test Presentation

Jenkins

Page 13: Unit Test Presentation

Goals

Glitch free methods Tested methods Fully functional methods Tension free modificationA form of documentation. Confidence

Page 14: Unit Test Presentation

Demonstration

Page 15: Unit Test Presentation

Q & A

Page 16: Unit Test Presentation

Thank you


Recommended