# 통합 테스트 (.NET) > WebApplicationFactory, TestServer, 데이터베이스 테스트, HTTP 클라이언트 테스트, test fixtures - 18 면접 질문 - Mid-Level - [면접 질문: .NET](https://sharpskill.dev/ko/technologies/dotnet/interview-questions.md) ## 1. ASP.NET Core에서 WebApplicationFactory란 무엇입니까? **답변** WebApplicationFactory는 Microsoft.AspNetCore.Mvc.Testing 패키지가 제공하는 클래스로, 통합 테스트를 위한 인메모리 테스트 서버를 생성할 수 있습니다. 실제 배포 없이 모든 종속성을 갖춘 ASP.NET Core 애플리케이션을 초기화하여 테스트를 빠르고 격리되게 만듭니다. 이 방식은 실제 서버 설정 비용을 피하면서 프로덕션에 가까운 환경에서 애플리케이션을 테스트하므로 권장됩니다. ## 2. 통합 테스트에서 실제 HTTP 서버 대신 WebApplicationFactory를 사용하는 주요 이점은 무엇입니까? **답변** WebApplicationFactory는 인메모리 테스트 서버를 생성하여 네트워크 지연 시간과 배포 비용을 제거하는 동시에 구성에 대한 완전한 제어를 제공합니다. 실제 네트워크 통신이나 관리할 별도 프로세스가 없기 때문에 테스트가 훨씬 빠르게 실행됩니다. 또한 ConfigureTestServices를 통해 서비스를 대체할 수 있어 외부 인프라 없이 테스트 격리와 다양한 시나리오 시뮬레이션이 용이해집니다. ## 3. ASP.NET Core에서 단위 테스트와 통합 테스트의 차이점은 무엇입니까? **답변** 단위 테스트는 모든 종속성을 모킹하여 단일 코드 단위(메서드, 클래스)를 격리하고 테스트하는 반면, 통합 테스트는 데이터베이스, 미들웨어, 실제 서비스를 포함한 여러 구성 요소가 함께 올바르게 작동하는지 검증합니다. 단위 테스트는 더 빠르고 간단하지만 통합 문제를 감지하지 못하며, 통합 테스트는 더 느리지만 애플리케이션의 전반적인 동작을 검증합니다. 균형 잡힌 전략은 두 가지 접근 방식을 결합합니다. ## 15개 추가 질문 이용 가능 - 통합 테스트에서 WebApplicationFactory를 사용하는 데 필요한 NuGet 패키지는 무엇입니까? - WebApplicationFactory로 API를 테스트하기 위한 HTTP 클라이언트를 어떻게 생성합니까? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 .NET 면접 주제 - [C# 기초](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-basics.md): 25개 질문, Junior - [LINQ & Delegates](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-linq-delegates.md): 20개 질문, Junior - [C# 언어 핵심 요소](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-language-essentials.md): 15개 질문, Junior - [ASP.NET Core 기초](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/aspnet-core-fundamentals.md): 18개 질문, Junior - [ASP.NET Core 요청 수명 주기](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/aspnet-core-request-lifecycle.md): 20개 질문, Junior - [Configuration & Settings](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/configuration-settings.md): 20개 질문, Junior - [애플리케이션 라이프사이클](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/application-lifecycle.md): 20개 질문, Junior - [Dependency Injection](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/dependency-injection.md): 24개 질문, Mid-Level - [Entity Framework Core](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/entity-framework-core.md): 25개 질문, Mid-Level - [Minimal APIs](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/minimal-apis.md): 18개 질문, Mid-Level - [Web API 개발](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/web-api-development.md): 22개 질문, Mid-Level - [ASP.NET Core의 Async](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/async-aspnet-core.md): 20개 질문, Mid-Level - [Authentication & Authorization](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/authentication-authorization.md): 18개 질문, Mid-Level - [HttpClient & 네트워킹](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/httpclient-networking.md): 20개 질문, Mid-Level - [JSON 직렬화](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/json-serialization.md): 20개 질문, Mid-Level - [Entity Framework Core 고급](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/ef-core-advanced.md): 25개 질문, Mid-Level - [C# 고급 기능](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/csharp-advanced-features.md): 20개 질문, Mid-Level - [Clean Architecture](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/clean-architecture.md): 20개 질문, Mid-Level - [Logging, Monitoring & Observability](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/logging-monitoring.md): 22개 질문, Mid-Level - [단위 테스트와 xUnit](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/unit-testing-xunit.md): 20개 질문, Mid-Level - [Docker & Containerization](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/docker-containerization.md): 16개 질문, Mid-Level - [NuGet 패키지 관리](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/nuget-package-management.md): 16개 질문, Mid-Level - [Memory Management & GC](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/memory-management-gc.md): 22개 질문, Senior - [리액티브 프로그래밍](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/reactive-programming.md): 24개 질문, Senior - [Async/await 및 패턴](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/async-await-patterns.md): 26개 질문, Senior - [.NET 디자인 패턴](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/dotnet-design-patterns.md): 24개 질문, Senior - [성능 최적화](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/performance-optimization.md): 22개 질문, Senior - [보안 및 모범 사례](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/security-best-practices.md): 24개 질문, Senior - [SignalR 및 실시간](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/signalr-realtime.md): 22개 질문, Senior - [마이크로서비스 아키텍처](https://sharpskill.dev/ko/technologies/dotnet/interview-questions/microservices-architecture.md): 25개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/dotnet/interview-questions/integration-testing