{
    "url": "https://delaparra-services.nl/knowledge-hub/unit-test",
    "locale": "en",
    "title": "Unit test: Knowledge hub | DeLaParra Services",
    "description": "A test that verifies a single, isolated piece of functionality (a function, a method) in isolation from the rest of the system. The fastest and most granul...",
    "alternates": {
        "en": "https://delaparra-services.nl/knowledge-hub/unit-test",
        "nl": "https://delaparra-services.nl/nl/kennisbank/unit-test"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/knowledge-hub/unit-test.csv",
        "md": "https://delaparra-services.nl/knowledge-hub/unit-test.md",
        "json": "https://delaparra-services.nl/knowledge-hub/unit-test.json",
        "zip": "https://delaparra-services.nl/knowledge-hub/unit-test.zip",
        "pdf": "https://delaparra-services.nl/knowledge-hub/unit-test.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/knowledge-hub/unit-test.csv",
            "encodingFormat": "text/csv",
            "name": "unit-test.csv"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/unit-test.json",
            "encodingFormat": "application/json",
            "name": "unit-test.json"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/unit-test.md",
            "encodingFormat": "text/markdown",
            "name": "unit-test.md"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/unit-test.pdf",
            "encodingFormat": "application/pdf",
            "name": "unit-test.pdf"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/unit-test.zip",
            "encodingFormat": "application/zip",
            "name": "unit-test.zip"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/unit-test/skills.zip",
            "encodingFormat": "application/zip",
            "name": "unit-test-skills.zip"
        }
    ],
    "markdown": "1. [Home](<https://delaparra-services.nl/>) \n1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) \n1. [Unit test](<https://delaparra-services.nl/knowledge-hub/unit-test>)\n\n  \n\nCategory: Core glossary \n\n# Unit test\n\n  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    \n\n## What is Unit test?\n\n \n\nUnit test: A test that verifies a single, isolated piece of functionality (a function, a method) in isolation from the rest of the system. The fastest and most granular type of test. A unit test checks a small piece of code, such as one function or method, in isolation from the rest of the system. It runs in milliseconds, without a database, network or file system.\n\n \n\nDefinition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)\n\n \n\n## Frequently asked questions about Unit test\n\n  \n\n### How is Unit test used in practice?\n\n \n\nUnit tests are ideal for logic with clear inputs and outputs: price calculations, date rules, validation, formatting. They pinpoint exactly what broke, because each test covers so little.\n\n    \n\n### What should you keep in mind with Unit test?\n\n \n\nThey work best combined with other kinds of tests. Feature or integration tests check that parts work together, such as a request reaching the database and returning the right page. In Laravel, both live side by side in PHPUnit or Pest. A good habit is to write a failing test before fixing a bug. It proves the fix works and prevents the same bug from quietly returning.\n\n \n\n## At a glance\n\n   CategoryCore glossary Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026\n\n \n\n## More Core glossary terms\n\n \n\n- [Token](<https://delaparra-services.nl/knowledge-hub/token>) \n- [Transaction](<https://delaparra-services.nl/knowledge-hub/transaction>) \n- [Type checking](<https://delaparra-services.nl/knowledge-hub/type-checking>) \n- [URL (Uniform Resource Locator)](<https://delaparra-services.nl/knowledge-hub/url-uniform-resource-locator>) \n- [UUID (Universally Unique Identifier)](<https://delaparra-services.nl/knowledge-hub/uuid-universally-unique-identifier>) \n- [Version control](<https://delaparra-services.nl/knowledge-hub/version-control>)\n\n \n\n[All terms starting with U](<https://delaparra-services.nl/knowledge-hub#letter-u>)\n\n \n\n## Skills\n\n \n\n- ### Test-Driven Development (TDD)\n\n \n\nUse when implementing any feature or bugfix, before writing implementation code\n\n [View skill](<https://delaparra-services.nl/skills/test-driven-development>) [Download zip](<https://delaparra-services.nl/skills/test-driven-development/download>) \n- ### Test-Driven Development\n\n \n\nTest-driven development with red-green-refactor loop using Pest PHP. Use when user wants to build features or fix bugs using TDD, mentions \"red-green-refactor\", wants integration tests, asks for test-first development, or needs guidance on writing testable code with Pest.\n\n [View skill](<https://delaparra-services.nl/skills/tdd-laravel>) [Download zip](<https://delaparra-services.nl/skills/tdd-laravel/download>) \n- ### Laravel 13 Testing — Pest PHP 4 & PHPUnit 12\n\n \n\nLaravel 13 testing with Pest PHP 4 or PHPUnit 12. Use when writing feature tests, unit tests, or any test code in a Laravel application. Triggers on tasks involving HTTP tests, model factories, database assertions, mocking facades, authentication testing, or test organisation patterns.\n\n [View skill](<https://delaparra-services.nl/skills/laravel-testing>) [Download zip](<https://delaparra-services.nl/skills/laravel-testing/download>)\n\n [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/unit-test/skills.zip>)\n\n \n\n## Manuals\n\n \n\n- [Testing your app with Pest](<https://delaparra-services.nl/manuals/je-app-testen-met-pest>)\n\n \n\n## Related services\n\n \n\n- [AI code review](<https://delaparra-services.nl/services#service-05>)\n\nWhen you push your new change, I will review your code, help your agent avoid the same mistake again, and get your app ready for deployment. \n- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)\n\nPerhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet.\n\n \n\n## Need any help?\n\n \n\nStuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.\n\n  [Get in touch](<https://delaparra-services.nl/availability>)\n\n[HTML version](https://delaparra-services.nl/knowledge-hub/unit-test)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "FAQPage",
                "@id": "https://delaparra-services.nl/knowledge-hub/unit-test#webpage",
                "url": "https://delaparra-services.nl/knowledge-hub/unit-test",
                "name": "Unit test: Knowledge hub | DeLaParra Services",
                "description": "A test that verifies a single, isolated piece of functionality (a function, a method) in isolation from the rest of the system. The fastest and most granul...",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@type": "DefinedTerm",
                    "@id": "https://delaparra-services.nl/knowledge-hub/unit-test#term",
                    "name": "Unit test",
                    "description": "A test that verifies a single, isolated piece of functionality (a function, a method) in isolation from the rest of the system. The fastest and most granular type of test.",
                    "termCode": "unit-test",
                    "url": "https://delaparra-services.nl/knowledge-hub/unit-test",
                    "inLanguage": "en",
                    "keywords": "Core glossary",
                    "dateModified": "2026-11-25T17:46:31+00:00",
                    "inDefinedTermSet": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#terms"
                    },
                    "isPartOf": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#dataset"
                    },
                    "subjectOf": [
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/unit-test#webpage"
                        },
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/unit-test#dataset"
                        }
                    ]
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/unit-test#breadcrumb"
                },
                "mainEntity": [
                    {
                        "@type": "Question",
                        "name": "What is Unit test?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "A test that verifies a single, isolated piece of functionality (a function, a method) in isolation from the rest of the system. The fastest and most granular type of test. A unit test checks a small piece of code, such as one function or method, in isolation from the rest of the system. It runs in milliseconds, without a database, network or file system."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "How is Unit test used in practice?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "Unit tests are ideal for logic with clear inputs and outputs: price calculations, date rules, validation, formatting. They pinpoint exactly what broke, because each test covers so little."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What should you keep in mind with Unit test?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "They work best combined with other kinds of tests. Feature or integration tests check that parts work together, such as a request reaching the database and returning the right page. In Laravel, both live side by side in PHPUnit or Pest. A good habit is to write a failing test before fixing a bug. It proves the fix works and prevents the same bug from quietly returning."
                        }
                    }
                ],
                "author": {
                    "@id": "https://delaparra-services.nl/#person"
                },
                "mentions": [
                    {
                        "@id": "https://delaparra-services.nl/skills/test-driven-development#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/tdd-laravel#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/laravel-testing#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/je-app-testen-met-pest#article"
                    }
                ]
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/knowledge-hub/unit-test#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Knowledge hub",
                        "item": "https://delaparra-services.nl/knowledge-hub"
                    },
                    {
                        "@type": "ListItem",
                        "position": 3,
                        "name": "Unit test"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/knowledge-hub/unit-test#dataset",
                "name": "Unit test",
                "description": "A test that verifies a single, isolated piece of functionality (a function, a method) in isolation from the rest of the system. The fastest and most granular type of test.",
                "url": "https://delaparra-services.nl/knowledge-hub/unit-test",
                "identifier": "https://delaparra-services.nl/knowledge-hub/unit-test#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/unit-test#term"
                },
                "creator": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://creativecommons.org/licenses/by/4.0/",
                "creditText": "Coders Lingo (https://coderslingo.com/resources/open-dataset/), CC BY 4.0",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "keywords": "Core glossary",
                "version": "2026-11-25",
                "dateModified": "2026-11-25T17:46:31+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#dataset",
                    "name": "IT terms from A to Z",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "unit-test.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/unit-test.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:31+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "unit-test.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/unit-test.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:31+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "unit-test.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/unit-test.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:31+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "unit-test.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/unit-test.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:31+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "unit-test.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/unit-test.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:31+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "unit-test-skills.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/unit-test/skills.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:31+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    }
                ]
            }
        ]
    }
}