8 Development & Testing

Development and Testing

Objective

  1. Identify the main stages of development and testing.
  2. Learn how to develop and test software projects.

Hacker Laws (opens in a new tab): Laws, theories, principles, and patterns that developers will find useful. #hackerlaws

Principles

Development

“There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors.” —Leon Bambrick

Exercise 1

Create an application using JavaFX that converts temperature from Celsius to Fahrenheit and vice versa.

Testing

“If debugging is the process of removing bugs, programming must be the process of putting them in.” —Edsger Dijkstra

The following types of testing may be relevant:

Unit Testing

“More than the act of testing, the act of designing tests is one of the best bug preventers known.” —Boris Beizer

The product can also be specified using tests before implementing the code:

A test double (opens in a new tab) is a generic term for any case where you replace a production object for testing purposes: dummy (opens in a new tab), stub (opens in a new tab), spy, fake, mock (opens in a new tab). A test harness (opens in a new tab) is a collection of stubs (opens in a new tab) and drivers (opens in a new tab) configured to assist with the testing of an application or component.

Exercise 2

Follow the Get started with JUnit (opens in a new tab) guide to create and test a basic calculator application.

Exercise 3

Create and run unit tests for the application from Exercise 1.

Static Analysis

Exercise 4

Follow the Improving your code (opens in a new tab) guide to learn how to incorporate SonarQube (opens in a new tab) into your development environment and lifecycle.

Profiling

Exercise 5

Follow the profiling (opens in a new tab) guide to learn how to analyze applications in IDEA.

Collaboration

“Talk is cheap. Show me the code.” —Linus Torvalds

Structure

        • .gitignore
        • mvnw
        • mvnw.cmd
        • pom.xml
        • .gitignore
        • mvnw
        • mvnw.cmd
        • pom.xml
  • Resources