This repository contains the practice code for the labs in IBM-CD0241EN-SkillsNetwork Introduction to Test Driven Development
- Lab 1: Running Test with Nose
- Lab 2: Writing Test Assertions
- Lab 3: Creating an Initial State Using Text Fixtures
- Lab 4: Running Test Cases with Coverage
- Lab 5: Using Factories and Fakes
- Lab 6: Mocking Objects
- Lab 7: Practicing TDD
These labs are designed to be executed in the IBM Developer Skills Network Cloud IDE environment, however you can work on them locally using Docker and Visual Studio Code with the Remote Containers extension to provide a consistent repeatable disposable development environment for all of the labs in this course.
You will need the following software installed:
- Docker Desktop
- Visual Studio Code
- Remote Containers extension from the Visual Studio Marketplace
All of these can be installed manually by clicking on the links above or you can use a package manager like Homebrew on Mac of Chocolatey on Windows.
To bring up the development environment you should clone this repo, change into the repo directory, and then open Visual Studio Code using the code .
command. VS Code will prompt you to reopen in a container and you should say yes. This will take a while as it builds the Docker image and creates a container from it to develop in.
git clone https://github.com/ibm-developer-skills-network/duwjx-tdd_bdd_PracticeCode.git
cd duwjx-tdd_bdd_PracticeCode
code .
Note that there is a period .
after the code
command. This tells Visual Studio Code to open the editor and load the current folder of files. When prompted to Reopen in Contaner select that option and it will build a development for you inside a Docker container.
Once the environment is loaded you should be placed at a bash
prompt in the /app
folder inside of the development container. This folder is mounted to the current working directory of your repository on your computer. This means that any file you edit while inside of the /app
folder in the container is actually being edited on your computer. You can then commit your changes to git
from either inside or outside of the container.
John Rofrano, Senior Technical Staff Member, DevOps Champion, @ IBM Research