{"id":29189714,"url":"https://github.com/jwchung/experimentalism","last_synced_at":"2025-07-01T23:09:20.553Z","repository":{"id":15009793,"uuid":"17735351","full_name":"jwChung/Experimentalism","owner":"jwChung","description":"Experimentalism은 TDD에 도움을 줄 수 있는 라이브러리와 툴을 제공하는 것이 목적입니다.","archived":false,"fork":false,"pushed_at":"2016-04-13T20:07:25.000Z","size":12969,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-29T21:04:09.800Z","etag":null,"topics":["autofixture","c-sharp","tdd","unit-testing","xunit"],"latest_commit_sha":null,"homepage":"","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/jwChung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-14T04:27:05.000Z","updated_at":"2017-03-02T05:59:02.000Z","dependencies_parsed_at":"2022-09-23T03:12:16.098Z","dependency_job_id":null,"html_url":"https://github.com/jwChung/Experimentalism","commit_stats":null,"previous_names":[],"tags_count":113,"template":false,"template_full_name":null,"purl":"pkg:github/jwChung/Experimentalism","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwChung%2FExperimentalism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwChung%2FExperimentalism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwChung%2FExperimentalism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwChung%2FExperimentalism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwChung","download_url":"https://codeload.github.com/jwChung/Experimentalism/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwChung%2FExperimentalism/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263047679,"owners_count":23405280,"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":["autofixture","c-sharp","tdd","unit-testing","xunit"],"created_at":"2025-07-01T23:09:18.703Z","updated_at":"2025-07-01T23:09:20.510Z","avatar_url":"https://github.com/jwChung.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Stories in Ready](https://badge.waffle.io/jwChung/Experimentalism.png?label=ready\u0026title=Ready)](https://waffle.io/jwChung/Experimentalism)\nExperimentalism [![appveyor](http://img.shields.io/appveyor/ci/jwChung/Experimentalism.svg?style=flat-square)](https://ci.appveyor.com/project/jwChung/experimentalism)\n===============\n\nExperimentalism은 TDD에 도움을 줄 수 있는 라이브러리와 툴을 제공하는 것이 목적입니다. \n\nExperimentalism의 모든 프로젝트(NuGet패키지)는 [Semantic Versioning](http://semver.org/)을 따릅니다.\n\nExperimentalism의 프로젝트들은 [NuGet](https://www.nuget.org/profiles/jwChung/)에 등록이 되어있으므로,\nNuGet package manager 혹은 [Package manager console](http://docs.nuget.org/docs/start-here/using-the-package-manager-console)을 통해 각 패키지들을 설치할 수 있습니다.\n\n - Experiment.Xunit:  \n   [![install from nuget](http://img.shields.io/nuget/v/Experiment.Xunit.svg?style=flat-square)](https://www.nuget.org/packages/Experiment.Xunit)[![downloads](http://img.shields.io/nuget/dt/Experiment.Xunit.svg?style=flat-square)](https://www.nuget.org/packages/Experiment.Xunit)\n - Experiment.Idioms:  \n   [![install from nuget](http://img.shields.io/nuget/v/Experiment.Idioms.svg?style=flat-square)](https://www.nuget.org/packages/Experiment.Idioms)[![downloads](http://img.shields.io/nuget/dt/Experiment.Idioms.svg?style=flat-square)](https://www.nuget.org/packages/Experiment.Idioms)\n\nExperiment.Xunit\n----------------\nExperiment.Xunit란 [Parameterized Test](http://xunitpatterns.com/Parameterized%20Test.html)에 대한 auto data를 제공하기 위한 [xUnit.net](http://xunit.codeplex.com/)의 확장라이브러리입니다. 여기서 auto data란 테스트에 참여하는 객체 또는 값들이 anonymous 형태로 자동 생성된 것을 말합니다. 생성된 auto data는 테스트 메소드의 파라메타를 통해 제공되게 됩니다.\n\n### Parameterized test with auto data\n\n이 기능이 테스트작성에 어떤 장점을 가져다주는지, 아래의 예제코드를 통해 살펴보도록 하겠습니다. 예를 들어, `Person` 클래스의 `Say` 메소드를 테스트한다면, 아마 우리는 `SayTest`와 같이 작성할 수 있을 것입니다.\n\n```c#\npublic class Person\n{\n    private string name;\n    \n    public Person(string name)\n\t{\n        this.name = name;\n\t}\n    \n    public string Name\n    {\n        get { return this.name; }\n    }\n    \n    public string Say(string something)\n    {\n        return this.name + \": \" + something;\n    }\n}\n\npublic class PersonTest\n{\n    [Fact]\n    public void SayTest()\n    {\n        // Fixture setup\n        var name = \"Foo\";\n        var sut = new Person(name);\n        var something = \"Bar\";\n        var expected = name + \": \" + something;\n        \n        // Exercise system\n        var actual = sut.Say(something);\n        \n        // Verify outcome\n        Assert.Equal(expected, actual);\n    }\n}\n```\n\n`SayTest`를 Experiment.Xunit를 이용하여 다시 작성해 보면 아래와 같은 테스트를 작성할 수 있습니다. `sut`, `name`과 `something`값을 파라메타로 넘겨받음으로써, 테스트 데이터 생성의 번거로움을 덜 수 있을 뿐 아니라, 테스트가 무엇을 테스트하는지 그 의도를 좀 더 명확히 보여줄 수 있게 됩니다.\n\n```c#\npublic class PersonTest\n{\n    [Test]\n    public void SayTest(Person sut, string something)\n    {\n        // Fixture setup\n        var expected = sut.Name + \": \" + something;\n        \n        // Exercise system\n        var actual = sut.Say(something);\n        \n        // Verify outcome\n        Assert.Equal(expected, actual);\n    }\n}\n```\n\n### First class test with auto data\n우리는 종종 아래와 같이 하나의 테스트에서 여러 테스트를 동시에 실행하는 것으로 Parameterized test 효과를 얻고자 합니다.\n\n```c#\n[Fact]\npublic void AddTest()\n{\n    AddTestCase(1, 2, 3);\n    AddTestCase(2, 3, 5);\n    AddTestCase(10, 2, 12);\n}\n\npublic void AddTestCase(int a, int b, int expected)\n{\n    // Fixture setup\n    var sut = new Calc();\n    \n    // Exercise system\n    var actual = sut.Add(a, b);\n    \n    // Verify outcome\n    Assert.Equal(expected, actual);\n}\n```\n\n이러한 테스트를 [xUnit Patterns](http://xunitpatterns.com/index.html)에서는 [Tabular Test](http://xunitpatterns.com/Parameterized%20Test.html#Tabular%20Test)라 하는데, 모든 테스트가 통과할 때는 문제가 없지만, 만약 하나라도 실패하게 된다면 우리는 그 실패가 3가지 중 어느 테스트에서 발생하였는지 쉽게 알아차릴 수 없게 됩니다([Eager Test](http://xunitpatterns.com/Assertion%20Roulette.html#Eager%20Test), [Defect Localization](http://xunitpatterns.com/Goals%20of%20Test%20Automation.html#Defect%20Localization)).\n\n이 문제를 해결하기 위해서 Experiment.Xunit에서는 아래와 같이 xUnit.net의 `DataAttribute`를 사용하여 각각의 테스트를 분리하였습니다(Attribute Tabular Test). 이 경우 `AddTest`는 하나의 테스트가 아니라 arguments 별로 3개의 테스트로 작동하게 됩니다.\n\n```c#\n[Test]\n[InlineData(1, 2, 3)]\n[InlineData(2, 3, 5)]\n[InlineData(10, 2, 12)]\npublic void AddTest(int a, int b, int expected)\n{\n    // Fixture setup\n    var sut = new Calc();\n    \n    // Exercise system\n    var actual = sut.Add(a, b);\n    \n    // Verify outcome\n    Assert.Equal(expected, actual);\n}\n```\n\n하지만 Attribute Tabular Test는 Tabular Test에서는 없는 문제점이 있는데, 그것은 type-safe 방식이 아니라는 점입니다. 그래서 Experiment에서는 Tabular Test와 Attribute Tabular Test의 장점만을 살릴 수 있는 First class test 방식을 지원합니다. First class test 방식에서는 Eager Test 문제를 해결함과 동시에 type-safe 방식을 지원하는 장점을 가집니다.\n\n```c#\n[Test]\npublic IEnumerable\u003cITestCase\u003e AddTest()\n{\n\tvar testCases = new[]\n\t{\n\t\tnew { X = 1, Y = 2, Z = 3 },\n\t\tnew { X = 3, Y = 7, Z = 10 },\n\t\tnew { X = 100, Y = 23, Z = 123 }\n\t};\n\treturn TestCases.WithArgs(testCases).Create(\n\t\tc =\u003e Assert.Equal(c.Z, c.X + c.Y));\n}\n```\n\n또한, First class test 방식은 아래와 같이 anonymous 값을 넘겨주는 auto data 기능도 제공합니다.\n\n```c#\n[Test]\npublic IEnumerable\u003cITestCase\u003e AddTest()\n{\n\tvar testCases = new[]\n\t{\n\t\tnew { X = 1, Y = 2, Z = 3 },\n\t\tnew { X = 3, Y = 7, Z = 10 },\n\t\tnew { X = 100, Y = 23, Z = 123 }\n\t};\n\treturn TestCases.WithArgs(testCases).WithAuto\u003cCalc\u003e().Create(\n\t\t(c, sut) =\u003e\n\t\t{\n\t\t\tvar actual = sut.Add(c.X, c.Y);\n\t\t\tAssert.Equal(c.Z, actual);\n\t\t});\n}\n```\n\nCredits\n-------\n\n### Inspiration\nExperimentalism의 auto data 기능은 [xUnit Test Patterns(*by Gerard Meszaros*)](http://xunitpatterns.com/index.html)의 [Anonymous Creation Method](http://xunitpatterns.com/Creation%20Method.html#Anonymous%20Creation%20Method)와 [Parameterized Anonymous Creation Method](http://xunitpatterns.com/Creation%20Method.html#Parameterized%20Anonymous%20Creation%20Method)에서 영감을 얻었으며, [AutoFixture](https://github.com/AutoFixture/AutoFixture)의 [AutoFixture.Xunit](https://www.nuget.org/packages/AutoFixture.Xunit/)로부터 많은 영향을 받았습니다.\n\nFirst class test 방식은 [Bug squash의 First-class tests in MbUnit](http://bugsquash.blogspot.dk/2012/05/first-class-tests-in-mbunit.html)라는 글과 [Exude](https://github.com/GreanTech/Exude)에서 영감을 얻었습니다.\n\n###Third-party libraries\nExperimentalism은 아래와 같은 Third-party libraries를 사용하고 있습니다. 아래의 각 라이브러리에서 언급되는 라이센스 전문은 LICENSE.txt 파일 또는 각 소스파일의 헤더형태로 제공되므로 이를 참고할 수 있습니다.\n\n* Albedo 1.0.2  \n  Website:      https://github.com/ploeh/Albedo  \n  Copyright:    Copyright (c) 2013 Mark Seemann  \n  License:      The MIT License\n\n* AutoFixture 3.18.7  \n  Website:      https://github.com/AutoFixture/AutoFixture  \n  Copyright:    Copyright (c) 2013 Mark Seemann  \n  License:      The MIT License\n\n* AutoFixture.AutoMoq 3.18.7  \n  Website:      https://github.com/AutoFixture/AutoFixture  \n  Copyright:    Copyright (c) 2013 Mark Seemann  \n  License:      The MIT License\n\n* AutoFixture.Idioms 3.18.7  \n  Website:      https://github.com/AutoFixture/AutoFixture  \n  Copyright:    Copyright (c) 2013 Mark Seemann  \n  License:      The MIT License\n\n* AutoFixture.Xunit 3.18.7  \n  Website:      https://github.com/AutoFixture/AutoFixture  \n  Copyright:    Copyright (c) 2013 Mark Seemann  \n  License:      The MIT License\n\n* Mono.Reflection 1.0.0  \n  Website:      https://github.com/jbevain/mono.reflection  \n  Copyright:    Copyright (C) 2009 - 2010 Novell, Inc. (http://www.novell.com)  \n  License:      The MIT License\n\n* Moq 4.2.1402.2112\n  Website:      http://www.moqthis.com  \n  Copyright:    Copyright (c) 2007. Clarius Consulting, Manas Technology Solutions, InSTEDD  \n  License:      BSD\n\n* xunit 1.9.0.1566  \n  Website:      https://github.com/xunit/xunit  \n  Copyright:    Copyright 2013 Outercurve Foundation  \n  License:      Apache 2.0\n\n* xunit.extensions 1.9.0.1566  \n  Website:      https://github.com/xunit/xunit  \n  Copyright:    Copyright 2013 Outercurve Foundation  \n  License:      Apache 2.0\n\n### Icon image\nWebsite:      http://www.oxygen-icons.org  \nCopyright:    Copyright (c) Oxygen Team  \nLicense:      [Creative Commons (Attribution-NonCommercial-NoDerivs 2.5 Generic)](http://creativecommons.org/licenses/by-nc-nd/2.5/)\n\nQuestions\n---------\nExperimentalism에 대한 도움말이나 설명 문서가 많이 부족합니다. 따라서, 궁금증이나 문의가 있으시면 [Issue list](https://github.com/jwChung/Experimentalism/issues)에 질문을 등록하실 수 있습니다.\n\nAdditional references\n---------------------\nExperimentalism은 각 테스트 프로젝트에서 해당 프로젝트에 대한 시나리오 테스트(acceptance test)를 포함하고 있습니다. 이 시나리오 테스트들은 해당 프로젝트를 어떻게 이용하는지 간략히 잘 나타내고 있습니다. 아래 링크를 참고하세요.\n\n* [Experiment.Xunit scenario tests](https://github.com/jwChung/Experimentalism/blob/master/test/Experiment.Xunit.UnitTest/Scenario.cs)\n* [Experiment.Idioms scenario tests](https://github.com/jwChung/Experimentalism/blob/master/test/Experiment.Idioms.UnitTest/Scenario.cs)\n\nContributions\n-------------\n\u003e Coming together is a beginning; keeping together is progress; working together is success. – Henry Ford\n\n관심이 있으신 **누구나** Experimentalism에 참여하실 수 있습니다. 특히, TDD에 관심있거나 또는 배우고자하는 분들이 참여하시면 TDD에 관한 insight를 얻을 수 있을 것으로 생각됩니다. 참여방법은 [CONTRIBUTING 문서](https://github.com/jwChung/Experimentalism/blob/master/CONTRIBUTING.md)를 통해서 확인하실 수 있습니다.\n\n###New Contributor? Jump In!\nExperimentalism 오픈소스 참여에 익숙하지 않으신 분들은 [Issue list](https://github.com/jwChung/Experimentalism/issues)에서 **Jump in** 라벨이 붙은 이슈를 주목하시기 바랍니다. Jump in 라벨은 다음과 같은 의미이며, _Experimentalism 오픈소스 참여를 독려하기 위한 장치_입니다.\n\n* 해당 이슈를 해결하는데 상대적으로 많은 시간을 할애하지 않아도 된다.\n* 상대적으로 독립적인 이슈이기 때문에 이해하기 쉽다.\n* 해당 이슈는 구현을 위한 핵심을 잘 지적하고 있다.\n* 필요 시 해당 이슈에 대한 설명을 요청할 수 있다.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwchung%2Fexperimentalism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwchung%2Fexperimentalism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwchung%2Fexperimentalism/lists"}