Git Product home page Git Product logo

unit-testing-tips's Introduction

Hi there ๐Ÿ‘‹

๐Ÿ‘จ About

I am a Software Engineer with many years of experience. Software engineering is not only my daily job but also my main interest. I have a professional attitude and despite improving during every day of work I also try to extend my knowledge in my spare time. The business value is most important for me, so I focus mainly on modeling business logic and solving specific domain problems with proper tools. Programming languages, technologies, etc. are not a barrier for me. I like to share knowledge with others by writing on my blog or sometimes giving presentations.

โญ Featured:

๐Ÿ“ซ Links:

unit-testing-tips's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unit-testing-tips's Issues

Data Fixtures Example Unjustified

This is a great resource, but I don't think your Data Fixtures section is right.

The information says that it's better to avoid shared state between tests and the "Bad" example given is using PHPUnit's setUp() method. But I don't think this example provides any shared state. The setUp() method should be called before each test. PHPUnit should also, as far as I'm aware, be running each test in a class in a new instance of the class.

From the manual...

The setUp() and tearDown() template methods are run once for each test method (and on fresh instances) of the test case class.

https://phpunit.readthedocs.io/en/9.5/fixtures.html#fixtures-examples-stacktest-php

Highlight clearly why mocking is problematic

I often see developers using mocks for entities to simplify their creation for testing.

While this is easy enough it creates a lot of coupling to the implementation details.

I would like to see a clear warning that mocks shouldn't be used especially for data classes like entities which have no side effects

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.