[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"me":3,"catalog:en:qa-test-automation\u002Fsd-test-doubles-mocking":4,"config":169},null,{"field_key":5,"field_name":6,"seniority":7,"topic_key":8,"topic_name":9,"spec_key":7,"spec_name":7,"locale":10,"cell_total":11,"field_total":12,"seniorities":13,"topics":17,"specs":76,"samples":84},"qa-test-automation","QA \u002F Test Automation","","sd-test-doubles-mocking","Sd Test Doubles Mocking","en",75,1500,[14,15,16],"junior","mid","senior",[18,21,24,27,30,33,36,39,42,45,48,51,54,55,58,61,64,67,70,73],{"key":19,"name":20,"count":11},"qa-api-testing","Qa Api Testing",{"key":22,"name":23,"count":11},"qa-automation-fundamentals","Qa Automation Fundamentals",{"key":25,"name":26,"count":11},"qa-ci-cd-testing","Qa Ci Cd Testing",{"key":28,"name":29,"count":11},"qa-defect-management","Qa Defect Management",{"key":31,"name":32,"count":11},"qa-exploratory-manual-testing","Qa Exploratory Manual Testing",{"key":34,"name":35,"count":11},"qa-performance-testing","Qa Performance Testing",{"key":37,"name":38,"count":11},"qa-test-case-design","Qa Test Case Design",{"key":40,"name":41,"count":11},"qa-test-strategy","Qa Test Strategy",{"key":43,"name":44,"count":11},"sd-ci-test-infrastructure","Sd Ci Test Infrastructure",{"key":46,"name":47,"count":11},"sd-code-quality-test-code","Sd Code Quality Test Code",{"key":49,"name":50,"count":11},"sd-contract-testing","Sd Contract Testing",{"key":52,"name":53,"count":11},"sd-test-data-management","Sd Test Data Management",{"key":8,"name":9,"count":11},{"key":56,"name":57,"count":11},"sd-test-framework-design","Sd Test Framework Design",{"key":59,"name":60,"count":11},"ta-cross-browser-parallel-execution","Ta Cross Browser Parallel Execution",{"key":62,"name":63,"count":11},"ta-framework-architecture-patterns","Ta Framework Architecture Patterns",{"key":65,"name":66,"count":11},"ta-locators-selectors-strategy","Ta Locators Selectors Strategy",{"key":68,"name":69,"count":11},"ta-selenium-cypress-playwright-tradeoffs","Ta Selenium Cypress Playwright Tradeoffs",{"key":71,"name":72,"count":11},"ta-synchronization-flaky-tests","Ta Synchronization Flaky Tests",{"key":74,"name":75,"count":11},"ta-visual-regression-reporting","Ta Visual Regression Reporting",[77,81],{"key":78,"name":79,"count":80},"sdet","SDET",450,{"key":82,"name":83,"count":80},"test-automation","Test Automation",[85,103,116,129,142,155],{"id":86,"topic":9,"difficulty":87,"body":88,"options":89,"correct_key":97,"explanation":102},"019fb4ec-2afe-7d58-aaf2-23d2e1d6e507",1,"In unit testing, what is a \"mock\" object primarily used for?",[90,93,96,99],{"key":91,"text":92},"a","Storing the application's production configuration values safely between each deploy",{"key":94,"text":95},"b","Replacing the database with a slower but functionally more accurate copy",{"key":97,"text":98},"c","Verifying that specific methods were called on it, with specific arguments",{"key":100,"text":101},"d","Formatting the final test report after the entire suite finishes running","A mock is a test double that records how it was called (which methods, how many times, with which arguments) so the test can assert on those interactions afterward — that's (c). The other options describe unrelated concerns like config storage or reporting.",{"id":104,"topic":9,"difficulty":87,"body":105,"options":106,"correct_key":94,"explanation":115},"019fb4ec-2aff-77e5-99b0-0288f43a232a","What best describes a \"stub\" in the context of test doubles?",[107,109,111,113],{"key":91,"text":108},"An object that records every single call, including its exact arguments and order, for later behavior verification",{"key":94,"text":110},"An object that returns predetermined canned answers to calls, without the test verifying how it was invoked",{"key":97,"text":112},"A fully working alternative implementation used in place of the real one entirely, indefinitely",{"key":100,"text":114},"An object passed only to satisfy a parameter list, never actually used anywhere at all","A stub supplies fixed, predetermined responses to calls so the code under test has something to work with, but the test doesn't assert on how the stub was called — that's (b). Recording calls for verification describes a mock\u002Fspy, not a stub.",{"id":117,"topic":9,"difficulty":87,"body":118,"options":119,"correct_key":91,"explanation":128},"019fb4ec-2aff-7e0a-b8e1-24014f995e9f","A \"fake\" test double is best described as:",[120,122,124,126],{"key":91,"text":121},"A lightweight but genuinely working implementation, such as an in-memory repository instead of a real database",{"key":94,"text":123},"An object whose sole purpose is to record which methods were invoked",{"key":97,"text":125},"An object that always returns the exact same hardcoded value regardless of input, with no way to reconfigure it per test case",{"key":100,"text":127},"A production dependency accessed over the real network during the test","A fake has real, working behavior but takes a shortcut unsuitable for production — an in-memory repository is a classic example: it behaves like a real repository (store\u002Fquery) without needing an actual database, which is (a).",{"id":130,"topic":9,"difficulty":87,"body":131,"options":132,"correct_key":94,"explanation":141},"019fb4ec-2b00-76fa-bf32-7754f3318d4b","What distinguishes a \"spy\" from a plain mock?",[133,135,137,139],{"key":91,"text":134},"A spy never allows any verification of calls made to it at all, unlike a mock",{"key":94,"text":136},"A spy wraps a real object, letting behavior run while allowing verification",{"key":97,"text":138},"A spy can only ever be used for testing network requests and nothing else whatsoever",{"key":100,"text":140},"A spy always throws an exception when any of its methods is called, regardless of configuration","A spy wraps a real object (partially or fully) so the actual implementation still executes, while also recording calls for later verification — a hybrid of real behavior plus observation, matching (b).",{"id":143,"topic":9,"difficulty":87,"body":144,"options":145,"correct_key":97,"explanation":154},"019fb4ec-2b02-7a0a-9435-4737a2b6c151","What is a \"dummy\" object in the test double vocabulary?",[146,148,150,152],{"key":91,"text":147},"An object that records every method call and later lets the test verify each individual one of them",{"key":94,"text":149},"An object that simulates real business logic in a simplified, in-memory form for use across many different tests",{"key":97,"text":151},"An object passed to satisfy a method signature but never actually invoked or inspected by the test",{"key":100,"text":153},"An object that returns different canned values depending on exactly which arguments the test happens to pass in","A dummy exists purely to fill a required parameter slot — the code under test may hold a reference to it, but the test never calls its methods or checks its state, matching (c). Recording\u002Fverifying calls describes a mock, not a dummy.",{"id":156,"topic":9,"difficulty":157,"body":158,"options":159,"correct_key":100,"explanation":168},"019fb4ec-2b03-70ec-8def-718edb553718",2,"What is the key practical difference between using a mock and using a stub in a test?",[160,162,164,166],{"key":91,"text":161},"A mock can only be created with Mockito, while a stub can only be created with a completely separate framework such as Jest",{"key":94,"text":163},"A stub is always slower to execute than a mock in the test suite, regardless of what either one is configured to do",{"key":97,"text":165},"There is no practical difference whatsoever; the terms are fully interchangeable in every context and every mocking framework ever built",{"key":100,"text":167},"A mock's test asserts on the interactions it received, while a stub's test only checks the outcome produced from its canned data","The core distinction is what the test asserts afterward: with a mock, the test verifies the interaction itself (e.g. verify(service).sendEmail(...)); with a stub, the test only checks the result the code under test produced using the stub's data — that's (d).",{"fields":170,"seniorities":356,"interview_shapes":357,"locales":362,"oauth":364,"question_count":367,"coach_enabled":368,"jd_match_enabled":368},[171,196,216,233,257,270,289,308,330,337,343,350],{"key":172,"name_tr":173,"name_en":173,"sort":87,"specializations":174},"backend","Backend",[175,178,181,184,187,190,193],{"key":176,"name":177,"field":172},"general","Genel",{"key":179,"name":180,"field":172},"go","Go",{"key":182,"name":183,"field":172},"python","Python",{"key":185,"name":186,"field":172},"java","Java",{"key":188,"name":189,"field":172},"csharp","C#\u002F.NET",{"key":191,"name":192,"field":172},"nodejs","Node.js",{"key":194,"name":195,"field":172},"php","PHP",{"key":197,"name_tr":198,"name_en":198,"sort":157,"specializations":199},"frontend","Frontend",[200,201,204,207,210,213],{"key":176,"name":177,"field":197},{"key":202,"name":203,"field":197},"javascript","JavaScript",{"key":205,"name":206,"field":197},"typescript","TypeScript",{"key":208,"name":209,"field":197},"react","React",{"key":211,"name":212,"field":197},"vue","Vue",{"key":214,"name":215,"field":197},"angular","Angular",{"key":217,"name_tr":218,"name_en":218,"sort":219,"specializations":220},"fullstack","Fullstack",3,[221,222,223,224,225,226,227,228,229,230,231,232],{"key":176,"name":177,"field":217},{"key":179,"name":180,"field":172},{"key":182,"name":183,"field":172},{"key":185,"name":186,"field":172},{"key":188,"name":189,"field":172},{"key":191,"name":192,"field":172},{"key":194,"name":195,"field":172},{"key":202,"name":203,"field":197},{"key":205,"name":206,"field":197},{"key":208,"name":209,"field":197},{"key":211,"name":212,"field":197},{"key":214,"name":215,"field":197},{"key":234,"name_tr":235,"name_en":235,"sort":236,"specializations":237},"devops-cloud","DevOps \u002F Cloud",4,[238,239,242,245,248,251,254],{"key":176,"name":177,"field":234},{"key":240,"name":241,"field":234},"aws","AWS",{"key":243,"name":244,"field":234},"gcp","GCP",{"key":246,"name":247,"field":234},"azure","Azure",{"key":249,"name":250,"field":234},"kubernetes","Kubernetes",{"key":252,"name":253,"field":234},"terraform","Terraform",{"key":255,"name":256,"field":234},"linux","Linux",{"key":258,"name_tr":259,"name_en":259,"sort":260,"specializations":261},"ai-engineer","AI Engineer",5,[262,263,264,267],{"key":176,"name":177,"field":258},{"key":182,"name":183,"field":258},{"key":265,"name":266,"field":258},"llm-rag","LLM\u002FRAG",{"key":268,"name":269,"field":258},"mlops","MLOps",{"key":271,"name_tr":272,"name_en":273,"sort":274,"specializations":275},"database","Veritabanı","Database",6,[276,277,280,283,286],{"key":176,"name":177,"field":271},{"key":278,"name":279,"field":271},"postgresql","PostgreSQL",{"key":281,"name":282,"field":271},"mysql","MySQL",{"key":284,"name":285,"field":271},"mongodb","MongoDB",{"key":287,"name":288,"field":271},"redis","Redis",{"key":290,"name_tr":291,"name_en":292,"sort":293,"specializations":294},"mobile","Mobil","Mobile",7,[295,296,299,302,305],{"key":176,"name":177,"field":290},{"key":297,"name":298,"field":290},"ios-swift","iOS (Swift)",{"key":300,"name":301,"field":290},"android-kotlin","Android (Kotlin)",{"key":303,"name":304,"field":290},"flutter","Flutter",{"key":306,"name":307,"field":290},"react-native","React Native",{"key":309,"name_tr":310,"name_en":311,"sort":312,"specializations":313},"security","Güvenlik","Security",8,[314,315,318,321,324,327],{"key":176,"name":177,"field":309},{"key":316,"name":317,"field":309},"appsec","AppSec",{"key":319,"name":320,"field":309},"offensive-pentest","Offensive \u002F Pentest",{"key":322,"name":323,"field":309},"cloud-security","Cloud Security",{"key":325,"name":326,"field":309},"devsecops","DevSecOps",{"key":328,"name":329,"field":309},"blue-team-incident","Blue Team \u002F Incident",{"key":5,"name_tr":331,"name_en":6,"sort":332,"specializations":333},"QA \u002F Test Otomasyonu",9,[334,335,336],{"key":176,"name":177,"field":5},{"key":82,"name":83,"field":5},{"key":78,"name":79,"field":5},{"key":338,"name_tr":339,"name_en":339,"sort":340,"specializations":341},"data-engineer","Data Engineer",10,[342],{"key":176,"name":177,"field":338},{"key":344,"name_tr":345,"name_en":346,"sort":347,"specializations":348},"game-dev","Oyun Geliştirme","Game Development",11,[349],{"key":176,"name":177,"field":344},{"key":351,"name_tr":352,"name_en":352,"sort":353,"specializations":354},"ml-engineer","ML Engineer",12,[355],{"key":176,"name":177,"field":351},[14,15,16],{"junior":358,"mid":360,"senior":361},{"questions":359,"median_sec":3},20,{"questions":359,"median_sec":3},{"questions":359,"median_sec":3},[363,10],"tr",[365,366],"google","github",22650,true]