Skip to content

Instantly share code, notes, and snippets.

View danilobatistaqueiroz's full-sized avatar

Danilo Batista de Queiroz danilobatistaqueiroz

View GitHub Profile

TDD WITH PHP

Start with an error test

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

@danilobatistaqueiroz
danilobatistaqueiroz / angularjs_html5mode_without_deeplink.md
Created December 1, 2017 17:40
Angularjs Html5mode Without Deeplink
@danilobatistaqueiroz
danilobatistaqueiroz / first_spring_boot_controller.md
Last active December 10, 2017 23:58
First Spring Boot Controller

First Spring Boot Controller

configuring download_cli

starting_first starting_first2 starting_first_cmd home_page

@danilobatistaqueiroz
danilobatistaqueiroz / Quick_Start_Spring_Boot_Cli.md
Last active December 11, 2017 00:30
Quick Start Spring Boot Cli

Quick Start Spring Boot Cli

quick_start_cli

code_quick

setpath

starting_quick

@danilobatistaqueiroz
danilobatistaqueiroz / ders.md
Last active August 24, 2018 19:03
DER's diagramas entidade relacionamento

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.

@danilobatistaqueiroz
danilobatistaqueiroz / installing_mongodb.md
Last active September 27, 2018 13:47
installing mongodb
@danilobatistaqueiroz
danilobatistaqueiroz / working_with_mockito.md
Last active February 11, 2018 05:07
Working With Mockito

Working With Mockito

Using Mockito for mocking objects

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.

Test Doubles

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.

@danilobatistaqueiroz
danilobatistaqueiroz / agile_and_lean.md
Last active February 23, 2018 01:59
agile and lean

Agile and Lean

Agile

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.

@danilobatistaqueiroz
danilobatistaqueiroz / why_use_mock.md
Last active February 11, 2018 04:15
why use mock?

Why Use Mock?

Teste unitário

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.