Skip to content

QST: Request for a method to map test functions to the functions they test #60456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
angiolye24 opened this issue Nov 30, 2024 · 3 comments
Closed
2 tasks done
Labels
Closing Candidate May be closeable, needs more eyeballs Usage Question

Comments

@angiolye24
Copy link

angiolye24 commented Nov 30, 2024

Research

  • I have searched the [pandas] tag on StackOverflow for similar questions.

  • I have asked my usage related question on StackOverflow.

Link to question on StackOverflow

https://stackoverflow.com/questions/79239968/request-for-a-method-to-map-test-functions-to-the-functions-they-test

Question about pandas

I am looking for a way to efficiently map test functions to the specific functions or modules they test. This would help in understanding the coverage and relationships between the test suite and the codebase. Specifically, I'd like to:

Identify which test functions are associated with which functions or modules in the pandas library.

Determine if there's a built-in tool, strategy, or script to extract this mapping.

If there is no such tool or methodology currently available, could you guide us on how this might be achieved?

This would greatly help in improving test coverage analysis.

I have been trying to use git blame and commit history analysis to trace which test functions were added or modified alongside new or updated functions in the codebase. The goal is to map these test functions to the specific functions or modules they test.

Thank you

@angiolye24 angiolye24 added Needs Triage Issue that has not been reviewed by a pandas team member Usage Question labels Nov 30, 2024
@rhshadrach rhshadrach added Needs Info Clarification about behavior needed to assess issue and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Dec 1, 2024
@rhshadrach
Copy link
Member

I do not think I understand your request. Is this related to pandas development itself, or the development of your codebase / test suite which uses pandas?

I am looking for a way to efficiently map test functions to the specific functions or modules they test.

Can you give an example of such a test function. Are these test functions in the pandas test suite, or one that you have written?

When you say "to the specific functions or modules they test", is this pandas functions / modules?

@angiolye24
Copy link
Author

I am working on understanding the relationship between the test suite and the core pandas codebase. Specifically, I want to efficiently map test functions to the specific pandas functions or modules they test.

For example, consider the test function:

def test_get_slice(self, mgr):

located in pandas/pandas/tests/internals/test_internals.py. I would like to determine exactly which functions or parts of the pandas codebase this test is designed to cover. My goal is to create a clear mapping between test cases and the pandas implementation they validate.

@rhshadrach
Copy link
Member

It sounds like you are looking for code coverage of a particular test or collection of tests. There are a variety of packages that provide this, e.g. https://coverage.readthedocs.io/en/7.6.8/.

@rhshadrach rhshadrach added Closing Candidate May be closeable, needs more eyeballs and removed Needs Info Clarification about behavior needed to assess issue labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closing Candidate May be closeable, needs more eyeballs Usage Question
Projects
None yet
Development

No branches or pull requests

2 participants