Try to start simple, making test about methods without implementation
Increase the implementation step by step (baby steps)
Always make an error test to avoid false positives
in English entity–relationship model (ER model)
Differences between physical, logical and conceptual models:
https://classroom.synonym.com/what-is-the-difference-between-a-conceptual-model-a-physical-model-12592752.html
http://tdan.com/conceptual-logical-physical-clearing-the-confusion/5021
an important aspect of let
is that a variable declared using it is only available in the block scope in which it was defined.
var
is function scoped, not block scoped, and shouldn't be used in ES6 now that you have const
and let
at your disposal.
Requires
are run synchronously by Node.js. If they are called from within a function, it may block other requests from being handled at a more critical time.
Prefer the strict equality operator ===
over the weaker abstract equality operator ==
node.js is designed to be asynchronous. So, any function which does blocking input/output (I/O), such as reading from a socket or querying a database, will take a callback function as the last parameter, and then continue with the control flow, only returning to that callback function once the blocking operation has completed.
Let’s look at the following simple example to demonstrate this.
access: https://www.mongodb.com/download-center#community
create directories:
mkdir c:\mongodb\data\db
mkdir c:\mongodb\data\log
create a file at root folder named mongod.cfg:
Mockito is a popular mock framework which can be used in conjunction with JUnit.
Mockito allows you to create and configure mock objects.
Using Mockito simplifies the development of tests for classes with external dependencies significantly.
A unit test should test functionality in isolation.
Side effects from other classes or the system should be eliminated for a unit test, if possible.
Com o advento da internet, com os serviços web, o barateamento do hardware, os sistemas tornaram-se altamente conectados, modularizados, aumentou muito a velocidade em que surgem necessidades, mudou a necessidade na eficiência de responder ao mercado, os sistemas mudaram tornando-se web, modularizados.
Algo que começou a ocorrer nos projetos é que na prática os modelos, diagramas dificilmente conferem com o que está implementado, documentação desatualizada.
O nome já diz: que é para testar uma unidade.
Qual unidade? A menor possível devido a coesão.
O que é menor: Classe e seus métodos públicos.
Se uma classe tem relacionamentos de dependência com outras classes, o teste dessa unidade vai ficar comprometido em tempo e isolamento. Por que tempo? Porque no tempo que se testa essa unidade, talvez as dependências dela não estejam testadas.