Data Modeling
3 advantages to Test Driven Development
-
Better program design and higher code quality
-
Detailed project documentation
-
TDD reduces the time required for project development
In what case would you need to use beforeEach() or afterEach() in a test suite?
The difference is beforeEach()/afterEach() automatically run before and after each tests, which:
- removes the explicit calls from the tests themselves, and
- invites inexperienced users to share state between tests. Tests should be explicit, and tests should never share state.
What is one downside of Test Driven Development
- slow process – If you begin TDD, you’ll get the sensation that you simply need an extended duration of your time for straightforward implementations. you would like to believe the interfaces, write the test code, and run the tests before you’ll finally start writing the code.
What’s the primary difference between ES6 Classes and Constructor/Prototype Classes?
ES6 class constructors:
-
ES6 class constructors creates objects by adding function to their prototypes (Blueprint).
- It ensures that this keyword used by the developer is referring to the object being created by the developer.
- This can be said to be a syntax base for constructor functions and instantiate objects using a new operator. This also uses a new operator for object creation but focuses on how the objects are being instantiated.
- ES5 function constructors:
- ES5 function constructors also create objects along with inheritance property.
- Its syntax is similar to object creation in other object-oriented programming languages. Its syntax is unique and is not generally found in other object-oriented programming languages.
- Any function can be used as a function constructor and it primarily focuses on the creation of reusable object creation code.
## Why REST?
- REST is Easy to Understand and Implement
- REST Makes your Application More Scalable
- Caching is Easier with REST
- REST is Flexibile
## TERMS:
| Term | Def |
|---|---|
| functional programming | is a programming paradigm where programs are constructed by applying and composing functions. |
| object-oriented programming (OOP) | is a programming paradigm based on the concept of “objects”, which can contain data and code |
| class | Classes are a template for creating objects. They encapsulate data with code to work on that data. |
| super | keyword to call the constructor of the super class. |
| this | In the global execution context (outside of any function), this refers to the global object whether in strict mode or not. |
| Test Driven Development (TDD) | is a software development practice enabling developers to create proper specifications about how their code should be written and implemented. Fundamentally, TDD is a practice when a programmer writes a functional test before building a code. |
| Jest | is a JavaScript testing framework developed by Facebook. It works out of the box with minimal configuration and has in-built test runner, assertion library and mocking support. |
| Continuous Integration (CI) | it is the practice of automating the integration of code changes from multiple contributors into a single software project. |
| REST | Representational State Transfer (REST) is an architectural style that has gained a lot of popularity in recent years due to its simplicity and scalability. |
| Data Model | an abstract model that organizes elements of data and standardizes how they relate to one another and to the properties of real-world entities. |