{"id":23033953,"url":"https://github.com/freenowtech/4yfn-kata","last_synced_at":"2025-06-25T15:07:59.728Z","repository":{"id":98690750,"uuid":"122346740","full_name":"freenowtech/4yfn-kata","owner":"freenowtech","description":"Coding kata for the 2018 4yfn event","archived":false,"fork":false,"pushed_at":"2018-12-28T16:50:19.000Z","size":360,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T01:01:51.474Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/freenowtech.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":"2018-02-21T14:27:37.000Z","updated_at":"2021-09-30T07:52:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"d4496d5c-3bbe-4919-bc85-48d17d6fe6cf","html_url":"https://github.com/freenowtech/4yfn-kata","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/freenowtech/4yfn-kata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freenowtech%2F4yfn-kata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freenowtech%2F4yfn-kata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freenowtech%2F4yfn-kata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freenowtech%2F4yfn-kata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freenowtech","download_url":"https://codeload.github.com/freenowtech/4yfn-kata/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freenowtech%2F4yfn-kata/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261897003,"owners_count":23226648,"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":"2024-12-15T16:28:15.142Z","updated_at":"2025-06-25T15:07:59.704Z","avatar_url":"https://github.com/freenowtech.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Alt text](Braze-Referal.png?raw=true \"Title\")\n\n\n# 4yfn-kata\nCoding kata for the 2018 4yfn event. The following is a TDD Kata, an exercise in coding, refactoring and test-first.\n\n## Before you start\n* Try not to read ahead.\n* Do one task at a time. The trick is to learn to work incrementally.\n* Make sure you only test for correct inputs. There is no need to test for invalid inputs for this kata.\n* There are several folders , each one belonging to a specific language or technology in which you can solve the exercise. \n* **Follow the red-green-refactor approach**\n\n\n## Instructions\n\n\n* Please create a separate git branch from master with your solution\n\t* ``` git checkout master```  \n\t* ``` git pull origin master```\n\t* ``` git checkout -b \u003cyour_branch_name\u003e``` ( to create a branch from master). As branch name we suggest you to use your name and surname  separated by underscores( e.g. markus_wallace)\n\t\n* Commit each one of the requested tasks separately :\n\t\n\t* ``` git add -u . ```\n\t* ``` git commit -m \"\u003cmessage regarding the task you are solving\u003e\"```\n\n* Push your changes :\t\n\t*  ``` git push origin \u003cyour_branch_name\u003e```\n\t*  The user and passwords if required will be given at the momment of solving the exercise \t\n\n\t\n\n## The kata\n\n### Step 1: the simplest thing\nCreate a simple String calculator with a method `int add(String numbers)`.\n\n* The string argument can contain 0, 1 or 2 numbers, and will return their sum (for an empty string it will return 0) for example `\"\"` or `\"1\"` or `\"1,2\"`.\n* Start with the simplest test case of an empty string and move to one and two numbers.\n* Remember to solve things as simply as possible so that you force yourself to write tests you did not think about.\n* Remember to refactor after each passing test.\n\n### Step 2: handle an unknown amount of numbers\nAllow the `add()` method to handle an unknown amount of numbers.\n\n### Step 3: handle new lines between numbers\nAllow the `add()` method to handle new lines between numbers (instead of commas).\n\n* the following input is ok:  `\"1\\n2,3\"` (will equal 6)\n* the following input is NOT ok:  `\"1,\\n\"` (not need to prove it - just clarifying)\n\n### Step 4: negative numbers\nCalling `add()` with a negative number will throw an exception `\"negatives not allowed\"` - and the negative that was passed.\n\nFor example `add(\"1,4,-1\")` should throw an exception with the message `\"negatives not allowed: -1\"`.\n\nIf there are multiple negatives, show all of them in the exception message.\n\n### Step 5: ignore big numbers\nNumbers bigger than 1000 should be ignored, so adding 2 + 1001  = 2\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreenowtech%2F4yfn-kata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreenowtech%2F4yfn-kata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreenowtech%2F4yfn-kata/lists"}