Advanced_enterprise_general Flashcards
What is n-tier (or multi-tier) architecture?
- N-tier architecture is a software design approach where an application is divided into multiple layers or tiers, each responsible for specific functions, such as presentation, business logic, and data access.
What are microservices? Advantages and disadvantages?
- Microservices are a specific architectural style where a software system is built as a collection of separate services, each running as its own independent application. These services are designed to do specific tasks and communicate with each other through well-defined APIs, often over networks. Advantages include scalability and flexibility, while challenges may include complexity in management.
What is Separation of Concerns?
- Separation of Concerns refers to the practice of breaking down the functionality of a software system into distinct and independent parts, often referred to as concerns. These concerns address specific aspects of the system’s behavior, like data storage, business logic, user interface, etc. Separation of concerns is a design principle that aims to make the codebase more manageable by isolating different responsibilities from each other.
What is a layered design and why is it important in enterprise applications?
- Layered design organizes an application into distinct layers (e.g., presentation, business logic, data access). It improves maintainability, scalability, and enables changes to one layer without affecting others.
What is Dependency Injection?
- Dependency Injection is a design pattern in which the components of a system receive their dependencies (e.g., services or objects) from external sources rather than creating them internally.
What is the DAO pattern? When and how to implement?
- The DAO (Data Access Object) pattern separates data access logic from the rest of the application. It’s used to encapsulate interactions with a data source (e.g., a database). Implement it when you want to abstract data access and decouple it from the business logic.
What is SOA? When to use?
- SOA (Service-Oriented Architecture) is an architectural style that focuses on organizing software as a collection of services that communicate with each other. Use SOA when you need modular, reusable, and loosely-coupled services in your system.
What are unit test, integration test, system test, regression test, acceptance test? What is the major difference between these?
- Unit Test: Tests individual components or functions.
- Integration Test: Tests interactions between components.
- System Test: Tests the entire system.
- Regression Test: Ensures new changes don’t break existing functionality.
- Acceptance Test: Validates if the system meets the user’s requirements.
What is code coverage? Why is it used? How you can measure?
- Code coverage measures the percentage of code that is executed during testing. It’s used to assess the thoroughness of testing. It’s measured using tools that analyze which parts of the code were executed during test runs.
What does mocking mean? How would you do it ‘manually’ (i. e. without using any fancy framework)?
- Mocking involves creating simulated versions of objects or components to isolate the unit being tested. To do it manually, you’d create simple “fake” objects or functions that mimic the behavior of the real components without relying on external frameworks.
What is a test case? What is an assertion? Give examples!
A test case is a specific scenario or condition you test to verify the behavior of a component. An assertion is a statement that checks whether the expected outcome of a test case matches the actual outcome. Example:
- Test case: Validate user login.
- Assertion: The user should be authenticated and directed to the dashboard.
What is TDD? What are the benefits?
- TDD (Test-Driven Development) is a development approach where tests are written before the actual code. Benefits include improved code quality, faster development, and increased confidence in the system’s behavior.
What are the unit testing best practices? (Eg. how many assertion should a test case contain?)
- Test a single unit (function or method) in isolation.
- Keep tests independent and isolated from each other.
- Test boundary conditions and edge cases.
- Use meaningful test names.
- Aim for one logical assertion per test case.
What is arrange/act/assert pattern?
The Arrange-Act-Assert (AAA) pattern is a structure for writing unit tests.
- Arrange: Set up the test by initializing objects and preparing the environment.
- Act: Perform the action you’re testing.
- Assert: Verify that the action’s outcome matches the expected result.
What is continuous integration? Why is CI important?
- Continuous Integration (CI) is the practice of frequently integrating code changes into a shared repository. It’s essential because it helps catch integration issues early, improves collaboration, and enables automated testing.
Why are tests important in the CI workflow?
- Tests are crucial in the CI workflow because they ensure that code changes don’t introduce regressions or break existing functionality. Automated tests help catch issues before they reach production.
Name some software that help the CI workflow!
- Popular CI/CD tools include Jenkins, Travis CI, CircleCI, GitLab CI/CD, and GitHub Actions.
What is Continuous Delivery?
- Continuous Delivery is the practice of automatically deploying code changes to a staging or production environment after passing automated tests and reviews.