My advisor has multiple electrical engineering masters research students under him. One of them came to me asking for help, saying the advisor asked her (let's call her Jen) to write some code to test out one of his ideas and generate graphs for a paper. Jen is horrible at writing code (her words), so thinking this was a rush job and not related to Jen's research (her words again), I ended up writing all the code. I spent way more time on it than I originally expected to, but it's done, the advisor is happy, and the paper is submitted with everyone's names on it. FYI, this research is completely unrelated to mine.
Turns out, according to the advisor, this is Jen's research topic. The advisor has now asked that I send the code to both of them so they can make some modifications and continue the research. I estimate the modifications to be 10% of the work that I've already contributed. While this isn't Jen's entire thesis, I feel I have completed a massive part of it for her and don't want to just give it all away, just to have to go and then do my entire thesis as well.
Is it normal for code to just be shared (likely without citation) internal to a university? Should I just send the code? Should I question the request? Should I flat out refuse to share it and make Jen develop the code on her own (given there isn't an immediate paper deadline pending)? I don't want to offend my advisor, but I don't know the standard procedure for academia and want to make sure I'm not being taken advantage of here.