Unit Testing (JUnit, Mockito, and PowerMock) 3 Unit Testing-JUnit, Mokito and...800/938-1222 Caliber Data Training 1 TT3525: Mastering Unit Testing (JUnit, Mockito, and PowerMock) – 3 days Mastering Unit Testing is ...

  • Published on
    21-Apr-2018

  • View
    215

  • Download
    2

Transcript

  • 800/938-1222 Caliber Data Training www.caliberdt.com 1

    TT3525:MasteringUnitTesting(JUnit,Mockito,andPowerMock)3days MasteringUnitTestingisathreeday,comprehensivehandsonunittestingtrainingcoursegearedfordeveloperswhoneedtogetupandrunningwithessentialunittestingskillsusingJUnit,EasyMock,andothertools.ThroughoutthecoursestudentslearnthebestpracticesforwritinggreatprogramsinJava,usingunittestingtechniques.ThiscomprehensivecoursealsocoversessentialTDDtopicsandskills.StudentswhoattendMasteringUnitTestingwillleavethecoursearmedwiththeskillstheyrequiretodevelopsolidJavaprograms,usingsoundcodingtestingtechniquesandbestcodingpractices.ThiscoursequicklyintroducesdeveloperstothefeaturesofJUnitandeducatesthemregardingJUnitsstrengthsandweaknesses.JUnitandEasyMockmakeitpossibletowritehigherqualityJavacode.Thesepowerfultoolsaredesignedtosupportrobust,predictableandautomatedtestingdevelopmentintheJavaenterpriseapplicationarena.ThiscourseincludescoverageofmanyoftheessentialJUnitcapabilities,andcanbetailoredtofocusexactlyontheareasthatyouareinterestedin.Workingwithininadynamic,learningenvironment,guidedbyourexpertTDDteam,attendeeswill:: Understandwhatunittestingisandwhatitisnotintendedto

    cover UnderstandJUnit. UnderstandandusetheJUnitTestRunnerinterface. UseJUnittodrivetheimplementationofJavacode. TestapplicationsusingnativeIDEsupport. Bestpracticesandpatternsforunittesting.

    UnderstandJUnitsstrengthsandweaknesses Understandtheroleofdebuggingwhendoneinconjunction

    withtests. UnderstandnotonlythefundamentalsoftheTDDusingJava,

    butalsoitsimportance,uses,strengthsandweaknesses. UnderstandhowJUnitaffectsyourperspectiveon

    developmentandincreasesyourfocusonatask. LearngoodJUnitcodingstyle. CreatewellstructuredJUnitprograms. UnderstandhowJUnittestingcanbeusedforeitherstate

    basedorinteractionbasedtesting. HowtoextendtestingwithmockobjectsusingEasyMock. Lookatrefactoringtechniquesavailabletomakecodeas

    reusable/robustaspossible. Discussvarioustestingtechniques. ThefollowingJUnitbasedtestingframeworksareexamined: JUnit Mockito PowerMock

    Workshop Topics Covered / Course Syllabus

    Session:JUnitLesson:JUnitOverview WhatisUnitTesting? PurposeofUnitTesting SuccessfulUnitTesting GoodUnitTests TestStages UnitTestStage IntegrationTestStage UnitTestingVsIntegrationTesting FunctionalTesting NonFunctionalTestingLesson:Jumpstart:JUnit4.x

    UnderstandingUnitTestingFrameworks

    JUnitOverview JUnitDesignGoals JUnitFeatures ReasonstoUseJUnit HowJUnitWorks ClasstobeTested TestCaseusingJUnit ExploringJUnit WritingtheTestCase TestResultVerification(Assertions) Assert LaunchingTests Failuresvs.Errors

    IntroducingClassMessage CreatingClassMessageTest TheFirstTestImplementationSteps TheInitialTestCode TestingtheConstructor RunningaTestinanIDE RunningaTestFromtheCommand

    Line SeeingResultsofaTest:JUnitView UsingtheResultsofaTest SeeingResultsofaSuccessfulTest TestSuites CreatingaTestSuite ComposingTestsUsingSuite JUnitTestFixture

  • ManagingResourceswithFixtures ShareSimilarObjects ShareExpensiveSetups JUnitMethodLifecycle JUnit:ResourcesLesson:@TestAnnotation TestExecutionCycle CheckingforExceptions LimitationofExpectedParameter TestingforanExpectedException TestingUsingaTimeout UsingTimeouts TestAnnotation:ResourcesLesson:Hamcrest AboutHamcrest junit.assert.Assert.assertThat(...) TheHamcrestMatcherFramework UsingassertThat HamcrestMatchersLogical HamcrestMatchersObject HamcrestMatchersNumber HamcrestMatchersCollections AdditionalHamcrestMatchers Hamcrest:ResourcesLesson:ParameterizedTests ParameterizeaTestCase InjectingtheParameters SettingtheParameters WritetheTestMethod WritingaParameterizedTest TestExecutionCycle Observations ParameterizedTests:ResourcesLesson:Theories WritingTheoryEnabledTests DefiningDataPoints DefiningTheories TestExecutionCycle Observations Theories:ResourcesLesson:JUnitBestPractices SoWhatisa"Good"Test? Good:ReadableEquatesto

    Maintainable Good:ProperOrganizationand

    Structure Good:TesttheRightThing Good:RuninSolitude PracticestoReduceandManage

    Dependences Good:Reliability ImportanceofQualityofAssertions BadSmell:PrimitiveAssertions BadSmell:BroadAssertion BadSmell:HiddenBeef BadSmell:SplitPersonality BadSmell:SplitLogic ManagingData BadSmell:ParameterizedMess CodingPractices LegacyCode PreparingUnitTestEnvironment Stubs>Mocks WhiteBoxUnitTesting BlackBoxUnitTesting KeystoSuccess BoundaryBetweenUnitand

    IntegrationTesting IntegrationTesting PurposeofIntegrationTesting WhoDoesIntegrationTesting TheLowestBarforUnitTesting AutomatedTesting AutomationandCoverage WorkingWithCoverageAnalysisSession:TestingToolsandTechniquesLesson:ImprovingCodeQualityThroughRefactoring RefactoringOverview SampleofRefactorings RefactoringandTesting SuggestedRefactoring TheImpactofRefactoring RefactoringtoDesignPatterns SampleRefactorings BestPractices Refactoring Namingconventions Organizingtestsuites Lesson:MockingofComponents WhyWeuseTestDummies Isolation

    ImprovingSpeedandReliability HandlingSpecialConditionsand

    HiddenData TypesofTestDummies Stubs MockObjects WorkingwithMockObjects ChallengesofTestingUserInterfaces UsingMockswiththeUserInterface MockObjectStrategiesLesson:MockObjectsandMockito MockitoDescriptionandFeatures DecouplingSystemUnderTestFrom

    Mocks StubbingandArgumentMatchers VerifyingInnvocations

    o Numbero Ordero Redundanto Timeouts

    AdvancedStubbingTechniques do*Methods Spying WorkingwithPartialMocks MockitoAnnotations MockitoLimitations TestingwithMocks MockitoHOWTO MockitoBestPracticesLesson:PowerMock PowerMockDescriptionand

    Features UsingPowerMock PowerMockObjectLifecycle ExampleofMockingaStaticMethod PowerMockNotesAppendix:AddingTestingtotheBuildProcess JUnitandAnt TheAntJUnitTag ExampleAntBuildFile RunningJUnitTestsFromAnt GeneratingaJUnitReport

    TT3525/j13

    800/938-1222 Caliber Data Training www.caliberdt.com 2

    Workshop Topics Covered / Course Syllabus

Recommended

View more >