Short Answer Reviews Flashcards
What is Dependency Injection
- Dependency injection is providing objects with their dependencies instead of having them construct them themselves.
- Dependencies can be injected by any means, constructor injection or setter injection.
- Dependency injection makes testing easier. It decouples the creation of an object and gives the ability to replace dependencies
Front End Load Time Techniques
- Minification: Combine Scripts and CSS to minimize bloated files. Load one single file
- Caching: Reduce server calls, storing certain files in the cache.
- CDN: Load from nearest server and compressed for delivery
- Optimize Assets and Smart Comprehension: Scale assets based on user case
Front-End Testing
- Implement useability and accessibility Standards
- Test tools that allow you to see all end users testing.
Code Structure and Efficiencies
- Segment and Organize code for increase comprehension
- Mark with Appropriate Docstrings and variable names
- Indicate constraints and edge cases.
Inheritance
Inheritance is when a child’s class inherits from all properties and characteristics from the parent’s class, creating a class hierarchy.
Composition
Composition enables the creation of complex types by combining objects of other types, rather than inheriting from base or part. It contains instances of other classes
Procedural Programming
Operates on functions, where the entire program operates on a sequence of functions.
Object-Oriented Programming
Focuses on real-world objects that encapsulates data and priorities the states and behaviors of objects
Abstraction
Abstraction helps simplify the programming process and displays data that are relevant and hides complexity
Polymorphism
Polymorphism in Java is the ability of an object to take many forms. To put it simply, polymorphism in Java allows us to perform the same action in many different ways. Any Java object that can pass more than one IS-A test is polymorphic in Java. Polymorphism takes two forms:
- Runtime polymorphism
- Compile-time polymorphism
Encapsulation
Encapsulation is a class that conceals data fields and methods that achieve functions, though they become accessible through access modifiers
Manipulators
Similar to helping functions, Manipulators modifies input/output stream using an objects’ insertion and extraction operators.
Constructor Rules
- A constructor does not have return type
- The name of the constructor is the same as the name of the class
- A constructor cannot be abstract, final, static, and synchronized
- You can use access specifiers
Abstract class / methods
An abstract class is a class that is declared abstract—it may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed.
An abstract method is a method that is declared without an implementation
Static and Dynamic Binding
Association of method call to the method body is known as binding. There are two types of binding: Static Binding that happens at compile time and Dynamic Binding that happens at runtime.
Advantages of OOP
- Maintains objects in an isolated capacity
- Allows for future modifications without affecting other parts of the program
Types of Constructors
- Default Constructor: does not have parameters
- Parameterized Constructor: takes in pararmeters
- Copy Constructor
- Static Constructor
- Private Constructor
How do structure and class differ?
A structure is public by default and only used when grouping data, while the access type of a class is automatically private and has more uses, including data grouping and other methods. Classes can encapsulate and inherit data and need strict validation.
Destructor
A destructor is a member function that is invoked automatically when the object goes out of scope or is explicitly destroyed by a call to delete .
Different Levels of Testing
- Unit Testing
- Integration Testing
- System Testing
- Acceptance testing
Functional vs Non-Functional Test
Functional: Performed before non-functional testing, based on customer requirements, describes what the product does
Non-Functional Testing: Performed after functional testing, based on customers expectations, describes how the product works
Coverage
The parameter used in software testing to describe the extent to which the source code is tested is known as coverage.
- Statement coverage: it ensures that each line of source code has been executed and test
- Decision coverage: it assures that every decision in the source code has been executed and tested
- Path coverage: ensures that every possible route through a given part of the code is executed and tested