The code examples of the "Effective Software Testing: A Developer's Guide" book

Related tags

Spring Boot code
Overview

Effective software testing

example workflow

This repository contains the code examples of the Software Testing: A Developer's Guide book, by Maurício Aniche.

Each folder contains the code examples of their respective chapter:

  • Chapter 1: Effective and systematic software testing
  • Chapter 2: Specification-based testing
  • Chapter 3: Structural testing and code coverage
  • Chapter 4: Design by Contracts
  • Chapter 5: Property-based testing
  • Chapter 6: Test doubles and mocks
  • Chapter 7: Designing for testability
  • Chapter 8: Test-Driven Development
  • Chapter 9: Larger tests
  • Chapter 10: Test code quality

Each folder is an independent maven project. You should be able to import the project directly in your favorite IDE (e.g., InteliiJ, Eclipse). You can also run all the tests via mvn test.

To run code coverage in chapter 3, go to the ch3 folder and type mvn clean test jacoco:report. Then, open the target/site/jacoco/index.html file to see the report. If you want to run the mutation coverage, type mvn clean compile test-compile pitest:mutationCoverage. The report will be generated in the target/pit-reports/**/index.html, where ** is a string that represents the date time that you ran the report. For Linux or Mac users, I provide bash scripts coverage.sh and mutation.sh that run the commands above for you.

To run the web tests of chapter 9, you first should run the Spring PetClinic application. For convenience, we provide a compiled jar here. To run the web app, just go to the ch9 folder and type java -jar *.jar.

Contributing to PRs

Maybe you found a test I missed or a better way to implement the code. You are most welcome to submit your PRs!

If you do so, I ask you to create another file, with the same name as the original plus some suffix, and add a comment explaining what you did there. I do not want to touch the original files as they match with the code snippets in the book; we do not want readers to get lost.

License and reuse

You are free to reuse and modify the code provided in this repository, for personal or business purposes, as long as the book is always explicitly mentioned as reference. For example, if you are providing training or workshops, you are required to have a dedicated slide with the picture of the book in each of the slide decks that make use of examples from here.

You might also like...

Simple examples for various Design patterns

About Simple examples for various Design patterns. Design patterns represent the best practices used by experienced object-oriented software developer

Jan 26, 2022

This repository includes selenium web driver tests examples using spring boot application.

This repository includes selenium web driver tests examples using spring boot application.

Selenium Web Driver Tests This repository includes selenium tests examples using custom spring boot application. Overview Run tests Additional Informa

Nov 27, 2022

Spring GraphQL examples using Netflix DGS, GraphQL Java and Spring GraphQL

spring-graphql-sample Spring GraphQL examples using the following frameworks and libraries: Netflix DGS(Domain Graph Service) framework Spring GraphQL

Dec 20, 2022

Parallel programming quick sort and parallel sum examples with Fork-join, RecursiveTaskT, RecursiveAction

Parallel programming quick sort and parallel sum examples with Fork-join, RecursiveTask<T>, RecursiveAction

QuickSortMultiThreading Parallel programming quick sort and parallel sum examples with Fork-join, RecursiveTaskT, RecursiveAction Fork-Join Fork-Joi

Jun 12, 2022

The repository is created to showcase examples of microservices patterns using different technologies.

Repository Objective The goal of this repository is to demonstrate coding examples in different languages mainly Java and .NET core. These examples wi

Nov 17, 2022

These are examples of work/homework from the Java Camp 2022.

Hi 👋 , This is Java Camp 2022 Repository These are examples of work/homework from the Java Camp 2022. 🔭 I’m currently working on JavaCamp2022 🌱 I’m

Oct 19, 2022

This repository contains examples of modern Java features that appear in various videos I'm creating for my courses at Vanderbilt.

This repository contains examples of modern Java features that appear in various videos I'm creating for my courses at Vanderbilt. It's organized into

Dec 1, 2022

Business Application Platform - no-code/low-code platform to build business applications

Business Application Platform - no-code/low-code platform to build business applications

Orienteer What is Orienteer Orienteer is Business Application Platform: Easy creation of business applications Extendable to fit your needs Dynamic da

Dec 6, 2022

Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based system

FRC 2022 Team 5468's 2022 FRC robot code. This code is written in Java and is based off of WPILib's Java control system and utilizes a command based s

Oct 4, 2022
Comments
  • Bug fix at Ch7

    Bug fix at Ch7

    there is a bug in InstallmentGenerator.java, Date should be LocalDate.now().plusMonths(i) in order to match with in InstallmentGeneratorTest.java otherwise test cases fails

    opened by altuga 0
Owner
null
Source codes of book Java Concurrency In Practice, rebuild by maven.

Introduction Source codes of book: Java Concurrency In Practice(2011, Brain Goetz etc. jcip for short.), rebuild from https://jcip.net/ with maven. Mo

Sam Sune 2 Jun 9, 2022
A Minecraft Fabric mod to make crafting with the recipe book faster

OneClickCrafting This mod is clientside only. After selecting a recipe in the recipe book, the client with shift-click the crafted item from the resul

BreadMoirai 4 Jun 2, 2022
Java Design Patterns code examples

Java Design Patterns code examples Behavioral In software engineering, behavioral design patterns are design patterns that identify common communicati

Gaboso™ 3 Jun 29, 2022
Log4j CVE-2021-44228 examples: Remote Code Execution (through LDAP, RMI, ...), Forced DNS queries, ...

Log4j CVE-2021-44228 and CVE-2021-45046 Requisites Use a vulnerable JDK, for instance JDK 1.8.0_181 Usage Malicious server The malicious server deploy

Manuel Álvarez Álvarez 5 Feb 7, 2022
100+ Spring Boot Articles, Tutorials, Video tutorials, Projects, Guides, Source code examples etc

YouTube Channel - Spring Boot Tutorial Subscribe for future video and updates Spring Boot Tutorial on YouTube Newly published spring boot tutorials (2

Ramesh Fadatare 1.2k Jan 2, 2023
This repository contains source code examples to support my course Spring Data JPA and Hibernate Beginner to Guru

Spring Data JPA - Spring Data JPA This repository contains source code examples to support my course Spring Data JPA and Hibernate Beginner to Guru Co

John Thompson 8 Aug 24, 2022
about learning Spring Boot via examples. Spring Boot 教程、技术栈示例代码,快速简单上手教程。

Spring Boot 学习示例 Spring Boot 使用的各种示例,以最简单、最实用为标准,此开源项目中的每个示例都以最小依赖,最简单为标准,帮助初学者快速掌握 Spring Boot 各组件的使用。 Spring Boot 中文索引 | Spring Cloud学习示例代码 | Spring

纯洁的微笑 28.3k Jan 1, 2023
This repo for kodlama.io java camp examples

JavaCampExamples This repo for kodlama.io java camp examples Bu repository'de İsteyen herkesin faydalanabilmesi ve örnek alması için Java Kapında yapı

Salih Değirmenci 18 Mar 2, 2022
FIDO2(WebAuthn) server officially certified by FIDO Alliance and Relying Party examples.

Overview FIDO (Fast IDentity Online) is an open standard for online authentication. It is designed to solve the password problems stemming from a lot

LINE 400 Jan 5, 2023
An examples of creating test records in the database with Spring Boot + Spring Data + JPA usage.

Spring Boot + JPA — Clear Tests An examples of creating test records in the database with Spring Boot + Spring Data + JPA usage. Check out the article

Semyon Kirekov 8 Nov 24, 2022