Raf Guns

69 papers Journal 59Unranked 10
YearRankTypeTitle / Venue / Authors
2026 J jnl
Scientometrics
Cristina Arhiliuc, Raf Guns, Tim C. E. Engels
2025 J jnl
J. Inf. Sci.
Joshua Eykens, Raf Guns, Tim C. E. Engels, Frédéric Vandermoere
2025 J jnl
CoRR
Cristina Arhiliuc, Raf Guns, Tim C. E. Engels
2025 J jnl
Scientometrics
Cristina Arhiliuc, Raf Guns, Walter Daelemans, Tim C. E. Engels
2024 J jnl
Learn. Publ.
Elina Late, Raf Guns, Janne Pölönen, Jadranka Stojanovski, Mimi Urbanc, Michael Ochsner
2024 J jnl
J. Assoc. Inf. Sci. Technol.
Hongyu Zhou, Beibei Sun, Raf Guns, Tim C. E. Engels, Ying Huang, Lin Zhang
2024 J jnl
J. Assoc. Inf. Sci. Technol.
Eline Vandewalle, Raf Guns, Tim C. E. Engels
2023 J jnl
Scientometrics
Cristina Arhiliuc, Raf Guns
2023 J jnl
J. Assoc. Inf. Sci. Technol.
Hongyu Zhou, Raf Guns, Tim C. E. Engels
2023 J jnl
Scientometrics
Ruinan Li, Raf Guns, Tim C. E. Engels, Lin Zhang, Ying Huang
2022 J jnl
J. Assoc. Inf. Sci. Technol.
Hongyu Zhou, Raf Guns, Tim C. E. Engels
2022 J jnl
CoRR
Hongyu Zhou, Raf Guns, Tim C. E. Engels
2022 J jnl
Scientometrics
Joshua Eykens, Raf Guns, Raf Vanderstraeten
2022 J jnl
J. Assoc. Inf. Sci. Technol.
Emanuel Kulczycki, Ying Huang, Alesia A. Zuccala, Tim C. E. Engels, Antonio Ferrara, Raf Guns, Janne Pölönen, Gunnar Sivertsen, Zehra Taskin, Lin Zhang
2021 J jnl
Quant. Sci. Stud.
Joshua Eykens, Raf Guns, Tim C. E. Engels
2021 conf
ASIST
Hongyu Zhou, Raf Guns, Tim C. E. Engels
2021 J jnl
J. Data Inf. Sci.
Janne Pölönen, Raf Guns, Emanuel Kulczycki, Gunnar Sivertsen, Tim C. E. Engels
2021 J jnl
Quant. Sci. Stud.
Alesia A. Zuccala, Janne Pölönen, Raf Guns, Vidar Røeggen, Emanuel Kulczycki, Kasper Bruun, Eeva Savolainen
2021 J jnl
Frontiers Res. Metrics Anal.
Eline Vandewalle, Raf Guns, Tim C. E. Engels
2021 J jnl
J. Documentation
Linda Sile, Raf Guns, Alesia A. Zuccala, Tim C. E. Engels
2021 J jnl
Quant. Sci. Stud.
Linda Sile, Raf Guns, Frédéric Vandermoere, Gunnar Sivertsen, Tim C. E. Engels
2021 J jnl
Quant. Sci. Stud.
Lutz Bornmann, Raf Guns, Michael Thelwall, Dietmar Wolfram
2020 J jnl
CoRR
Michal Petr, Tim C. E. Engels, Emanuel Kulczycki, Marta Dusková, Raf Guns, Monika Sieberova, Gunnar Sivertsen
2020 J jnl
J. Assoc. Inf. Sci. Technol.
Emanuel Kulczycki, Raf Guns, Janne Pölönen, Tim C. E. Engels, Ewa A. Rozkosz, Alesia A. Zuccala, Kasper Bruun, Olli Eskola, Andreja Istenic Starcic, Michal Petr, Gunnar Sivertsen
2020 J jnl
Quant. Sci. Stud.
Janne Pölönen, Mikael Laakso, Raf Guns, Emanuel Kulczycki, Gunnar Sivertsen
2019 conf
ISSI
Joshua Eykens, Raf Guns, Tim C. E. Engels
2019 conf
ISSI
Linda Sile, Raf Guns
2019 conf
ISSI
Linda Sile, Raf Guns, Frédéric Vandermoere, Tim C. E. Engels
2019 conf
ISSI
Janne Pölönen, Raf Guns, Emanuel Kulczycki, Mikael Laakso, Gunnar Sivertsen
2019 J jnl
Scientometrics
Elea Giménez-Toledo, Jorge Mañana-Rodríguez, Tim C. E. Engels, Raf Guns, Emanuel Kulczycki, Michael Ochsner, Janne Pölönen, Gunnar Sivertsen, Alesia A. Zuccala
2019 conf
ISSI
Gunnar Sivertsen, Raf Guns, Emanuel Kulczycki, Janne Pölönen
2018 J jnl
Scientometrics
Raf Guns, Linda Sile, Joshua Eykens, Frederik T. Verleysen, Tim C. E. Engels
2018 J jnl
Scientometrics
Emanuel Kulczycki, Tim C. E. Engels, Janne Pölönen, Kasper Bruun, Marta Dusková, Raf Guns, Robert Nowotniak, Michal Petr, Gunnar Sivertsen, Andreja Istenic Starcic, Alesia A. Zuccala
2018 J jnl
J. Data Inf. Sci.
Tim C. E. Engels, Raf Guns
2018 J jnl
Frontiers Res. Metrics Anal.
Raf Guns, Joshua Eykens, Tim C. E. Engels
2017 J jnl
Frontiers Res. Metrics Anal.
A. I. M. Jakaria Rahman, Raf Guns, Ronald Rousseau, Tim C. E. Engels
2017 conf
ISSI
Raf Guns, Tim C. E. Engels, Frederik T. Verleysen
2017 J jnl
J. Informetrics
Raf Guns, Lili Wang
2017 J jnl
J. Informetrics
Ronald Rousseau, Raf Guns, A. I. M. Jakaria Rahman, Tim C. E. Engels
2017 J jnl
J. Data Inf. Sci.
Raf Guns
2016 J jnl
J. Informetrics
A. I. M. Jakaria Rahman, Raf Guns, Ronald Rousseau, Tim C. E. Engels
2016 J jnl
CoRR
A. I. M. Jakaria Rahman, Raf Guns, Ronald Rousseau, Tim C. E. Engels
2016 J jnl
CoRR
A. I. M. Jakaria Rahman, Raf Guns, Loet Leydesdorff, Tim C. E. Engels
2016 J jnl
Scientometrics
A. I. M. Jakaria Rahman, Raf Guns, Loet Leydesdorff, Tim C. E. Engels
2016 J jnl
CoRR
Ronald Rousseau, A. I. M. Jakaria Rahman, Raf Guns, Tim C. E. Engels
2015 J jnl
Learn. Publ.
Truyken L. B. Ossenblok, Raf Guns, Mike Thelwall
2015 J jnl
J. Assoc. Inf. Sci. Technol.
Alesia A. Zuccala, Raf Guns, Roberto Cornacchia, Rens Bod
2015 conf
ISSI
A. I. M. Jakaria Rahman, Raf Guns, Ronald Rousseau, Tim C. E. Engels
2015 J jnl
J. Informetrics
A. I. M. Jakaria Rahman, Raf Guns, Ronald Rousseau, Tim C. E. Engels
2015 J jnl
Frontiers Inf. Technol. Electron. Eng.
Raf Guns, Ronald Rousseau
2014 J jnl
J. Informetrics
Ronald Rousseau, Yuxian Liu, Raf Guns
2014 J jnl
J. Informetrics
Erjia Yan, Raf Guns
2014 J jnl
Scientometrics
Raf Guns, Ronald Rousseau
2013 J jnl
J. Informetrics
Yuxian Liu, Ronald Rousseau, Raf Guns
2013 J jnl
J. Informetrics
Ronald Rousseau, Yuxian Liu, Raf Guns
2013 J jnl
Scientometrics
Leo Egghe, Raf Guns, Ronald Rousseau
2013 J jnl
J. Documentation
Raf Guns
2013 J jnl
J. Assoc. Inf. Sci. Technol.
Raf Guns
2012 J jnl
J. Assoc. Inf. Sci. Technol.
Leo Egghe, Raf Guns
2012 J jnl
J. Assoc. Inf. Sci. Technol.
Leo Egghe, Raf Guns, Ronald Rousseau
2012 J jnl
Inf. Process. Manag.
Raf Guns, Christina Lioma, Birger Larsen
2011 J jnl
J. Informetrics
Leo Egghe, Lutz Bornmann, Raf Guns
2011 J jnl
Scientometrics
Raf Guns, Yuxian Liu, Dilruba Mahbuba
2011 J jnl
J. Assoc. Inf. Sci. Technol.
Leo Egghe, Raf Guns, Ronald Rousseau
2009 conf
ASIST
Raf Guns
2009 J jnl
J. Informetrics
Raf Guns, Ronald Rousseau
2009 J jnl
J. Assoc. Inf. Sci. Technol.
Raf Guns, Ronald Rousseau
2008 conf
BIS (Workshops)
Raf Guns
2008 J jnl
Scalable Comput. Pract. Exp.
Raf Guns
tests/integration/test_pe_extractor.py
← Index tests/integration/test_pe_extractor.py python
"""
Integration tests for the PEExtractor base class.
"""
import pytest
from unittest.mock import Mock, patch, MagicMock

pytestmark = [pytest.mark.integration, pytest.mark.pe]


class TestPEExtractorInitialization:
    """Tests for PEExtractor initialization."""

    def test_pe_extractor_with_valid_pe(self, pe_binary_path, mock_logger):
        """Test PEExtractor initialization with valid PE file."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            assert extractor.pe is not None
            assert extractor.filepath == pe_binary_path

    def test_pe_extractor_with_provided_pe_object(self, pe_binary_path, mock_logger, pe_object):
        """Test PEExtractor initialization with pre-existing PE object."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger, pe=pe_object)

            # Should use the provided PE object, not create a new one
            assert extractor.pe is pe_object

    def test_pe_extractor_with_invalid_file(self, elf_binary_path, mock_logger):
        """Test PEExtractor initialization with non-PE file."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(elf_binary_path, mock_logger)

            # Should return None for pe when file is not a valid PE
            assert extractor.pe is None
            # Logger should have recorded an error
            assert mock_logger.error.called


class TestPEExtractorMethods:
    """Tests for PEExtractor helper methods."""

    def test_check_dotnet_true(self, pe_binary_path, mock_logger):
        """Test _check_dotnet returns True for .NET PE."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            # The test PE file is a .NET binary
            if extractor.pe is not None:
                result = extractor._check_dotnet()
                # d8637bdbcfc9112fcb1f0167b398e771 is a .NET binary
                assert result is True

    def test_check_dotnet_false(self, elf_binary_path, mock_logger):
        """Test _check_dotnet returns False for non-PE file."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(elf_binary_path, mock_logger)

            # Should return False when PE is None
            result = extractor._check_dotnet()
            assert result is False

    def test_is_signed_false(self, pe_binary_path, mock_logger):
        """Test _is_signed method."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            if extractor.pe is not None:
                result = extractor._is_signed()
                # Result depends on the actual binary
                assert isinstance(result, bool)

    def test_has_overlay(self, pe_binary_path, mock_logger):
        """Test _has_overlay method."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            if extractor.pe is not None:
                result = extractor._has_overlay()
                assert isinstance(result, bool)


class TestGeneratePEFileObject:
    """Tests for _generate_pefile_object method."""

    def test_generate_pefile_object_valid(self, pe_binary_path, mock_logger):
        """Test _generate_pefile_object with valid PE file."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            # The PE object should be created successfully
            assert extractor.pe is not None

    def test_generate_pefile_object_invalid(self, temp_text_file, mock_logger):
        """Test _generate_pefile_object with invalid file."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(temp_text_file, mock_logger)

            # Should return None for invalid PE
            assert extractor.pe is None


class TestGenerateDotNetFileObject:
    """Tests for _generate_dotnetfile_object method."""

    def test_generate_dotnetfile_object_valid(self, pe_binary_path, mock_logger):
        """Test _generate_dotnetfile_object with .NET PE file."""
        from redb.extractors.pe_extractors.pe_dotnet import PEDotNetExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEDotNetExtractor(pe_binary_path, mock_logger)

            if extractor.pe is not None and extractor._check_dotnet():
                dotnet, error = extractor._generate_dotnetfile_object()
                # Should create dotnet object for .NET PE
                assert dotnet is not None
                assert error is None

    def test_generate_dotnetfile_object_invalid(self, elf_binary_path, mock_logger):
        """Test _generate_dotnetfile_object with non-.NET file."""
        from redb.extractors.pe_extractors.pe_dotnet import PEDotNetExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEDotNetExtractor(elf_binary_path, mock_logger)

            dotnet, error = extractor._generate_dotnetfile_object()
            # Should return error for non-.NET file
            assert dotnet is None
            assert error is not None


class TestPEExtractorTag:
    """Tests for tag method in PE extractors."""

    def test_pe_features_tag(self, pe_binary_path, mock_logger):
        """Test that PEFeaturesExtractor returns correct tag."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor
        from redb.extractors.enum import Tag

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)
            assert extractor.tag() == Tag.PE_FEATURES.value

    def test_pe_import_tag(self, pe_binary_path, mock_logger):
        """Test that PEImportExtractor returns correct tag."""
        from redb.extractors.pe_extractors.pe_imports import PEImportExtractor
        from redb.extractors.enum import Tag

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEImportExtractor(pe_binary_path, mock_logger)
            assert extractor.tag() == Tag.PE_IMPORT.value

    def test_pe_section_tag(self, pe_binary_path, mock_logger):
        """Test that PESectionExtractor returns correct tag."""
        from redb.extractors.pe_extractors.pe_sections import PESectionExtractor
        from redb.extractors.enum import Tag

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PESectionExtractor(pe_binary_path, mock_logger)
            assert extractor.tag() == Tag.PE_SECTION.value


class TestPEExtractorClickHouseTable:
    """Tests for get_clickhouse_table method in PE extractors."""

    def test_pe_features_clickhouse_table(self, pe_binary_path, mock_logger):
        """Test that PEFeaturesExtractor returns correct ClickHouse table name."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)
            assert extractor.get_clickhouse_table() == "redb_pe_features"

    def test_pe_import_clickhouse_table(self, pe_binary_path, mock_logger):
        """Test that PEImportExtractor returns correct ClickHouse table name."""
        from redb.extractors.pe_extractors.pe_imports import PEImportExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEImportExtractor(pe_binary_path, mock_logger)
            assert extractor.get_clickhouse_table() == "redb_pe_imports"

    def test_pe_section_clickhouse_table(self, pe_binary_path, mock_logger):
        """Test that PESectionExtractor returns correct ClickHouse table name."""
        from redb.extractors.pe_extractors.pe_sections import PESectionExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PESectionExtractor(pe_binary_path, mock_logger)
            assert extractor.get_clickhouse_table() == "redb_pe_sections"


class TestPEExtractorPrepareExportData:
    """Tests for prepare_export_data method in PE extractors."""

    def test_pe_features_prepare_export_elasticsearch(self, pe_binary_path, mock_logger):
        """Test prepare_export_data for Elasticsearch."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            if extractor.pe is not None:
                # First extract
                extractor.extract()
                result = extractor.prepare_export_data("ElasticsearchExporter")
                # Should return the pe_features dataclass
                assert result is extractor.pe_features

    def test_pe_features_prepare_export_clickhouse(self, pe_binary_path, mock_logger):
        """Test prepare_export_data for ClickHouse."""
        from redb.extractors.pe_extractors.pe_features import PEFeaturesExtractor

        with patch('redb.settings.ELASTIC_BINARIES_COLLECTION', 'test'):
            extractor = PEFeaturesExtractor(pe_binary_path, mock_logger)

            if extractor.pe is not None:
                # First extract
                extractor.extract()
                result = extractor.prepare_export_data("ClickHouseExporter")

                # Should return tuple of (data, column_names, column_type_names)
                assert isinstance(result, tuple)
                assert len(result) == 3
                data, column_names, column_type_names = result
                assert isinstance(data, list)
                assert isinstance(column_names, list)
                assert isinstance(column_type_names, list)
                # Column names and types should match in length
                assert len(column_names) == len(column_type_names)