WorksheetsPROG4 Part 1
Total questions: 50
Worksheet time: 25mins
What is the main objective of testing in the software development lifecycle?
To write code efficiently
To ensure the software runs on all operating systems
To reduce the cost of development
To ensure bug-free software that meets customer requirements
Why is testing considered strenuous?
It requires manual execution of test cases to detect bugs and errors
It requires setting up many servers
It involves compiling code repeatedly
It requires internet access
Selenium is primarily used for testing:
Desktop applications
Web applications
Mobile applications
Game software
Which of the following browsers is NOT mentioned as supported by Selenium?
Firefox
Chrome
Opera
Brave
Which languages can be used to write Selenium tests?
C++, C#, Python
Java, Python, Perl, PHP, Ruby
Pascal, JavaScript, HTML
Kotlin, Swift, Bash
Why is Selenium considered platform-independent?
It doesn’t require installation
It works only with Windows
It uses only Python
It can be deployed on Windows, Linux, and Macintosh
Selenium can be integrated with which of the following tools for test management?
GitHub
Docker
JUnit and TestNG
Jenkins and Travis
What is Selenium IDE primarily used for?
Writing Java programs
Recording user interactions
Installing plugins
Managing databases
What is the output format of test scripts generated by Selenium IDE?
C#, Java, Python, Ruby, and Selenese
Binary format
Only Java
Only XML
Selenium RC communicates with browsers using:
JavaScript-based proxy
Native browser drivers
Webhooks
REST APIs
Selenium WebDriver was developed to overcome the limitations of:
Selenium IDE
Selenium RC
Selenium Grid
JUnit
Which is a major limitation of Selenium RC?
It only works on Linux
It cannot test websites
It uses a JavaScript-based proxy, affecting performance
It does not support any programming language
What is the main advantage of Selenium Grid?
It enables parallel testing on multiple machines
It supports only one browser at a time
It increases test accuracy
It reduces the need for programming
Which of the following is NOT an advantage of Selenium testing?
Multi-language support
Strong image testing capabilities
Accurate and reliable results
Free and open-source
A key limitation of Selenium is:
It requires expensive licenses
It only supports Java
It cannot test mobile or desktop applications
It cannot run on Windows
How does Selenium help with Continuous Integration/Deployment (CI/CD)?
It sends alerts to developers manually
It doesn't support CI/CD
It blocks code from deployment
It integrates into CI/CD pipelines to automate testing
Selenium scripts are considered reusable because:
They are stored on cloud automatically
They can be modified only by Selenium engineers
They can be used across different test cases and projects
They are encrypted
What scripting language is unique to Selenium IDE?
Java
Selenese
Ruby
Python
Which of the following is a reason why Selenium is widely adopted?
It is developed in JavaScript and easy to use
It tests only Java-based apps
It has strong commercial support
It does not need programming knowledge at all
What protocol does Selenium WebDriver use to communicate with web browsers?
HTTP
FTP
XML
JSON
What does ORM stand for?
Object-Related Memory
Object-Relational Mapping
Operational Relational Method
Object Runtime Manager
What is the primary purpose of an ORM?
To manage network requests
To optimize frontend performance
To control access permissions
To transmit data between a relational database and the application model
What does ORM help developers avoid writing manually?
SQL
HTML
JavaScript
CSS
What is a QuerySet in ORM context?
A list of tables
A SQL statement
A list of objects of a model
A method to connect databases
In a one-to-one relationship, how do the records relate?
One record in table1 relates to many in table2
Each row in table1 corresponds to a single row in table2
Every row relates to itself
Table2 has no connection with table1
What is true about a one-to-many relationship?
Table2 objects relate to multiple objects in table1
Table1 objects relate to only one in table2
One object from table1 can relate to multiple in table2
The relationship is always circular
In a many-to-many relationship:
There is no relationship between tables
One table can only connect with one other
Every row must have a unique ID
Multiple objects from both tables can relate to each other
Which ORM strategy involves a class representing each database table and instances mapping to rows?
Active Record
Data Mapper
Identity Map
Unit of Work
What does the Data Mapper pattern do?
Separates the domain model from the database layer
Deletes unused database entries
Combines all objects into one table
Disables schema changes
Which pattern ensures that only one instance represents each object in the application?
Unit of Work
Active Record
Identity Map
Table Gateway
What is the Table Gateway pattern responsible for?
Encrypting data at rest
Handling database access for a specific table
Connecting multiple databases
Managing front-end behavior
What is the function of the Unit of Work pattern?
Logging user activity
Mapping front-end UI components
Compressing large data sets
Managing and coordinating database transactions
Which is the first step in using an ORM?
Create a database
Run a SQL command
Define the mapping between objects and tables
Delete all data
Which CRUD operation involves fetching data from a database?
Update
Create
Delete
Retrieve
What ORM operation allows you to modify existing records in the database?
Update
Read
Write
Delete
How does ORM support database schema changes?
By dropping all tables
By handling schema changes automatically or through migration tools
By manually rewriting SQL code
It doesn’t support schema changes
One key benefit of using ORM is:
Requires complex SQL queries
Reduces security
Improves developer productivity
Slows down testing
Which of the following is NOT a benefit of ORM?
Requires writing raw SQL
Enhances security
Simplifies maintenance
Promotes code reusability
ORM provides database independence, meaning:
It only supports one type of database
The database must be created manually
It requires separate code for each database
The application logic doesn't need to change when switching databases
This command will create a new migration file in the myapp/migrations directory that contains the necessary SQL statements to modify the database.
migrations
makemigrations
modifymigrations
createmigrations
What is the primary purpose of isolation testing?
To isolate and test individual components independently
To test the entire application workflow
To test UI responsiveness
To write integration scripts
According to Kent Beck, what is the best way to find bugs?
By reviewing logs
By isolating them
By performing stress testing
By integrating components first
What is a key benefit of isolation testing?
Increases development time
Makes applications slower
Helps identify and fix defects early
Replaces unit testing
Which of the following is a characteristic of isolation testing?
It is performed after release
It requires no simulation
It is atomic in nature
It skips edge case scenarios
Why can isolation testing be expensive?
It requires more RAM
It needs a live database
It requires paid frameworks
It involves creating stubs and drivers
What is the role of a stub in isolation testing?
To provide expected inputs to a component
To collect test output
To delete test data
To perform integration
Drivers in isolation testing are used to:
Replace entire modules
Collect output from the unit under test
Store test cases
Simulate UI behavior
In isolation testing, mock objects are often used to:
Format output
Generate random input
Simulate the behavior of external dependencies
Replace the code being tested
What makes isolation testing time-consuming?
It runs only after deployment
It requires user input
It uses third-party APIs
Each component must be tested individually
Which of the following is NOT an advantage of isolation testing?
Improved quality
Early bug detection
Reduced debugging time
Real-time system performance monitoring
