Giter Club home page Giter Club logo

Comments (10)

npetzall avatar npetzall commented on May 23, 2024

I'll help with this. It might get ugly but having tests before refactoring is required.

from schemaspy.

npetzall avatar npetzall commented on May 23, 2024

@rafalkasa how do you want to handle test failures?

Example utils/Caseinsensativemap will fail it's purpose if entries are added with methods that are not overriden example putIfAbsent.

In this case the full Map interface is exposed. PR with failing tests or issue to discuss solutions.

From a verify functionality I would probably create a facade interface to avoid implementation of Map interface. Since Map interface isn't owned by schemaspy it needs to evolve with the jdk which might be a coupling one wouldn't want.

from schemaspy.

rafalkasa avatar rafalkasa commented on May 23, 2024

@npetzall you need to know that a lot of code is more than ten years old in this project.
Maybe instead of thinking how to test utils\CaseInsensitiveMap class as it is we should start thinking about refactor and find out better solution to doing the same.

The same is with other part of the project first we need to think how to make this code testable and after try to write the unit test to not avoid lost some functionality.

From other point of view we should concentrate to test this part of the project what is the core one and where the most complex application logic exist.

from schemaspy.

rafalkasa avatar rafalkasa commented on May 23, 2024

@npetzall if you want to improve project unit test coverage please propose something and during the review your PR we can discuss about the details if your solution and test will be ok or not 😄

from schemaspy.

npetzall avatar npetzall commented on May 23, 2024

@rafalkasa testing legacy code is actually something challenging and for me a bit fun. But in a refactoring sense it should be done first, verify and inspect behaviour so that you can verify said behaviour after refactoring.

The case with Caseinsensativemap is that I've found holes in the implementation, not that I have problems with testing.

Same goes with mocking, don't want to do to much of it in the beginning since it would decrease test coverage. So first build coverage then refactoring and mocking.

I've only looked at the project these last couple of days. So if you provide a "hit" list I'll attack said list with test.

from schemaspy.

rafalkasa avatar rafalkasa commented on May 23, 2024

@npetzall the level of code coverage looks impressive mostly because of you.
So we can close the issue, and maybe set Travis to not pass the PR build of code coverage is less than 80% or more

from schemaspy.

npetzall avatar npetzall commented on May 23, 2024

I don't think that Sonarqube is run for PR unless the github apps will allow it.

from schemaspy.

npetzall avatar npetzall commented on May 23, 2024

Well, for local, but not for PR coming from a fork.

from schemaspy.

rafalkasa avatar rafalkasa commented on May 23, 2024

Maybe we can use other coverage solution for this verification which is working with fork PRs

from schemaspy.

rafalkasa avatar rafalkasa commented on May 23, 2024

This issue with Sonarqube and GitHub forks PR is very old topic as I see nothing change..

from schemaspy.

Related Issues (20)

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.