<aside>

</aside>

๐ŸŽฏ ์ด๋ฒˆ ์ฑ•ํ„ฐ ๋ชฉํ‘œ


๐Ÿ’ป ๊ฐ•์˜ ์ „์ฒด ์ฝ”๋“œ ๋ฐ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ (Hypothesis ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€!)

ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ:

graph TD
    A(my-pytest-project) --> B(.venv);
    A --> C(mycalc);
    A --> D(tests);
    A --> E(pytest.ini);
    C --> C1(__init__.py);
    C --> C2(calculator.py);
    C --> C3(exchange.py);
    D --> D1(__init__.py);
    D --> D2(test_calculator.py);
    D --> D3(conftest.py);
    D --> D4(test_scopes.py);
    D --> D5(test_markers.py);
    D --> D6(test_exchange.py);
    D --> D7(test_properties.py Hypothesis ํ…Œ์ŠคํŠธ ํŒŒ์ผ);

    style B fill:#eee,stroke:#333,stroke-dasharray: 5 5;
    style C fill:#ccf,stroke:#333;
    style D fill:#cfc,stroke:#333;
    style E fill:#fef,stroke:#333;
    style C2 fill:#cce,stroke:#333;
    style C3 fill:#fda,stroke:#333;
    style D2 fill:#cef,stroke:#333;
    style D3 fill:#fec,stroke:#333;
    style D4 fill:#dff,stroke:#333;
    style D5 fill:#ffd,stroke:#333;
    style D6 fill:#adf,stroke:#333;
    style D7 fill:#dff,stroke:#333;


๐Ÿ“š ๋‚ด์šฉ

1. ์˜ˆ์ œ ๊ธฐ๋ฐ˜ ํ…Œ์ŠคํŠธ vs ์†์„ฑ ๊ธฐ๋ฐ˜ ํ…Œ์ŠคํŠธ ๐Ÿค”

graph TD
    subgraph Example-Based Testing
        direction LR
        A["๊ฐœ๋ฐœ์ž ์˜ˆ์‹œ ์„ ์ • (2,3) -> 5"] --> B{ํ…Œ์ŠคํŠธ ์‹คํ–‰};
        B -- ๊ฐ ์˜ˆ์‹œ ๊ฒ€์ฆ --> C[๊ฒฐ๊ณผ ํ™•์ธ ์„ ์ •๋œ ์˜ˆ์‹œ๋งŒ];
    end

    subgraph Property-Based Testing
        direction LR
        D["๊ฐœ๋ฐœ์ž ์†์„ฑ ์ •์˜ add(x,y)==add(y,x)"] --> E{"๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฐ์ดํ„ฐ ์ƒ์„ฑ (0,0),(-1,5)..."};
        E -- ๊ฐ ๋ฐ์ดํ„ฐ๋กœ ์†์„ฑ ๊ฒ€์ฆ --> F{๋ฐ˜๋ก€ ์‹คํŒจ ์ผ€์ด์Šค ์ฐพ๊ธฐ};
        F -- ๋ฐ˜๋ก€ ๋ฐœ๊ฒฌ --> G[๊ฒฐ๊ณผ ๋ณด๊ณ  ๋ฒ„๊ทธ ๊ฐ€๋Šฅ์„ฑ];
        F -- ๋ฐ˜๋ก€ ๋ชป ์ฐพ์Œ --> H[๊ฒฐ๊ณผ ๋ณด๊ณ  ์†์„ฑ ๋งŒ์กฑ];
    end

    style C fill:#cfc, stroke:#333
    style G fill:#fcc, stroke:#333
    style H fill:#cfc, stroke:#333