Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce issue-based artifact-network creation, new tests and fix current tests + minor bug fixes #244

Merged
merged 20 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
98a93ee
Create edges for issue-based artifact-networks
MaLoefUDS Aug 29, 2023
9f840c0
Adjust testing data and add tests for issue-based artifact-networks
MaLoefUDS Aug 29, 2023
56e1b35
Adjust tests to the changed testing data
MaLoefUDS Aug 29, 2023
62ff9d0
Reformat 'event.info.1' column of issue-events if necessary
MaLoefUDS Aug 29, 2023
26d7b7e
Replace 'IssueEvent' vertex attribute by 'Issue' in multi-networks
MaLoefUDS Aug 29, 2023
ece569c
Add 'split.data.by.bins.vector' and fix miscellaneous bugs in splitting
MaLoefUDS Sep 4, 2023
9112db0
Readd previously removed testing data and adjust tests
MaLoefUDS Oct 12, 2023
0e2df73
Introduce constant for issue id formatting
MaLoefUDS Oct 18, 2023
771bcc8
Get directedness of issue-based artifact-networks from configuration
MaLoefUDS Oct 18, 2023
48ef4fa
Rework sliding window approach of 'split.data.activity.based'
MaLoefUDS Oct 18, 2023
ed5feb2
Rename 'split.data.by.bins' to 'split.datafame.by.bins'
MaLoefUDS Oct 18, 2023
1018fbd
Fix comments and simplify logical condition
MaLoefUDS Nov 15, 2023
ed0a530
Validate the format of the 'bins' parameter when splitting data by bins
MaLoefUDS Nov 19, 2023
cdc00f0
Parameterize issue-based artifact-network tests using directedness
MaLoefUDS Nov 19, 2023
5e5ecba
Improve input validation
MaLoefUDS Nov 20, 2023
958f272
Test input validation of splitting functions
MaLoefUDS Nov 22, 2023
ea4fe8d
Adjust test data to be consistent and realistic
MaLoefUDS Dec 19, 2023
eeb0a12
Add and update a few comments in tests
MaLoefUDS Dec 19, 2023
cdb3cb2
Update 'NEWS.md'
MaLoefUDS Dec 20, 2023
7f78966
Move changes in 'NEWS.md' to new unversioned release
MaLoefUDS Dec 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
3;"Error in construct.networks.from.list for openssl function networks";"[""issue"", ""bug""]";"closed";"[]";"2016-07-12 15:59:25";"2016-07-12 16:06:30";"[]";"add_link";"Karl";"karl@example.org";"2016-08-07 15:37:02";"930af63a030fb92e48eddff01f53284c3eeba80e";"""commit"""
bockthom marked this conversation as resolved.
Show resolved Hide resolved
3;"Error in construct.networks.from.list for openssl function networks";"[""issue"", ""bug""]";"closed";"[]";"2016-07-12 15:59:25";"2016-07-12 16:06:30";"[]";"referenced";"Karl";"karl@example.org";"2016-08-31 16:45:09";"";""""""
3;"Error in construct.networks.from.list for openssl function networks";"[""issue"", ""bug""]";"closed";"[]";"2016-07-12 15:59:25";"2016-07-12 16:06:30";"[]";"referenced";"Thomas";"thomas@example.org";"2016-10-05 16:45:09";"";""""""
3;"Error in construct.networks.from.list for openssl function networks";"[""issue"", ""bug""]";"closed";"[]";"2016-07-12 15:59:25";"2016-07-12 16:06:30";"[]";"add_link";"Karl";"karl@example.org";"2016-08-07 15:37:02";"6";"""issue"""
3;"Error in construct.networks.from.list for openssl function networks";"[""issue"", ""bug""]";"closed";"[]";"2016-07-12 15:59:25";"2016-07-12 16:06:30";"[]";"add_link";"Thomas";"thomas@example.org";"2016-08-07 15:30:00";"2";"""issue"""
6;"Distinguish directedness of networks and edge-construction algorithm";"[""issue"", ""bug"", ""enhancement""]";"open";"[]";"2016-07-12 14:30:13";"";"[]";"mentioned";"udo";"udo@example.org";"2016-07-12 15:30:02";"Thomas";"""thomas@example.org"""
6;"Distinguish directedness of networks and edge-construction algorithm";"[""issue"", ""bug"", ""enhancement""]";"open";"[]";"2016-07-12 14:30:13";"";"[]";"subscribed";"udo";"udo@example.org";"2016-07-12 15:30:02";"Thomas";"""thomas@example.org"""
6;"Distinguish directedness of networks and edge-construction algorithm";"[""issue"", ""bug"", ""enhancement""]";"open";"[]";"2016-07-12 14:30:13";"";"[]";"commented";"Thomas";"thomas@example.org";"2016-07-12 16:03:59";"open";"[]"
Expand All @@ -15,6 +17,7 @@
6;"Distinguish directedness of networks and edge-construction algorithm";"[""issue"", ""bug"", ""enhancement""]";"open";"[]";"2016-07-12 14:30:13";"";"[]";"subscribed";"Björn";"bjoern@example.org";"2016-12-07 15:30:02";"udo";"""udo@example.org"""
6;"Distinguish directedness of networks and edge-construction algorithm";"[""issue"", ""bug"", ""enhancement""]";"open";"[]";"2016-07-12 14:30:13";"";"[]";"labeled";"Olaf";"olaf@example.org";"2017-05-23 12:31:34";"decided";""""""
6;"Distinguish directedness of networks and edge-construction algorithm";"[""issue"", ""bug"", ""enhancement""]";"open";"[]";"2016-07-12 14:30:13";"";"[]";"commented";"Björn";"bjoern@example.org";"2017-05-23 12:32:39";"open";"[]"
6;"Distinguish directedness of networks and edge-construction algorithm";"[""issue"", ""bug"", ""enhancement""]";"open";"[]";"2016-07-12 14:30:13";"";"[]";"referenced_by";"Karl";"karl@example.org";"2016-08-07 15:37:02";"3";"""issue"""
"1";"Example pull request 1";"[""pull request""]";"reopened";"[]";"2016-07-14 13:37:00";"";"[]";"created";"Thomas";"thomas@example.org";"2016-07-12 15:59:25";"open";"[]"
"1";"Example pull request 1";"[""pull request""]";"reopened";"[]";"2016-07-14 13:37:00";"";"[]";"commented";"Thomas";"thomas@example.org";"2016-07-12 15:59:25";"open";"[]"
"1";"Example pull request 1";"[""pull request""]";"reopened";"[]";"2016-07-14 13:37:00";"";"[]";"state_updated";"Thomas";"thomas@example.org";"2016-07-12 15:59:59";"closed";"""open"""
Expand All @@ -25,6 +28,7 @@
"2";"Example pull request 2";"[""pull request""]";"closed";"[]";"2016-07-12 14:59:25";"2016-07-12 16:04:59";"[]";"commented";"Björn";"bjoern@example.org";"2016-07-12 14:59:25";"open";"[]"
"2";"Example pull request 2";"[""pull request""]";"closed";"[]";"2016-07-12 14:59:25";"2016-07-12 16:04:59";"[]";"merged";"Olaf";"olaf@example.org";"2016-07-12 16:04:59";"";""""""
"2";"Example pull request 2";"[""pull request""]";"closed";"[]";"2016-07-12 14:59:25";"2016-07-12 16:04:59";"[]";"state_updated";"Olaf";"olaf@example.org";"2016-07-12 16:04:59";"closed";"""open"""
"2";"Example pull request 2";"[""pull request""]";"closed";"[]";"2016-07-12 14:59:25";"2016-07-12 16:04:59";"[]";"referenced_by";"Thomas";"thomas@example.org";"2016-08-07 15:30:00";"3";"""issue"""
"4";"Example pull request 4";"[""pull request"", ""enhancement""]";"open";"[]";"2016-07-12 16:02:02";"";"[]";"commit_added";"Björn";"bjoern@example.org";"2016-07-12 15:58:59";"72c8dd25d3dd6d18f46e2b26a5f5b1e2e8dc28d0";""""""
"4";"Example pull request 4";"[""pull request"", ""enhancement""]";"open";"[]";"2016-07-12 16:02:02";"";"[]";"created";"Olaf";"olaf@example.org";"2016-07-12 16:02:02";"open";"[]"
"4";"Example pull request 4";"[""pull request"", ""enhancement""]";"open";"[]";"2016-07-12 16:02:02";"";"[]";"commented";"Olaf";"olaf@example.org";"2016-07-12 16:02:02";"open";"[]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"ZEPPELIN-328";"[ZEPPELIN-328] Interpreter page should clarify the % magic syntax for interpreter group.name";"[""issue"", ""bug""]";"closed";"[""fixed""]";"2013-04-21 23:52:09";"2013-05-25 20:02:08";"[""GUI"", ""Interpreters""]";"commented";"Olaf";"olaf@example.org";"2013-05-25 06:22:23";"open";"[""unresolved""]"
"ZEPPELIN-328";"[ZEPPELIN-328] Interpreter page should clarify the % magic syntax for interpreter group.name";"[""issue"", ""bug""]";"closed";"[""fixed""]";"2013-04-21 23:52:09";"2013-05-25 20:02:08";"[""GUI"", ""Interpreters""]";"commented";"Olaf";"olaf@example.org";"2013-06-01 06:50:26";"open";"[""unresolved""]"
"ZEPPELIN-328";"[ZEPPELIN-328] Interpreter page should clarify the % magic syntax for interpreter group.name";"[""issue"", ""bug""]";"closed";"[""fixed""]";"2013-04-21 23:52:09";"2013-05-25 20:02:08";"[""GUI"", ""Interpreters""]";"resolution_updated";"Björn";"bjoern@example.org";"2013-06-01 06:53:06";"fixed";"""unresolved"""
"ZEPPELIN-328";"[ZEPPELIN-328] Interpreter page should clarify the % magic syntax for interpreter group.name";"[""issue"", ""bug""]";"closed";"[""fixed""]";"2013-04-21 23:52:09";"2013-05-25 20:02:08";"[""GUI"", ""Interpreters""]";"add_link";"Thomas";"thomas@example.org";"2013-06-01 06:54:00";"ZEPPELIN-332";"""issue"""
"ZEPPELIN-332";"[ZEPPELIN-332] CNFE when running SQL query against Cassandra temp table";"[""issue"", ""bug""]";"open";"[""unresolved""]";"2016-07-12 16:01:30";"";"[""Interpreters""]";"referenced_by";"Thomas";"thomas@example.org";"2013-06-01 06:54:00";"ZEPPELIN-328";"""issue"""
bockthom marked this conversation as resolved.
Show resolved Hide resolved
"ZEPPELIN-332";"[ZEPPELIN-332] CNFE when running SQL query against Cassandra temp table";"[""issue"", ""bug""]";"open";"[""unresolved""]";"2016-07-12 16:01:30";"";"[""Interpreters""]";"created";"Björn";"bjoern@example.org";"2016-07-12 16:01:30";"open";"[""unresolved""]"
"ZEPPELIN-332";"[ZEPPELIN-332] CNFE when running SQL query against Cassandra temp table";"[""issue"", ""bug""]";"open";"[""unresolved""]";"2016-07-12 16:01:30";"";"[""Interpreters""]";"commented";"Björn";"bjoern@example.org";"2016-07-12 16:02:30";"open";"[""unresolved""]"
"ZEPPELIN-332";"[ZEPPELIN-332] CNFE when running SQL query against Cassandra temp table";"[""issue"", ""bug""]";"open";"[""unresolved""]";"2016-07-12 16:01:30";"";"[""Interpreters""]";"commented";"Björn";"bjoern@example.org";"2016-07-15 19:55:39";"open";"[""unresolved""]"
Expand Down
5 changes: 3 additions & 2 deletions tests/test-core-peripheral.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
## Copyright 2022 by Thomas Bock <bockthom@cs.uni-saarland.de>
## Copyright 2019 by Christian Hechtl <hechtl@fim.uni-passau.de>
## Copyright 2021 by Christian Hechtl <hechtl@cs.uni-saarland.de>
## Copyright 2023 by Maximilian Löffler <s8maloef@stud.uni-saarland.de>
## All Rights Reserved.


Expand Down Expand Up @@ -171,8 +172,8 @@ test_that("Issue-count classification" , {
result = get.author.class.issue.count(proj.data, issue.type = "all")

## Assert
expected.core = data.frame(author.name = c("Björn", "Olaf", "Thomas"), issue.count = c(6, 6, 4))
expected.peripheral = data.frame(author.name = c("Karl", "Max", "udo"), issue.count = c(1, 1, 1))
expected.core = data.frame(author.name = c("Björn", "Olaf", "Thomas"), issue.count = c(6, 6, 6))
expected.peripheral = data.frame(author.name = c("Karl", "Max", "udo"), issue.count = c(2, 1, 1))
expected = list(core = expected.core, peripheral = expected.peripheral)

row.names(result[["core"]]) = NULL
Expand Down
5 changes: 3 additions & 2 deletions tests/test-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
## Copyright 2021 by Johannes Hostert <s8johost@stud.uni-saarland.de>
## Copyright 2021 by Mirabdulla Yusifli <s8miyusi@stud.uni-saarland.de>
## Copyright 2022 by Jonathan Baumann <joba00002@stud.uni-saarland.de>
## Copyright 2023 by Maximilian Löffler <s8maloef@stud.uni-saarland.de>
## All Rights Reserved.


Expand Down Expand Up @@ -402,8 +403,8 @@ test_that("Filter bots from issue data", {
filtered.issues = proj.data$get.issues()

expect_true(all(filtered.issues[["author.name"]] != "Thomas"))
## there are now 41 issue events remaining, since 6 issue events have been removed during filtering
expect_equal(nrow(filtered.issues), 41)
## there are now 42 issue events remaining, since 11 issue events have been removed during filtering
bockthom marked this conversation as resolved.
Show resolved Hide resolved
expect_equal(nrow(filtered.issues), 43)
})

test_that("Filter bots from mail data", {
Expand Down
88 changes: 88 additions & 0 deletions tests/test-networks-artifact.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,91 @@ test_that("Network construction of the undirected artifact-cochange network", {
## test
expect_true(igraph::identical_graphs(network.built, network.expected))
})

test_that("Network construction of an issue-based artifact-network", {
## build expected network:
## 1) vertices
vertices = data.frame(name = c("<issue-jira-ZEPPELIN-328>",
"<issue-jira-ZEPPELIN-332>" ,
"<issue-github-2>",
"<issue-github-6>",
"<issue-github-3>",
"<issue-github-1>",
"<issue-github-4>"),
kind = "Issue",
type = TYPE.ARTIFACT)
## 2) edges
edges = data.frame(
from = c("<issue-jira-ZEPPELIN-328>", "<issue-github-3>", "<issue-github-3>"),
to = c("<issue-jira-ZEPPELIN-332>", "<issue-github-2>", "<issue-github-6>"),
date = get.date.from.string(c("2013-06-01 06:54:00", "2016-08-07 15:30:00", "2016-08-07 15:37:02")),
artifact.type = c("IssueEvent", "IssueEvent", "IssueEvent"),
issue.id = c("<issue-jira-ZEPPELIN-328>", "<issue-github-3>", "<issue-github-3>"),
event.name = c("add_link", "add_link", "add_link"),
author.name = c("Thomas", "Thomas", "Karl"),
weight = c(1, 1, 1),
type = TYPE.EDGES.INTRA,
relation = "issue"
)

## configurations
proj.conf = ProjectConf$new(CF.DATA, CF.SELECTION.PROCESS, CASESTUDY, ARTIFACT)
proj.conf$update.value("issues.only.comments", FALSE)
net.conf = NetworkConf$new()
net.conf$update.values(updated.values = list(artifact.relation = "issue"))

## construct objects
proj.data = ProjectData$new(project.conf = proj.conf)
network.builder = NetworkBuilder$new(project.data = proj.data, network.conf = net.conf)

## build expected network
network.expected = igraph::graph.data.frame(edges, directed = FALSE, vertices = vertices)

## build network
network.built = network.builder$get.artifact.network()

## test
expect_true(igraph::identical_graphs(network.built, network.expected))
})

test_that("Network construction of an empty 'comments-only' issue-based artifact-network", {

##
## 'issues.only.comments' (by default), this should not create any edges
##

## configurations
proj.conf = ProjectConf$new(CF.DATA, CF.SELECTION.PROCESS, CASESTUDY, ARTIFACT)
net.conf = NetworkConf$new()
net.conf$update.values(updated.values = list(artifact.relation = "issue"))

## construct objects
proj.data = ProjectData$new(project.conf = proj.conf)
network.builder = NetworkBuilder$new(project.data = proj.data, network.conf = net.conf)

## build network
network.built = network.builder$get.artifact.network()

## 1) vertices
vertices = data.frame(name = c("<issue-jira-ZEPPELIN-328>",
"<issue-github-2>",
"<issue-github-1>",
"<issue-github-3>",
"<issue-github-4>",
"<issue-jira-ZEPPELIN-332>",
"<issue-github-6>"),
bockthom marked this conversation as resolved.
Show resolved Hide resolved
kind = "Issue",
type = TYPE.ARTIFACT)
## 2) edges
edges = data.frame(
from = character(), to = character(), date = get.date.from.string(character(0)), artifact.type = character(),
issue.id = character(), event.name = character(), weight = numeric(), type = character(),
relation = character()
)

## build expected network
network.expected = igraph::graph.data.frame(edges, directed = FALSE, vertices = vertices)

## test
compare.networks(network.built, network.expected)
})
Loading