What is Test Driven Development (TDD)?

Writing tests before we write a function helps us to design and write our functions better.

It makes sure that we think about what we want the software to do before we start writing functions.

Expected Path, Error Path, and Alternate Paths

Whenever we think about the programs we are writing, there are a few things to consider:

Cellphone Bill:

If you are calculating a phone bill, with the following costs:

You receive the input as a list of connections made, which you convert into costs.

Questions to include in your thinking:

Input Expected Error Error Error Alternate
call,sms,call,sms,sms = 7.45 < 7.45 > 7.45 != 9.55  
sms,sms,sms,sms = 2.6 < 2.6 > 2.6 != 11.00  
call,30kb,call,sms = 6.15 != 8.9 != 6.8   = 9.15