CAS Testing and Quality Assurance 2 — Questions and Answers
Question 1: What is Selenium primarily used for in the context of software quality assurance?
- Performance testing of server-side applications
- Automated web browser interaction and UI testing (Correct answer)
- Static code analysis and linting
- Database query validation and testing
Correct answer: Automated web browser interaction and UI testing
Selenium is an open-source framework that automates web browser interactions, making it a standard tool for automated UI and functional web testing.
Question 2: In software delivery pipelines, what does CI/CD stand for?
- Code Integration / Code Deployment
- Continuous Integration / Continuous Delivery (Correct answer)
- Complete Inspection / Complete Deployment
- Critical Implementation / Critical Design
Correct answer: Continuous Integration / Continuous Delivery
CI/CD stands for Continuous Integration and Continuous Delivery, automating the build, test, and deployment pipeline to deliver software changes reliably and frequently.
Question 3: What is a mock object in unit testing?
- A fake test that always returns a pass result
- A simulated object that mimics real dependencies so tests run in isolation (Correct answer)
- A copy of the production database used for testing
- A script that auto-generates realistic test data
Correct answer: A simulated object that mimics real dependencies so tests run in isolation
A mock object simulates the behavior of real dependencies such as databases or APIs, allowing unit tests to run in isolation with predictable, controlled responses.
Question 4: Which testing metric measures the percentage of source code executed during a test run?
- Test velocity
- Defect density
- Code coverage (Correct answer)
- Test pass rate
Correct answer: Code coverage
Code coverage measures what percentage of lines, branches, or paths in the source code are exercised by the test suite, indicating how thoroughly the code is tested.
Question 5: What is the primary advantage of automated testing compared to manual testing?
- Automated tests are inherently more accurate than manual testers
- Automated tests can be executed repeatedly and quickly without human fatigue or variation (Correct answer)
- Automated tests require no initial investment to set up and maintain
- Automated tests always uncover more edge cases than manual exploration
Correct answer: Automated tests can be executed repeatedly and quickly without human fatigue or variation
The core advantage of automated testing is the ability to run tests consistently at high speed, many times, without the variability or fatigue that affects human testers.
Question 6: In test automation, what design pattern creates an object repository for web UI elements to separate test logic from page structure?
- Factory Method Pattern
- Page Object Model (POM) (Correct answer)
- Observer Pattern
- Singleton Pattern
Correct answer: Page Object Model (POM)
The Page Object Model (POM) encapsulates UI element locators and interactions for each page into dedicated classes, keeping test logic separate and improving maintainability.
Question 7: What is the purpose of a test harness in automated testing?
- To manually walk through test cases step by step
- To provide an automated environment with stubs and drivers needed to execute tests (Correct answer)
- To generate formal test documentation for project stakeholders
- To schedule and prioritize testing activities on a project timeline
Correct answer: To provide an automated environment with stubs and drivers needed to execute tests
A test harness provides the infrastructure — including stubs, drivers, and test data — that surrounds tests and enables them to execute automatically and capture results.
What is Selenium primarily used for in the context of software quality assurance?