{"id":19458618,"url":"https://github.com/luontola/tdd-mooc-legacy-code","last_synced_at":"2025-04-25T06:30:31.710Z","repository":{"id":66604291,"uuid":"416442549","full_name":"luontola/tdd-mooc-legacy-code","owner":"luontola","description":"Exercise for dealing with legacy code","archived":false,"fork":false,"pushed_at":"2023-12-21T14:34:26.000Z","size":2910,"stargazers_count":0,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T17:22:57.684Z","etag":null,"topics":["javascript","kata","legacy-code"],"latest_commit_sha":null,"homepage":"https://tdd.mooc.fi","language":"JavaScript","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/luontola.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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":"2021-10-12T17:55:31.000Z","updated_at":"2021-10-16T00:40:50.000Z","dependencies_parsed_at":"2024-11-10T17:29:57.222Z","dependency_job_id":null,"html_url":"https://github.com/luontola/tdd-mooc-legacy-code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luontola%2Ftdd-mooc-legacy-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luontola%2Ftdd-mooc-legacy-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luontola%2Ftdd-mooc-legacy-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luontola%2Ftdd-mooc-legacy-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luontola","download_url":"https://codeload.github.com/luontola/tdd-mooc-legacy-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250766963,"owners_count":21483895,"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":["javascript","kata","legacy-code"],"created_at":"2024-11-10T17:27:50.983Z","updated_at":"2025-04-25T06:30:31.375Z","avatar_url":"https://github.com/luontola.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [TDD MOOC](https://tdd.mooc.fi/): Legacy code\n\nThis is an exercise to practice dealing with legacy code. There are three things you need to do:\n\n1. **Write test for the code [src/gilded_rose.mjs](src/gilded_rose.mjs), until it has 100% mutation test coverage.**\n2. **Refactor the code to make it understandable.**\n3. **Add the \"conjured items\" feature described in [Gilded Rose requirements](GildedRoseRequirements.txt).**\n\nWhen writing the tests, at first use just line coverage (`npm run coverage`) to find non-tested lines. After all lines\nare tested, switch to using mutation coverage (`npm run mutation`) and improve your tests. Both commands write their\nreports in html format under the `coverage` directory.\n\n(In real projects, mutation coverage typically takes many minutes to run, so for faster feedback it can be practical to\nfirst focus on just the line coverage.)\n\nWhen refactoring, first try to see how far you can get without understanding the problem domain (i.e. use mechanical,\nprovably correct refactorings). Then read the [Gilded Rose requirements](GildedRoseRequirements.txt) document to\nunderstand the problem domain and get a new perspective for improving the design.\n\n---\n\n_This exercise is part of the [TDD MOOC](https://tdd.mooc.fi) at the University of Helsinki, brought to you\nby [Esko Luontola](https://twitter.com/EskoLuontola) and [Nitor](https://nitor.com/). This exercise is based on\nthe [Gilded Rose Refactoring Kata](https://github.com/emilybache/GildedRose-Refactoring-Kata)\nby [Emily Bache](https://twitter.com/emilybache) and [Terry Hughes](https://twitter.com/TerryHughes)._\n\n## Prerequisites\n\nYou'll need a recent [Node.js](https://nodejs.org/) version. Then download this project's dependencies with:\n\n    npm install\n\n## Developing\n\nRun tests once\n\n    npm run test\n\nRun tests continuously\n\n    npm run autotest\n\nCalculate line coverage, writes results to `coverage/lcov-report/index.html`\n\n    npm run coverage\n\nCalculate mutation coverage, writes results to `coverage/mutation-report/index.html`\n\n    npm run mutation\n\nCode reformat\n\n    npm run format\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluontola%2Ftdd-mooc-legacy-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluontola%2Ftdd-mooc-legacy-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluontola%2Ftdd-mooc-legacy-code/lists"}