I want to encourage beginners to contribute by making refactoring pull requests #11351
Labels
type: proposal
proposal for a new feature, often to gather opinions or design the API around the new feature
type: refactoring
internal improvements to the code
I have started to learn the codebase and I would like to perform refactorings. In part, I am hoping to make it easier for others to get involved. This issue was created to discuss the idea that this could be an improvement.
What's the problem this improvement will solve?
As someone that is not particularly clever, I get confused by long functions with multiple responsibilities. I have found the complexity and length of some of the code blocks in the repository a barrier to entry. I think this makes it harder for people to engage with the codebase. Why is that a problem?
Testing is important. It is also hard and uninspiring to some. But cars will crash and medical equipment will deliver lethal doses when inadequately tested. So testing is needed - especially as the length of code's shadow grows. On LinkedIn, a lot of veterans comment that their programming mindset and methodology were largely determined by what they enjoyed and/or were exposed to at the start of their programming journey. This makes me think it would be helpful if programmers had formative experiences in a passionate and beginner-friendly testing community.
If I can make the pytest codebase more accessible to beginners like me, maybe programmers will find some of the passion and professionalism they will need to make the world safer by being part of the pytest community. I would also work at supporting new arrivals, doing outreach and creating documentation as I become more seasoned. But that is in the future and ultimately separate from the proposal.
Describe the solution you'd like
As I learn the codebase, I would like to perform opportunistic and simple
Extract Function/Method
refactors. I'd consider doing other refactorings as my skills increase but my proposal for now is to keep things simple. The algorithm would berefactor(optional scope): summary
and a body for additional information and questions.An example of my proposed refactoring approach can be seen by applying the algorithm to the argument-parsing responsibilities of
_prepareconfig(...)
:The argument-parsing behaviour of
_prepareconfig
delegated to the functionget_parsed_args
.get_parsed_args
with annotations and docstring.The commit
Alternative Solutions
To restate, I hope to make it easier for people to get involved. I want people to have the opportunity to find intellectual, social and emotional welcome in the pytest community. That would be a satisfying end in itself. But I also hope to increase the number of people who have a passion for something I think is very important:
I think outreach and documentation of all stripes could achieve this. For example, one documentation idea is Case Study documents. Case Study documents would give an example of how a beginner (me) learned how to contribute to pytest. An example of that could be: documenting the work I do on changing the --fixtures-per-test output to ignore the parameterize mark's pseudo-fixtures. Of course, documentation ideas are not true alternatives - they can support rather than compete with the proposal.
Additional context
A worry I have is that my enthusiasm to contribute creates more work for the maintainers than it is worth to them on balance. My dream is not necessarily their dream and I feel self-conscious on this point. I do not want to take up their hours when it is my brain and heart - not theirs - motivating me to make this proposal. I've never liked the idea of getting others to do my work for me.
To that end, what steps would I need to take and what skills would I need to develop and demonstrate in order to be trusted with authority so that I can take the extra load this proposal might create - especially if it caught the interest of others - off the current maintainer's shoulders?
The text was updated successfully, but these errors were encountered: