MCSD MCSD Testing and Quality Assurance 2 — Questions and Answers
Question 1: Which testing approach validates that multiple components or services work correctly together?
- Integration testing (Correct answer)
- Unit testing
- Smoke testing
- Regression testing
Correct answer: Integration testing
Integration testing verifies that separately developed modules, services, or components function correctly when combined, unlike unit tests that test them in isolation.
Question 2: What is the role of a stub in software testing compared to a mock?
- A stub returns predefined responses without verifying calls, while a mock also verifies interactions (Correct answer)
- A stub verifies method calls while a mock only returns data
- A stub is used for integration tests while a mock is for unit tests
- A stub replaces the entire layer while a mock replaces only one method
Correct answer: A stub returns predefined responses without verifying calls, while a mock also verifies interactions
Stubs provide canned answers to calls made during the test without caring whether those calls occur, whereas mocks include expectations that verify specific interactions happened.
Question 3: In Azure Test Plans, what is a Test Suite used for?
- Organizing test cases into logical groups within a test plan (Correct answer)
- Running performance load tests against an application
- Generating automated test code from requirements
- Configuring environment variables for test runs
Correct answer: Organizing test cases into logical groups within a test plan
A Test Suite in Azure Test Plans groups related test cases together, allowing teams to manage, execute, and report on subsets of tests within a larger test plan.
Question 4: Which NuGet package provides the FluentAssertions library used to write more readable .NET test assertions?
- FluentAssertions (Correct answer)
- NUnit.Assertions
- Should.Net
- AssertHelper
Correct answer: FluentAssertions
The FluentAssertions NuGet package extends assertion capabilities with a natural language chain syntax that makes test failure messages more descriptive and readable.
Question 5: What does TDD stand for and what is its core practice in software development?
- Test-Driven Development; write a failing test before writing production code (Correct answer)
- Test-Driven Design; design class diagrams before coding
- Type-Directed Development; use strong typing before testing
- Test-Data Driven; populate test databases before running suites
Correct answer: Test-Driven Development; write a failing test before writing production code
Test-Driven Development requires writing a failing automated test first, then writing just enough production code to make it pass, then refactoring—following the red-green-refactor cycle.
Question 6: Which command runs all tests in a .NET solution using the .NET CLI?
- dotnet test (Correct answer)
- dotnet run --test
- dotnet build --verify
- dotnet exec tests
Correct answer: dotnet test
`dotnet test` discovers and executes all test projects in the solution, reporting pass/fail results and optionally collecting code coverage.
Which testing approach validates that multiple components or services work correctly together?