{"id":25006633,"url":"https://github.com/markandre13/kaffeeklatsch","last_synced_at":"2025-03-30T00:16:28.528Z","repository":{"id":221983210,"uuid":"755945604","full_name":"markandre13/kaffeeklatsch","owner":"markandre13","description":"a c++ unit test library modeled after rspec, mocha/chai","archived":false,"fork":false,"pushed_at":"2025-02-23T11:25:51.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T12:24:31.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markandre13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-11T14:49:27.000Z","updated_at":"2025-02-23T11:25:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"ab5117f8-7395-4cf1-afbe-08eaff44a554","html_url":"https://github.com/markandre13/kaffeeklatsch","commit_stats":null,"previous_names":["markandre13/kaffeeklatsch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markandre13%2Fkaffeeklatsch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markandre13%2Fkaffeeklatsch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markandre13%2Fkaffeeklatsch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markandre13%2Fkaffeeklatsch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markandre13","download_url":"https://codeload.github.com/markandre13/kaffeeklatsch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246258868,"owners_count":20748573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-05T01:50:27.080Z","updated_at":"2025-03-30T00:16:28.509Z","avatar_url":"https://github.com/markandre13.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kaffeeklatsch\nexecutable specifications for c++\n\n```c++\nimport store;\n\nimport kaffeeklatsch;\nusing namespace kaffeeklatsch;\n\nkaffeeklatsch_spec([] {\n    describe(\"a shopping cart\", []{\n        it(\"can be filled with articles\", []{\n            auto cart = make_shared\u003cCart\u003e();\n            auto article make_shared\u003cArticle\u003e(\"Ketchup\", 3.99EUR);\n            cart.add(article);\n            expect(cart).to.have.sizeOf(1);\n            expect(cart.total()).to.equal(3.99EUR);\n        });\n    });\n});\n\nint main(int argc, char *argv[]) { \n    return kaffeeklatsch::run(argc, argv);\n}\n```\n\n## About\n\nthis unit test library is a c++ variant of mocha/chai, which is a variant of rspec.\n\nthe mindset behind it is to regard tests not just as mere tests, but foremost as\nexecutable specification and documentation.\n\n* tests can capture the most expensive part of software development: figuring out what\n  it is that needs to be build.\n\n* the test's names serve as documentation to the user of the unit under test.\n\n* the test's body is an example to the user on how to use the code being tested.\n\n  one can duplicate such tests to learn how to use the unit by using it or to\n  create regression tests with something does not work as expected.\n\n* the test's body serves as executable specification which can be automatically validated.\n  whenever the specification diverts from the implementation, the computer will tell you.\n\n* tests, when done right, allow to refactor the whole implementation to keep it readable\n  and extenable for future requirements.\n\n## Be Aware...\n\n* ...that unit tests are the least effective way of testing.\n\n* ...that there two kinds of unit tests:\n \n  * a _social unit test_ sends and gets data to to and from the unit via it's api.\n    but the test does not care what other objects the unit may use under the hood.\n    only slow external services might be mocked using validated fakes.\n  \n  * a _solitary unit test_ sends data to the unit's api and validates what data it\n    is sending to other units. those other units are mocked. furthermore, if the\n    mock returns data, the exact value should be of no relevance to the test, otherwise\n    the test implementation will depend on the unit being mocked.\n\n    this approach can be used in object oriented code, which, due to the\n    _information hiding_ principle, has no getters, and instead of asking a unit for\n    a value, one tell's a unit to do something. (tell, don't ask rule).\n\n* ...of [context driven testing](https://context-driven-testing.com)\n\n* ...of [shift-left testing](https://en.wikipedia.org/wiki/Shift-left_testing)\n\n* ...of [growing object-oriented software driven by tests](http://www.growing-object-oriented-software.com)\n\n## Further Reading\n\n* steven r. baker's [history of rspec](https://stevenrbaker.com/tech/history-of-rspec.html)\n* [rspec style guide](https://rspec.rubystyle.guide/)\n* [rspec](https://rspec.info) (ruby)\n* [mocha test framework](https://mochajs.org) (javascript/typescript)\n* [chai assertion library](https://www.chaijs.com) (javascript/typescript)\n* [bandit](https://banditcpp.github.io/bandit/) (c++)\n\n## The Name\n\n\"kaffeeklatsch\" is an informal social gathering for coffee and conversation. the reason\nto choose this name was\n\n* kaffee/coffee: to honour the mocha/chai javascript test tools i've working with for\n  several years. and only while working on this library i learned that they were\n  inspired by rspec.\n* klatsch/gossip: i'm an advocate of xp, double-loop-tdd and 3c and hence to start\n  by pairing with the user and writing down the names of acceptance tests.\n\n## Addendum\n\nthank you for your interest. i've tried to do this software in modern c++ but there is\nstill so much for me to learn.\n\nif you'd like to contribute, please fork on github and send merge requests.\n\nkeep hacking,\n\nmark\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkandre13%2Fkaffeeklatsch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkandre13%2Fkaffeeklatsch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkandre13%2Fkaffeeklatsch/lists"}