Test Driven Development is a software development approach that emphasizes writing tests for a piece of code before actually implementing that code. The primary goal of TDD is to ensure that software functions correctly and meets the desired requirements by following a structured and iterative process.
Steps:
- Write a Test: Before writing any code, the developer writes a test case that defines the expected behavior of a specific piece of functionality. This test is usually written in a testing framework specific to the programming language being used.
- Run the Test: Initially, the test will fail since the code to be tested doesn't exist yet, or it doesn't implement the desired functionality.
- Write the Code: The developer then proceeds to write the minimum amount of code necessary to make the test pass. This code should fulfill the requirements outlined in the test case.
- Run the Test Again: After writing the code, the developer runs the test again. If the test now passes, it means that the code meets the specified requirements and hasn't introduced any regressions.
- Refactor (if necessary): If the code passes the test but could be improved in terms of readability, efficiency, or maintainability, the developer can refactor it while keeping the test in a passing state. This ensures that any changes don't break the existing functionality.
This project is built with Ruby.
- Followed TDD approach
- Method to solve factorial of a number
- Method to reverse a string
- Method to return strings ("FizzBuzz", "Fizz", "Buzz")
To get a local copy up and running, follow these steps.
In order to run this project you need:
- Download and Install Ruby for your OS.
Clone this repository to your desired folder:
git clone https://github.com/anita00001/tdd-solver.git
cd tdd-solver
Install this project with:
gem install
bundle install
To run the project, execute the following command:
ruby filename.rb
To run the tests, execute the following command:
gem install rspec
rspec
👤 Anita Sharma
- GitHub: @anita00001
- LinkedIn: anitaa-sharmaa
- Twitter: @anitaa_sharmaa
👤 Muhammad Amran Khan (Mike)
- GitHub: @Mike111222
- Twitter: @iMike111222
- LinkedIn: @iMikeKhan
- Add design for User Interface
- Add more test cases
- Add more methods on class Solver
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
If you like this project, you can appreciate us by giving star ⭐
We are grateful to provide the opportunity to collaborate on this project. It has helped us to empower our knowledge on Ruby together and hence growing us as a skilled Software developer.
This project is MIT licensed.