365 lines
14 KiB
Markdown
365 lines
14 KiB
Markdown
file:: [TOSEM-2023-0377_Proof_hi_1700083339192_0.pdf](../assets/TOSEM-2023-0377_Proof_hi_1700083339192_0.pdf)
|
||
file-path:: ../assets/TOSEM-2023-0377_Proof_hi_1700083339192_0.pdf
|
||
|
||
- Configurable Graph Code Representation
|
||
ls-type:: annotation
|
||
hl-page:: 1
|
||
hl-color:: green
|
||
id:: 6598171e-ee4c-4e6f-adb3-a95086f59c38
|
||
- Deep learning is widely used to uncover hidden patterns in large code corpora.
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: green
|
||
id:: 65981731-adca-4210-8ebb-fba055510702
|
||
- To achieve this, constructing a format that captures the relevant characteristics and features of source code is essential.
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: green
|
||
id:: 659817ec-e886-4536-887f-a3f878be06b6
|
||
- he output of these tools often lacks interoperability and results in excessively large graphs, making graph-based neural networks training slower and less scalable
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: blue
|
||
id:: 65981800-d43e-4a09-8e46-ab9bdd1b1585
|
||
- We introduce Concord, a domain-specific language to build customizable graph representations.
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: purple
|
||
id:: 65981816-5aa6-4360-85f4-46ce5a5a69cb
|
||
- It implements reduction heuristics to reduce graphs’ size complexity.
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: purple
|
||
id:: 65981824-e456-4b82-8841-233025c27972
|
||
- e demonstrate its effectiveness in code smell detection as an illustrative use case
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: purple
|
||
id:: 65981831-d2ba-45e9-829e-3aba0f53bbff
|
||
- address the issue of scalability in GNN models,
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: yellow
|
||
id:: 659819a2-98ea-4fc3-83a1-9d87caa5923e
|
||
- defect prediction
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: green
|
||
id:: 659904ce-dce1-4287-b2a4-2772cfd78263
|
||
hl-stamp:: 1704527067529
|
||
- code smell detection
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: green
|
||
id:: 659904d3-2bb3-48e2-b6b9-c514b3a09110
|
||
hl-stamp:: 1704527069827
|
||
- code summarization
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: green
|
||
id:: 659904d9-1500-4fea-b1c9-d6cf1570f0bf
|
||
- code is converted from its raw textual form to a numeric representation that can be processed and fed to dl-models
|
||
ls-type:: annotation
|
||
hl-page:: 2
|
||
hl-color:: blue
|
||
id:: 659904f0-3a35-4dda-a849-2de831073313
|
||
- augmented ast with custom data flow edges and control flow edges to detect variable misuse in a code snippet
|
||
ls-type:: annotation
|
||
hl-page:: 3
|
||
hl-color:: green
|
||
id:: 65990522-e532-4314-9141-56cd18c2d930
|
||
- The process of combining code representations, pre-processing them, and training a dl model is done manually and from scratch which wastes significant research time and resources
|
||
ls-type:: annotation
|
||
hl-page:: 3
|
||
hl-color:: green
|
||
id:: 6599056a-6c94-48c2-82dd-c738d80f0557
|
||
- varied asts representation and hindering effective combinations.
|
||
ls-type:: annotation
|
||
hl-page:: 3
|
||
hl-color:: blue
|
||
id:: 659bc9e3-73fd-487d-a881-61e248b79e7c
|
||
- Lack of interoperability
|
||
ls-type:: annotation
|
||
hl-page:: 3
|
||
hl-color:: purple
|
||
id:: 659bc9e8-7e43-4eb5-af3e-c71c30877695
|
||
- Control Flow Graphs (cfgs)
|
||
ls-type:: annotation
|
||
hl-page:: 3
|
||
hl-color:: green
|
||
id:: 659bca36-04a5-4c94-a707-d5584fe17dc7
|
||
- Graph Neural Networks (gnns) require large memory and computational resources during training, which renders them computationally expensive to train and difficult to scale.
|
||
ls-type:: annotation
|
||
hl-page:: 3
|
||
hl-color:: green
|
||
id:: 659bca57-eadc-4294-ae70-27fab1ae6ee1
|
||
- gnn must store and manipulate large adjacency matrices representing the graph
|
||
ls-type:: annotation
|
||
hl-page:: 3
|
||
hl-color:: green
|
||
id:: 659bca97-a175-42c2-8dc2-bd20e126b768
|
||
- computational requirements are directly proportional to the size of the graph and the number of layers in a gnn
|
||
ls-type:: annotation
|
||
hl-page:: 3
|
||
hl-color:: green
|
||
id:: 659bcaad-1856-4cf4-8203-0ecc6af00f51
|
||
- One might conjecture that the removal of such statements can reduce source code and allow the model to learn better its implicit patterns and salient features to capture its intended behaviour.
|
||
ls-type:: annotation
|
||
hl-page:: 4
|
||
hl-color:: green
|
||
id:: 659bcae2-6e4c-44e5-8e8d-ea5c4ee37051
|
||
- This paper introduces configurable code representation (Concord), a Domain Specific Language(dsl) and a unifying framework designed to automate the generation of custom code representations.
|
||
ls-type:: annotation
|
||
hl-page:: 4
|
||
hl-color:: purple
|
||
id:: 659bcafc-05cf-4452-88d5-b8ca73ab1d6c
|
||
- Experimental results demonstrate that our proposed method achieves improved model performance at a lower computational cost.
|
||
ls-type:: annotation
|
||
hl-page:: 4
|
||
hl-color:: yellow
|
||
id:: 659bcb29-167c-4364-af82-49714fa63d8a
|
||
hl-stamp:: 1704708908005
|
||
- We applied Concord to solve the code smell detection task, and managed to maintain up to 100% performance and reduce computations by 10.15%.
|
||
ls-type:: annotation
|
||
hl-page:: 4
|
||
hl-color:: yellow
|
||
id:: 659bcb6b-d444-4a68-9eeb-934f7b00a3cd
|
||
- We show how the proposed pruning techniques can reduce size and computational time for gnn training while preserving performance
|
||
ls-type:: annotation
|
||
hl-page:: 4
|
||
hl-color:: yellow
|
||
id:: 659bcba9-fb02-4cca-b635-7adb03216bdc
|
||
- Graph Neural Networks [54] operate on graph-structured data, using a message-passing mechanism to learn node and edge representations.
|
||
ls-type:: annotation
|
||
hl-page:: 4
|
||
hl-color:: green
|
||
id:: 659bcc0a-d47c-4680-a611-e5a1ad4932c4
|
||
- The reason behind the prevalence of using such architecture is that source code is often modelled using graphs like in the case of syntax trees, control flow graphs and call graphs.
|
||
ls-type:: annotation
|
||
hl-page:: 4
|
||
hl-color:: blue
|
||
id:: 659bcc40-1711-42c5-9a97-41ee9bc89003
|
||
- External dsls like css and sql, have their own syntax and parser that interprets the language or translates it into another language.
|
||
ls-type:: annotation
|
||
hl-page:: 4
|
||
hl-color:: green
|
||
id:: 659bcc5d-32a5-46ca-b877-277ee93dea36
|
||
- data-centric cultural shift
|
||
ls-type:: annotation
|
||
hl-page:: 5
|
||
hl-color:: green
|
||
id:: 659bcc8a-eed7-4ae3-a8e4-55bad8f27350
|
||
- Morales et al. [ 46] have proposed a dsl to model AI engineering processes, tailored for multidisciplinary teams developing AI-embedded software
|
||
ls-type:: annotation
|
||
hl-page:: 5
|
||
hl-color:: green
|
||
id:: 659bccb1-a488-4830-a2f0-df30d314c0a3
|
||
- Sergio Morales, Robert Clarisó, and Jordi Cabot. 2022. Towards a DSL for AI Engineering Process Modeling. In Product-Focused Software Process Improvement, Davide Taibi, Marco Kuhrmann, Tommi Mikkonen, Jil Klünder, and Pekka Abrahamsson (Eds.). Springer International Publishing, Cham, 53–60.
|
||
ls-type:: annotation
|
||
hl-page:: 22
|
||
hl-color:: green
|
||
id:: 659bccf0-1a77-4ea0-864c-8c75a095c58a
|
||
- Its goal is to facilitate the formalization of AI processes within organizations and seamlessly integrate with existing model-driven tools, advancing the adoption of AI engineering practices
|
||
ls-type:: annotation
|
||
hl-page:: 5
|
||
hl-color:: blue
|
||
id:: 659bcdcd-0f74-41be-8b38-896468422a12
|
||
- Bieber et al. [ 9] provide an open-source Python library called python_graphs to construct graph representations of Python programs suitable for training machine learning models by employing static analysis.
|
||
ls-type:: annotation
|
||
hl-page:: 5
|
||
hl-color:: green
|
||
id:: 659bd1aa-560a-4ac6-b3cd-f6b13b39d37c
|
||
- control-flow graphs, data-flow graphs, and composite “program graphs” that combine control-flow, data-flow, syntactic, and lexical information about a program.
|
||
ls-type:: annotation
|
||
hl-page:: 5
|
||
hl-color:: green
|
||
id:: 659bd1b5-efcd-41b7-94a8-52d50132b076
|
||
- Limitations of existing work
|
||
ls-type:: annotation
|
||
hl-page:: 5
|
||
hl-color:: green
|
||
id:: 659bd1f9-7c70-4639-ae9c-66f93c51d7ca
|
||
- each tool supports one programming language, either Python or Jav
|
||
ls-type:: annotation
|
||
hl-page:: 5
|
||
hl-color:: green
|
||
id:: 659bd206-fa95-46e8-8de9-bd3f2fbefd24
|
||
- lack of composability and configurability.
|
||
ls-type:: annotation
|
||
hl-page:: 5
|
||
hl-color:: green
|
||
id:: 659bd212-ed12-4e55-91fc-c105a56197ce
|
||
- the set of augmentations in these tools is disjoint, i.e., a list of operations is found in one tool but missing in another.
|
||
ls-type:: annotation
|
||
hl-page:: 6
|
||
hl-color:: green
|
||
id:: 659bd231-75fd-4845-9e0a-f62457347012
|
||
- Zhang et al. [ 68] introduce an approach referred to as DietCode that leverages large pre-trained models such as CodeBERT [17] for source code. Through an empirical analysis of CodeBERT’s attention mechanism, they discovered that the model attends more to certain types of tokens and statements such as keywords and data-relevant statements
|
||
ls-type:: annotation
|
||
hl-page:: 6
|
||
hl-color:: green
|
||
id:: 659bd3ea-511f-4a92-852b-3d2ef2022150
|
||
- selects statements and tokens with the highest attention weights
|
||
ls-type:: annotation
|
||
hl-page:: 6
|
||
hl-color:: green
|
||
id:: 659bd49d-0157-44ff-b3d4-2f8bd8629f54
|
||
- 40% less computational cost during fine-tuning and testing
|
||
ls-type:: annotation
|
||
hl-page:: 6
|
||
hl-color:: green
|
||
id:: 659bd4a9-9543-4e14-9f7f-498f7f143ae7
|
||
- Limitations of existing work:
|
||
ls-type:: annotation
|
||
hl-page:: 6
|
||
hl-color:: yellow
|
||
id:: 659bd500-4f92-4ed3-83e9-b1471c4521ae
|
||
- The limitation of these works is that they require multiple rounds of expensive computation.
|
||
ls-type:: annotation
|
||
hl-page:: 6
|
||
hl-color:: yellow
|
||
id:: 659bd64a-a3e1-471b-82a8-f9673e6a2cb1
|
||
- [:span]
|
||
ls-type:: annotation
|
||
hl-page:: 5
|
||
hl-color:: green
|
||
id:: 659bd67e-cf52-44c1-828c-4d7009f6e376
|
||
hl-type:: area
|
||
hl-stamp:: 1704711804507
|
||
- To train a gnn model
|
||
ls-type:: annotation
|
||
hl-page:: 6
|
||
hl-color:: green
|
||
id:: 659bd96b-a2e3-4eae-a82e-d7da151c4a80
|
||
- A dsl is typically characterized by a metamodel, which serves as a representation of its domain-specific entities and their interconnections.
|
||
ls-type:: annotation
|
||
hl-page:: 6
|
||
hl-color:: green
|
||
id:: 659bd997-e61f-49f7-bd1b-c6d5e3bc297b
|
||
- arsing Expression Grammar (PEG)
|
||
ls-type:: annotation
|
||
hl-page:: 7
|
||
hl-color:: green
|
||
id:: 659bd9a5-36d1-43e2-b4f8-46578d999b43
|
||
- node removal and edge addition
|
||
ls-type:: annotation
|
||
hl-page:: 7
|
||
hl-color:: yellow
|
||
id:: 659bda02-94d9-48aa-9557-153458217366
|
||
- I. Dejanović, R. Vaderna, G. Milosavljević, and Ž. Vuković. 2017. TextX: A Python tool for Domain-Specific Languages implementation. Knowledge-Based Systems 115 (2017), 1–4.
|
||
ls-type:: annotation
|
||
hl-page:: 21
|
||
hl-color:: green
|
||
id:: 659bdb96-81bf-444d-b020-6f2272216fa7
|
||
- 3.2 Graph generation process
|
||
ls-type:: annotation
|
||
hl-page:: 8
|
||
hl-color:: yellow
|
||
id:: 659bdbfc-81cc-4f69-b85f-7d849579f6a3
|
||
- 3.3 Node remova
|
||
ls-type:: annotation
|
||
hl-page:: 8
|
||
hl-color:: yellow
|
||
id:: 659bdc69-49f6-4e3e-a729-f78a729f9520
|
||
- simple assignment, print, and system exit statements
|
||
ls-type:: annotation
|
||
hl-page:: 8
|
||
hl-color:: green
|
||
id:: 659bdd8b-9ee3-4545-99ae-0276314f7160
|
||
- Simple assignment statement to be removed
|
||
ls-type:: annotation
|
||
hl-page:: 10
|
||
hl-color:: yellow
|
||
id:: 659bdf08-9037-43e1-a49d-c87be7c53814
|
||
- Edge addition
|
||
ls-type:: annotation
|
||
hl-page:: 10
|
||
hl-color:: yellow
|
||
id:: 659bdf77-e9b2-43d5-a2be-0b3916021171
|
||
- 4 CASE STUDY: CODE SMELL DETECTION
|
||
ls-type:: annotation
|
||
hl-page:: 12
|
||
hl-color:: green
|
||
id:: 659fe255-ed3d-43d6-967f-a06c667606ce
|
||
- we conducted a study to prepare code representations to classify code smells
|
||
ls-type:: annotation
|
||
hl-page:: 12
|
||
hl-color:: green
|
||
id:: 659fe51d-5587-474d-933a-9452921a1ced
|
||
- poorly written code that requires refactoring
|
||
ls-type:: annotation
|
||
hl-page:: 12
|
||
hl-color:: green
|
||
id:: 659fe528-62eb-4c39-abca-7880eee03031
|
||
- four types of code smells that were initially investigated by Sharma et al. [ 55]: Complex method, Complex conditional, Feature envy, and Multifaceted abstraction.
|
||
ls-type:: annotation
|
||
hl-page:: 12
|
||
hl-color:: green
|
||
id:: 659fe567-2a99-4b9c-8149-b5a7a7ff3064
|
||
- eight repository characteristics
|
||
ls-type:: annotation
|
||
hl-page:: 12
|
||
hl-color:: yellow
|
||
id:: 659fe5ba-f3af-42c0-ba05-7a3e3650faae
|
||
- we define three Concord configurations: R1, R2, and R
|
||
ls-type:: annotation
|
||
hl-page:: 12
|
||
hl-color:: green
|
||
id:: 65a0196b-3a6e-4649-b072-3807554566d4
|
||
- training, validation, and test
|
||
ls-type:: annotation
|
||
hl-page:: 13
|
||
hl-color:: green
|
||
id:: 65a019da-8373-4f35-9a2e-1e792f5f7884
|
||
- P
|
||
ls-type:: annotation
|
||
hl-page:: 14
|
||
hl-color:: yellow
|
||
id:: 65a01a5a-a15f-42f6-a44e-ed8860605b0d
|
||
- solve the code smell classification task
|
||
ls-type:: annotation
|
||
hl-page:: 15
|
||
hl-color:: green
|
||
id:: 65a01b04-66d5-4e3c-a372-9ca2c8159a9d
|
||
- we feed 𝑉 and the adjacency matrix 𝐸 to the ggnn layer.
|
||
ls-type:: annotation
|
||
hl-page:: 15
|
||
hl-color:: green
|
||
id:: 65a01c0d-a32e-448c-b137-e421aebe7d03
|
||
- following equations
|
||
ls-type:: annotation
|
||
hl-page:: 15
|
||
hl-color:: yellow
|
||
id:: 65a01c58-9ec9-4df7-8cd3-b3ee111ee962
|
||
- We train a classifier for each code smell-representation combination, giving a total of 12 trained models.
|
||
ls-type:: annotation
|
||
hl-page:: 16
|
||
hl-color:: yellow
|
||
id:: 65a01c99-3061-4a1f-a818-6eaa31f62c18
|
||
- Matthews Correlation Coefficient (mcc) metric.
|
||
ls-type:: annotation
|
||
hl-page:: 16
|
||
hl-color:: green
|
||
id:: 65a01cbd-aca4-401c-a5a9-d09f4379ce15
|
||
- flops (floating operation points)
|
||
ls-type:: annotation
|
||
hl-page:: 16
|
||
hl-color:: green
|
||
id:: 65a01cdb-2a60-43a3-860f-ab44a6adedb6
|
||
- RQ. Does reducing the size complexity of code representation affect the performance and the needed computational operations?
|
||
ls-type:: annotation
|
||
hl-page:: 16
|
||
hl-color:: yellow
|
||
id:: 65a01cfa-d6fa-4492-b41c-776dbf40fa58
|
||
hl-stamp:: 1704992204743
|
||
- The results indicate that our proposed approach generates code representation that can effectively capture the desired code features for code analysis tasks
|
||
ls-type:: annotation
|
||
hl-page:: 17
|
||
hl-color:: yellow
|
||
id:: 65a01e93-c534-432f-97fb-075c24556185
|
||
hl-stamp:: 1704992405606
|
||
- It is a method to build representations in a configurable and customizable way.
|
||
ls-type:: annotation
|
||
hl-page:: 19
|
||
hl-color:: green
|
||
id:: 65a01f88-6864-44cb-b7e5-eee10e22a809 |