Show simple item record  

dc.contributor.authorCompton, Rhysen_NZ
dc.contributor.authorFrank, Eibeen_NZ
dc.contributor.authorPatros, Panosen_NZ
dc.contributor.authorKoay, Abigailen_NZ
dc.coverage.spatialSeoul, Republic of Koreaen_NZ
dc.date.accessioned2020-06-11T02:18:19Z
dc.date.available2020en_NZ
dc.date.available2020-06-11T02:18:19Z
dc.date.issued2020en_NZ
dc.identifier.citationCompton, R., Frank, E., Patros, P., & Koay, A. (2020). Embedding Java classes with code2vec: improvements from variable obfuscation. In IEEE/ACM 17th International Conference on Mining Software Repositories (MSR 2020). New York, NY, USA: ACM. https://doi.org/10.1145/3379597.3387445en
dc.identifier.urihttps://hdl.handle.net/10289/13618
dc.description.abstractAutomatic source code analysis in key areas of software engineering, such as code security, can benefit from Machine Learning (ML). However, many standard ML approaches require a numeric representation of data and cannot be applied directly to source code. Thus, to enable ML, we need to embed source code into numeric feature vectors while maintaining the semantics of the code as much as possible. code2vec is a recently released embedding approach that uses the proxy task of method name prediction to map Java methods to feature vectors. However, experimentation with code2vec shows that it learns to rely on variable names for prediction, causing it to be easily fooled by typos or adversarial attacks. Moreover, it is only able to embed individual Java methods and cannot embed an entire collection of methods such as those present in a typical Java class, making it difficult to perform predictions at the class level (e.g., for the identification of malicious Java classes). Both shortcomings are addressed in the research presented in this paper. We investigate the effect of obfuscating variable names during training of a code2vec model to force it to rely on the structure of the code rather than specific names and consider a simple approach to creating class-level embeddings by aggregating sets of method embeddings. Our results, obtained on a challenging new collection of source-code classification problems, indicate that obfuscating variable names produces an embedding model that is both impervious to variable naming and more accurately reflects code semantics. The datasets, models, and code are shared1 for further ML research on source code.
dc.format.mimetypeapplication/pdf
dc.language.isoen
dc.publisherACM
dc.relation.urihttps://2020.msrconf.org/details/msr-2020-papers/6/Embedding-Java-Classes-with-code2vec-Improvements-from-Variable-Obfuscation
dc.rights© 2020 Association for Computing Machinery. This is the author's accepted version.
dc.sourceMSR 2020en_NZ
dc.titleEmbedding Java classes with code2vec: improvements from variable obfuscationen_NZ
dc.typeConference Contribution
dc.identifier.doi10.1145/3379597.3387445en_NZ
dc.relation.isPartOfIEEE/ACM 17th International Conference on Mining Software Repositories (MSR 2020)en_NZ
pubs.elements-id252614
pubs.finish-date2020-06-29en_NZ
pubs.place-of-publicationNew York, NY, USA
pubs.start-date2020-06-30en_NZ


Files in this item

This item appears in the following Collection(s)

Show simple item record