{"id":20138679,"url":"https://github.com/el-moudni-hicham/test-driven-development","last_synced_at":"2025-09-14T04:33:19.301Z","repository":{"id":208528633,"uuid":"721736868","full_name":"el-moudni-hicham/test-driven-development","owner":"el-moudni-hicham","description":"All what you need about Test Driven Development","archived":false,"fork":false,"pushed_at":"2023-11-22T22:58:04.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T23:15:29.751Z","etag":null,"topics":["java","junit","tdd","testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/el-moudni-hicham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-11-21T17:08:45.000Z","updated_at":"2023-11-22T21:13:17.000Z","dependencies_parsed_at":"2023-11-22T00:59:20.987Z","dependency_job_id":"3261d850-cf59-4a59-9181-aeb6c0b2f1d2","html_url":"https://github.com/el-moudni-hicham/test-driven-development","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.33333333333333337","last_synced_commit":"316ee51f1430a698a8868fa64de24ada9f152d66"},"previous_names":["el-moudni-hicham/test-driven-development"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/el-moudni-hicham/test-driven-development","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el-moudni-hicham%2Ftest-driven-development","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el-moudni-hicham%2Ftest-driven-development/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el-moudni-hicham%2Ftest-driven-development/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el-moudni-hicham%2Ftest-driven-development/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/el-moudni-hicham","download_url":"https://codeload.github.com/el-moudni-hicham/test-driven-development/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/el-moudni-hicham%2Ftest-driven-development/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275062953,"owners_count":25398886,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["java","junit","tdd","testing"],"created_at":"2024-11-13T21:40:24.664Z","updated_at":"2025-09-14T04:33:19.240Z","avatar_url":"https://github.com/el-moudni-hicham.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test Driven Development\n\n```All what you need about Test Driven Development```\n\n# Table of content\n- [Behavior Driven Development BDD](#behavior-driven-development-bdd)\n- [Test Driven Development TDD](#test-driven-development-tdd)\n- [ARRANGE ACT ASSERT Pattern](#arrange-act-assert-pattern)\n\n# Behavior Driven Development BDD\nBDD is a development methodology that emphasizes meeting the business needs of the software.\n\n### **BDD syntax** \nBDD is based on words that we often use in real life like **Given, When, Then,** and **And**, which will describe the  behavior of our feature.\n\nFor example:\n\n- **Given** a user leaves a comment\n\n- **When** the comment exceeds 1000 characters\n\n- **Then** the comment should not be saved\n\n- **And** the user  should see an error message\n\n\n\n# Test Driven Development TDD\n\n is an approach to software development where you write tests first, then use those tests to drive the design and development of your software application\n\nHere's how the two BDD and TDD work together. You will: \n\n1. Identify **behaviors**  with BDD.\n2. Write **tests** for these behaviors with TDD.\n\n### The Three Rules of TDD\n`Robert C. Martin` provides a concise set of rules for practicing TDD :\n\n1. Write production code only to pass a failing unit test.\n2. Write no more of a unit test than sufficient to fail (compilation failures are failures).\n3. Write no more production code than necessary to pass the one failing unit test.   \n\n### Red, Green, Refactor Cycle\nThe red, green, refactor approach helps developers compartmentalize their focus into three phases:\n\n**Red —** think about what you want to develop\n\n**Green —** think about how to make your tests pass\n\n**Refactor —** think about how to improve your existing implementation\n\n![image](https://github.com/el-moudni-hicham/test-driven-development/assets/85403056/84ec68ff-4ad1-48af-88ab-23b06a406f1b)\n\n![image](https://github.com/el-moudni-hicham/test-driven-development/assets/85403056/289bf7ba-144f-4d11-87ea-ef48e58b91cc)\n\n\n# ARRANGE ACT ASSERT Pattern\n\nThere is a standard way to structure a test. This is the AAA Pattern, or Arrange - Act - Assert: \n\n  * **Arrange :** initialize all necessary inputs and the system to be tested if necessary. \n  * **Act :** Run the system under test with previously initialized inputs into outputs that you keep. \n  * **Assert :** Validate outbounds based on what is expected from your inbounds. You then conclude whether it is a success or a failure.\n\nThe figure below illustrates the entire overall architecture of the test :\n\n\n![image](https://github.com/el-moudni-hicham/test-driven-development/assets/85403056/5f2560ac-d105-48b0-a3dc-0d4813d8d288)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fel-moudni-hicham%2Ftest-driven-development","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fel-moudni-hicham%2Ftest-driven-development","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fel-moudni-hicham%2Ftest-driven-development/lists"}