68

I am a PhD student and I wrote a computer program for my dissertation research. Recently my advisor professor got a grant and she wants to use my computer program in her grant and she asks me for the computer source-code. I will graduate next May and I am planning to use this program in my other studies. So I am not willing to share the code with her. She didn't mention future cooperation and I will also not cooperate with her because of huge differences in our research interests and perspectives.

So how can I refuse her properly?

Note: I was not a RA for her when I wrote the computer program, but this semester she got a grant and she set me as RA.

anonymous
  • 2,470
  • 14
  • 33
W_H
  • 647
  • 1
  • 5
  • 5
  • 102
    Does sharing your code with her prevent you from using it in your other studies? I don't understand why sharing your code is a problem here. Research projects in CS and Computer Engineering frequently use other groups' code without infringing on one another's research. – tonysdg Oct 31 '16 at 04:08
  • 110
    This is great that someone wants to use your software! You might even get some cites from this, congratulations! You could even put it on github or something so that she can cite that too and others can benefit from your program. – Austin Henley Oct 31 '16 at 04:15
  • 5
    I am not in CS or related domains. I am in neuroscience, citation of computer code is meaningless and uninteresting to me. Honestly speaking, one reason I am not willing to share code with her is due to her lack of support in my research. – W_H Oct 31 '16 at 04:23
  • 5
    this semester she got the grant and she set me as RA You're currently her RA. Why do you say due to her lack of support in my research.? – Nobody Oct 31 '16 at 04:41
  • 81
    I understand that you're upset with your advisor for whatever reason. But, you may stand to lose a lot by refusing to share your code (alienating your advisor, not getting good recommendation letters from her when you graduate, etc). On the other hand, I can't think of a single thing you will gain by refusing to share. – ff524 Oct 31 '16 at 04:46
  • 66
    If you wrote the program for your dissertation research, doesn't it belong to your institution? – Phil Oct 31 '16 at 09:34
  • 7
    Not sure about this, but shouldn't your PHD thesis be somewhat novel and original? What if that got compromised by part of the OP's research 'leaking' before he gets to publish it under his name? My advice: Hand over the code, but make sure you get credited wherever it is used. – JimmyB Oct 31 '16 at 10:19
  • 13
    @W_H Generally speaking, you don't cite computer code, you cite the papers which first introduced or described the computer code. A paper cited for the methods section looks exactly the same on your CV or h-index (and to the tenure committee) as a paper that's cited for the conclusions section. – R.M. Oct 31 '16 at 15:20
  • 1
    @R.M. while a paper is certainly preferrable, you can cite code as well - and should do so if there's no paper yet. – cbeleites unhappy with SX Oct 31 '16 at 17:59
  • 3
  • 1
    My adviser is a much more experienced and so is a much more skilled researcher than I am. The notion that my adviser would take some rough idea I had discussed with him and spend a serious amount of effort himself turning into his own research (to be published only under his name) would be terrifying to me. It is very unlikely someone just getting their feet wet in research could compete with someone who already is an established researcher. I don't know the general ethics of the code sharing, but I would not want to be advised by anyone trying to compete with their students in this fashion. – PVAL Oct 31 '16 at 22:04
  • 1
    What would she be doing with the source code? I suggest you contact the Ombuds office at your institute. They should be able to give you a better understanding of what your options are, and if necessary, help you resolve the issue with your advisor. – AatG Oct 31 '16 at 22:20
  • 7
    @JimmyB: If transfer of information from a PhD candidate to the candidate's advisor is considered "leaking", something seems fundamentally amiss with the PhD project. (Personally, I'd go as far as saying it's nowhere near "leaking" as long as information is transferred only among people at the same university, but from what I have read on this site over the years, I am aware not all places are that cooperative to start with.) – O. R. Mapper Nov 01 '16 at 12:57
  • 5
    If this code was important part of your PhD research, ideally, you should share it with everyone (open source or similar manner). Not sharing even with your supervisor makes the transparency of your research rather questionable. I am not questioning your intentions, you can have all kid of reasons to not cooperate with your supervisor, but in general keeping everything for yourself is not a good policy. – Greg Nov 01 '16 at 13:36
  • 3
    In my particular sub-field, if the code is not shared with at least the internal reviewers and everyone else in a particular collaboration the paper just doesn't get published. I'm quite amazed that you are/were able to submit a thesis that uses novel/homegrown code without sharing it with your supervisor. If you really want to go ahead with this, make sure you are on legally solid ground. – Marianne013 Nov 01 '16 at 17:29
  • 1
    @Marianne013: Based upon the question, there actually isn't all that much information on what the code actually is. Is the code the "result" or the "research", or is it merely a tool to simplify the research, or just a demonstration of the actual research? I can think of many cases where "novel/homegrown code" has merely been created for internal demonstration purposes and was never in any state to be shared (e.g. depending on the specifics of the OP's system setup). If that is the case, though, the OP should have even less reason to fear being scooped based upon the code. – O. R. Mapper Nov 01 '16 at 18:32
  • 1
    If the code was a significant part of your dissertation, it should be part of your dissertation. I guess I don't understand how your dissertation could have been accepted if the source code wasn't included somewhere. If it's just code you wrote to help you do or explain something, then you may need to consider your schools IP policies. Generally, they own you, so you may not actually have a choice. – iheanyi Nov 01 '16 at 22:48
  • 1
    If it is just about getting credit of your work, make the code wordwide available first. Then just give her the link. In other case, I do not know How to proceed. – user1420303 Nov 02 '16 at 13:29
  • 8
    I’ll go further than the other commenters: if you don’t share your source code, it’s not research, it’s an anecdote. It can’t get published, and shouldn’t be used in any of your publications. It’s bad science not to publish research code. – Konrad Rudolph Nov 02 '16 at 13:51
  • 1
    You may wish to look at the conditions for getting your research grant - it may very well be that the code you've written, isn't yours, but the universities. – UKMonkey Nov 02 '16 at 17:09
  • 2
    @KonradRudolph: As I've indicated in my other comment, I think your comment makes plenty of assumptions that are in no way based upon what we actually know from the question. If a paper presents an algorithm, interaction concept, or other programmable thing, and that algorithm is unambiguously defined in the paper or additional materials, that is fully sufficient for the research to be taken seriously. It is in no way implied that a concrete implementation of the algorithm or concept itself must be made accessible, ... – O. R. Mapper Nov 03 '16 at 12:26
  • 2
    ... and much less so any surrounding code such as a user interface for running the algorithm/concept, code for saving and loading test cases, and other peripheral utilities that may have been useful to the OP (and possibly even to others using their code), but that are simply not a part of the scientific contribution. – O. R. Mapper Nov 03 '16 at 12:28
  • 1
    @O.R.Mapper I fundamentally disagree. You seem to narrowly define the outcome of research as the dissemination of knowledge. However, I’m more interested in cumulative increase of knowledge. By refusing to make usable implementations of algorithms available you cause other people to waste time on mundane reimplementation, thus decreasing their time doing useful work. You may still have contributed to science, but you did so patently ineffectively, for no good reason. – Konrad Rudolph Nov 03 '16 at 14:38
  • 2
    @KonradRudolph: Personally, I am an avid fan and contributor to open source projects, and I like providing more or less everything I do for reuse online when I'm allowed to. That notwithstanding, I'd consider it downright unethical to, say, reject a paper that clearly communicates its findings and everything leading up to those findings for the sole reason that the author just provides the information how to rebuild all tools used instead of the tools themselves. Doing so is a tremendous convenience and good practice, but requiring it would draw the focus too far away from the results ... – O. R. Mapper Nov 03 '16 at 14:57
  • 1
    ... in my opinion. What about a tool that was built in such a way that it cannot be integrated with my research code? Does that count as "published tools" or as "did not publish tools"? What about a published tool that only runs on a heavily customized OS that itself cannot be published? Maybe we need a separate publication channel for research materials/tools (as opposed to results) that contributes to how researchers are evaluated, but I see no point in conflating the two. ... – O. R. Mapper Nov 03 '16 at 14:57
  • ... Lastly, there are plenty of good reasons why research code might not be ready for redistribution. However, this is leading quite a bit off-topic - my point in this question was rather that we do not have enough information to evaluate how crucial for their research the dissemination of their code is, irrespective of pointing them to the generally good practice of helping fellow researchers by providing convenient tools. – O. R. Mapper Nov 03 '16 at 14:59
  • 2
    if you decide to share, consider doing it with free license — GPL v3+ – Display Name Nov 04 '16 at 12:47
  • So, you're a research who doesn't make her/his research reproducible by voluntarily withholding part of your data collection / analysis tools? Sadly, that probably puts you right on track for tenure in the US system... :-( – Steve Dodier-Lazaro Nov 04 '16 at 17:12
  • Is this person on your committee? – Fomite Dec 28 '16 at 01:54
  • Reading some of the answers to this question, there's another related question: what if you believed your code would do society more harm than good? E.g. an open-source method for effectively toppling an economy, say, with armies of twitter-bots... would it be immoral to share that code? – hello_there_andy Mar 16 '17 at 23:29

11 Answers11

237

One of the reasons Science has been so successful is that scientists treat knowledge and tools as public goods. We don't hoard knowledge, but rather we write papers, share techniques, offer suggestions, etc. There are certainly cases in which sharing isn't beneficial, but these seem not to apply here. So of course you should share your computer program! You should share it with people you like, people you don't like, and people you don't even know.

Raghu Parthasarathy
  • 10,331
  • 3
  • 30
  • 32
85

Ideally in this situation you would make your program publicly available.

Giving others access to this code does not prevent you from using it, and will help you build reputation within your field.

Not only that, but by making it publicly available rather than to just your advisor there is no risk of them claiming your work as their own - which I would assume to be your primary concern with the current power balance of your relationship.

Weckar E.
  • 1,272
  • 8
  • 16
  • 4
    If you publish it online with a free software license (e.g. GNU GPL, Apache Software License etc., see this page for a list and comments) - it will be unlikely it could be misused to appropriated by your Professor. – einpoklum Nov 01 '16 at 21:37
  • 5
    @einpoklum: there's a big difference between a copyleft license (like the GPL) that requires that copies stay open-source, vs. the MIT or BSD licenses that let people use the code as part of a closed-source project. Choose whichever you want based on how you want people to be allowed to use your code. – Peter Cordes Nov 02 '16 at 03:50
  • 1
    @PeterCordes: You're right, but - the code would still not be usable as something a third party can submit as their own work to some grant committee or other financing body. – einpoklum Nov 02 '16 at 08:20
  • 3
    @einpoklum: Ah yes, that kind of misuse. I think even if you made your code public domain, it would still be plagiarism for someone else to claim credit for it. ("Look at this play I wrote, it's called MacBeth"). The difference is that you can take legal action directly, because they'd also be violating your copyright rights as well as committing plagiarism / fraud (against the grant committee, not against you). – Peter Cordes Nov 02 '16 at 08:29
75

As someone who works in scientific computing, I agree with what others say, and would likely take it a step further. To put it hyperbolicly:

Refusing reasonable requests to code used in a published article is ethical misconduct.

If you relied on the output of a program to produce your scientific result, then that program is part of the "materials" of your paper, and the same guidelines for sharing other materials used in making papers apply. Just like you're ethically obligated to reasonably make available (non-commercially available) plasmids, cell lines, mouse strains, etc. which you generated for your published research, you're likewise obligated to make available the (non-commercially available) code that you generated for your published research.

That's even more applicable to code, as code is not just a "material", but also a "method". While you certainly should describe the algorithm in text, there's typically a large number of details which are only apparent on examining the code. It's unlikely that a researcher would be adequately able to recapitulate your results from a reimplementation of the algorithm from just the methods section. This is particularly true in the (unlikely?) event you have a bug. Not releasing code is equivalent to just saying "We purified the protein" or "We measured the X" in the methods section: lacking in the needed details for someone to adequately reproduce your results.

Of course, "reasonably" is there in the release requirements, but "reasonable" refusals for wet-lab materials tend toward availability and time considerations: there's not currently enough of it to share or it would be a significant burden on the lab to send it to you. These tend not to apply for software - you can make as many copies as you want, and it's cheap to do so.

"Reasonable" refusals of software tend toward licensing issues. For example, if you don't have the legal ability to distribute the code due to the libraries you used. Or if your institution is selling the code commercially, you may need to require others to obtain the software commercially.

In your case, it doesn't sound like you have an effort-based or license-based reason for refusal. It doesn't even sound like you're refusing due to potential competition ("huge difference in our research interests and perspectives"). Instead, it sounds like you're more refusing because you are nursing a grudge. That's not good. It certainly happens that others act that way, but I think most people would agree that refusing reasonable requests for methods and materials sharing because of pique is unethical.

R.M.
  • 5,244
  • 1
  • 20
  • 26
  • 4
    I hope they will now give me codes to the UK Met Office weather model, because someone certainly published something with it. If it is an academic misconduct... – Vladimir F Героям слава Oct 31 '16 at 18:53
  • And that many papers about simulations with ANSYS/Fluent.. – Vladimir F Героям слава Oct 31 '16 at 18:54
  • It sounds like you have this, but your answer doesn't really explain why the source code the OP developed needs to be released, but potentially proprietary tools the OP used (e.g. matlab) do not. –  Nov 01 '16 at 00:42
  • 11
    He does not need to release MATLAB because MATLAB is already available to all scientists (and others). (same for other tools) – David Balažic Nov 01 '16 at 01:07
  • I agree with your answer, but in the case of the original question there is no publication to be immediately cited. – Dylan Richard Muir Nov 01 '16 at 15:53
  • I respectfully but categorically disagree with the assertion that "If you relied on the output of a program to produce your scientific result, then that program is part of the "materials" of your paper". On that basis, I should claim ownership of Microsoft Word source code for that great chili recipe I wrote up a decade ago. – David W Nov 01 '16 at 16:52
  • 8
    @DavidW Just because it's materials, doesn't mean you own all rights to it. For example, if you did a research study on Viagra, then Viagra would be a material for your paper. That doesn't mean you can claim ownership of Viagra. The bulk of the answer only pertains to code you generated yourself. As David Balažic mentions, if code (or other materials) were obtained through third parties, you can direct people requesting to go to those same third parties. – R.M. Nov 01 '16 at 18:09
  • @VladimirF If you wrote to them with a genuine scientific enquiry based on something that appeared in a published piece of research than the Met Office would help you. Of course they would not hand over complete source code to their model to someone who wants to exploit it commercially or avoid paying them for weather predictions. – jwg Nov 02 '16 at 11:34
  • 12
    “to put it hyperbolicly” — No. This is not a hyperbole. It’s literal truth. And luckily it’s increasingly handled just like this by institutions (though progress has been slow). – Konrad Rudolph Nov 02 '16 at 13:52
  • @VladimirF The Met Office is providing a funded service, not publishing Ph.D. dissertations or scientific papers of any kind. Your analogy does not hold water. – user207421 Nov 02 '16 at 21:12
  • @EJP Surely you are joking https://scholar.google.co.uk/scholar?q=met+office+journal+of+atmospheric+sciences+unified+model&hl=cs&as_sdt=0&as_vis=1&oi=scholart&sa=X&ved=0ahUKEwjq48L7_orQAhXCHxoKHZbxCBwQgQMIHjAA But actually, jwg is probably right and MetOffice researches could help in some cases. But they cannot hand out the code they used for their research. – Vladimir F Героям слава Nov 02 '16 at 21:16
  • @VladimirF FYI http://earthscience.stackexchange.com/questions/6552/paper-result-validation-and-the-scientific-method-in-earth-science –  Nov 03 '16 at 07:23
72

If you wrote the code as part of your work as a PhD candidate, and were at all considered an employee of the institution as a PhD candidate, then the institution may well own intellectual property rights to the code you write ("work for hire" rules). This of course depends on the laws of the country where your institution resides.

If you wrote code that is essential for some future work of your supervisor, and which reflects an important intellectual contribution, then either (a) it should be cited if a publication describing the code exists; or (b) you should be an author on publications using the code.

In any case you have a moral (and possibly legal) responsibility to share the code; your supervisor has a reciprocal responsibility to acknowledge your contribution properly. Ideally you should publish your method (e.g. Frontiers Neuroinformatics), and then it can be cited in academic work.

Dylan Richard Muir
  • 1,415
  • 9
  • 13
  • 9
    Very often a PhD candidate is a student, not an employee. – Vladimir F Героям слава Oct 31 '16 at 11:29
  • 7
    Often, but not always. – Dylan Richard Muir Oct 31 '16 at 12:06
  • 3
    Writing code is sometimes, but not always, an intellectual contribution that merits authorship. (Whether or not it is "essential" to the work does not necessarily determine whether authorship credit is appropriate.) – ff524 Oct 31 '16 at 14:34
  • 11
    @VladimirF Such rules on intellectual property may apply to students, too. – Greg Nov 01 '16 at 13:39
  • @ff524: You're right. There's a big difference between writing a plotting function, and developing an analysis toolchain. I edited my answer slightly. – Dylan Richard Muir Nov 01 '16 at 15:57
  • IANL but the student handbook at my university reads as though the university can claim anything developed as student coursework/thesis/dissertation as the universities intellectual property. In practice there are usually several startups being formed within the university and later spun off as independent companies. I'm not sure how they handle the handoff of intellectual property rights. – cs_alumnus Nov 03 '16 at 18:16
  • What does it say about the community I live in that I saw IANL and rather than thinking it might be a typo for IANAL, I immediately thought, "huh, does Iowa have a National Lab?"... – Joel Nov 04 '16 at 05:16
36

A lot of people have mentioned making your code available, and I entirely second that. But to get more specific, put it on GitHub.

Public repositories are free, it keeps a version history of your work so that even you can't mess it up in a terminal way, and others can branch your code off in another direction and develop it, all while keeping the proper reference back to you as the originator. You can include your licensing in the repository; you often want one that allows free usage but requires citation. GitHub even automates it for you.

You can also explain your code and leave links to your website/published work/etc using markdown in the readme.md file

Then when someone like your professor asks for your code, you just share your GitHub link.

Jeff
  • 16,238
  • 6
  • 43
  • 65
  • 7
    Yes, this. Open source software has been dealing with this issue for years and many standard agreements allow you to simply license software. –  Nov 02 '16 at 12:53
  • This is good advice and GitHub certainly is great but what part of this answers the question? – RyanfaeScotland Nov 02 '16 at 16:57
  • @RyanfaeScotland How to carry out the suggested course of action doesn't seem relevant to you? – Jeff Nov 02 '16 at 17:00
  • Someone asks how to refuse to share something and you provide an answer on the best platform to share it with the world. So no, I'm afriad in this case it doesn't seem relevant. I should mention that I'm of the school of thought that most of these answers don't actual answer the question, but I've picked up on this one as it seems even a further step removed from those answer. – RyanfaeScotland Nov 02 '16 at 17:06
  • 1
    @RyanfaeScotland I think that's an unnecessarily pedantic adherence to a literal reading of the question, which isn't the way StackExchanges work. The question was "how to not share it" and the correct answer is "actually you should share it and here's why", while my answer simply adds "and also, here's how you can share it in a way that should address any concerns with sharing it." – Jeff Nov 02 '16 at 17:12
  • @JeffL. Hmmm I still disagree and tend to think of answering the actual question that is being asked as the right thing to do (pedantically literally or otherwise). However the other answers and votes do look to support your train of thought. Thanks for taking the time to explain. – RyanfaeScotland Nov 02 '16 at 17:21
  • @RyanfaeScotland I'm grateful for your considerate attitude, and hope my explanation makes a bit more sense. Would you always assume that the asker knows the best course of action X when they ask a targeted question, How do I do X? I myself don't even assume that the OP even knows the best way to describe the problem, because often enough, I find myself in that situation. Those who know how to ask the best questions are often (already) experts themselves. Conversely, when I'm not an expert on a particular topic, I rely on comments/answers to refine my question, or broaden my perspective. – jpaugh Nov 03 '16 at 01:54
  • @Jeff Actually, if you put content on GitHub without a license, it's automatically under the MIT license, which is one of the most permissive ones (e.g. allowing commercial reuse)! MIT does require attribution, however; and that's about as little protection as you can get beyond public domain. (In other words, "you [must] include your licensing...," because if you don't (explicitly), you still do (implicitly) include the MIT license.) – jpaugh Nov 03 '16 at 01:57
  • 1
    @JeffL I don't assume the OP knows the best solution and it could be the solution they need help with is going to make the situation worse, I'd advise on it but still answer the question. Take this Q as an example, if I had the rep my answer would be 'If you are commited to refusing then you can do so politely as follows.... however be aware the code may belong to the university as part of the conditions also be aware you may be burning your bridges and limiting the good that can come from sharing your work.' Alas I don't have the rep (perhaps cause of my too literal answers!) – RyanfaeScotland Nov 03 '16 at 08:27
  • There are other version control systems than Git. And Github only supports Git. – Faheem Mitha Nov 04 '16 at 17:14
  • 1
    @jpaugh: I'm pretty sure Github doesn't have a "default license". Quoting: "[The] absence of a license means that the default copyright laws apply. This means that you retain all rights to your source code and that nobody else may reproduce, distribute, or create derivative works from your work." (Github does reserve some rights though, through the ToS.) – You Nov 06 '16 at 13:07
  • @You Thanks. I must have misread that, way back when. Yes, GitHub would have to reserve enough rights to actually provide the service to you, even if you reserved all rights otherwise. – jpaugh Nov 08 '16 at 20:53
20

It's generally considered good practice to publish code that you use for research/analysis related to things you publish. Not everyone does but then lots of people fail to follow best practices.

Not publishing it is like keeping part of your methods secret or using confidential chemistries.

If you've used it for other publications then not only should you provide it to her: you should provide it to everyone who might want to inspect/replicate your work.

Also, as someone working in a neurology dept who writes a lot of code: Yes citations for analysis does still count positively, not as much as citations for things in your exact specialty but it shows you as being more well rounded.

Murphy
  • 2,427
  • 1
  • 14
  • 17
15

Code used in research should be peer reviewed just like any other methods anyway.

First things first: find out who is the owner! I'm not a lawyer. Depending on situation, country etc, code may already belong to institution, research group etc. Before refusing, first make sure it's really your decision to make.

If it's yours, I suggest making it public, but put licence that will require mentioning use of it when results are used, and require sharing improvements with you.

Mołot
  • 681
  • 5
  • 11
  • In practice (and unfortunately), the costs of reviewing (potentially large amounts) code to the required level are prohibitive, and it's also not clear that the same people who are reviewing the paper should be reviewing the code (put bluntly, not all good researchers are good programmers). Moreover, a lot of research code is (quite frankly) hacked together just before the deadline to the point that reviewing it would be (a) an unholy nightmare and (b) unproductive. – Stuart Golodetz Nov 01 '16 at 19:41
  • 2
    I say this as someone who's spent a lot of time over the past couple of years reviewing code in a research context - you can do it, but it takes ages, and you have to be willing to let people incur (significant) technical debt just before deadlines and (hopefully) pay it back afterwards. It's not ideal, but the way in which academia is structured (i.e. prioritising papers over code quality) makes it difficult to do much more. – Stuart Golodetz Nov 01 '16 at 19:44
  • @StuartGolodetz even if code can't be reviewed, it should at least be reviewable, right? If anyone would doubt if program results are good, he should be able to see for himself? – Mołot Nov 03 '16 at 22:14
  • 1
    Yes, in principle. In practice, though, stipulating that all source code must be released as a condition of publishing (which is the obvious way to try to enforce it) would just restrict who could publish papers - in particular, licensing and intellectual property issues can prevent people from releasing their source code even when they want to. I would err on the side of rewarding people who publish their source code rather than punishing those who don't. (Disclaimer: I publish my source code and I want cake, so I'm not unbiased.) – Stuart Golodetz Nov 04 '16 at 00:14
  • "Code used in research should be peer reviewed just like any other methods anyway." - I am not convinced it is useful in any way to spend scientific peer-reviewing resources on evaluating makefiles that copy our documents to our internal share server. – O. R. Mapper Nov 06 '16 at 12:46
12

Read your institution's policies.

Your position assumes that you own the copyright for said code, and that's false in general. This will strongly depend on which university you attend, your formal student/staff status, and the institutions that fund you, but there are plenty of cases where the copyright for a PhD candidate's research output rests with the university. Moreover, in those cases, the person responsible for this bit of intellectual property is usually your line manager - i.e. your supervisor.

That means that your supervisor may well have the legal right to demand that you give her the code, and that you refrain from using it in further research outside of your current institution. This means that your very first stop here needs to be verifying that this is not actually the case.

E.P.
  • 6,835
  • 39
  • 68
4

One of my friends has been in a similar situation. He was not willing to give his LaTeX notes to our boss, because a former postdoc in the group did that before and our boss (according to them) published stuff in the notes without giving this former postdoc co-authorship. As a result, the relationship between my friend and my boss at the time soured and my friend lost a few job opportunities because of bad recommendation letters.

I, on the other hand, always share codes. The codes are not meant for advisers who rarely have the time to dive into them. They are meant for future graduate students who have the time to learn from them and, sometimes, happen to find bugs we never thought of.

There might be some rules, as other posters said, on sharing intellectual property generated while working at the university, and your adviser might try to enforce them, depending on your relationship with them. Instead of refusing, I would rather ask for being cited properly, and if there is any extra-work needed to help her with running the code you should tell her you want co-authorship of the papers.

Faheem Mitha
  • 5,004
  • 3
  • 26
  • 38
  • 3
    This is why publishing the code online on github is ideal. As would be publishing the notes on ARXIV in your advisors case. If they are already published, the advisor will have difficulty plagiarising it. – WetlabStudent Nov 01 '16 at 16:21
4

If you must refuse, refuse in person, or refuse by phone. Do not put anything in writing, unless you're absolutely sure of your rights.

Since your advisor is making you a Research Assistant, note that she could be implicitly buying your future collaboration as well. After all, if your code is sufficiently complex, she may require your expertise to install it, understand it, run it properly, and possibly modify it.

In which case, you could use the fact that you don't have the time to work with her, nor the time to clean up your code to make it more readable or usable right now. Or you could simply refuse her request without justifying yourself to her (but again, do not put any of this in writing, just tell her in person or over the phone, if you're not absolutely sure of your rights).

And some people mentioned that you might want to get cited for your source code, but it could also be that you don't want your name associated with her project. So you could ask for that as well if you wanted.

Or perhaps, you could set the goal to release the source code, but only a year or two from now, by which time, it will be too late for her to use it in her grant. Or perhaps, you could release an older less usable version of the code.

Or if your relationship ended really badly, you could just tell her that you won't help and that you don't wish her to ever contact you again. And then, you could make a filter that ensures that you never see her email messages ever again.

My point is that you have many options. It's just that I am not really clear about your reason for refusing her request. If we knew your exact reason, then maybe we could supply you with a more exact answer.

Stephan Branczyk
  • 1,590
  • 8
  • 14
4

Here's what I would advise: write a paper that uses and explains the code. Then when you share the code, request that whoever you share it with cites your paper.

A good example is here: http://www.modelinginfectiousdiseases.org/. Read the last line, where some code is distributed with the line "if you use any of the programs in your research, we ask that you reference..."

Especially in your case where you say you have different research interests, and so your advisor will not be competing with you, you're just throwing away free citations (and good letters of recommendation) if you refuse to share. The fact that no-one has given a good answer to "how to refuse" is because we can't think of any good justification for doing it. If you really need an answer to this question, you need to explain what the reason is to do it. "I don't want to collaborate" is not a good reason.

Joel
  • 749
  • 4
  • 9
  • 1
    I am not convinced a paper about a set of utility routines that combines spreadsheets from different Excel files into a single Excel file will be accepted anywhere. It is simply not interesting as research. No, the OP doesn't say that's what their code does, but they also do not say anything beyond "a computer program for my dissertation research", so it is completely possible their computer program is meant for such "menial" tasks. This answer applies only to the limited case that the computer program is the actual subject of the research. – O. R. Mapper Nov 06 '16 at 12:49