Web Application Development using Java || A+ Graded.
What is integration tests? correct answers Designed to test behaviors between objects and
parts of the overall system.
Characteristics of Integration Tests: correct answers * Much larger in scope / takes more time
to run.
* Can include the Spring Context, database and message brokers.
* Will run much slower than units tests.
Functional Tests correct answers Typically means you are testing the running application.
What could be a characteristic of Functional Tests? correct answers The application is live,
likely deployed in a known environment.
How functional touch points are tested in a Functional Test? correct answers * Using a
selenium web driver,
* Calling a web service,
* Sending/receiving messages etc...
TDD correct answers Test Driven Development
What is Test Driven Development? correct answers Write tests first, which will fail initially,
then code to "fix" each test.
BDD correct answers Behavior Driven Development
What is Behavior Driven Development? correct answers Builds on TDD and specifies that
tests of any unit of software should be specified in terms of desired behavior of the unit.
What are some characteristics of Behavior Driven Development? correct answers * Often
implemented with DSLs(domain specific language) to create natural language tests.
* JBehave, Cucumber, Spock.
- Spock example --> given, when, then.
What is Mock and Spy? correct answers * Mock: A fake implementation of a calss used for
testing. Think of a test stunt double.
* Spy: A partial mock, allowing you to override select methods of a real class.
Testing Goals correct answers * Generally, you will want the majority of your test to be 'unit
tests'.
* Bringing up the Spring Context makes you tests exponentially slower.
* Try to test specific business logic in unit tests.
* Use integration Tests to test interactions.
What tests is more expensive to write / Time to execute? correct answers Unit testing -->
Integration testing --> Functional testing.
Which test takes the longest in Return on investment (ROI)? correct answers Unit testing -->
Integration testing --> Functional testing.
, Which test has the most quantity of tests? correct answers Unit testing --> Integration testing
--> Functional testing.
Which dependencies will load using spring-boot-starter-test (default from Spring Initalizr)
correct answers * Junit → The defacto standard for unit testing Java applications.
* Spring Test and Spring Boot Test → Utilities and integration test support for Spring
Bootapplications.
* AssertJ → A fluent assertion library.
* Hamcrest → A Java mocking framework.
* JSONassert → An assertion library for JSON.
* JSONPath → Xpath for JSON.
Which testing framework is one of the most popular originally written by Erich Gamma and
Ken Beck? correct answers JUnit testing Framework
Where is JUnit test located? correct answers under the test/java/
<your reverse domain>/<class_name>Tests.java
How do you create a unit test for a class? correct answers Click on the class → Alt + Enter →
Create Test
Where do you use Mockito Mocks? correct answers * RecipeService
* Model
What is SpringMock MVC? correct answers * Is a feature in Spring that gives us the
capabilities to test SpringMVC controllers and to unit test them.
* SpringMock MVC will bring in a mock servlet context
Continuous Integration (CI) correct answers * is the (best) practice of merging developers
code into a shared repository
• developers integrate code frequently (several times per day)
• each integration (commit) is then verified by invoking an automated build
• part of the build is the invocation of the automated tests (unit and integration)
• while automated tests are not strictly part of CI, it is typically implied
Continuous Deployment (CD) correct answers * Continuous software delivery approach in
which teams provide software in short cycles
• Each cycle ensures that the software can be reliably released at any time
• Its aim is to release software with greater speed and frequency
• This approach helps to reduce cost, time and risk of delivering changes by allowing formore
incremental updates.
Lombok features correct answers * One of the biggest criticisms against a Java, is the large
amount of ceremonialcode one has to code through in developing enterprise application
(think pojos,properties, setters, getters etc...)
• If you were to compare that to groovy for example ... where a developerautomatically has
getters and setters provided by default (under the covers).
What is integration tests? correct answers Designed to test behaviors between objects and
parts of the overall system.
Characteristics of Integration Tests: correct answers * Much larger in scope / takes more time
to run.
* Can include the Spring Context, database and message brokers.
* Will run much slower than units tests.
Functional Tests correct answers Typically means you are testing the running application.
What could be a characteristic of Functional Tests? correct answers The application is live,
likely deployed in a known environment.
How functional touch points are tested in a Functional Test? correct answers * Using a
selenium web driver,
* Calling a web service,
* Sending/receiving messages etc...
TDD correct answers Test Driven Development
What is Test Driven Development? correct answers Write tests first, which will fail initially,
then code to "fix" each test.
BDD correct answers Behavior Driven Development
What is Behavior Driven Development? correct answers Builds on TDD and specifies that
tests of any unit of software should be specified in terms of desired behavior of the unit.
What are some characteristics of Behavior Driven Development? correct answers * Often
implemented with DSLs(domain specific language) to create natural language tests.
* JBehave, Cucumber, Spock.
- Spock example --> given, when, then.
What is Mock and Spy? correct answers * Mock: A fake implementation of a calss used for
testing. Think of a test stunt double.
* Spy: A partial mock, allowing you to override select methods of a real class.
Testing Goals correct answers * Generally, you will want the majority of your test to be 'unit
tests'.
* Bringing up the Spring Context makes you tests exponentially slower.
* Try to test specific business logic in unit tests.
* Use integration Tests to test interactions.
What tests is more expensive to write / Time to execute? correct answers Unit testing -->
Integration testing --> Functional testing.
Which test takes the longest in Return on investment (ROI)? correct answers Unit testing -->
Integration testing --> Functional testing.
, Which test has the most quantity of tests? correct answers Unit testing --> Integration testing
--> Functional testing.
Which dependencies will load using spring-boot-starter-test (default from Spring Initalizr)
correct answers * Junit → The defacto standard for unit testing Java applications.
* Spring Test and Spring Boot Test → Utilities and integration test support for Spring
Bootapplications.
* AssertJ → A fluent assertion library.
* Hamcrest → A Java mocking framework.
* JSONassert → An assertion library for JSON.
* JSONPath → Xpath for JSON.
Which testing framework is one of the most popular originally written by Erich Gamma and
Ken Beck? correct answers JUnit testing Framework
Where is JUnit test located? correct answers under the test/java/
<your reverse domain>/<class_name>Tests.java
How do you create a unit test for a class? correct answers Click on the class → Alt + Enter →
Create Test
Where do you use Mockito Mocks? correct answers * RecipeService
* Model
What is SpringMock MVC? correct answers * Is a feature in Spring that gives us the
capabilities to test SpringMVC controllers and to unit test them.
* SpringMock MVC will bring in a mock servlet context
Continuous Integration (CI) correct answers * is the (best) practice of merging developers
code into a shared repository
• developers integrate code frequently (several times per day)
• each integration (commit) is then verified by invoking an automated build
• part of the build is the invocation of the automated tests (unit and integration)
• while automated tests are not strictly part of CI, it is typically implied
Continuous Deployment (CD) correct answers * Continuous software delivery approach in
which teams provide software in short cycles
• Each cycle ensures that the software can be reliably released at any time
• Its aim is to release software with greater speed and frequency
• This approach helps to reduce cost, time and risk of delivering changes by allowing formore
incremental updates.
Lombok features correct answers * One of the biggest criticisms against a Java, is the large
amount of ceremonialcode one has to code through in developing enterprise application
(think pojos,properties, setters, getters etc...)
• If you were to compare that to groovy for example ... where a developerautomatically has
getters and setters provided by default (under the covers).