This repository is used for the IBM Garage Method TDD course to illistrate the fundamentals of TDD using javascript
You will need the following installed
- Node.js
- Git command line
To setup and execute the tests perform the following in a terminal window
git clone git@github.com:ibm-cloud-academy/javascript-tdd.git
cd javascript-tdd
npm install mocha --save-dev
npm install should --save-dev
npm test
- Passes the tests
- Reveals intention
- No duplication
- Fewest elements
(01) [{} –> nil] no code => return nil
(02) [nil->constant] nil => simple constant
(03) [constant->constant+] simple constant => complex constant
(04) [constant->scalar] complex constant => variable or an argument
(05) [statement->statements] adding more unconditional statements.
(06) [unconditional->if] splitting the execution path
(07) [scalar->array]
(08) [array->container]
(09) [statement->recursion]
(10) [if->while]
(11) [expression->function] replacing an expression with a function or algorithm
(12) [variable->assignment] replacing the value of a variable.
(01) constant => a value
(02) scalar => a local binding, or variable
(03) invocation => calling a function/method
(04) conditional => if/switch/case/cond
(05) while loop => applies to for loops as well
(06) assignment => replacing the value of a variable