Coder Social home page Coder Social logo

tdd-dojo's Introduction

Test-Driven Development Dojo (道場)

A dojo (道場) is a local for practice. The goal of this project is to practice the Way of Test-Driven Development.

Each directory contains a small project, some of the code were extracted from good references such as books, articles and courses, while other code were created by own.

The languages used doesn't matter since the focus is the TDD, but I'll try to stick to: C++, Python, Go and maybe also Rust (since I really want to learn this one).

Last but not least, I really expect this to be a permanent work in progress.

Soundex

From Jeff Langr's Modern C++ Programming with Test-Driven Development.

Each numbered directory contains a different development stage starting from the most basic test and code possible. Also, it's not guaranteed the code here will follow exactly the same from the book just because at certain point it can be interesting for me to add different tests or change the approach of an existing one.

Build

To build this project it's necessary to have installed one C++ compiler which supports C++17, GCC version 9 or greater for example along with CMake version 3.18.4 or greater.

I've configured CPM in order to provide some mandatory dependencies such as Boost libraries, Google Test and so on. This also differs from the original codebase provided in the book.

Other tools such as ccache and cppcheck are optional and can be removed from the CMakeLists.txt files.

From the repository root directory, which contains this CMakeLists.txt, run:

mkdir build && cd $_
cmake ../ && make

Execute

Once built, it's possible to find the binaries for the test suites inside the build/bin directory, and run it from there:

$ cd build/bin
$ ./SoundexTest01
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from SoundexEncoding
[ RUN      ] SoundexEncoding.RetainsSleLetterOfOneLetterWord
[       OK ] SoundexEncoding.RetainsSleLetterOfOneLetterWord (0 ms)
[----------] 1 test from SoundexEncoding (0 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (0 ms total)
[  PASSED  ] 1 test.

tdd-dojo's People

Contributors

furansa avatar

Stargazers

Callum Connolly avatar Daniel Garbi avatar Michel avatar Ky-Anh Huynh avatar Saddam Abu Ghaida avatar  avatar Damares Resende avatar

Watchers

Saddam Abu Ghaida avatar  avatar Damares Resende avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.