Back to Catalog

TDD & BDD: Testing Practices for Better Software Quality

Premium
Intermediatecourse

This course covers Test Driven Development (TDD) and Behavior Driven Development (BDD), crucial for creating high-quality applications, reducing bugs, and improving performance.

Language

  • English

Topic

  • Cloud Development

Skills You Will Learn

  • Test Driven Development (TDD), Behavior Driven Development (BDD), Selenium, Testing, Workflow, Behave

Offered By

  • IBMSkillsNetwork

Estimated Effort

  • 12 hours

Platform

  • SkillsNetwork

Last Update

  • December 16, 2024
About this course
Testing is crucial in Software Development for preventing bugs, reducing costs, and boosting performance. This course covers essential methods like Test Driven Development (TDD) and Behavior Driven Development (BDD), with TDD focusing on individual code units and BDD on how these units integrate. 
  
You’ll learn the fundamentals of TDD and BDD, including automated testing’s role in creating resilient applications. Explore testing basics such as test cases, levels, release cycles, and popular tools. 
  
Through real-world inspired labs, you’ll gain hands-on experience with TDD and BDD. Develop TDD test cases with assertions and fixtures using the Nose testing package, and apply advanced techniques like code coverage, fake data, and mock objects. Set up a BDD environment with Behave, write feature and step files, and test web interfaces with Selenium. 
  
By the end, you'll have the skills to effectively perform TDD and BDD, and understand when to use these methodologies for optimal development outcomes. 

Learning Outcomes

  • Explain why testing is crucial for ensuring high-quality software and minimizing bugs. 
  • Describe Test-Driven Development (TDD) concepts and its advantages in DevOps, then develop and run unit tests with assertions and fixtures. 
  • Improve unit testing with advanced TDD techniques such as coverage reports, factories, fakes, and mock objects. 
  • Outline the BDD workflow, explore popular BDD tools and their benefits, and perform BDD tests using Honcho and Behave. 

Course Syllabus

Module 1: Introduction to Testing 
  • The Importance of Testing 
  • Why Developers Don’t Test 
  • Testing Levels and Release Cycle 
  • TDD and BDD 
  • Testing Case Study 
  • Reading: Summary & Highlights 
  • Module 1 Glossary: Introduction to Testing 
  • Practice Quiz: Introduction to Testing 
  • Graded Quiz: Introduction to Testing 
Module 2: Introduction to Test Driven Development 
  • Benefits of Test Driven Development 
  • Tools for TDD 
  • Practice Quiz: Introduction to Test Driven Development 
  • Running Tests with Nose 
  • Running Tests with Nose Demo 
  • Hands-on Lab: Running Tests with Nose 
  • Anatomy of a Test Case 
  • Writing Test Assertions 
  • Writing Test Assertions Demo 
  • Hands-on Lab: Writing Test Assertions 
  • Test Fixtures 
  • Creating Initial State Using Test Fixtures Demo 
  • Hands-on Lab: Creating an Initial State Using Test Fixtures 
  • Reading: Summary & Highlights 
  • Module 2 Glossary: Test Driven Development 
  • Practice Quiz: Methods for Test Driven Development 
  • Graded Quiz: Methods for Test Driven Development 
Module 3: Advanced Methods for Test Driven Development 
  • Test Coverage 
  • Running Test Cases with Coverage Demo 
  • Hands-on Lab: Running Test Cases with Coverage 
  • Factories and Fakes 
  • Factories and Fakes Demo 
  • Hands-on Lab: Using Factories and Fakes 
  • Mocking 
  • Mocking with Patch 
  • Mocking with Mock Objects 
  • Mocking with Mock Objects Demo 
  • Hands-on Lab: Mocking Objects 
  • Practicing Test Driven Development 
  • Practicing Test Driven Development Demo 
  • Hands-On Lab: Practicing Test Driven Development 
  • Reading: Summary & Highlights 
  • Module 3 Glossary: Advanced Methods for Test Driven Development 
  • Practice Quiz: Advanced Methods for Test Driven Development 
  • Graded Quiz: Advanced Methods for Test Driven Development 
Module 4: Introduction to Behavior-Driven Development 
  • What is Behavior Driven Development 
  • Benefits of BDD 
  • BDD Workflow and Gherkin Syntax 
  • Example of BDD 
  • Tools for Behavior Driven Development 
  • Quiz: Practice Quiz: Introduction to Behavior-Driven Development 
  • Overview of Behave 
  • Environment Setup 
  • Hands-on Lab: Setting up an Environment in Behave 
  • Writing Feature Files 
  • Hands-on Lab: Writing Feature Files 
  • Selenium 
  • Writing Step Files 
  • Loading Test Data with Behave  
  • Hands-on Lab: Loading Test Data with Behave 
  • Reading: Summary and Highlights 
  • Module 4 Glossary: Behavior Driven Development 
  • Quiz: Practice Quiz: Methods for Behavior Driven Development 
  • Quiz: Graded Quiz: Introduction to Behavior Driven Development 
Module 5: Running Behave for Behavior Driven Development 
  • Generating Steps with Behave 
  • Generating Steps with Behave Demo 
  • Hands-on Lab: Generating Steps with Behave 
  • Implementing Your First Steps 
  • Implementing Your First Steps Demo 
  • Hands-on Lab: Implementing Your First Steps 
  • Working with the Context 
  • Using Variable Substitution 
  • Hands-on Lab: Using Variable Substitution 
  • Module Summary: Running Behave for Behavior Driven Development 
  • Ungraded Plugin: Module 5 Glossary: Running Behave for Behavior Driven Development 
  • Practice Quiz: Running Behave for Behavior Driven Development 
  • Graded Quiz: Running Behave for Behavior Driven Development 
Module 6: Final Project 
  • Reading: Final Project Overview 
  • Reading: About the Product Model 
  • Lab Environment and Starter Code 
  • Check list: Final Project 
  • Peer-Assignment: Peer Graded Final Assignment 
  • Graded Quiz: Final Exam

General Information

  • This course is self-paced. 
  • This platform works best with current versions of Chrome, Edge, Firefox, Internet Explorer, or Safari.

Recommended Skills Prior to Taking this Course

  • Software Engineering principles  
  • Working knowledge of Python 

Instructors

John Rofrano

Senior Technical Staff Member | DevOps Champion

John J. Rofrano is a Senior Technical Staff Member and DevOps Champion at IBM T.J. Watson Research Center where he leads a variety of research projects exploring the use of AI for accelerating Application Modernization to the Cloud. He is also an Adjunct Faculty Member at New York University Courant Institute, and Stern School of Business @ NYU, where he teaches a graduate course on DevOps and Agile Methodologies. John is an accomplished musician and videographer, and has authored numerous patents, industry papers, training videos, and books.

Read more