[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"content:legacy:page:\u002Finterviews\u002Fsoftware-testing":3,"content:legacy:navigation":209,"content:legacy:surround:\u002Finterviews\u002Fsoftware-testing":537},{"id":4,"title":5,"body":6,"description":196,"extension":197,"icon":198,"meta":199,"modifiedAt":200,"navigation":201,"path":202,"publishedAt":203,"seo":204,"sitemap":205,"stem":206,"updatedAt":207,"__hash__":208},"interviews\u002Finterviews\u002Fsoftware-testing.md","Software Testing",{"type":7,"value":8,"toc":194},"minimark",[9,32,50,68,86,104,122,140,158,176],[10,11,12,23],"collapsible",{},[13,14,16],"template",{"v-slot:title":15},"",[17,18,19],"ol",{},[20,21,22],"li",{},"What makes a test valuable?",[13,24,25,29],{"v-slot:content":15},[26,27,28],"p",{},"A valuable test protects important behavior, fails for a clear reason, runs at an appropriate speed, and remains stable through harmless refactoring. Its confidence should justify its maintenance and execution cost.",[26,30,31],{},"Prioritize business risk, complex logic, integration boundaries, and previously observed failures over maximizing a coverage number.",[10,33,34,42],{},[13,35,36],{"v-slot:title":15},[17,37,39],{"start":38},2,[20,40,41],{},"How do unit, integration, and end-to-end tests differ?",[13,43,44,47],{"v-slot:content":15},[26,45,46],{},"Unit tests exercise a small behavior with controlled dependencies. Integration tests verify real collaboration such as application code with a database or adapter. End-to-end tests validate critical user journeys through the deployed stack.",[26,48,49],{},"Use many focused lower-level tests and a smaller set of high-value end-to-end paths; exact proportions depend on the product's risks.",[10,51,52,60],{},[13,53,54],{"v-slot:title":15},[17,55,57],{"start":56},3,[20,58,59],{},"What should be mocked?",[13,61,62,65],{"v-slot:content":15},[26,63,64],{},"Mock unstable or expensive boundaries when a test needs deterministic control: external services, time, randomness, or failure injection. Prefer real domain objects and realistic local infrastructure when their behavior is central to the test.",[26,66,67],{},"Over-mocking implementation details creates tests that pass while the real integration is broken.",[10,69,70,78],{},[13,71,72],{"v-slot:title":15},[17,73,75],{"start":74},4,[20,76,77],{},"What is contract testing?",[13,79,80,83],{"v-slot:content":15},[26,81,82],{},"Contract tests verify that a provider and consumer agree on requests, responses, events, or schemas without requiring every service to run in one end-to-end environment.",[26,84,85],{},"They are most useful when contracts are versioned, representative, and checked by both sides. They do not replace provider logic tests or a few system-level journeys.",[10,87,88,96],{},[13,89,90],{"v-slot:title":15},[17,91,93],{"start":92},5,[20,94,95],{},"How do you test asynchronous code reliably?",[13,97,98,101],{"v-slot:content":15},[26,99,100],{},"Await the observable completion condition instead of sleeping for an arbitrary duration. Control clocks only when time itself is part of the behavior, and expose cancellation or completion signals for background work.",[26,102,103],{},"Ensure rejected promises fail the test and restore fake timers or global stubs during cleanup.",[10,105,106,114],{},[13,107,108],{"v-slot:title":15},[17,109,111],{"start":110},6,[20,112,113],{},"Why are flaky tests harmful, and how should they be handled?",[13,115,116,119],{"v-slot:content":15},[26,117,118],{},"Flaky tests erode trust, waste investigation time, and train teams to ignore failures. Common causes include shared state, timing assumptions, order dependence, external networks, and non-deterministic data.",[26,120,121],{},"Record evidence, assign ownership, fix or quarantine with a deadline, and track recurrence. Blind retries can hide a real race condition.",[10,123,124,132],{},[13,125,126],{"v-slot:title":15},[17,127,129],{"start":128},7,[20,130,131],{},"What does code coverage tell you—and what does it not tell you?",[13,133,134,137],{"v-slot:content":15},[26,135,136],{},"Coverage reports which statements, branches, or functions executed during tests. It can reveal unexercised code but cannot prove assertions are meaningful, requirements are correct, or edge cases are covered.",[26,138,139],{},"Use coverage as a diagnostic signal and review changed high-risk code, not as the sole quality target.",[10,141,142,150],{},[13,143,144],{"v-slot:title":15},[17,145,147],{"start":146},8,[20,148,149],{},"How do property-based tests differ from example-based tests?",[13,151,152,155],{"v-slot:content":15},[26,153,154],{},"Example-based tests verify selected inputs and expected outputs. Property-based tests generate many inputs and check invariants such as round-trip behavior, ordering, or conservation.",[26,156,157],{},"They are powerful for parsers, serializers, algorithms, and validation, especially when failures are minimized to a small counterexample.",[10,159,160,168],{},[13,161,162],{"v-slot:title":15},[17,163,165],{"start":164},9,[20,166,167],{},"What is a good database-test isolation strategy?",[13,169,170,173],{"v-slot:content":15},[26,171,172],{},"Each test should start from known data and not depend on execution order. Options include transaction rollback, isolated schemas or databases, or explicit cleanup with unique test data.",[26,174,175],{},"Run migrations against the test database and keep a layer of real-engine tests when engine-specific constraints and query behavior matter.",[10,177,178,186],{},[13,179,180],{"v-slot:title":15},[17,181,183],{"start":182},10,[20,184,185],{},"What belongs in a release smoke test?",[13,187,188,191],{"v-slot:content":15},[26,189,190],{},"Check a short set of critical capabilities: process health, authentication if applicable, one representative read and write, essential dependencies, and a primary user path.",[26,192,193],{},"Smoke tests should be fast, safe to repeat, environment-aware, and diagnostic enough to stop a bad rollout before broad exposure.",{"title":15,"searchDepth":38,"depth":38,"links":195},[],"Testing interview questions covering test strategy, unit and integration boundaries, contracts, flakiness, and CI feedback.","md","lucide:flask-conical",{},null,true,"\u002Finterviews\u002Fsoftware-testing","2026-09-21",{"title":5,"description":196},{"loc":202,"lastmod":203},"interviews\u002Fsoftware-testing","2026-09-21T22:49:35+07:00","zGAxKo7TxPvFyjOiwtqZyesqK4b85LSCulnhtBOGJ7M",[210,361,469,484],{"title":211,"icon":212,"path":213,"stem":214,"children":215,"page":226},"Posts","fluent-color:data-bar-vertical-ascending-24","\u002Fposts","posts",[216,227,245,271,281,295,305,315,325,351],{"title":217,"icon":218,"redirect":219,"path":220,"stem":221,"children":222,"page":226},"Database","material-icon-theme:database","\u002Fposts\u002Fdatabase\u002Freplication-strategy","\u002Fposts\u002Fdatabase","posts\u002Fdatabase",[223],{"title":224,"path":219,"stem":225,"icon":200},"Database Replication strategy in large systems","posts\u002Fdatabase\u002Freplication-strategy",false,{"title":228,"icon":229,"redirect":230,"path":231,"stem":232,"children":233,"page":226},"Docker","vscode-icons:file-type-docker2","\u002Fposts\u002Fdocker\u002Fdocker-commands","\u002Fposts\u002Fdocker","posts\u002Fdocker",[234,237,241],{"title":235,"path":230,"stem":236,"icon":200},"Docker commands essentials","posts\u002Fdocker\u002Fdocker-commands",{"title":238,"path":239,"stem":240,"icon":200},"Some useful Dockerfile templates","\u002Fposts\u002Fdocker\u002Fdockerfile-templates","posts\u002Fdocker\u002Fdockerfile-templates",{"title":242,"path":243,"stem":244,"icon":200},"Setup Docker environment on Windows","\u002Fposts\u002Fdocker\u002Fsetup-docker-on-window","posts\u002Fdocker\u002Fsetup-docker-on-window",{"title":246,"icon":247,"redirect":248,"path":249,"stem":250,"children":251,"page":226},"Git & GitHub","material-icon-theme:git","\u002Fposts\u002Fgit\u002Fbrightly-decorate-graph","\u002Fposts\u002Fgit","posts\u002Fgit",[252,255,259,263,267],{"title":253,"path":248,"stem":254,"icon":200},"Brightly decorate your GitHub Graph","posts\u002Fgit\u002Fbrightly-decorate-graph",{"title":256,"path":257,"stem":258,"icon":200},"Download a specific folder on GitHub repository","\u002Fposts\u002Fgit\u002Fdownload-specific-folder","posts\u002Fgit\u002Fdownload-specific-folder",{"title":260,"path":261,"stem":262,"icon":200},"Syncing Git Tags across to other repositories","\u002Fposts\u002Fgit\u002Fsyncing-tags-across-repositories","posts\u002Fgit\u002Fsyncing-tags-across-repositories",{"title":264,"path":265,"stem":266,"icon":200},"Unlocking GitHub Achievement badges","\u002Fposts\u002Fgit\u002Funlocking-achievement-badges","posts\u002Fgit\u002Funlocking-achievement-badges",{"title":268,"path":269,"stem":270,"icon":200},"Essential Git commands every developer should master","\u002Fposts\u002Fgit\u002Fuseful-commands-like-pro","posts\u002Fgit\u002Fuseful-commands-like-pro",{"title":272,"icon":273,"redirect":274,"path":275,"stem":276,"children":277,"page":226},"Golang","material-icon-theme:go","\u002Fposts\u002Fgolang\u002Foptimizing-performance-with-pgo","\u002Fposts\u002Fgolang","posts\u002Fgolang",[278],{"title":279,"path":274,"stem":280,"icon":200},"Optimizing Performance in Go Applications with PGO","posts\u002Fgolang\u002Foptimizing-performance-with-pgo",{"title":282,"icon":283,"redirect":284,"path":285,"stem":286,"children":287,"page":226},"JavaScript","vscode-icons:file-type-js","\u002Fposts\u002Fjavascript\u002F9-lines-of-tips","\u002Fposts\u002Fjavascript","posts\u002Fjavascript",[288,291],{"title":289,"path":284,"stem":290,"icon":200},"9 lines of JavaScript replace 50 lines of code","posts\u002Fjavascript\u002F9-lines-of-tips",{"title":292,"path":293,"stem":294,"icon":200},"Javascript Promises - Specific functions and use cases","\u002Fposts\u002Fjavascript\u002Fpromises-cheatsheet","posts\u002Fjavascript\u002Fpromises-cheatsheet",{"title":296,"icon":297,"redirect":298,"path":299,"stem":300,"children":301,"page":226},"Node","material-icon-theme:nodejs-alt","\u002Fposts\u002Fnodejs\u002Fevent-loop","\u002Fposts\u002Fnodejs","posts\u002Fnodejs",[302],{"title":303,"path":298,"stem":304,"icon":200},"Secret about Event Loop flow in Nodejs","posts\u002Fnodejs\u002Fevent-loop",{"title":306,"icon":307,"redirect":308,"path":309,"stem":310,"children":311,"page":226},"Nuxt","vscode-icons:file-type-nuxt","\u002Fposts\u002Fnuxt\u002Fenable-pwa-in-nuxt","\u002Fposts\u002Fnuxt","posts\u002Fnuxt",[312],{"title":313,"path":308,"stem":314,"icon":200},"Enable PWA and Service Worker in Nuxt","posts\u002Fnuxt\u002Fenable-pwa-in-nuxt",{"title":316,"icon":317,"redirect":318,"path":319,"stem":320,"children":321,"page":226},"Performance","emojione:rocket","\u002Fposts\u002Fperformance\u002Fbackground-image-injection-problem","\u002Fposts\u002Fperformance","posts\u002Fperformance",[322],{"title":323,"path":318,"stem":324,"icon":200},"Background-Image injection problem in UX","posts\u002Fperformance\u002Fbackground-image-injection-problem",{"title":326,"icon":327,"redirect":328,"path":329,"stem":330,"children":331,"page":226},"Tutorial","fluent-color:book-open-lightbulb-24","\u002Fposts\u002Ftutorial\u002Fclassification-and-functionality-of-the-servers","\u002Fposts\u002Ftutorial","posts\u002Ftutorial",[332,335,339,343,347],{"title":333,"path":328,"stem":334,"icon":200},"Classification and functionality of the servers","posts\u002Ftutorial\u002Fclassification-and-functionality-of-the-servers",{"title":336,"path":337,"stem":338,"icon":200},"What is the difference between localhost and 127.0.0.1?","\u002Fposts\u002Ftutorial\u002Fdifferent-between-localhost-and-127-0-0-1","posts\u002Ftutorial\u002Fdifferent-between-localhost-and-127-0-0-1",{"title":340,"path":341,"stem":342,"icon":200},"8 essential network protocols every programmer should know","\u002Fposts\u002Ftutorial\u002Fessential-network-protocols","posts\u002Ftutorial\u002Fessential-network-protocols",{"title":344,"path":345,"stem":346,"icon":200},"Pre rels in header link tag - SEO technique enhancement","\u002Fposts\u002Ftutorial\u002Fpre-rels-in-header-link-tag","posts\u002Ftutorial\u002Fpre-rels-in-header-link-tag",{"title":348,"path":349,"stem":350,"icon":200},"Better code with SOLID principles","\u002Fposts\u002Ftutorial\u002Fwhat-is-solid","posts\u002Ftutorial\u002Fwhat-is-solid",{"title":352,"icon":353,"redirect":354,"path":355,"stem":356,"children":357,"page":226},"UI\u002FUX","devicon:figma","\u002Fposts\u002Fuiux\u002Fcommon-button-mistake","\u002Fposts\u002Fuiux","posts\u002Fuiux",[358],{"title":359,"path":354,"stem":360,"icon":200},"Common Button Mistake in UI\u002FUX","posts\u002Fuiux\u002Fcommon-button-mistake",{"title":362,"icon":363,"path":364,"stem":365,"children":366,"page":226},"Cheatsheets","fluent-color:paw-16","\u002Fcheatsheets","cheatsheets",[367,372,377,380,385,388,393,397,402,407,412,417,422,427,431,435,440,445,449,454,459,464],{"title":368,"path":369,"stem":370,"icon":371},"Bash","\u002Fcheatsheets\u002Fbash","cheatsheets\u002Fbash","material-icon-theme:powershell",{"title":373,"path":374,"stem":375,"icon":376},"CSS","\u002Fcheatsheets\u002Fcss","cheatsheets\u002Fcss","vscode-icons:file-type-css2",{"title":228,"path":378,"stem":379,"icon":229},"\u002Fcheatsheets\u002Fdocker","cheatsheets\u002Fdocker",{"title":381,"path":382,"stem":383,"icon":384},"Git","\u002Fcheatsheets\u002Fgit","cheatsheets\u002Fgit","devicon:git",{"title":272,"path":386,"stem":387,"icon":273},"\u002Fcheatsheets\u002Fgo","cheatsheets\u002Fgo",{"title":389,"path":390,"stem":391,"icon":392},"HTML","\u002Fcheatsheets\u002Fhtml","cheatsheets\u002Fhtml","material-icon-theme:html",{"title":282,"path":394,"stem":395,"icon":396},"\u002Fcheatsheets\u002Fjavascript","cheatsheets\u002Fjavascript","material-icon-theme:javascript",{"title":398,"path":399,"stem":400,"icon":401},"Latex","\u002Fcheatsheets\u002Flatex","cheatsheets\u002Flatex","material-icon-theme:latexmk",{"title":403,"path":404,"stem":405,"icon":406},"Linux","\u002Fcheatsheets\u002Flinux","cheatsheets\u002Flinux","devicon:linux",{"title":408,"path":409,"stem":410,"icon":411},"Markdown","\u002Fcheatsheets\u002Fmarkdown","cheatsheets\u002Fmarkdown","material-icon-theme:markdown",{"title":413,"path":414,"stem":415,"icon":416},"Mongo","\u002Fcheatsheets\u002Fmongo","cheatsheets\u002Fmongo","devicon:mongodb",{"title":418,"path":419,"stem":420,"icon":421},"Nest","\u002Fcheatsheets\u002Fnest","cheatsheets\u002Fnest","material-icon-theme:nest",{"title":423,"path":424,"stem":425,"icon":426},"Next","\u002Fcheatsheets\u002Fnext","cheatsheets\u002Fnext","logos:nextjs-icon",{"title":296,"path":428,"stem":429,"icon":430},"\u002Fcheatsheets\u002Fnode","cheatsheets\u002Fnode","material-icon-theme:nodejs",{"title":306,"path":432,"stem":433,"icon":434},"\u002Fcheatsheets\u002Fnuxt","cheatsheets\u002Fnuxt","material-icon-theme:nuxt",{"title":436,"path":437,"stem":438,"icon":439},"React","\u002Fcheatsheets\u002Freact","cheatsheets\u002Freact","material-icon-theme:react",{"title":441,"path":442,"stem":443,"icon":444},"Redis","\u002Fcheatsheets\u002Fredis","cheatsheets\u002Fredis","vscode-icons:folder-type-redis-opened",{"title":446,"path":447,"stem":448,"icon":218},"SQL","\u002Fcheatsheets\u002Fsql","cheatsheets\u002Fsql",{"title":450,"path":451,"stem":452,"icon":453},"Typescript","\u002Fcheatsheets\u002Ftypescript","cheatsheets\u002Ftypescript","material-icon-theme:typescript",{"title":455,"path":456,"stem":457,"icon":458},"Vercel","\u002Fcheatsheets\u002Fvercel","cheatsheets\u002Fvercel","vscode-icons:file-type-light-vercel",{"title":460,"path":461,"stem":462,"icon":463},"Vue","\u002Fcheatsheets\u002Fvue","cheatsheets\u002Fvue","material-icon-theme:vue",{"title":465,"path":466,"stem":467,"icon":468},"Windows","\u002Fcheatsheets\u002Fwindow","cheatsheets\u002Fwindow","material-icon-theme:folder-windows",{"title":470,"icon":471,"path":472,"stem":473,"children":474,"page":226},"Prompts","fluent-color:bot-sparkle-24","\u002Fprompts","prompts",[475],{"title":476,"path":477,"stem":478,"children":479,"page":226},"Image Generation","\u002Fprompts\u002Fimage-generation","prompts\u002Fimage-generation",[480],{"title":481,"path":482,"stem":483,"icon":471},"Futuristic Cloud Workspace","\u002Fprompts\u002Fimage-generation\u002Ffuturistic-cloud-workspace","prompts\u002Fimage-generation\u002Ffuturistic-cloud-workspace",{"title":485,"icon":486,"path":487,"stem":488,"children":489,"page":226},"Interviews","lucide:messages-square","\u002Finterviews","interviews",[490,494,499,502,506,511,512,517,522,527,532],{"title":491,"path":492,"stem":493,"icon":486},"Behavioral Engineering","\u002Finterviews\u002Fbehavioral-engineering","interviews\u002Fbehavioral-engineering",{"title":495,"path":496,"stem":497,"icon":498},"DevOps and Cloud","\u002Finterviews\u002Fdevops-cloud","interviews\u002Fdevops-cloud","logos:docker-icon",{"title":389,"path":500,"stem":501,"icon":392},"\u002Finterviews\u002Fhtml","interviews\u002Fhtml",{"title":282,"path":503,"stem":504,"icon":505},"\u002Finterviews\u002Fjavascript","interviews\u002Fjavascript","logos:javascript",{"title":507,"path":508,"stem":509,"icon":510},"Node.js and API Design","\u002Finterviews\u002Fnodejs-api","interviews\u002Fnodejs-api","logos:nodejs-icon",{"title":5,"path":202,"stem":206,"icon":198},{"title":513,"path":514,"stem":515,"icon":516},"SQL and Databases","\u002Finterviews\u002Fsql-databases","interviews\u002Fsql-databases","lucide:database",{"title":518,"path":519,"stem":520,"icon":521},"System Design","\u002Finterviews\u002Fsystem-design","interviews\u002Fsystem-design","lucide:network",{"title":523,"path":524,"stem":525,"icon":526},"TypeScript","\u002Finterviews\u002Ftypescript","interviews\u002Ftypescript","logos:typescript-icon",{"title":528,"path":529,"stem":530,"icon":531},"Vue and Nuxt","\u002Finterviews\u002Fvue-nuxt","interviews\u002Fvue-nuxt","logos:nuxt-icon",{"title":533,"path":534,"stem":535,"icon":536},"Web Security","\u002Finterviews\u002Fweb-security","interviews\u002Fweb-security","lucide:shield-check",[538,539],{"title":507,"path":508,"stem":509,"children":-1},{"title":513,"path":514,"stem":515,"children":-1}]