Git Product home page Git Product logo

cover's Introduction

Code Coverage Cheating

What does this package do?

It can be used to automatically call an object's getters, setters, toString, hashCode and equals.

How do I use it?

 new Coverage(new MyObject()).cover();

Why would I want to do that?

To increase the unit test code coverage "percentage" with minimum effort, especially in projects that use a lot of value objects, such as Entity classes, JSON representations etc.

Isn't that completely pointless?

Yes, it will add no value to your test suite, and may give you a false sense of security.

The target use case, though, is in when developing software in large enterprises.

Manager: We need to make sure that every class has at least 75% code coverage.

You: Even our value objects? They are nothing but a bunch of getters and setters.

Manager: Well, I can try to get an exception, but I think the Big Bosses are rather fond of the idea.

You: Oh, I see. I'll start writing some useless tests, then.

This package helps you minimize the amount of time you spend writing useless tests.

cover's People

Contributors

paulcager avatar

Watchers

James Cloos avatar  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.