English doesn't have a genitive case. There is a "clitic", ('s) that is used to indicate possession (in the general sense)
We might say that John has a car. So we could say that "John's car is red."
We can say that a method has a name. So we would say "The method's name is
We can also use nouns to describe other nouns. For example one type of soup is made from mushrooms. We can say "I ate mushroom soup"
In programming, we might say that there are different types of names. Perhaps methods have a different style to attributes. In that you can talk about a "method name", if you are talking about the type of name.
Now there are exceptions and particular idioms, but generally if you want to indicate any sort of possession (an A has B relation) use an apostrophe (A's B). If you are describing something, then you don't need an apostrophe.
The technical name for using a noun like an adjective is "Noun adjunct" See https://english.stackexchange.com/questions/87591/a-noun-adjunct-the-possessive-case