Assignment 2.1 Test Driven Development


Open Source Your Knowledge, Become a Contributor

Technology knowledge has to be shared and made accessible for free. Join the movement.

Create Content

POC TEST OF TECH.IO For Course Material suppliments

Ye be warned! This is just a demo of Do not assume this is even remotely accurate or relevant.

Test driven development

Test driven development is a software development technique that allows you to create software based on a pre-defined specification or set of specifications that you define in advance of writing your code. This way you constrain yourself to a set of features and behaviours that you need to implement and can continuously test your code until the expected behaviour is achieved.


Assignment 2.1
In this assignment you have been given a specification to create a calculator program. A senior developer has provided an Interface that describes what methods the calculator is expected to have, and a suite of tests to test these methods. Your task is to implement this interface, and write a calculator class that passes the test suite.

    public interface ICalculator {
        double Add(double firstNumber, double secondNumber);
        double Subtract(double firstNumber, double secondNumber);
        double Multiply(double firstNumber, double secondNumber);
        double Divide(double firstNumber, double secondNumber);

Write your code here

Write your code inside the already defined Calculator class
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content