Giter Site home page Giter Site logo

code's Introduction

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.

code's People

Contributors

kevin-orr avatar mauricioaniche avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.