Call : (+91) 968636 4243
Mail : info@EncartaLabs.com
EncartaLabs

xUnit

( Duration: 2 Days )

xUnit is the collective name for several unit testing frameworks. The xUnit training course provides a vocabulary of test smells and patterns with which to elevate our craft while writing test code. These smells give us a way to reason about the quality of our test code as well as a set of reusable test code design patterns that can be used to eliminate the smells. This course also describes techniques for choosing the right set of tests and how to organize the test code including naming standards.

While the course is designed to be equally applicable to test-driven and test-after styles of development, the interplay between when the tests are written and how the system is designed for testability (and how this impacts one's test automation strategy) is highlighted to help you to make an informed choice.

By attending xUnit workshop, delegates will learn:

  • What is the role of automated unit testing?
    • What is developer testing?
    • How to "think like a tester"
    • How to determine which tests to write?
    • Why should I automate tests?
  • How to automate tests with XUnit
    • Basic mechanics of test automation
    • What tests should I automate?
    • Proper use of assertions
    • Testing of exceptions
    • Ways to set up the test fixture and when to use which
    • Use of stubs to isolate the class being tested
    • Common problems and how to avoid them
    • Bad smells (symptoms) and what they mean
  • How to get the best "bang" for your testing dollar
    • When to write the tests
    • How to verify the tests
    • How to make the tests maintainable and useful as documention
    • How to make tests portable (run anywhere)
    • How to make tests repeatable and robust (provide consistent results even as the system evolves)

  • At least 6 months experience programming in language of training

COURSE AGENDA

1

Overview

  • An overview of the learning objectives, the topics that will be covered in the course and the teaching style.
2

Introduction to Testing

  • Introduction to the basic concepts and terminology of software testing:
  • Unit vs Component vs. Functional Tests.
  • Black box vs. White Box tests
  • Acceptance Tests vs Regression Tests
3

Basics of xUnit

  • Introduction to the basic concepts and terminology of the JUnit (or equivalent) software
  • testing framework.
  • Patterns: Simple Success Test, Expected Exception Test
  • Smells: Obscure Test
4

Unit Testing Methodology

  • How to determine the minimal set of test conditions required to test a piece of software
  • sufficiently.
  • When should tests be automated? How does this impact the development process?
  • Test Conditions, Test Cases & Test Scenarios
  • Equivalence Classes & Boundary Conditions
5

Testing Style

  • How do you ensure tests are understandable and easily found?
  • Economics of test automation; how automated testing can reduce cost.
  • How should test case classes and methods be named and organized?
  • Techniques for verifying the tests: Test Inspections, Testing the Tests, Code Coverage
  • Goals of unit testing: Tests as Specification, Tests as Documentation, Fully Automated Tests
  • Smells: High Test Maintenance Cost, Hard-to-Test Code
  • Patterns: Testcase Class per Class, Testcase Class per Feature, Testcase Class per Fixture
6

Introduction to Functional and Component Testing

  • How to define and automate functional tests.
  • Using use cases as a source of test conditions.
  • Patterns: Subcutaneous Test, Layer Test
  • Smells: Indirect Testing
7

Verifying Expected Outcomes

  • How to use Assertions properly to make tests valuable as a specification.(intent revealing)
  • while verifying that actual outcomes match expected outcomes without over-specifying the
  • system behavior.
  • Verify expected outputs using Guard Assertions, Expected Objects & Custom Assertions
  • (Patterns)
  • Smells: Obscure Test, Fragile Test
8

Setting up the Test Fixture

  • How to initialize the test fixture required to run a test using various fixture setup strategies.
  • Common problems and how to solve them.
  • Test robustness and repeatability
  • Smells: Slow Tests , Erratic Tests (Interacting Tests, Unrepeatable Test, Non-Deterministic,
  • Test Run Wars),
  • Patterns: Fresh Fixtures vs Shared Fixtures, Creation Methods & Finder Methods
9

Testing Indirect Inputs

  • Using stubs and real components to verify proper behavior for all inputs from used components
  • Testing handling of Exceptions thrown by used components (and how to force them to be thrown)
  • Smells - Indirect Testing, Obscure Test, Erratic (Non-Deterministic Tests)
  • Patterns - Test Double, Test Stub
10

Testing Indirect Outputs

  • Using stubs and real components to verify expected outputs via used components
  • Patterns: Test Spy, Mock Object, Fake Object
11

Design for Testability

  • Designing software so that it can be tested easily. Includes how to enable use of stubs.
  • Patterns: Layer Tests, Dependency Inject, Dependency Lookup, Humble Object, Fake Object
  • Smells: Hard-to-Test Code, Test Double
12

Testing Legacy Code

  • What makes software "legacy"?
  • What makes testing legacy software so difficult?
  • How to get started
  • What tests to write first?
  • Breaking Dependencies using Seams
13

Test-Driven Development

  • How to improve quality and reduce cost by writing unit tests before writing code.
  • How can you avoid going into "software debt" as you write software?
  • What is "emergent design" and how is it done?
  • The Red-Green-Refactor cycle.

Encarta Labs Advantage

  • One Stop Corporate Training Solution Providers for over 6,000 various courses on a variety of subjects
  • All courses are delivered by Industry Veterans
  • Get jumpstarted from newbie to production ready in a matter of few days
  • Trained more than 50,000 Corporate executives across the Globe
  • All our trainings are conducted in workshop mode with more focus on hands-on sessions

View our other course offerings by visiting https://www.encartalabs.com/course-catalogue-all.php

Contact us for delivering this course as a public/open-house workshop/online training for a group of 10+ candidates.

Top
Notice
X