Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Do we need tests?#

Sumit Rawal answered on May 23, 2023 Popularity 2/10 Helpfulness 1/10

Contents


More Related Answers

  • what is test management review
  • what is soak testing
  • what is test plan
  • how good test case should be
  • performance testing test cases
  • how to write a test plan
  • how to parameterize test cases
  • how to run testcafe tests\
  • what is testing
  • unit testing best practices
  • why do we write unit tests in programming
  • when to do manual testing
  • //testing
  • Unit tests#
  • test answers
  • Unit Tests
  • Tests in unittest
  • 4. Testing
  • About Tests
  • Types of tests#
  • Unit Tests
  • More tests#
  • What do we have left to test?#
  • Execute the tests#
  • It makes sure your tests are testing the right things.
  • unit test methods
  • how to achieve best test coverage

  • Do we need tests?#

    0

    In the domain of strong static typing (not necessarily functional), we might hear phrases like “It compiles, therefore, it must be correct , and thus we don’t need tests!”

    While it is true that certain kinds of tests can be omitted in favor of strong static typing, such a stance overlooks that even a correctly-typed program may produce the wrong output.

    svg viewer

    The other extreme (coming from dynamically-typed land) is to substitute typing with testing, which is even worse. Remember that testing is usually a probabilistic approach and cannot guarantee the absence of bugs. If you have ever refactored a large codebase in both paradigms, you will very likely come to esteem a good type system.

    Types of tests

    Let us think a bit about the kinds of tests we need.

    Our service must read and create data in the JSON format. This format should be fixed and changes to it should raise red flags because any changes would mean that our API just broke.

    We want to unleash the power of ScalaCheck to benefit from property-based testing. But even when we’re not using that, we can still use ScalaCheck to generate test data for us.

    In addition to the regular unit tests, there should be integration tests if a service is written. We can test a lot of things on the unit test side, but in the end, the integration of all our moving parts is what matters, and often (usually on the not-so-pure side of things) we would have to mock a lot to test things in isolation.

    Popularity 2/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Tags: whatever
    Link to this answer
    Share Copy Link
    Contributed on May 23 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.