How does MVC architecture enhance unit testing of individual components?

  • By eliminating the need for unit testing
  • By making unit testing more complex
  • By promoting separation of concerns
  • By restricting access to components
MVC architecture enhances unit testing by promoting separation of concerns. Each component (model, view, controller) has a distinct role, making it easier to isolate and test individual units. This modular approach facilitates more effective unit testing, leading to improved code quality and maintainability.

Which feature in CodeIgniter can be used to improve performance by caching entire web pages?

  • Database Caching
  • Fragment Caching
  • Object Caching
  • Page Caching
CodeIgniter provides a feature called 'Page Caching' to store entire web pages in the cache. This helps in improving performance by serving pre-rendered pages instead of re-rendering them on every request.

The ________ method in CodeIgniter is used for adding default data during seeding.

  • $this->db->insert()
  • $this->db->insert_batch()
  • $this->db->populate()
  • $this->db->seed()
In CodeIgniter, the $this->db->seed() method is used for adding default data during seeding.

Which file in CodeIgniter is typically modified to include a third-party library?

  • autoload.php
  • config.php
  • index.php
  • routes.php
The autoload.php file in CodeIgniter is typically modified to include a third-party library. This file contains the configuration for auto-loading various resources, including libraries. Adding a third-party library to the autoload configuration ensures that it is loaded automatically when the application starts, making it readily available for use throughout the code.

In CodeIgniter, where are session data typically stored by default?

  • Cookies
  • Database
  • Server-side files
  • URL parameters
By default, CodeIgniter stores session data on the server-side in files. This provides a secure and efficient way to manage user sessions without exposing sensitive information in cookies or other less secure methods.

The technique of _________ effectively limits SQL injection by stripping out SQL commands from user inputs.

  • Code Obfuscation
  • Data Encryption
  • Input Sanitization
  • Output Validation
Input Sanitization is a security technique that involves cleansing user inputs to remove potentially harmful content, such as SQL commands. This helps prevent SQL injection attacks by ensuring that only valid and safe data is processed.

In CodeIgniter, to perform a database insert operation, the Model method used is ________.

  • add()
  • create()
  • insert()
  • save()
The correct method for performing a database insert operation in CodeIgniter is insert(). This method is used to insert data into the database table. It is essential for creating new records.

What file extension is typically used for controller files in CodeIgniter?

  • .ci
  • .php
  • .ctl
  • .controller
In CodeIgniter, controller files typically have the ".php" file extension. This is a common convention for PHP files. The ".ci" and other options are not standard file extensions for CodeIgniter controllers.

What is the primary function of CodeIgniter's Cross-Site Request Forgery (CSRF) protection?

  • Ensuring secure password storage
  • Mitigating cross-site request forgery
  • Preventing unauthorized data submission
  • Protecting against cross-site scripting
CodeIgniter's CSRF protection aims to prevent unauthorized data submission by generating and validating unique tokens for each request.

Describe the role of seeding in automated testing scenarios.

  • Test Data Generation
  • Code Optimization
  • Performance Testing
  • Automated Deployment
Seeding in CodeIgniter involves generating test data for automated testing scenarios. The "Test Data Generation" option accurately reflects the role of seeding in providing consistent and reproducible data for testing purposes.